예제 #1
0
 rocksdb::Status DeletePDS( const rocksdb::Slice &aPDSName, const rocksdb::Slice &aPDSId )
 {
   rocksdb::Status rs = mPDSDBHndl->Delete( mPDSwropts, aPDSName );
   if( rs.ok() )
     rs = mPDSDBHndl->Delete( mPDSwropts, aPDSId );
   return rs;
 }
예제 #2
0
  rocksdb::Status ClosePDS( const rocksdb::Slice &aPDSId )
  {
    // we currently ignore the pdsid because we don't use separate file per PDS. This might change later!!

    rocksdb::FlushOptions flOpts = rocksdb::FlushOptions();
    rocksdb::Status rs = mPDSDBHndl->Flush( flOpts );
    if( rs.ok() )
      rs = mDataDBHndl->Flush( flOpts );
    return rs;
  }
예제 #3
0
  rocksdb::Status CreatePDS( const rocksdb::Slice &aPDSName,
                             const rocksdb::Slice &aPDSId,
                             const rocksdb::Slice &aPDSData )
  {
    rocksdb::Status rs = mPDSDBHndl->Put( mPDSwropts,
                                          aPDSName,
                                          aPDSData );

    if( rs.ok() )
    {
      rs = mPDSDBHndl->Put( mPDSwropts,
                            aPDSId,
                            aPDSData );
    }
    return rs;
  }
예제 #4
0
  rocksdb::Iterator* NewIterator( const rocksdb::Slice *aStartKey, const rocksdb::Slice *aPDSId )
  {
#if (ROCKSDB_MAJOR < 3 )
    mIteratorOpts.prefix = NULL;
#endif
    mIteratorOpts.tailing = true;

    rocksdb::Iterator *iter = mDataDBHndl->NewIterator( mIteratorOpts );
    if( aStartKey != NULL )
    {
      iter->Seek( *aStartKey );
    }
    else
    {
      iter->SeekToFirst();
    }
    return iter;
  }
예제 #5
0
파일: query.cpp 프로젝트: pipedown/noisecpp
 unique_ptr<rocksdb::Iterator> NewIterator() {
     return unique_ptr<rocksdb::Iterator>(db_->NewIterator(options_));
 }
예제 #6
0
파일: query.cpp 프로젝트: pipedown/noisecpp
 ~SnapshopIteratorCreator() {
     db_->ReleaseSnapshot(options_.snapshot);
 }
예제 #7
0
파일: query.cpp 프로젝트: pipedown/noisecpp
 SnapshopIteratorCreator(rocksdb::DB* db) : db_(db) {
     options_.snapshot = db_->GetSnapshot();
 }
예제 #8
0
 rocksdb::Status DeleteData( const rocksdb::Slice &aKey )
 {
   return mDataDBHndl->Delete( mDeleteOpts, aKey );
 }
예제 #9
0
 rocksdb::Status PutData( const rocksdb::Slice &aKey, const rocksdb::Slice &aValue )
 {
   return mDataDBHndl->Put( mPDSwropts, aKey, aValue );
 }
예제 #10
0
 rocksdb::Status LookupData( const rocksdb::Slice &aKey, std::string *aValue )
 {
   rocksdb::Status rs = mDataDBHndl->Get( mPDSrdopts, aKey, aValue );
   return rs;
 }
예제 #11
0
 bool DataKeyMayExist( const rocksdb::Slice &aKey )
 {
   bool getval = false;
   std::string value;
   return mDataDBHndl->KeyMayExist( mPDSrdopts, aKey, &value, &getval );
 }
예제 #12
0
 rocksdb::Status GetPDS( const rocksdb::Slice &aKey, std::string *aValue )
 {
   return mPDSDBHndl->Get( mPDSrdopts, aKey, aValue );
 }