/** * Initialize the TabletBalancer. This gives the balancer the opportunity to read the * configuration. */ public void init(ServerConfigurationFactory conf) { context = new AccumuloServerContext(conf); configuration = conf; }
public WalkingSecurity(State state2, Environment env2) { super(new AccumuloServerContext(new ServerConfigurationFactory(HdfsZooInstance.getInstance()))); this.state = state2; this.env = env2; authorizor = this; authenticator = this; permHandle = this; }
@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; }
public static void main(String[] args) throws Exception { listVolumes( new AccumuloServerContext(new ServerConfigurationFactory(HdfsZooInstance.getInstance()))); }
public static void main(String[] args) throws Exception { ClientOpts opts = new ClientOpts(); opts.parseArgs(FindOfflineTablets.class.getName(), args); AccumuloServerContext context = new AccumuloServerContext( new ServerConfigurationFactory(opts.getInstance())); findOffline(context, null); }
@Override public void visit(State state, Environment env, Properties props) throws Exception { log.info("Starting all servers"); SetGoalState.main(new String[] {MasterGoalState.NORMAL.name()}); Process exec = Runtime.getRuntime() .exec(new String[] {System.getenv().get("ACCUMULO_HOME") + "/bin/start-all.sh"}); exec.waitFor(); while (true) { try { AccumuloServerContext context = new AccumuloServerContext( new ServerConfigurationFactory(HdfsZooInstance.getInstance())); Client client = MasterClient.getConnection(context); MasterMonitorInfo masterStats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); if (!masterStats.tServerInfo.isEmpty()) break; } catch (Exception ex) { sleepUninterruptibly(1, TimeUnit.SECONDS); } } }
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) { AccumuloServerContext context = new AccumuloServerContext( new ServerConfigurationFactory(opts.getInstance())); 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); } }
public static void main(String args[]) throws Exception { getInstance( new AccumuloServerContext(new ServerConfigurationFactory(HdfsZooInstance.getInstance()))) .printProblems(); }
AccumuloServerContext context = new AccumuloServerContext(confFactory); initSecurity(context, opts, uuid.toString(), rootUser); } catch (Exception e) {
refs = new WrappedCloseWriteAheadLogReferences(new AccumuloServerContext(factory));
private static GCStatus fetchGcStatus() { GCStatus result = null; HostAndPort address = null; try { // Read the gc location from its lock ZooReaderWriter zk = ZooReaderWriter.getInstance(); String path = ZooUtil.getRoot(instance) + Constants.ZGC_LOCK; List<String> locks = zk.getChildren(path, null); if (locks != null && locks.size() > 0) { Collections.sort(locks); address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0), null), UTF_8)) .getAddress(Service.GC_CLIENT); GCMonitorService.Client client = ThriftUtil.getClient(new GCMonitorService.Client.Factory(), address, new AccumuloServerContext(config)); try { result = client.getStatus(Tracer.traceInfo(), getContext().rpcCreds()); } finally { ThriftUtil.returnClient(client); } } } catch (Exception ex) { log.warn("Unable to contact the garbage collector at " + address, ex); } return result; }
@Override public void visit(State state, Environment env, Properties props) throws Exception { log.info("shutting down"); SetGoalState.main(new String[] {MasterGoalState.CLEAN_STOP.name()}); while (!env.getConnector().instanceOperations().getTabletServers().isEmpty()) { sleepUninterruptibly(1, TimeUnit.SECONDS); } while (true) { try { AccumuloServerContext context = new AccumuloServerContext( new ServerConfigurationFactory(HdfsZooInstance.getInstance())); Client client = MasterClient.getConnection(context); client.getMasterStats(Tracer.traceInfo(), context.rpcCreds()); } catch (Exception e) { // assume this is due to server shutdown break; } sleepUninterruptibly(1, TimeUnit.SECONDS); } log.info("servers stopped"); sleepUninterruptibly(10, TimeUnit.SECONDS); }
private long getSyncs() throws Exception { Connector c = getConnector(); ServerConfigurationFactory confFactory = new ServerConfigurationFactory(c.getInstance()); AccumuloServerContext context = new AccumuloServerContext(confFactory); for (String address : c.instanceOperations().getTabletServers()) { TabletClientService.Client client = ThriftUtil .getTServerClient(HostAndPort.fromString(address), context); TabletServerStatus status = client.getTabletServerStatus(null, context.rpcCreds()); return status.syncs; } return 0; }
public static void main(String[] args) throws Exception { Random random = new Random(System.currentTimeMillis() % 1000); int port = random.nextInt(30000) + 2000; AccumuloServerContext context = new AccumuloServerContext( new ServerConfigurationFactory(HdfsZooInstance.getInstance()));
AccumuloServerContext context = new AccumuloServerContext( new ServerConfigurationFactory(HdfsZooInstance.getInstance())); if (isInitialized(fs)) {
public static void main(String[] args) throws Exception { final String app = "monitor"; Accumulo.setupLogging(app); SecurityUtil.serverLogin(SiteConfiguration.getInstance()); ServerOpts opts = new ServerOpts(); opts.parseArgs(app, args); String hostname = opts.getAddress(); VolumeManager fs = VolumeManagerImpl.get(); instance = HdfsZooInstance.getInstance(); config = new ServerConfigurationFactory(instance); context = new AccumuloServerContext(config); log.info("Version " + Constants.VERSION); log.info("Instance " + instance.getInstanceID()); MetricsSystemHelper.configure(Monitor.class.getSimpleName()); Accumulo.init(fs, config, app); Monitor monitor = new Monitor(); DistributedTrace.enable(hostname, app, config.getConfiguration()); try { monitor.run(hostname); } finally { DistributedTrace.disable(); } }
AccumuloServerContext context = new AccumuloServerContext(new ServerConfigurationFactory(zki)); new AccumuloServerContext(new ServerConfigurationFactory(HdfsZooInstance.getInstance())), watcher); Processor<Iface> processor = new Processor<Iface>(tch);
ClientContext context = new AccumuloServerContext(confFactory);
MasterMonitorInfo stats = null; try { AccumuloServerContext context = new AccumuloServerContext( new ServerConfigurationFactory(HdfsZooInstance.getInstance())); client = MasterClient.getConnectionWithRetry(context);
private void run() throws Exception { Instance inst = HdfsZooInstance.getInstance(); AccumuloServerContext c = new AccumuloServerContext(new ServerConfigurationFactory(inst)); String zPath = ZooUtil.getRoot(inst) + "/testLock"; IZooReaderWriter zoo = ZooReaderWriter.getInstance();