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; }
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; }
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; }
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; }
unique_ptr<rocksdb::Iterator> NewIterator() { return unique_ptr<rocksdb::Iterator>(db_->NewIterator(options_)); }
~SnapshopIteratorCreator() { db_->ReleaseSnapshot(options_.snapshot); }
SnapshopIteratorCreator(rocksdb::DB* db) : db_(db) { options_.snapshot = db_->GetSnapshot(); }
rocksdb::Status DeleteData( const rocksdb::Slice &aKey ) { return mDataDBHndl->Delete( mDeleteOpts, aKey ); }
rocksdb::Status PutData( const rocksdb::Slice &aKey, const rocksdb::Slice &aValue ) { return mDataDBHndl->Put( mPDSwropts, aKey, aValue ); }
rocksdb::Status LookupData( const rocksdb::Slice &aKey, std::string *aValue ) { rocksdb::Status rs = mDataDBHndl->Get( mPDSrdopts, aKey, aValue ); return rs; }
bool DataKeyMayExist( const rocksdb::Slice &aKey ) { bool getval = false; std::string value; return mDataDBHndl->KeyMayExist( mPDSrdopts, aKey, &value, &getval ); }
rocksdb::Status GetPDS( const rocksdb::Slice &aKey, std::string *aValue ) { return mPDSDBHndl->Get( mPDSrdopts, aKey, aValue ); }