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

com.amazonaws.services.kinesis.leases.interfaces.LeaseSelector 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.leases.interfaces;

import com.amazonaws.services.kinesis.leases.impl.Lease;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * LeaseSelector abstracts away the lease selection logic from the application code that's using leasing.
 * It owns filtering of the leases to be taken.
 */
public interface LeaseSelector {

    /**
     * Provides the list of leases to be taken.
     * @param expiredLeases list of leases that are currently expired
     * @param numLeasesToReachTarget the number of leases to be taken
     * @return
     */
    Set getLeasesToTakeFromExpiredLeases(List expiredLeases, int numLeasesToReachTarget);

    /**
     * Provides the number of leases that should be taken by the worker.
     * @param allLeases list of all existing leases
     * @return
     */
    int getLeaseCountThatCanBeTaken(Collection allLeases);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy