@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { List<String> tservers; MasterMonitorInfo stats; MasterClientService.Iface client = null; ClientContext context = shellState.getContext(); while (true) { try { client = MasterClient.getConnectionWithRetry(context); stats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); break; } catch (ThriftNotActiveServiceException e) { // Let it loop, fetching a new location sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } finally { if (client != null) MasterClient.close(client); } } final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt()); if (cl.hasOption(tserverOption.getOpt())) { tservers = new ArrayList<>(); tservers.add(cl.getOptionValue(tserverOption.getOpt())); } else { tservers = Collections.emptyList(); } shellState.printLines(new BulkImportListIterator(tservers, stats), paginate); return 0; }
client = MasterClient.getConnection(context); if (client != null) { mmi = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); retry = false; } else {
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { List<String> tservers; MasterMonitorInfo stats; MasterClientService.Iface client = null; try { AccumuloServerContext context = new AccumuloServerContext( new ServerConfigurationFactory(shellState.getInstance())); client = MasterClient.getConnectionWithRetry(context); stats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); } finally { if (client != null) MasterClient.close(client); } final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt()); if (cl.hasOption(tserverOption.getOpt())) { tservers = new ArrayList<>(); tservers.add(cl.getOptionValue(tserverOption.getOpt())); } else { tservers = Collections.emptyList(); } shellState.printLines(new BulkImportListIterator(tservers, stats), paginate); return 0; }
client = MasterClient.getConnection(context); if (client != null) { mmi = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); retry = false; } else {
client = MasterClient.getConnection(HdfsZooInstance.getInstance()); if (client != null) { mmi = client.getMasterStats(Tracer.traceInfo(), SecurityConstants.getSystemCredentials()); retry = false; } else {
new ServerConfigurationFactory(HdfsZooInstance.getInstance())); client = MasterClient.getConnectionWithRetry(context); stats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); } finally { if (client != null)
client = MasterClient .getConnectionWithRetry(new ClientContext(instance, creds, cluster.getClientConfig())); stats = client.getMasterStats(Tracer.traceInfo(), creds.toThrift(instance)); } catch (ThriftSecurityException exception) { throw new AccumuloSecurityException(exception);
try { client = MasterClient.getConnectionWithRetry(context); stats = client.getMasterStats(Tracer.traceInfo(), creds.toThrift(c.getInstance())); } finally { if (client != null)
client = MasterClient .getConnectionWithRetry(new ClientContext(c.getInstance(), creds, clientConf)); stats = client.getMasterStats(Tracer.traceInfo(), creds.toThrift(c.getInstance())); } finally { if (client != null)
new ServerConfigurationFactory(opts.getInstance()).getConfiguration()); client = MasterClient.getConnectionWithRetry(context); MasterMonitorInfo stats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds());
try { client = MasterClient.getConnectionWithRetry(context); stats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); } finally { if (client != null)
/** * Get programmatic interface to information available in a normal monitor. XXX the returned * structure won't contain information about the metadata table until there is data in it. e.g. if * you want to see the metadata table you should create a table. * * @since 1.6.1 */ public MasterMonitorInfo getMasterMonitorInfo() throws AccumuloException, AccumuloSecurityException { MasterClientService.Iface client = null; MasterMonitorInfo stats = null; try { Instance instance = new ZooKeeperInstance(getClientConfig()); ClientContext context = new ClientContext(instance, new Credentials("root", new PasswordToken("unchecked")), getClientConfig()); client = MasterClient.getConnectionWithRetry(context); stats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); } catch (ThriftSecurityException exception) { throw new AccumuloSecurityException(exception); } catch (TException exception) { throw new AccumuloException(exception); } finally { if (client != null) { MasterClient.close(client); } } return stats; }
private int getMajorCompactionCount() { int majC = 0; ZooKeeperInstance instance = new ZooKeeperInstance(ClientConfiguration.loadDefault().withInstance(instanceName).withZkHosts(zooKeepers)); Iface client = null; try { client = MasterClient.getConnection(new ClientContext(instance, credentials, AccumuloConfiguration.getDefaultConfiguration())); MasterMonitorInfo mmi = client.getMasterStats(null, credentials.toThrift(instance)); Map<String,TableInfo> tableStats = mmi.getTableMap(); for (java.util.Map.Entry<String,TableInfo> e : tableStats.entrySet()) { majC += e.getValue().getMajors().getQueued(); majC += e.getValue().getMajors().getRunning(); } } catch (Exception e) { // Accumulo API changed, catch exception for now until we redeploy // accumulo on lightning. log.error("Unable to retrieve major compaction stats: " + e.getMessage()); } finally { if (client != null) { MasterClient.close(client); } } return majC; }
public getMasterStats_result getResult(I iface, getMasterStats_args args) throws org.apache.thrift.TException { getMasterStats_result result = new getMasterStats_result(); try { result.success = iface.getMasterStats(args.tinfo, args.credentials); } catch (org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec) { result.sec = sec; } return result; } }
public getMasterStats_result getResult(I iface, getMasterStats_args args) throws org.apache.thrift.TException { getMasterStats_result result = new getMasterStats_result(); try { result.success = iface.getMasterStats(args.tinfo, args.credentials); } catch (org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec) { result.sec = sec; } catch (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase) { result.tnase = tnase; } return result; } }