Addressing comments and adding initial documentation and changing the retreiver from interface to class.
This commit is contained in:
parent
190d8fb5aa
commit
8ceb5f2492
3 changed files with 30 additions and 12 deletions
|
|
@ -3,10 +3,23 @@ package com.amazonaws.services.kinesis.clientlibrary.lib.worker;
|
|||
import com.amazonaws.services.kinesis.model.GetRecordsResult;
|
||||
|
||||
/**
|
||||
*
|
||||
* This class is used as a cache for Prefetching data from Kinesis.
|
||||
*/
|
||||
public interface GetRecordsCache {
|
||||
/**
|
||||
* This method dispatches the next call to getRecords from Kinesis.
|
||||
*/
|
||||
void dispatchNextCall();
|
||||
|
||||
/**
|
||||
* This method returns the next set of records from the Cache if present, or blocks the request till it gets the
|
||||
* next set of records back from Kinesis.
|
||||
*
|
||||
* @return The next set of records.
|
||||
*/
|
||||
GetRecordsResult getNextResult();
|
||||
|
||||
void addGetRecordsResultToCache(GetRecordsResult getRecordsResult);
|
||||
|
||||
void shutdown();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
package com.amazonaws.services.kinesis.clientlibrary.lib.worker;
|
||||
|
||||
import com.amazonaws.services.kinesis.model.GetRecordsResult;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface GetRecordsRetriever {
|
||||
GetRecordsResult getRecords(int maxRecords);
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.amazonaws.services.kinesis.clientlibrary.lib.worker;
|
||||
|
||||
import com.amazonaws.services.kinesis.model.GetRecordsResult;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/**
|
||||
* This class uses the GetRecordsRetrievalStrategy class to retrieve the next set of records and update the cache.
|
||||
*/
|
||||
public class GetRecordsRetrieverDaemon implements Callable<GetRecordsResult> {
|
||||
@Override
|
||||
public GetRecordsResult call() throws Exception {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue