private void setupWriter(Configuration configuration) throws IOException {
setupWriter(configuration, false);
}
private void setupWriter(Configuration configuration, boolean reload) throws IOException {
TableDescriptor tableDescriptor = new TableDescriptor();
tableDescriptor.setName(TEST_TABLE);
if (!reload && uuid == null) {
uuid = UUID.randomUUID().toString();
}
tableDescriptor.setTableUri(new File(_base, "table-store-" + uuid).toURI().toString());
Map<String, String> tableProperties = new HashMap<String, String>();
tableProperties.put(BlurConstants.BLUR_SHARD_QUEUE_MAX_PAUSE_TIME_WHEN_EMPTY, "500");
tableProperties.put(BlurConstants.BLUR_SHARD_QUEUE_MAX_QUEUE_BATCH_SIZE, "500");
tableProperties.put(BlurConstants.BLUR_SHARD_QUEUE_MAX_WRITER_LOCK_TIME, "1000");
tableProperties.put(BlurConstants.BLUR_SHARD_QUEUE_MAX_INMEMORY_LENGTH, "1000");
tableDescriptor.setTableProperties(tableProperties);
TableContext tableContext = TableContext.create(tableDescriptor);
File path = new File(_base, "index_" + uuid);
path.mkdirs();
FSDirectory directory = FSDirectory.open(path);
ShardContext shardContext = ShardContext.create(tableContext, "test-shard-" + uuid);