use of org.apache.accumulo.core.client.impl.OfflineScanner in project accumulo by apache.
the class SampleIT method newOfflineScanner.
private Scanner newOfflineScanner(Connector conn, String tableName, String clone, SamplerConfiguration sc) throws Exception {
if (conn.tableOperations().exists(clone)) {
conn.tableOperations().delete(clone);
}
Map<String, String> em = Collections.emptyMap();
Set<String> es = Collections.emptySet();
conn.tableOperations().clone(tableName, clone, false, em, es);
conn.tableOperations().offline(clone, true);
Table.ID cloneID = Table.ID.of(conn.tableOperations().tableIdMap().get(clone));
OfflineScanner oScanner = new OfflineScanner(conn.getInstance(), new Credentials(getAdminPrincipal(), getAdminToken()), cloneID, Authorizations.EMPTY);
if (sc != null) {
oScanner.setSamplerConfiguration(sc);
}
return oScanner;
}
Aggregations