private void put(TableReference tableRef, Map<Cell, byte[]> values, long timestamp, boolean idempotent) { Iterable<List<Entry<Cell, byte[]>>> batches = IterablePartitioner.partitionByCountAndBytes( values.entrySet(), config.mutationBatchCount(), config.mutationBatchSizeBytes(), tableRef, getByteSizingFunction()); runReadWrite(tableRef, (readTable, writeTable) -> { for (List<Entry<Cell, byte[]>> batch : batches) { try { writeTable.put(batch, timestamp); } catch (KeyAlreadyExistsException e) { if (idempotent) { putIfNotUpdate(readTable, writeTable, tableRef, batch, timestamp, e); } else { throw e; } } } return null; }); }
private void put(TableReference tableRef, Map<Cell, byte[]> values, long timestamp, boolean idempotent) { Iterable<List<Entry<Cell, byte[]>>> batches = IterablePartitioner.partitionByCountAndBytes( values.entrySet(), config.mutationBatchCount(), config.mutationBatchSizeBytes(), tableRef, getByteSizingFunction()); runReadWrite(tableRef, (readTable, writeTable) -> { for (List<Entry<Cell, byte[]>> batch : batches) { try { writeTable.put(batch, timestamp); } catch (KeyAlreadyExistsException e) { if (idempotent) { putIfNotUpdate(readTable, writeTable, tableRef, batch, timestamp, e); } else { throw e; } } } return null; }); }