}
public static void main(String[] args) throws Exception {
String program = CreateTestTable.class.getName();
Opts opts = new Opts();
BatchWriterOpts bwOpts = new BatchWriterOpts();
ScannerOpts scanOpts = new ScannerOpts();
opts.parseArgs(program, args, bwOpts, scanOpts);
// create the test table within accumulo
Connector connector = opts.getConnector();
if (!opts.readOnly) {
TreeSet<Text> keys = new TreeSet<Text>();
for (int i = 0; i < opts.count / 100; i++) {
keys.add(new Text(String.format("%05d", i * 100)));
}
// presplit
connector.tableOperations().create(opts.getTableName());
connector.tableOperations().addSplits(opts.getTableName(), keys);
BatchWriter b = connector.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
// populate
for (int i = 0; i < opts.count; i++) {
Mutation m = new Mutation(new Text(String.format("%05d", i)));
m.put(new Text("col" + Integer.toString((i % 3) + 1)), new Text("qual"), new Value("junk".getBytes()));