Examples of LoggingRunnable


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

      LogService.startLogListener(Monitor.getSystemConfiguration(), instance.getInstanceID(), hostname);
    } else {
      log.warn("Not starting log4j listener as we could not determine address to use");
    }

    new Daemon(new LoggingRunnable(log, new ZooKeeperStatus()), "ZooKeeperStatus").start();

    // need to regularly fetch data so plot data is updated
    new Daemon(new LoggingRunnable(log, new Runnable() {

      @Override
      public void run() {
        while (true) {
          try {
            Monitor.fetchData();
          } catch (Exception e) {
            log.warn(e.getMessage(), e);
          }

          UtilWaitThread.sleep(333);
        }

      }
    }), "Data fetcher").start();
   
    new Daemon(new LoggingRunnable(log, new Runnable() {
      @Override
      public void run() {
        while (true) {
          try {
            Monitor.fetchScans();
View Full Code Here

Examples of org.apache.accumulo.fate.util.LoggingRunnable

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

Examples of org.apache.accumulo.fate.util.LoggingRunnable

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

Examples of org.elasticsearch.common.thread.LoggingRunnable

            return;
        }

        // we only write the local metadata if this is a possible master node
        if (event.state().nodes().localNode().masterNode() && event.metaDataChanged()) {
            executor.execute(new LoggingRunnable(logger, new PersistMetaData(event)));
        }

        if (event.state().nodes().localNode().dataNode() && event.routingTableChanged()) {
            LocalGatewayStartedShards.Builder builder = LocalGatewayStartedShards.builder();
            if (currentStartedShards != null) {
                builder.state(currentStartedShards);
            }
            builder.version(event.state().version());

            boolean changed = false;

            // remove from the current state all the shards that are primary and started somewhere, we won't need them anymore
            // and if they are still here, we will add them in the next phase

            // Also note, this works well when closing an index, since a closed index will have no routing shards entries
            // so they won't get removed (we want to keep the fact that those shards are allocated on this node if needed)
            for (IndexRoutingTable indexRoutingTable : event.state().routingTable()) {
                for (IndexShardRoutingTable indexShardRoutingTable : indexRoutingTable) {
                    if (indexShardRoutingTable.countWithState(ShardRoutingState.STARTED) == indexShardRoutingTable.size()) {
                        changed |= builder.remove(indexShardRoutingTable.shardId());
                    }
                }
            }
            // remove deleted indices from the started shards
            for (ShardId shardId : builder.build().shards().keySet()) {
                if (!event.state().metaData().hasIndex(shardId.index().name())) {
                    changed |= builder.remove(shardId);
                }
            }
            // now, add all the ones that are active and on this node
            RoutingNode routingNode = event.state().readOnlyRoutingNodes().node(event.state().nodes().localNodeId());
            if (routingNode != null) {
                // out node is not in play yet...
                for (MutableShardRouting shardRouting : routingNode) {
                    if (shardRouting.active()) {
                        changed |= builder.put(shardRouting.shardId(), shardRouting.version());
                    }
                }
            }

            // only write if something changed...
            if (changed) {
                final LocalGatewayStartedShards stateToWrite = builder.build();
                executor.execute(new LoggingRunnable(logger, new PersistShards(event, stateToWrite)));
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.