client = MasterClient.getConnection(context); if (client != null) { mmi = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); retry = false; } else {
@Override public void send(TCredentials credentials, String serverName, MasterClientService.Iface client) throws TException, ThriftSecurityException { TabletSplit split = new TabletSplit(); split.oldTablet = old_extent.toThrift(); split.newTablets = Translator.translate(extents.keySet(), Translators.KET); client.reportSplitExtent(Tracer.traceInfo(), credentials, serverName, split); }
private long beginFateOperation() throws ThriftSecurityException, TException { while (true) { MasterClientService.Iface client = null; try { client = MasterClient.getConnectionWithRetry(context); return client.beginFateOperation(Tracer.traceInfo(), context.rpcCreds()); } catch (TTransportException tte) { log.debug("Failed to call beginFateOperation(), retrying ... ", tte); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } catch (ThriftNotActiveServiceException e) { // Let it loop, fetching a new location log.debug("Contacted a Master which is no longer active, retrying"); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } finally { MasterClient.close(client); } } }
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)
try { client = MasterClient.getConnectionWithRetry(context); stats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); } finally { if (client != null)
new ServerConfigurationFactory(opts.getInstance()).getConfiguration()); client = MasterClient.getConnectionWithRetry(context); MasterMonitorInfo stats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds());
/** * 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; }
@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; }
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; }
private long beginFateOperation() throws ThriftSecurityException, TException { while (true) { MasterClientService.Iface client = null; try { client = MasterClient.getConnectionWithRetry(context); return client.beginFateOperation(Tracer.traceInfo(), context.rpcCreds()); } catch (TTransportException tte) { log.debug("Failed to call beginFateOperation(), retrying ... ", tte); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } finally { MasterClient.close(client); } } }
public void send(TCredentials auth, String serverName, Iface client) throws TException, ThriftSecurityException { client.reportTabletStatus(Tracer.traceInfo(), auth, serverName, status, extent.toThrift()); } }
@Override public void send(TCredentials credentials, String serverName, MasterClientService.Iface client) throws TException, ThriftSecurityException { TabletSplit split = new TabletSplit(); split.oldTablet = old_extent.toThrift(); split.newTablets = Translator.translate(extents.keySet(), Translators.KET); client.reportSplitExtent(Tracer.traceInfo(), credentials, serverName, split); }
public drainReplicationTable_result getResult(I iface, drainReplicationTable_args args) throws org.apache.thrift.TException { drainReplicationTable_result result = new drainReplicationTable_result(); result.success = iface.drainReplicationTable(args.tfino, args.credentials, args.tableName, args.logsToWatch); result.setSuccessIsSet(true); 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.client.impl.thrift.ThriftSecurityException sec) { result.sec = sec; } return result; } }
public org.apache.thrift.TBase getResult(I iface, reportTabletStatus_args args) throws org.apache.thrift.TException { iface.reportTabletStatus(args.tinfo, args.credentials, args.serverName, args.status, args.tablet); return null; } }