Tabnine Logo
Worker.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker
constructor

Best Java code snippets using com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.<init> (Showing top 8 results out of 315)

origin: harishreedharan/usingflumecode

 @Override
 public void run() {
  while (!Thread.currentThread().isInterrupted()){
   worker = new Worker(processorFactory, clientConfig);
   worker.run(); // Returns when worker is shutdown
  }
 }
});
origin: awslabs/amazon-kinesis-aggregators

public int run() throws Exception {
  configure();
  System.out.println(String.format("Starting %s", appName));
  LOG.info(String.format("Running %s to process stream %s", appName,
      streamName));
  IRecordProcessorFactory recordProcessorFactory = new AggregatorProcessorFactory(
      aggGroup);
  worker = new Worker(recordProcessorFactory, this.config);
  int exitCode = 0;
  int failures = 0;
  // run the worker, tolerating as many failures as is configured
  while (failures < failuresToTolerate || failuresToTolerate == -1) {
    try {
      worker.run();
    } catch (Throwable t) {
      LOG.error("Caught throwable while processing data.", t);
      failures++;
      if (failures < failuresToTolerate) {
        LOG.error("Restarting...");
      } else {
        shutdown();
      }
      exitCode = 1;
    }
  }
  return exitCode;
}
origin: aws/amazon-kinesis-video-streams-parser-library

@Override
public void run() {
  try {
    String workerId = InetAddress.getLocalHost().getCanonicalHostName() + ":" + UUID.randomUUID();
    KinesisClientLibConfiguration kinesisClientLibConfiguration = new KinesisClientLibConfiguration(APPLICATION_NAME, kdsStreamName, credentialsProvider, workerId);
    kinesisClientLibConfiguration.withInitialPositionInStream(SAMPLE_APPLICATION_INITIAL_POSITION_IN_STREAM).withRegionName(region.getName());
    final IRecordProcessorFactory recordProcessorFactory = () -> new KinesisRecordProcessor(rekognizedFragmentsIndex, credentialsProvider);
    final Worker worker = new Worker(recordProcessorFactory, kinesisClientLibConfiguration);
    System.out.printf("Running %s to process stream %s as worker %s...", APPLICATION_NAME, kdsStreamName, workerId);
    int exitCode = 0;
    try {
      worker.run();
    } catch (Throwable t) {
      System.err.println("Caught throwable while processing data.");
      t.printStackTrace();
      exitCode = 1;
    }
    System.out.println("Exit code : " + exitCode);
  } catch (Exception e) {
    e.printStackTrace();
  }
}
origin: aws-samples/aws-dynamodb-examples

worker = new Worker(recordProcessorFactory, workerConfig, adapterClient, dynamoDBClient, cloudWatchClient);
System.out.println("Starting worker...");
Thread t = new Thread(worker);
origin: awslabs/amazon-kinesis-connectors

      new Worker(getKinesisConnectorRecordProcessorFactory(),
          kinesisClientLibConfiguration,
          metricFactory);
} else {
  worker = new Worker(getKinesisConnectorRecordProcessorFactory(), kinesisClientLibConfiguration);
origin: com.amazonaws/amazon-kinesis-connectors

      new Worker(getKinesisConnectorRecordProcessorFactory(),
          kinesisClientLibConfiguration,
          metricFactory);
} else {
  worker = new Worker(getKinesisConnectorRecordProcessorFactory(), kinesisClientLibConfiguration);
origin: awslabs/dynamodb-cross-region-library

return new Worker(factory, kclConfig, streamsAdapterClient, kclDynamoDBClient, kclCloudWatchClient);
origin: com.amazonaws/amazon-kinesis-client

return new Worker(config.getApplicationName(),
    recordProcessorFactory,
    config,
com.amazonaws.services.kinesis.clientlibrary.lib.workerWorker<init>

Javadoc

Constructor.

Popular methods of Worker

  • run
    Start consuming data from the stream, and pass it to the application record processors.
  • shutdown
    Signals worker to shutdown. Worker will try initiating shutdown of all record processors. Note that
  • buildConsumer
  • cleanupShardConsumers
    NOTE: This method is internal/private to the Worker class. It has package access solely for testing.
  • createGracefulShutdownCallable
    Creates a callable that will execute the graceful shutdown process. This callable can be used to exe
  • createOrGetShardConsumer
    NOTE: This method is internal/private to the Worker class. It has package access solely for testing.
  • createWorkerShutdownCallable
  • finalShutdown
    Perform final shutdown related tasks for the worker including shutting down worker owned executor se
  • getExecutorService
    Returns default executor service that should be used by the worker.
  • getMetricsFactory
    Given configuration, returns appropriate metrics factory.
  • getShardInfoForAssignments
  • getShardInfoShardConsumerMap
  • getShardInfoForAssignments,
  • getShardInfoShardConsumerMap,
  • initialize,
  • isShutdownComplete,
  • requestShutdown,
  • runProcessLoop,
  • setField,
  • shouldShutdown,
  • startGracefulShutdown

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • String (java.lang)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Best IntelliJ 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