예제 #1
0
 @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();
 }
예제 #2
0
  @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();
  }
예제 #3
0
 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);
       }
     }
   }
 }