Tabnine Logo
PartitionChangeException
Code IndexAdd Tabnine to your IDE (free)

How to use
PartitionChangeException
in
org.apache.samza

Best Java code snippets using org.apache.samza.PartitionChangeException (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

Javadoc

Exception to indicate that the input org.apache.samza.system.SystemStreamPartition changed

Most used methods

  • <init>

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • 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
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Vim plugins
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