use of jetbrains.exodus.ByteIterable in project xodus by JetBrains.
the class TreeCursorMutable method treeChanged.
@Override
public void treeChanged() {
final ByteIterable key = getKey();
final ByteIterable value = getValue();
// moveToPair(key, value);
moveToKey = key;
moveToValue = value;
}
use of jetbrains.exodus.ByteIterable in project xodus by JetBrains.
the class EnvironmentTestInMemory method deleteRandomKey.
private void deleteRandomKey(Store primary, Store secondary, Transaction txn, int keysCount, Persistent23TreeMap.MutableMap<Integer, Integer> testMap) {
final int key = rnd.nextInt(keysCount);
testMap.remove(key);
final ArrayByteIterable keyEntry = IntegerBinding.intToCompressedEntry(key);
final ByteIterable oldValue = primary.get(txn, keyEntry);
primary.delete(txn, keyEntry);
if (oldValue != null) {
try (Cursor cursor = secondary.openCursor(txn)) {
Assert.assertTrue(cursor.getSearchBoth(oldValue, keyEntry));
Assert.assertTrue(cursor.deleteCurrent());
}
}
}
use of jetbrains.exodus.ByteIterable in project xodus by JetBrains.
the class EnvironmentTestsBase method assertNotNullStringValue.
protected void assertNotNullStringValue(final Transaction txn, final Store store, final ByteIterable keyEntry, final String value) {
final ByteIterable valueEntry = store.get(txn, keyEntry);
Assert.assertNotNull(valueEntry);
Assert.assertEquals(value, StringBinding.entryToString(valueEntry));
}
use of jetbrains.exodus.ByteIterable in project xodus by JetBrains.
the class EnvironmentTestsBase method assertEmptyValue.
protected void assertEmptyValue(final Transaction txn, final Store store, final ByteIterable keyEntry) {
final ByteIterable valueEntry = store.get(txn, keyEntry);
Assert.assertNull(valueEntry);
}
use of jetbrains.exodus.ByteIterable in project xodus by JetBrains.
the class TreeCursorNoDuplicatesTest method testGetSearchKeyRange5.
@Test
public void testGetSearchKeyRange5() throws IOException {
tm = createMutableTree(false, 1);
final ByteIterable v = value("0");
tm.put(key("aaba"), v);
tm.put(key("aabb"), v);
Cursor c = tm.openCursor();
assertNotNull(c.getSearchKeyRange(key("aababa")));
assertEquals(key("aabb"), c.getKey());
}
Aggregations