Example #1
0
 @Override
 public Thread newThread(Runnable r) {
   Thread t = new Thread(r);
   t.setName("Threading.THREAD_POOL worker");
   t.setDaemon(true);
   return t;
 }
 @Override
 public Thread newThread(Runnable r) {
   Thread t = new Thread(r);
   t.setDaemon(true);
   t.setName("shell-bolt-heartbeat");
   return t;
 }
 public Notifier(String listenNodePath) {
   super.setDaemon(true);
   super.setName("LTSRedisSubscribe");
   this.listenNodePath = listenNodePath;
   if (monitorId == null) {
     monitorId = listenNodePath;
   }
 }
Example #4
0
 public ContinuousChangesFeed(String dbName, HttpResponse httpResponse) {
   this.httpResponse = httpResponse;
   try {
     reader = new BufferedReader(new InputStreamReader(httpResponse.getContent(), "UTF-8"));
     thread.setName(
         String.format(
             "ektorp-%s-changes-listening-thread-%s", dbName, THREAD_COUNT.getAndIncrement()));
     thread.start();
   } catch (UnsupportedEncodingException e) {
     throw Exceptions.propagate(e);
   }
 }
Example #5
0
 @Test
 public void testThread() {
   Thread thread =
       new Thread("aaa") {
         public void run() {
           System.out.println(this.getName());
         }
       };
   thread.setName("bbb");
   //        thread.setDaemon(true);
   thread.start();
 }
  MetricsSinkAdapter(
      String name,
      String description,
      MetricsSink sink,
      String context,
      MetricsFilter sourceFilter,
      MetricsFilter recordFilter,
      MetricsFilter metricFilter,
      int period,
      int queueCapacity,
      int retryDelay,
      float retryBackoff,
      int retryCount) {
    this.name = Contracts.checkNotNull(name, "name");
    this.description = description;
    this.sink = Contracts.checkNotNull(sink, "sink object");
    this.context = context;
    this.sourceFilter = sourceFilter;
    this.recordFilter = recordFilter;
    this.metricFilter = metricFilter;
    this.period = Contracts.checkArg(period, period > 0, "period");
    firstRetryDelay = Contracts.checkArg(retryDelay, retryDelay > 0, "retry delay");
    this.retryBackoff = Contracts.checkArg(retryBackoff, retryBackoff > 1, "backoff factor");
    oobPutTimeout = (long) (firstRetryDelay * Math.pow(retryBackoff, retryCount) * 1000);
    this.retryCount = retryCount;
    this.queue =
        new SinkQueue<MetricsBuffer>(
            Contracts.checkArg(queueCapacity, queueCapacity > 0, "queue capacity"));
    latency =
        registry.newStat("sink." + name + ".latency", "Sink end to end latency", "ops", "time");
    dropped = registry.newCounter("sink." + name + ".dropped", "Dropped updates per sink", 0);
    qsize = registry.newGauge("sink." + name + ".qsize", "Queue size", 0);

    sinkThread =
        new Thread() {
          @Override
          public void run() {
            publishMetricsFromQueue();
          }
        };
    sinkThread.setName(name);
    sinkThread.setDaemon(true);
  }
 @Override
 public Thread newThread(Runnable r) {
   Thread thread = new Thread(r);
   thread.setName(createThreadName(threadNamePrefix, thread.getId()));
   return thread;
 }