Package com.hubspot.singularity.logwatcher.tailer

Examples of com.hubspot.singularity.logwatcher.tailer.SingularityLogWatcherTailer


    if (!maybeTailer.isPresent()) {
      return false;
    }

    final SingularityLogWatcherTailer tailer = maybeTailer.get();

    tailService.submit(new Runnable() {

      @Override
      public void run() {
        try {
          tailer.watch();

          if (!shutdown) {
            LOG.info("Consuming tail: {}", tail);

            tailer.consumeStream();
            store.markConsumed(tail);
          }
        } catch (Throwable t) {
          if (shutdown) {
            LOG.error("Exception tailing {} while shutting down", tail, t);
          } else {
            LOG.error("Exception tailing {}, will retry in {}", tail, JavaUtils.durationFromMillis(TimeUnit.SECONDS.toMillis(configuration.getRetryDelaySeconds())), t);

            tailLater(tail);
          }
        } finally {
          tailer.close();

          tailers.remove(tail);
        }
      }
    });
View Full Code Here


    LOG.info("Shutdown after {}", JavaUtils.duration(start));
  }

  private Optional<SingularityLogWatcherTailer> buildTailer(TailMetadata tail) {
    try {
      SingularityLogWatcherTailer tailer = new SingularityLogWatcherTailer(tail, configuration, store, logForwarder);
      return Optional.of(tailer);
    } catch (Throwable t) {
      LOG.warn("Couldn't create a tailer for {}", tail, t);
      return Optional.absent();
    }
View Full Code Here

      if (shutdown) {
        LOG.info("Not handling notification {}, shutting down...", tailMetadata);
        return;
      }

      final SingularityLogWatcherTailer tailer = tailers.get(tailMetadata);

      if (tailer != null) {
        if (tailMetadata.isFinished()) {
          tailer.stop();
        } else {
          LOG.info("Ignoring notification about {} since we already had a tailer for it", tailMetadata);
        }
      } else {
        tail(tailMetadata);
View Full Code Here

TOP

Related Classes of com.hubspot.singularity.logwatcher.tailer.SingularityLogWatcherTailer

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.