Search in sources :

Example 1 with OfflineScanner

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;
}
Also used : Table(org.apache.accumulo.core.client.impl.Table) OfflineScanner(org.apache.accumulo.core.client.impl.OfflineScanner) Credentials(org.apache.accumulo.core.client.impl.Credentials)

Aggregations

Credentials (org.apache.accumulo.core.client.impl.Credentials)1 OfflineScanner (org.apache.accumulo.core.client.impl.OfflineScanner)1 Table (org.apache.accumulo.core.client.impl.Table)1