}
return bwpe;
}
private BatchWriterPlusException getWriter(ByteBuffer login, String tableName, WriterOptions opts) throws Exception {
BatchWriterConfig cfg = new BatchWriterConfig();
if (opts != null) {
if (opts.maxMemory != 0)
cfg.setMaxMemory(opts.maxMemory);
if (opts.threads != 0)
cfg.setMaxWriteThreads(opts.threads);
if (opts.timeoutMs != 0)
cfg.setTimeout(opts.timeoutMs, TimeUnit.MILLISECONDS);
if (opts.latencyMs != 0)
cfg.setMaxLatency(opts.latencyMs, TimeUnit.MILLISECONDS);
}
BatchWriterPlusException result = new BatchWriterPlusException();
result.writer = getConnector(login).createBatchWriter(tableName, cfg);
return result;
}