|
|
|
@ -1032,6 +1032,62 @@ public class RocksDB extends RocksObject { |
|
|
|
|
return getProperty0(nativeHandle_, property, property.length()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <p> Similar to GetProperty(), but only works for a subset of properties whose |
|
|
|
|
* return value is a numerical value. Return the value as long.</p> |
|
|
|
|
* |
|
|
|
|
* <p><strong>Note</strong>: As the returned property is of type |
|
|
|
|
* {@code uint64_t} on C++ side the returning value can be negative |
|
|
|
|
* because Java supports in Java 7 only signed long values.</p> |
|
|
|
|
* |
|
|
|
|
* <p><strong>Java 7</strong>: To mitigate the problem of the non |
|
|
|
|
* existent unsigned long tpye, values should be encapsulated using |
|
|
|
|
* {@link java.math.BigInteger} to reflect the correct value. The correct |
|
|
|
|
* behavior is guaranteed if {@code 2^64} is added to negative values.</p> |
|
|
|
|
* |
|
|
|
|
* <p><strong>Java 8</strong>: In Java 8 the value should be treated as |
|
|
|
|
* unsigned long using provided methods of type {@link Long}.</p> |
|
|
|
|
* |
|
|
|
|
* @param property to be fetched. |
|
|
|
|
* |
|
|
|
|
* @return numerical property value. |
|
|
|
|
* |
|
|
|
|
* @throws RocksDBException if an error happens in the underlying native code. |
|
|
|
|
*/ |
|
|
|
|
public long getLongProperty(String property) throws RocksDBException { |
|
|
|
|
return getLongProperty(nativeHandle_, property, property.length()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <p> Similar to GetProperty(), but only works for a subset of properties whose |
|
|
|
|
* return value is a numerical value. Return the value as long.</p> |
|
|
|
|
* |
|
|
|
|
* <p><strong>Note</strong>: As the returned property is of type |
|
|
|
|
* {@code uint64_t} on C++ side the returning value can be negative |
|
|
|
|
* because Java supports in Java 7 only signed long values.</p> |
|
|
|
|
* |
|
|
|
|
* <p><strong>Java 7</strong>: To mitigate the problem of the non |
|
|
|
|
* existent unsigned long tpye, values should be encapsulated using |
|
|
|
|
* {@link java.math.BigInteger} to reflect the correct value. The correct |
|
|
|
|
* behavior is guaranteed if {@code 2^64} is added to negative values.</p> |
|
|
|
|
* |
|
|
|
|
* <p><strong>Java 8</strong>: In Java 8 the value should be treated as |
|
|
|
|
* unsigned long using provided methods of type {@link Long}.</p> |
|
|
|
|
* |
|
|
|
|
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle} |
|
|
|
|
* instance |
|
|
|
|
* @param property to be fetched. |
|
|
|
|
* |
|
|
|
|
* @return numerical property value |
|
|
|
|
* |
|
|
|
|
* @throws RocksDBException if an error happens in the underlying native code. |
|
|
|
|
*/ |
|
|
|
|
public long getLongProperty(ColumnFamilyHandle columnFamilyHandle, String property) |
|
|
|
|
throws RocksDBException { |
|
|
|
|
return getLongProperty(nativeHandle_, columnFamilyHandle.nativeHandle_, property, |
|
|
|
|
property.length()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Return a heap-allocated iterator over the contents of the database. |
|
|
|
|
* The result of newIterator() is initially invalid (caller must |
|
|
|
@ -1297,6 +1353,10 @@ public class RocksDB extends RocksObject { |
|
|
|
|
String property, int propertyLength) throws RocksDBException; |
|
|
|
|
protected native String getProperty0(long nativeHandle, long cfHandle, |
|
|
|
|
String property, int propertyLength) throws RocksDBException; |
|
|
|
|
protected native long getLongProperty(long nativeHandle, |
|
|
|
|
String property, int propertyLength) throws RocksDBException; |
|
|
|
|
protected native long getLongProperty(long nativeHandle, long cfHandle, |
|
|
|
|
String property, int propertyLength) throws RocksDBException; |
|
|
|
|
protected native long iterator0(long handle); |
|
|
|
|
protected native long iterator0(long handle, long cfHandle); |
|
|
|
|
protected native long[] iterators(long handle, |
|
|
|
|