@Override
 public void mutateMany(
     Map<String, Map<StaticBuffer, KCVMutation>> mutations, StoreTransaction txh)
     throws BackendException {
   for (Map.Entry<String, Map<StaticBuffer, KCVMutation>> storeMut : mutations.entrySet()) {
     KeyColumnValueStore store = stores.get(storeMut.getKey());
     Preconditions.checkNotNull(store);
     for (Map.Entry<StaticBuffer, KCVMutation> keyMut : storeMut.getValue().entrySet()) {
       store.mutate(
           keyMut.getKey(),
           keyMut.getValue().getAdditions(),
           keyMut.getValue().getDeletions(),
           txh);
     }
   }
 }
コード例 #2
0
 @Test
 public void addRecords() throws StorageException {
   for (int r = 0; r < numRows; r++) {
     int numCols = 10;
     List<Entry> entries = new ArrayList<Entry>();
     for (int c = 0; c < numCols; c++) {
       entries.add(
           new StaticBufferEntry(
               KeyValueStoreUtil.getBuffer(c + 1), KeyValueStoreUtil.getBuffer(c + r + 2)));
     }
     store.mutate(
         KeyValueStoreUtil.getBuffer(r + 1), entries, KeyColumnValueStore.NO_DELETIONS, tx);
   }
   tx.commit();
   tx = null;
 }