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;
}
Exemple #2
0
work_result(ErlNifEnv *env, const ERL_NIF_TERM& error, rocksdb::Status& status)
  : _is_set(true)
 {
    ERL_NIF_TERM reason = enif_make_string(env, status.ToString().c_str(),
                                           ERL_NIF_LATIN1);
    _result = enif_make_tuple2(env, erocksdb::ATOM_ERROR,
                            enif_make_tuple2(env, error, reason));
 }
Exemple #3
0
 Status toMongoStatus( rocksdb::Status s ) {
     if ( s.ok() )
         return Status::OK();
     else
         return Status( ErrorCodes::InternalError, s.ToString() );
 }