Search in sources :

Example 11 with InstanceOperations

use of org.apache.accumulo.core.client.admin.InstanceOperations in project accumulo by apache.

the class ListCompactionsCommand method execute.

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
    List<String> tservers;
    final InstanceOperations instanceOps = shellState.getConnector().instanceOperations();
    final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt());
    if (cl.hasOption(tserverOption.getOpt())) {
        tservers = new ArrayList<>();
        tservers.add(cl.getOptionValue(tserverOption.getOpt()));
    } else {
        tservers = instanceOps.getTabletServers();
    }
    shellState.printLines(new ActiveCompactionIterator(tservers, instanceOps), paginate);
    return 0;
}
Also used : InstanceOperations(org.apache.accumulo.core.client.admin.InstanceOperations)

Example 12 with InstanceOperations

use of org.apache.accumulo.core.client.admin.InstanceOperations in project accumulo by apache.

the class ListScansCommand method execute.

@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
    List<String> tservers;
    final InstanceOperations instanceOps = shellState.getConnector().instanceOperations();
    final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt());
    if (cl.hasOption(tserverOption.getOpt())) {
        tservers = new ArrayList<>();
        tservers.add(cl.getOptionValue(tserverOption.getOpt()));
    } else {
        tservers = instanceOps.getTabletServers();
    }
    shellState.printLines(new ActiveScanIterator(tservers, instanceOps), paginate);
    return 0;
}
Also used : InstanceOperations(org.apache.accumulo.core.client.admin.InstanceOperations)

Example 13 with InstanceOperations

use of org.apache.accumulo.core.client.admin.InstanceOperations in project accumulo by apache.

the class BadDeleteMarkersCreatedIT method restoreConfig.

@After
public void restoreConfig() throws Exception {
    InstanceOperations iops = getConnector().instanceOperations();
    if (null != gcCycleDelay) {
        iops.setProperty(Property.GC_CYCLE_DELAY.getKey(), gcCycleDelay);
    }
    if (null != gcCycleStart) {
        iops.setProperty(Property.GC_CYCLE_START.getKey(), gcCycleStart);
    }
    log.info("Restarting garbage collector");
    getCluster().getClusterControl().stopAllServers(ServerType.GARBAGE_COLLECTOR);
    getCluster().getClusterControl().startAllServers(ServerType.GARBAGE_COLLECTOR);
    log.info("Garbage collector was restarted");
}
Also used : InstanceOperations(org.apache.accumulo.core.client.admin.InstanceOperations) After(org.junit.After)

Aggregations

InstanceOperations (org.apache.accumulo.core.client.admin.InstanceOperations)13 Before (org.junit.Before)6 After (org.junit.After)3 AccumuloException (org.apache.accumulo.core.client.AccumuloException)1 Instance (org.apache.accumulo.core.client.Instance)1 ZooCache (org.apache.accumulo.fate.zookeeper.ZooCache)1