Class ForStDBWriteBatchWrapper

  • All Implemented Interfaces:
    AutoCloseable

    public class ForStDBWriteBatchWrapper
    extends Object
    implements AutoCloseable
    It's a wrapper class around ForStDB's WriteBatch for writing in bulk.

    IMPORTANT: This class is not thread safe.

    • Constructor Detail

      • ForStDBWriteBatchWrapper

        public ForStDBWriteBatchWrapper​(@Nonnull
                                        org.forstdb.RocksDB rocksDB,
                                        long writeBatchSize)
      • ForStDBWriteBatchWrapper

        public ForStDBWriteBatchWrapper​(@Nonnull
                                        org.forstdb.RocksDB rocksDB,
                                        @Nullable
                                        org.forstdb.WriteOptions options)
      • ForStDBWriteBatchWrapper

        public ForStDBWriteBatchWrapper​(@Nonnull
                                        org.forstdb.RocksDB rocksDB,
                                        @Nullable
                                        org.forstdb.WriteOptions options,
                                        long batchSize)
      • ForStDBWriteBatchWrapper

        public ForStDBWriteBatchWrapper​(@Nonnull
                                        org.forstdb.RocksDB rocksDB,
                                        @Nullable
                                        org.forstdb.WriteOptions options,
                                        int capacity,
                                        long batchSize)
    • Method Detail

      • put

        public void put​(@Nonnull
                        org.forstdb.ColumnFamilyHandle handle,
                        @Nonnull
                        byte[] key,
                        @Nonnull
                        byte[] value)
                 throws org.forstdb.RocksDBException
        Throws:
        org.forstdb.RocksDBException
      • remove

        public void remove​(@Nonnull
                           org.forstdb.ColumnFamilyHandle handle,
                           @Nonnull
                           byte[] key)
                    throws org.forstdb.RocksDBException
        Throws:
        org.forstdb.RocksDBException
      • merge

        public void merge​(@Nonnull
                          org.forstdb.ColumnFamilyHandle handle,
                          @Nonnull
                          byte[] key,
                          @Nonnull
                          byte[] value)
                   throws org.forstdb.RocksDBException
        Throws:
        org.forstdb.RocksDBException
      • flush

        public void flush()
                   throws org.forstdb.RocksDBException
        Throws:
        org.forstdb.RocksDBException
      • close

        public void close()
                   throws org.forstdb.RocksDBException
        Specified by:
        close in interface AutoCloseable
        Throws:
        org.forstdb.RocksDBException
      • markCancelled

        public void markCancelled()
      • getCancelCloseable

        public Closeable getCancelCloseable()