use of org.apache.accumulo.core.util.format.FormatterConfig in project accumulo by apache.
the class DeleterFormatterTest method testYes.
@Test
public void testYes() throws IOException {
input.set("y\nyes\n");
data.put(new Key("z"), new Value("v2".getBytes(UTF_8)));
formatter = new DeleterFormatter(writer, data.entrySet(), new FormatterConfig().setPrintTimestamps(true), shellState, false);
assertTrue(formatter.hasNext());
assertNull(formatter.next());
verify("[DELETED]", " r ", "cf", "cq", "value");
assertTrue(formatter.hasNext());
assertNull(formatter.next());
verify("[DELETED]", " z ", "v2");
}
use of org.apache.accumulo.core.util.format.FormatterConfig in project accumulo by apache.
the class DeleterFormatterTest method testNo.
@Test
public void testNo() throws IOException {
input.set("no\n");
data.put(new Key("z"), new Value("v2".getBytes(UTF_8)));
formatter = new DeleterFormatter(writer, data.entrySet(), new FormatterConfig().setPrintTimestamps(true), shellState, false);
assertTrue(formatter.hasNext());
assertNull(formatter.next());
verify("[SKIPPED]", " r ", "cf", "cq", "value");
assertTrue(formatter.hasNext());
}
use of org.apache.accumulo.core.util.format.FormatterConfig in project accumulo by apache.
the class DeleteManyCommand method execute.
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
final String tableName = OptUtil.getTableOpt(cl, shellState);
final ScanInterpreter interpeter = getInterpreter(cl, tableName, shellState);
// handle first argument, if present, the authorizations list to
// scan with
final Authorizations auths = getAuths(cl, shellState);
final Scanner scanner = shellState.getConnector().createScanner(tableName, auths);
scanner.addScanIterator(new IteratorSetting(Integer.MAX_VALUE, "NOVALUE", SortedKeyIterator.class));
// handle session-specific scan iterators
addScanIterators(shellState, cl, scanner, tableName);
// handle remaining optional arguments
scanner.setRange(getRange(cl, interpeter));
scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS);
// handle columns
fetchColumns(cl, scanner, interpeter);
// output / delete the records
final BatchWriter writer = shellState.getConnector().createBatchWriter(tableName, new BatchWriterConfig().setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS));
FormatterConfig config = new FormatterConfig();
config.setPrintTimestamps(cl.hasOption(timestampOpt.getOpt()));
shellState.printLines(new DeleterFormatter(writer, scanner, config, shellState, cl.hasOption(forceOpt.getOpt())), false);
return 0;
}
use of org.apache.accumulo.core.util.format.FormatterConfig in project accumulo by apache.
the class TraceFormatter method initialize.
@Override
public void initialize(Iterable<Entry<Key, Value>> scanner, FormatterConfig config) {
this.scanner = scanner.iterator();
this.config = new FormatterConfig(config);
}
use of org.apache.accumulo.core.util.format.FormatterConfig in project accumulo by apache.
the class StatusFormatter method initialize.
@Override
public void initialize(Iterable<Entry<Key, Value>> scanner, FormatterConfig config) {
this.iterator = scanner.iterator();
this.config = new FormatterConfig(config);
}
Aggregations