congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PartitionChangeException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.samza.PartitionChangeException
constructor

Best Java code snippets using org.apache.samza.PartitionChangeException.<init> (Showing top 4 results out of 315)

origin: org.apache.samza/samza-core

private StreamPartitionCountMonitor getPartitionCountMonitor(Config config, SystemAdmins systemAdmins) {
 StreamMetadataCache streamMetadata = new StreamMetadataCache(systemAdmins, 0, SystemClock.instance());
 Set<SystemStream> inputStreamsToMonitor = new TaskConfigJava(config).getAllInputStreams();
 if (inputStreamsToMonitor.isEmpty()) {
  throw new SamzaException("Input streams to a job can not be empty.");
 }
 return new StreamPartitionCountMonitor(
   inputStreamsToMonitor,
   streamMetadata,
   metrics,
   new JobConfig(config).getMonitorPartitionChangeFrequency(),
   streamsChanged -> {
   // Fail the jobs with durable state store. Otherwise, application state.status remains UNDEFINED s.t. YARN job will be restarted
   if (hasDurableStores) {
    log.error("Input topic partition count changed in a job with durable state. Failing the job.");
    state.status = SamzaApplicationState.SamzaAppStatus.FAILED;
   }
   coordinatorException = new PartitionChangeException("Input topic partition count changes detected.");
  });
}
origin: org.apache.samza/samza-core_2.11

private StreamPartitionCountMonitor getPartitionCountMonitor(Config config, SystemAdmins systemAdmins) {
 StreamMetadataCache streamMetadata = new StreamMetadataCache(systemAdmins, 0, SystemClock.instance());
 Set<SystemStream> inputStreamsToMonitor = new TaskConfigJava(config).getAllInputStreams();
 if (inputStreamsToMonitor.isEmpty()) {
  throw new SamzaException("Input streams to a job can not be empty.");
 }
 return new StreamPartitionCountMonitor(
   inputStreamsToMonitor,
   streamMetadata,
   metrics,
   new JobConfig(config).getMonitorPartitionChangeFrequency(),
   streamsChanged -> {
   // Fail the jobs with durable state store. Otherwise, application state.status remains UNDEFINED s.t. YARN job will be restarted
   if (hasDurableStores) {
    log.error("Input topic partition count changed in a job with durable state. Failing the job.");
    state.status = SamzaApplicationState.SamzaAppStatus.FAILED;
   }
   coordinatorException = new PartitionChangeException("Input topic partition count changes detected.");
  });
}
origin: org.apache.samza/samza-core_2.12

private StreamPartitionCountMonitor getPartitionCountMonitor(Config config, SystemAdmins systemAdmins) {
 StreamMetadataCache streamMetadata = new StreamMetadataCache(systemAdmins, 0, SystemClock.instance());
 Set<SystemStream> inputStreamsToMonitor = new TaskConfigJava(config).getAllInputStreams();
 if (inputStreamsToMonitor.isEmpty()) {
  throw new SamzaException("Input streams to a job can not be empty.");
 }
 return new StreamPartitionCountMonitor(
   inputStreamsToMonitor,
   streamMetadata,
   metrics,
   new JobConfig(config).getMonitorPartitionChangeFrequency(),
   streamsChanged -> {
   // Fail the jobs with durable state store. Otherwise, application state.status remains UNDEFINED s.t. YARN job will be restarted
   if (hasDurableStores) {
    log.error("Input topic partition count changed in a job with durable state. Failing the job.");
    state.status = SamzaApplicationState.SamzaAppStatus.FAILED;
   }
   coordinatorException = new PartitionChangeException("Input topic partition count changes detected.");
  });
}
origin: org.apache.samza/samza-core_2.10

private StreamPartitionCountMonitor getPartitionCountMonitor(Config config, SystemAdmins systemAdmins) {
 StreamMetadataCache streamMetadata = new StreamMetadataCache(systemAdmins, 0, SystemClock.instance());
 Set<SystemStream> inputStreamsToMonitor = new TaskConfigJava(config).getAllInputStreams();
 if (inputStreamsToMonitor.isEmpty()) {
  throw new SamzaException("Input streams to a job can not be empty.");
 }
 return new StreamPartitionCountMonitor(
   inputStreamsToMonitor,
   streamMetadata,
   metrics,
   new JobConfig(config).getMonitorPartitionChangeFrequency(),
   streamsChanged -> {
   // Fail the jobs with durable state store. Otherwise, application state.status remains UNDEFINED s.t. YARN job will be restarted
   if (hasDurableStores) {
    log.error("Input topic partition count changed in a job with durable state. Failing the job.");
    state.status = SamzaApplicationState.SamzaAppStatus.FAILED;
   }
   coordinatorException = new PartitionChangeException("Input topic partition count changes detected.");
  });
}
org.apache.samzaPartitionChangeException<init>

Popular methods of PartitionChangeException

    Popular in Java

    • Finding current android device location
    • requestLocationUpdates (LocationManager)
    • findViewById (Activity)
    • setContentView (Activity)
    • Container (java.awt)
      A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
    • ServerSocket (java.net)
      This class represents a server-side socket that waits for incoming client connections. A ServerSocke
    • BitSet (java.util)
      The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
    • Deque (java.util)
      A linear collection that supports element insertion and removal at both ends. The name deque is shor
    • TimeUnit (java.util.concurrent)
      A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
    • Project (org.apache.tools.ant)
      Central representation of an Ant project. This class defines an Ant project with all of its targets,
    • Top plugins for WebStorm
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

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