Beispiel #1
0
 /**
  * Main entry point of the application.
  *
  * @param args things which are ignored
  */
 public static void main(String[] args) {
   logger.info("Launching NiFi...");
   try {
     new NiFi(NiFiProperties.getInstance());
   } catch (final Throwable t) {
     logger.error("Failure to launch NiFi due to " + t, t);
   }
 }
  public TimerDrivenSchedulingAgent(
      final FlowController flowController,
      final FlowEngine flowEngine,
      final ProcessContextFactory contextFactory,
      final StringEncryptor encryptor) {
    this.flowController = flowController;
    this.flowEngine = flowEngine;
    this.contextFactory = contextFactory;
    this.encryptor = encryptor;

    final String boredYieldDuration = NiFiProperties.getInstance().getBoredYieldDuration();
    try {
      noWorkYieldNanos = FormatUtils.getTimeDuration(boredYieldDuration, TimeUnit.NANOSECONDS);
    } catch (final IllegalArgumentException e) {
      throw new RuntimeException(
          "Failed to create SchedulingAgent because the "
              + NiFiProperties.BORED_YIELD_DURATION
              + " property is set to an invalid time duration: "
              + boredYieldDuration);
    }
  }