public void flush() throws RocksDBException { if (options != null) { db.write(options, batch); } else { // use the default WriteOptions, if wasn't provided. try (WriteOptions writeOptions = new WriteOptions()) { db.write(writeOptions, batch); } } batch.clear(); }
@Override public ColumnFamilyOptions createColumnOptions() { return new ColumnFamilyOptions(); } };
@Override public DBOptions createDBOptions() { return new DBOptions() .setIncreaseParallelism(4) .setUseFsync(false) .setMaxOpenFiles(-1); }
@Override public ColumnFamilyOptions createColumnOptions() { final long blockCacheSize = 256 * 1024 * 1024; final long blockSize = 128 * 1024; final long targetFileSize = 256 * 1024 * 1024; final long writeBufferSize = 64 * 1024 * 1024; return new ColumnFamilyOptions() .setCompactionStyle(CompactionStyle.LEVEL) .setLevelCompactionDynamicLevelBytes(true) .setTargetFileSizeBase(targetFileSize) .setMaxBytesForLevelBase(4 * targetFileSize) .setWriteBufferSize(writeBufferSize) .setMinWriteBufferNumberToMerge(3) .setMaxWriteBufferNumber(4) .setTableFormatConfig( new BlockBasedTableConfig() .setBlockCacheSize(blockCacheSize) .setBlockSize(blockSize) .setFilter(new BloomFilter()) ); } },
@Override public boolean isValid() { return this.iterator.isValid(); }
public byte[] value() { return iterator.value(); }
public byte[] key() { return iterator.key(); }
@Override public ColumnFamilyOptions createColumnOptions() { return new ColumnFamilyOptions() .setCompactionStyle(CompactionStyle.LEVEL) .setLevelCompactionDynamicLevelBytes(true); } },
@Override public void remove() { if (currentEntry == null || currentEntry.deleted) { throw new IllegalStateException("The remove operation must be called after a valid next operation."); } currentEntry.remove(); }
@Override public DBOptions createDBOptions() { return new DBOptions() .setUseFsync(false); }
@Override public void close() { try { this.rocksDB.flush(new FlushOptions()); } catch (RocksDBException e) { LOG.warn("Failed to flush db before cleanup", e); } this.rocksDB.dispose(); }
@Override public void close() { iterator.close(); } }
@Override public void close() { rocksDb.dispose(); } }
@Override public DBOptions createDBOptions() { return new DBOptions() .setIncreaseParallelism(4) .setUseFsync(false) .setMaxOpenFiles(-1); }
@Override public boolean hasNext() { return iter.isValid(); }
public void close() { try { this.rocksDB.flush(new FlushOptions()); } catch (RocksDBException e) { LOG.warn("Failed to flush db before cleanup", e); } this.rocksDB.dispose(); } }
@Override public ColumnFamilyOptions createColumnOptions() { return new ColumnFamilyOptions(); }
@Override public DBOptions createDBOptions() { return new DBOptions() .setIncreaseParallelism(4) .setUseFsync(false) .setMaxOpenFiles(-1); }