use of org.apache.accumulo.server.AccumuloServerContext in project accumulo by apache.
the class ProblemReports method main.
public static void main(String[] args) throws Exception {
Instance instance = HdfsZooInstance.getInstance();
getInstance(new AccumuloServerContext(instance, new ServerConfigurationFactory(instance))).printProblems();
}
use of org.apache.accumulo.server.AccumuloServerContext in project accumulo by apache.
the class Monitor method main.
public static void main(String[] args) throws Exception {
final String app = "monitor";
ServerOpts opts = new ServerOpts();
opts.parseArgs(app, args);
String hostname = opts.getAddress();
SecurityUtil.serverLogin(SiteConfiguration.getInstance());
VolumeManager fs = VolumeManagerImpl.get();
instance = HdfsZooInstance.getInstance();
config = new ServerConfigurationFactory(instance);
context = new AccumuloServerContext(instance, config);
log.info("Version " + Constants.VERSION);
log.info("Instance " + instance.getInstanceID());
MetricsSystemHelper.configure(Monitor.class.getSimpleName());
Accumulo.init(fs, instance, config, app);
Monitor monitor = new Monitor();
// Servlets need access to limit requests when the monitor is not active, but Servlets are instantiated
// via reflection. Expose the service this way instead.
Monitor.HA_SERVICE_INSTANCE = monitor;
DistributedTrace.enable(hostname, app, config.getSystemConfiguration());
try {
monitor.run(hostname);
} finally {
DistributedTrace.disable();
}
}
use of org.apache.accumulo.server.AccumuloServerContext in project accumulo by apache.
the class Monitor method fetchGcStatus.
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(instance, 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;
}
use of org.apache.accumulo.server.AccumuloServerContext in project accumulo by apache.
the class FindOfflineTablets method main.
public static void main(String[] args) throws Exception {
ClientOpts opts = new ClientOpts();
opts.parseArgs(FindOfflineTablets.class.getName(), args);
Instance instance = opts.getInstance();
AccumuloServerContext context = new AccumuloServerContext(instance, new ServerConfigurationFactory(opts.getInstance()));
findOffline(context, null);
}
use of org.apache.accumulo.server.AccumuloServerContext in project accumulo by apache.
the class ListVolumesUsed method main.
public static void main(String[] args) throws Exception {
Instance instance = HdfsZooInstance.getInstance();
listVolumes(new AccumuloServerContext(instance, new ServerConfigurationFactory(instance)));
}
Aggregations