publicinterfaceBackendStore{// Store nameStringstore();// Stored versionStringstoredVersion();// Database nameStringdatabase();// Get the parent providerBackendStoreProviderprovider();// Get the system schema storeSystemSchemaStoresystemSchemaStore();// Whether it is the storage of schemabooleanisSchemaStore();// Open/close databasevoidopen(HugeConfigconfig);voidclose();booleanopened();// Initialize/clear databasevoidinit();voidclear(booleanclearSpace);booleaninitialized();// Delete all data of database (keep table structure)voidtruncate();// Add/delete datavoidmutate(BackendMutationmutation);// Query dataIterator<BackendEntry>query(Queryquery);NumberqueryNumber(Queryquery);// TransactionvoidbeginTx();voidcommitTx();voidrollbackTx();// Get metadata by key<R>Rmetadata(HugeTypetype,Stringmeta,Object[]args);// Backend featuresBackendFeaturesfeatures();// Increase next id for specific typevoidincreaseCounter(HugeTypetype,longincrement);// Get current counter for a specific typelonggetCounter(HugeTypetype);}
publicclassRocksDBOptionsextendsOptionHolder{privateRocksDBOptions(){super();}privatestaticvolatileRocksDBOptionsinstance;publicstaticsynchronizedRocksDBOptionsinstance(){if(instance==null){instance=newRocksDBOptions();instance.registerOptions();}returninstance;}publicstaticfinalConfigOption<String>DATA_PATH=newConfigOption<>("rocksdb.data_path","The path for storing data of RocksDB.",disallowEmpty(),"rocksdb-data/data");publicstaticfinalConfigOption<String>WAL_PATH=newConfigOption<>("rocksdb.wal_path","The path for storing WAL of RocksDB.",disallowEmpty(),"rocksdb-data/wal");publicstaticfinalConfigListOption<String>DATA_DISKS=newConfigListOption<>("rocksdb.data_disks",false,"The optimized disks for storing data of RocksDB. "+"The format of each element: `STORE/TABLE: /path/disk`."+"Allowed keys are [g/vertex, g/edge_out, g/edge_in, "+"g/vertex_label_index, g/edge_label_index, "+"g/range_int_index, g/range_float_index, "+"g/range_long_index, g/range_double_index, "+"g/secondary_index, g/search_index, g/shard_index, "+"g/unique_index, g/olap]",null,String.class,ImmutableList.of());}