All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.kinesis.clientlibrary.lib.worker.PeriodicShardSyncStrategy Maven / Gradle / Ivy

Go to download

The Amazon Kinesis Client Library for Java enables Java developers to easily consume and process data from Amazon Kinesis.

There is a newer version: 1.15.2
Show newest version
package com.amazonaws.services.kinesis.clientlibrary.lib.worker;


/**
 * An implementation of ShardSyncStrategy.
 */
class PeriodicShardSyncStrategy implements ShardSyncStrategy {

    private PeriodicShardSyncManager periodicShardSyncManager;

    PeriodicShardSyncStrategy(PeriodicShardSyncManager periodicShardSyncManager) {
        this.periodicShardSyncManager = periodicShardSyncManager;
    }

    @Override
    public ShardSyncStrategyType getStrategyType() {
        return ShardSyncStrategyType.PERIODIC;
    }

    @Override
    public TaskResult syncShards() {
        return periodicShardSyncManager.start();
    }

    @Override
    public TaskResult onWorkerInitialization() {
        return syncShards();
    }

    @Override
    public TaskResult onFoundCompletedShard() {
        return new TaskResult(null);
    }

    @Override
    public TaskResult onShardConsumerShutDown() {
        return new TaskResult(null);
    }

    @Override
    public void onWorkerShutDown() {
        periodicShardSyncManager.stop();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy