Package org.rocksdb
Class ColumnFamilyHandle
- java.lang.Object
-
- org.rocksdb.AbstractNativeReference
-
- org.rocksdb.AbstractImmutableNativeReference
-
- org.rocksdb.RocksObject
-
- org.rocksdb.ColumnFamilyHandle
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ColumnFamilyHandle extends RocksObject
ColumnFamilyHandle class to hold handles to underlying rocksdb ColumnFamily Pointers.
-
-
Field Summary
-
Fields inherited from class org.rocksdb.RocksObject
nativeHandle_
-
Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddisposeInternal()Deletes underlying C++ iterator pointer.protected voiddisposeInternal(long handle)booleanequals(java.lang.Object o)ColumnFamilyDescriptorgetDescriptor()Gets the up-to-date descriptor of the column family associated with this handle.intgetID()Gets the ID of the Column Family.byte[]getName()Gets the name of the Column Family.inthashCode()protected booleanisDefaultColumnFamily()-
Methods inherited from class org.rocksdb.RocksObject
getNativeHandle
-
Methods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Methods inherited from class org.rocksdb.AbstractNativeReference
dispose, finalize
-
-
-
-
Method Detail
-
getName
public byte[] getName() throws RocksDBExceptionGets 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.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:
disposeInternalin classRocksObject
-
disposeInternal
protected final void disposeInternal(long handle)
- Specified by:
disposeInternalin classRocksObject
-
-