Package org.rocksdb

Class ColumnFamilyHandle

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class ColumnFamilyHandle
    extends RocksObject
    ColumnFamilyHandle class to hold handles to underlying rocksdb ColumnFamily Pointers.
    • Method Detail

      • getName

        public byte[] getName()
                       throws RocksDBException
        Gets the name of the Column Family.
        Returns:
        The name of the Column Family.
        Throws:
        RocksDBException - if an error occurs whilst retrieving the name.
      • getID

        public int getID()
        Gets the ID of the Column Family.
        Returns:
        the ID of the Column Family.
      • getDescriptor

        public ColumnFamilyDescriptor getDescriptor()
                                             throws RocksDBException
        Gets the up-to-date descriptor of the column family associated with this handle. Since it fills "*desc" with the up-to-date information, this call might internally lock and release DB mutex to access the up-to-date CF options. In addition, all the pointer-typed options cannot be referenced any longer than the original options exist. Note that this function is not supported in RocksDBLite.
        Returns:
        the up-to-date descriptor.
        Throws:
        RocksDBException - if an error occurs whilst retrieving the descriptor.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isDefaultColumnFamily

        protected boolean isDefaultColumnFamily()
      • disposeInternal

        protected void disposeInternal()

        Deletes underlying C++ iterator pointer.

        Note: the underlying handle can only be safely deleted if the RocksDB instance related to a certain ColumnFamilyHandle is still valid and initialized. Therefore disposeInternal() checks if the RocksDB is initialized before freeing the native handle.

        Overrides:
        disposeInternal in class RocksObject