Package org.apache.accumulo.core.util

Examples of org.apache.accumulo.core.util.Daemon


    currentMaster = null;
   
    statsKeeper = new TabletStatsKeeper();
   
    // start major compactor
    majorCompactorThread = new Daemon(new LoggingRunnable(log, new MajorCompactor()));
    majorCompactorThread.setName("Split/MajC initiator");
    majorCompactorThread.start();
   
    String className = ServerConfiguration.getSystemConfiguration().get(Property.TSERV_LOGGER_STRATEGY);
    Class<? extends LoggerStrategy> klass = DEFAULT_LOGGER_STRATEGY;
View Full Code Here


    getMasterLock(zroot + Constants.ZMASTER_LOCK);
   
    TableManager.getInstance().addObserver(this);
   
    recovery = new CoordinateRecoveryTask(fs);
    Thread recoveryThread = new Daemon(new LoggingRunnable(log, recovery), "Recovery Status");
    recoveryThread.start();
   
    loggers = new TabletServerLoggers(this, ServerConfiguration.getSystemConfiguration());
    loggers.scanZooKeeperForUpdates();
   
    StatusThread statusThread = new StatusThread();
    statusThread.start();
   
    MigrationCleanupThread migrationCleanupThread = new MigrationCleanupThread();
    migrationCleanupThread.start();
   
    tserverSet.startListeningForTabletServerChanges();
   
    AuthInfo systemAuths = SecurityConstants.getSystemCredentials();
    final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new RootTabletStateStore(instance, systemAuths, this),
        new MetaDataStateStore(instance, systemAuths, this)};
    watchers.add(new TabletGroupWatcher(stores[2], null));
    watchers.add(new TabletGroupWatcher(stores[1], watchers.get(0)));
    watchers.add(new TabletGroupWatcher(stores[0], watchers.get(1)));
    for (TabletGroupWatcher watcher : watchers) {
      watcher.start();
    }
   
    // TODO: add shutdown for fate object
    try {
      fate = new Fate<Master>(this, new org.apache.accumulo.server.fate.ZooStore<Master>(ZooUtil.getRoot(instance) + Constants.ZFATE,
          ZooReaderWriter.getRetryingInstance()), fateThreadCount);
    } catch (KeeperException e) {
      throw new IOException(e);
    } catch (InterruptedException e) {
      throw new IOException(e);
    }
   
    Processor processor = new MasterClientService.Processor(TraceWrap.service(new MasterClientServiceHandler()));
    clientService = TServerUtils.startServer(Property.MASTER_CLIENTPORT, processor, "Master", "Master Client Service Handler", null,
        Property.MASTER_MINTHREADS, Property.MASTER_THREADCHECK).server;
   
    while (!clientService.isServing()) {
      UtilWaitThread.sleep(100);
    }
    while (clientService.isServing()) {
      UtilWaitThread.sleep(500);
    }
   
    final long deadline = System.currentTimeMillis() + MAX_CLEANUP_WAIT_TIME;
    statusThread.join(remaining(deadline));
   
    recovery.stop();
    recoveryThread.join(remaining(deadline));
   
    // quit, even if the tablet servers somehow jam up and the watchers
    // don't stop
    for (TabletGroupWatcher watcher : watchers) {
      watcher.join(remaining(deadline));
View Full Code Here

    currentMaster = null;
   
    statsKeeper = new TabletStatsKeeper();
   
    // start major compactor
    majorCompactorThread = new Daemon(new LoggingRunnable(log, new MajorCompactor()));
    majorCompactorThread.setName("Split/MajC initiator");
    majorCompactorThread.start();
   
    String className = AccumuloConfiguration.getSystemConfiguration().get(Property.TSERV_LOGGER_STRATEGY);
    Class<? extends LoggerStrategy> klass = DEFAULT_LOGGER_STRATEGY;
View Full Code Here

    getMasterLock(zroot + Constants.ZMASTER_LOCK);
   
    TableManager.getInstance().addObserver(this);
   
    recovery = new CoordinateRecoveryTask(fs);
    Thread recoveryThread = new Daemon(new LoggingRunnable(log, recovery), "Recovery Status");
    recoveryThread.start();
   
    loggers = new TabletServerLoggers(this);
    loggers.scanZooKeeperForUpdates();
   
    StatusThread statusThread = new StatusThread();
    statusThread.start();
   
    MigrationCleanupThread migrationCleanupThread = new MigrationCleanupThread();
    migrationCleanupThread.start();
   
    DeleteThread deleteThread = new DeleteThread();
    deleteThread.start();
   
    tserverSet.startListeningForTabletServerChanges();
   
    final int count = waitForTabletServerCountToStabilize();
    log.info("Starting with " + count + " tablet servers");
   
    recoverServersToShutdownFromZooKeeper();
    SimpleTimer.getInstance().schedule(new ShutdownTabletServers(), 1000, 1000);
   
    final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new RootTabletStateStore(this), new MetaDataStateStore(this)};
    for (int i = 0; i < stores.length; i++) {
      watchers.add(new TabletGroupWatcher(stores[i]));
    }
    for (TabletGroupWatcher watcher : watchers) {
      watcher.start();
    }
   
    Processor processor = new MasterClientService.Processor(TraceWrap.service(new MasterClientServiceHandler()));
    clientService = TServerUtils.startServer(Property.MASTER_CLIENTPORT, processor, "Master", "Master Client Service Handler", false).server;
    // use the main thread to accept client connections
    clientService.serve();
   
    final long deadline = System.currentTimeMillis() + 1000;
    statusThread.join(remaining(deadline));
    deleteThread.join(remaining(deadline));
   
    recovery.stop();
    recoveryThread.join(remaining(deadline));
   
    // quit, even if the tablet servers somehow jam up and the watchers
    // don't stop
    for (TabletGroupWatcher watcher : watchers) {
      watcher.join(remaining(deadline));
View Full Code Here

   
    BlockingQueue<Runnable> q = new LinkedBlockingQueue<Runnable>();
    ThreadFactory factory = new ThreadFactory() {
      @Override
      public Thread newThread(Runnable r) {
        return new Daemon(new LoggingRunnable(log, r));
      }
    };
    ThreadPoolExecutor e = new ThreadPoolExecutor(CORE_POOL_SIZE, MAX_POOL_SIZE, 1, TimeUnit.SECONDS, q, factory);
    state.set("pool", e);
  }
View Full Code Here

  }
 
  public static void halt(final int status, Runnable runnable) {
    try {
      // give ourselves a little time to try and do something
      new Daemon() {
        public void run() {
          UtilWaitThread.sleep(100);
          Runtime.getRuntime().halt(status);
        }
      }.start();
View Full Code Here

    getMasterLock(zroot + Constants.ZMASTER_LOCK);
   
    TableManager.getInstance().addObserver(this);
   
    recovery = new CoordinateRecoveryTask(fs);
    Thread recoveryThread = new Daemon(new LoggingRunnable(log, recovery), "Recovery Status");
    recoveryThread.start();
   
    loggers = new TabletServerLoggers(this, ServerConfiguration.getSystemConfiguration());
    loggers.scanZooKeeperForUpdates();
   
    StatusThread statusThread = new StatusThread();
    statusThread.start();
   
    MigrationCleanupThread migrationCleanupThread = new MigrationCleanupThread();
    migrationCleanupThread.start();
   
    tserverSet.startListeningForTabletServerChanges();
   
    AuthInfo systemAuths = SecurityConstants.getSystemCredentials();
    final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new RootTabletStateStore(instance, systemAuths, this),
        new MetaDataStateStore(instance, systemAuths, this)};
    watchers.add(new TabletGroupWatcher(stores[2], null));
    watchers.add(new TabletGroupWatcher(stores[1], watchers.get(0)));
    watchers.add(new TabletGroupWatcher(stores[0], watchers.get(1)));
    for (TabletGroupWatcher watcher : watchers) {
      watcher.start();
    }
   
    // TODO: add shutdown for fate object
    try {
      fate = new Fate<Master>(this, new org.apache.accumulo.server.fate.ZooStore<Master>(ZooUtil.getRoot(instance) + Constants.ZFATE,
          ZooReaderWriter.getRetryingInstance()), 4);
    } catch (KeeperException e) {
      throw new IOException(e);
    } catch (InterruptedException e) {
      throw new IOException(e);
    }
   
    Processor processor = new MasterClientService.Processor(TraceWrap.service(new MasterClientServiceHandler()));
    clientService = TServerUtils.startServer(Property.MASTER_CLIENTPORT, processor, "Master", "Master Client Service Handler", null,
        Property.MASTER_MINTHREADS, Property.MASTER_THREADCHECK).server;
   
    while (!clientService.isServing()) {
      UtilWaitThread.sleep(100);
    }
    while (clientService.isServing()) {
      UtilWaitThread.sleep(500);
    }
   
    final long deadline = System.currentTimeMillis() + MAX_CLEANUP_WAIT_TIME;
    statusThread.join(remaining(deadline));
   
    recovery.stop();
    recoveryThread.join(remaining(deadline));
   
    // quit, even if the tablet servers somehow jam up and the watchers
    // don't stop
    for (TabletGroupWatcher watcher : watchers) {
      watcher.join(remaining(deadline));
View Full Code Here

    this.store = store;
    this.environment = environment;
   
    for (int i = 0; i < numTreads; i++) {
      // TODO: use a ExecutorService, maybe a utility to do these steps throughout the server packages
      Thread thread = new Daemon(new LoggingRunnable(log, new TransactionRunner()), "Repo runner " + i);
      thread.start();
    }
  }
View Full Code Here

    if (sm != null) {
      sm.checkPermission(TRANSPORT_POOL_PERMISSION);
    }
   
    if (daemonStarted.compareAndSet(false, true)) {
      new Daemon(new Closer(instance), "Thrift Connection Pool Checker").start();
    }
    return instance;
  }
View Full Code Here

    }
  }
 
  static void startLogListener() {
    try {
      new Daemon(new SocketServer(ServerConfiguration.getSystemConfiguration().getPort(Property.MONITOR_LOG4J_PORT))).start();
    } catch (Throwable t) {
      log.info("Unable to listen to cluster-wide ports", t);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.util.Daemon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.