/** * Gets the name of the Column Family. * * @return The name of the Column Family. * * @throws RocksDBException if an error occurs whilst retrieving the name. */ public byte[] getName() throws RocksDBException { return getName(nativeHandle_); }
@Override public int hashCode() { try { return Objects.hash(getName(), getID(), rocksDB_.nativeHandle_); } catch (RocksDBException e) { throw new RuntimeException("Cannot calculate hash code of column family handle", e); } }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final ColumnFamilyHandle that = (ColumnFamilyHandle) o; try { return rocksDB_.nativeHandle_ == that.rocksDB_.nativeHandle_ && getID() == that.getID() && Arrays.equals(getName(), that.getName()); } catch (RocksDBException e) { throw new RuntimeException("Cannot compare column family handles", e); } }
cfHandles.put(new ByteArray(handle.getName()), handle);