Search in sources :

Example 1 with ClientOnRequiredTable

use of org.apache.accumulo.core.cli.ClientOnRequiredTable in project accumulo by apache.

the class RandomizeVolumes method main.

public static void main(String[] args) throws AccumuloException, AccumuloSecurityException {
    ClientOnRequiredTable opts = new ClientOnRequiredTable();
    opts.parseArgs(RandomizeVolumes.class.getName(), args);
    Connector c;
    if (opts.getToken() == null) {
        Instance instance = opts.getInstance();
        AccumuloServerContext context = new AccumuloServerContext(instance, new ServerConfigurationFactory(instance));
        c = context.getConnector();
    } else {
        c = opts.getConnector();
    }
    try {
        int status = randomize(c, opts.getTableName());
        System.exit(status);
    } catch (Exception ex) {
        log.error("{}", ex.getMessage(), ex);
        System.exit(4);
    }
}
Also used : Connector(org.apache.accumulo.core.client.Connector) AccumuloServerContext(org.apache.accumulo.server.AccumuloServerContext) Instance(org.apache.accumulo.core.client.Instance) ServerConfigurationFactory(org.apache.accumulo.server.conf.ServerConfigurationFactory) ClientOnRequiredTable(org.apache.accumulo.core.cli.ClientOnRequiredTable) TableNotFoundException(org.apache.accumulo.core.client.TableNotFoundException) AccumuloSecurityException(org.apache.accumulo.core.client.AccumuloSecurityException) IOException(java.io.IOException) AccumuloException(org.apache.accumulo.core.client.AccumuloException)

Aggregations

IOException (java.io.IOException)1 ClientOnRequiredTable (org.apache.accumulo.core.cli.ClientOnRequiredTable)1 AccumuloException (org.apache.accumulo.core.client.AccumuloException)1 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)1 Connector (org.apache.accumulo.core.client.Connector)1 Instance (org.apache.accumulo.core.client.Instance)1 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)1 AccumuloServerContext (org.apache.accumulo.server.AccumuloServerContext)1 ServerConfigurationFactory (org.apache.accumulo.server.conf.ServerConfigurationFactory)1