Example #1
0
static inline skv_status_t rocksdb_status_to_skv( rocksdb::Status &aRS )
{
  if( aRS.ok() ) return SKV_SUCCESS;
  if( aRS.IsNotFound() ) return SKV_ERRNO_ELEM_NOT_FOUND;
  if( aRS.IsNotSupported() ) return SKV_ERRNO_NOT_IMPLEMENTED;
  if( aRS.IsInvalidArgument() ) return SKV_ERRNO_NOT_DONE;

  // all other cases:
  return SKV_ERRNO_UNSPECIFIED_ERROR;
}
Example #2
0
 Status toMongoStatus( rocksdb::Status s ) {
     if ( s.ok() )
         return Status::OK();
     else
         return Status( ErrorCodes::InternalError, s.ToString() );
 }