Tabnine Logo
SamzaContainer.DEFAULT_READ_JOBMODEL_DELAY_MS
Code IndexAdd Tabnine to your IDE (free)

How to use
DEFAULT_READ_JOBMODEL_DELAY_MS
method
in
org.apache.samza.container.SamzaContainer

Best Java code snippets using org.apache.samza.container.SamzaContainer.DEFAULT_READ_JOBMODEL_DELAY_MS (Showing top 5 results out of 315)

origin: apache/samza

System.out.println(String.format("Coordinator URL: %s", coordinatorUrl));
int delay = new Random().nextInt(SamzaContainer.DEFAULT_READ_JOBMODEL_DELAY_MS()) + 1;
JobModel jobModel = SamzaContainer.readJobModel(coordinatorUrl, delay);
Config config = jobModel.getConfig();
origin: org.apache.samza/samza-core_2.12

public static void main(String[] args) throws Exception {
 Thread.setDefaultUncaughtExceptionHandler(
   new SamzaUncaughtExceptionHandler(() -> {
    log.info("Exiting process now.");
    System.exit(1);
   }));
 String containerId = System.getenv(ShellCommandConfig.ENV_CONTAINER_ID());
 log.info(String.format("Got container ID: %s", containerId));
 System.out.println(String.format("Container ID: %s", containerId));
 String coordinatorUrl = System.getenv(ShellCommandConfig.ENV_COORDINATOR_URL());
 log.info(String.format("Got coordinator URL: %s", coordinatorUrl));
 System.out.println(String.format("Coordinator URL: %s", coordinatorUrl));
 int delay = new Random().nextInt(SamzaContainer.DEFAULT_READ_JOBMODEL_DELAY_MS()) + 1;
 JobModel jobModel = SamzaContainer.readJobModel(coordinatorUrl, delay);
 Config config = jobModel.getConfig();
 JobConfig jobConfig = new JobConfig(config);
 if (jobConfig.getName().isEmpty()) {
  throw new SamzaException("can not find the job name");
 }
 String jobName = jobConfig.getName().get();
 String jobId = jobConfig.getJobId();
 MDC.put("containerName", "samza-container-" + containerId);
 MDC.put("jobName", jobName);
 MDC.put("jobId", jobId);
 ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc =
   ApplicationDescriptorUtil.getAppDescriptor(ApplicationUtil.fromConfig(config), config);
 run(appDesc, containerId, jobModel, config);
 System.exit(0);
}
origin: org.apache.samza/samza-core_2.10

public static void main(String[] args) throws Exception {
 Thread.setDefaultUncaughtExceptionHandler(
   new SamzaUncaughtExceptionHandler(() -> {
    log.info("Exiting process now.");
    System.exit(1);
   }));
 String containerId = System.getenv(ShellCommandConfig.ENV_CONTAINER_ID());
 log.info(String.format("Got container ID: %s", containerId));
 System.out.println(String.format("Container ID: %s", containerId));
 String coordinatorUrl = System.getenv(ShellCommandConfig.ENV_COORDINATOR_URL());
 log.info(String.format("Got coordinator URL: %s", coordinatorUrl));
 System.out.println(String.format("Coordinator URL: %s", coordinatorUrl));
 int delay = new Random().nextInt(SamzaContainer.DEFAULT_READ_JOBMODEL_DELAY_MS()) + 1;
 JobModel jobModel = SamzaContainer.readJobModel(coordinatorUrl, delay);
 Config config = jobModel.getConfig();
 JobConfig jobConfig = new JobConfig(config);
 if (jobConfig.getName().isEmpty()) {
  throw new SamzaException("can not find the job name");
 }
 String jobName = jobConfig.getName().get();
 String jobId = jobConfig.getJobId();
 MDC.put("containerName", "samza-container-" + containerId);
 MDC.put("jobName", jobName);
 MDC.put("jobId", jobId);
 ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc =
   ApplicationDescriptorUtil.getAppDescriptor(ApplicationUtil.fromConfig(config), config);
 run(appDesc, containerId, jobModel, config);
 System.exit(0);
}
origin: org.apache.samza/samza-core

public static void main(String[] args) throws Exception {
 Thread.setDefaultUncaughtExceptionHandler(
   new SamzaUncaughtExceptionHandler(() -> {
    log.info("Exiting process now.");
    System.exit(1);
   }));
 String containerId = System.getenv(ShellCommandConfig.ENV_CONTAINER_ID());
 log.info(String.format("Got container ID: %s", containerId));
 System.out.println(String.format("Container ID: %s", containerId));
 String coordinatorUrl = System.getenv(ShellCommandConfig.ENV_COORDINATOR_URL());
 log.info(String.format("Got coordinator URL: %s", coordinatorUrl));
 System.out.println(String.format("Coordinator URL: %s", coordinatorUrl));
 int delay = new Random().nextInt(SamzaContainer.DEFAULT_READ_JOBMODEL_DELAY_MS()) + 1;
 JobModel jobModel = SamzaContainer.readJobModel(coordinatorUrl, delay);
 Config config = jobModel.getConfig();
 JobConfig jobConfig = new JobConfig(config);
 if (jobConfig.getName().isEmpty()) {
  throw new SamzaException("can not find the job name");
 }
 String jobName = jobConfig.getName().get();
 String jobId = jobConfig.getJobId();
 MDC.put("containerName", "samza-container-" + containerId);
 MDC.put("jobName", jobName);
 MDC.put("jobId", jobId);
 ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc =
   ApplicationDescriptorUtil.getAppDescriptor(ApplicationUtil.fromConfig(config), config);
 run(appDesc, containerId, jobModel, config);
 System.exit(0);
}
origin: org.apache.samza/samza-core_2.11

public static void main(String[] args) throws Exception {
 Thread.setDefaultUncaughtExceptionHandler(
   new SamzaUncaughtExceptionHandler(() -> {
    log.info("Exiting process now.");
    System.exit(1);
   }));
 String containerId = System.getenv(ShellCommandConfig.ENV_CONTAINER_ID());
 log.info(String.format("Got container ID: %s", containerId));
 System.out.println(String.format("Container ID: %s", containerId));
 String coordinatorUrl = System.getenv(ShellCommandConfig.ENV_COORDINATOR_URL());
 log.info(String.format("Got coordinator URL: %s", coordinatorUrl));
 System.out.println(String.format("Coordinator URL: %s", coordinatorUrl));
 int delay = new Random().nextInt(SamzaContainer.DEFAULT_READ_JOBMODEL_DELAY_MS()) + 1;
 JobModel jobModel = SamzaContainer.readJobModel(coordinatorUrl, delay);
 Config config = jobModel.getConfig();
 JobConfig jobConfig = new JobConfig(config);
 if (jobConfig.getName().isEmpty()) {
  throw new SamzaException("can not find the job name");
 }
 String jobName = jobConfig.getName().get();
 String jobId = jobConfig.getJobId();
 MDC.put("containerName", "samza-container-" + containerId);
 MDC.put("jobName", jobName);
 MDC.put("jobId", jobId);
 ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc =
   ApplicationDescriptorUtil.getAppDescriptor(ApplicationUtil.fromConfig(config), config);
 run(appDesc, containerId, jobModel, config);
 System.exit(0);
}
org.apache.samza.containerSamzaContainerDEFAULT_READ_JOBMODEL_DELAY_MS

Popular methods of SamzaContainer

  • readJobModel
  • run
  • setContainerListener
  • shutdown
  • apply
  • getStatus
  • hasStopped

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • startActivity (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now