@Test public void containsKeyColumnReturnsFalseOnNonexistentInput() throws Exception { TransactionHandle txn = manager.beginTransaction(); ByteBuffer key1 = KeyColumnValueStoreUtil.longToByteBuffer(1); ByteBuffer c = KeyColumnValueStoreUtil.stringToByteBuffer("c"); assertFalse(store.containsKeyColumn(key1.duplicate(), c.duplicate(), txn)); txn.commit(); }
@Test public void containsKeyColumnReturnsTrueOnExtantInput() throws Exception { TransactionHandle txn = manager.beginTransaction(); KeyColumnValueStoreUtil.insert(store, txn, 1, "c", "v"); txn.commit(); txn = manager.beginTransaction(); ByteBuffer key1 = KeyColumnValueStoreUtil.longToByteBuffer(1); ByteBuffer c = KeyColumnValueStoreUtil.stringToByteBuffer("c"); assertTrue(store.containsKeyColumn(key1.duplicate(), c.duplicate(), txn)); txn.commit(); }
public void checkValueExistence(String[][] values, Set<KeyColumn> removed) { for (int i = 0; i < numKeys; i++) { for (int j = 0; j < numColumns; j++) { boolean result = store.containsKeyColumn( KeyValueStoreUtil.getBuffer(i), KeyValueStoreUtil.getBuffer(j), tx); if (removed.contains(new KeyColumn(i, j))) { assertFalse(result); } else { assertTrue(result); } } } }