Search in sources :

Example 11 with AccumuloServerContext

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();
}
Also used : AccumuloServerContext(org.apache.accumulo.server.AccumuloServerContext) Instance(org.apache.accumulo.core.client.Instance) HdfsZooInstance(org.apache.accumulo.server.client.HdfsZooInstance) ServerConfigurationFactory(org.apache.accumulo.server.conf.ServerConfigurationFactory)

Example 12 with AccumuloServerContext

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();
    }
}
Also used : VolumeManager(org.apache.accumulo.server.fs.VolumeManager) AccumuloServerContext(org.apache.accumulo.server.AccumuloServerContext) ServerOpts(org.apache.accumulo.server.ServerOpts) ServerConfigurationFactory(org.apache.accumulo.server.conf.ServerConfigurationFactory)

Example 13 with AccumuloServerContext

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;
}
Also used : HostAndPort(org.apache.accumulo.core.util.HostAndPort) ServerServices(org.apache.accumulo.core.util.ServerServices) AccumuloServerContext(org.apache.accumulo.server.AccumuloServerContext) ZooReaderWriter(org.apache.accumulo.server.zookeeper.ZooReaderWriter) GCStatus(org.apache.accumulo.core.gc.thrift.GCStatus) GCMonitorService(org.apache.accumulo.core.gc.thrift.GCMonitorService) MasterClient(org.apache.accumulo.core.client.impl.MasterClient) Client(org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Client) KeeperException(org.apache.zookeeper.KeeperException) UnknownHostException(java.net.UnknownHostException)

Example 14 with AccumuloServerContext

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);
}
Also used : AccumuloServerContext(org.apache.accumulo.server.AccumuloServerContext) Instance(org.apache.accumulo.core.client.Instance) TServerInstance(org.apache.accumulo.server.master.state.TServerInstance) ServerConfigurationFactory(org.apache.accumulo.server.conf.ServerConfigurationFactory) ClientOpts(org.apache.accumulo.server.cli.ClientOpts)

Example 15 with AccumuloServerContext

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)));
}
Also used : AccumuloServerContext(org.apache.accumulo.server.AccumuloServerContext) Instance(org.apache.accumulo.core.client.Instance) HdfsZooInstance(org.apache.accumulo.server.client.HdfsZooInstance) ServerConfigurationFactory(org.apache.accumulo.server.conf.ServerConfigurationFactory)

Aggregations

AccumuloServerContext (org.apache.accumulo.server.AccumuloServerContext)38 Test (org.junit.Test)20 ServerConfigurationFactory (org.apache.accumulo.server.conf.ServerConfigurationFactory)17 Instance (org.apache.accumulo.core.client.Instance)16 KeyExtent (org.apache.accumulo.core.data.impl.KeyExtent)12 TServerInstance (org.apache.accumulo.server.master.state.TServerInstance)12 HashMap (java.util.HashMap)9 TKeyExtent (org.apache.accumulo.core.data.thrift.TKeyExtent)8 HdfsZooInstance (org.apache.accumulo.server.client.HdfsZooInstance)8 ArrayList (java.util.ArrayList)7 VolumeManager (org.apache.accumulo.server.fs.VolumeManager)7 Connector (org.apache.accumulo.core.client.Connector)6 GCStatus (org.apache.accumulo.core.gc.thrift.GCStatus)6 Map (java.util.Map)5 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)5 GcCycleStats (org.apache.accumulo.core.gc.thrift.GcCycleStats)5 TabletServerStatus (org.apache.accumulo.core.master.thrift.TabletServerStatus)5 WalStateManager (org.apache.accumulo.server.log.WalStateManager)5 LiveTServerSet (org.apache.accumulo.server.master.LiveTServerSet)5 TabletMigration (org.apache.accumulo.server.master.state.TabletMigration)5