@Override public BatchWriter createBatchWriter(String tableName, BatchWriterConfig config) throws TableNotFoundException { return context.createBatchWriter(tableName, config); }
@Override public BatchWriter createBatchWriter(String tableName) throws TableNotFoundException { return createBatchWriter(tableName, new BatchWriterConfig()); }
BatchWriter createBatchWriter() { try { return context.createBatchWriter(targetTableName, new BatchWriterConfig().setMaxMemory(MAX_MEMORY) .setMaxLatency(LATENCY, TimeUnit.MILLISECONDS).setMaxWriteThreads(THREADS)); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Record the updated Status for this file and target * * @param filePath * Path to file being replicated * @param status * Updated Status after replication * @param target * Peer that was replicated to */ public void recordNewStatus(Path filePath, Status status, ReplicationTarget target) throws AccumuloException, TableNotFoundException { try (BatchWriter bw = context.createBatchWriter(ReplicationTable.NAME, new BatchWriterConfig())) { log.debug("Recording new status for {}, {}", filePath, ProtobufUtil.toString(status)); Mutation m = new Mutation(filePath.toString()); WorkSection.add(m, target.toText(), ProtobufUtil.toValue(status)); bw.addMutation(m); } } }
bwConfig.setMaxMemory(memoryInBytes); try { bw = context.createBatchWriter(tableName, bwConfig); } catch (TableNotFoundException e) { throw new RemoteReplicationException(RemoteReplicationErrorCode.TABLE_DOES_NOT_EXIST,