Addressed comments

This commit is contained in:
Wei 2017-09-21 11:26:10 -07:00
parent aaea26aefc
commit ba0bdc5fe3
3 changed files with 16 additions and 1 deletions

View file

@ -1294,6 +1294,12 @@ public class KinesisClientLibConfiguration {
return this; return this;
} }
public KinesisClientLibConfiguration withMaxRecordsCount(final int maxRecordsCount) {
checkIsValuePositive("maxRecordsCount", maxRecordsCount);
recordsFetcherFactory.setMaxRecordsCount(maxRecordsCount);
return this;
}
/** /**
* @param timeoutInSeconds The timeout in seconds to wait for the MultiLangProtocol to wait for * @param timeoutInSeconds The timeout in seconds to wait for the MultiLangProtocol to wait for
*/ */

View file

@ -32,6 +32,8 @@ public interface RecordsFetcherFactory {
void setMaxByteSize(int maxByteSize); void setMaxByteSize(int maxByteSize);
void setMaxRecordsCount(int maxRecordsCount);
void setDataFetchingStrategy(DataFetchingStrategy dataFetchingStrategy); void setDataFetchingStrategy(DataFetchingStrategy dataFetchingStrategy);
} }

View file

@ -14,7 +14,6 @@
*/ */
package com.amazonaws.services.kinesis.clientlibrary.lib.worker; package com.amazonaws.services.kinesis.clientlibrary.lib.worker;
import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog; import lombok.extern.apachecommons.CommonsLog;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
@ -48,14 +47,22 @@ public class SimpleRecordsFetcherFactory implements RecordsFetcherFactory {
} }
} }
@Override
public void setMaxSize(int maxSize){ public void setMaxSize(int maxSize){
this.maxSize = maxSize; this.maxSize = maxSize;
} }
@Override
public void setMaxByteSize(int maxByteSize){ public void setMaxByteSize(int maxByteSize){
this.maxByteSize = maxByteSize; this.maxByteSize = maxByteSize;
} }
@Override
public void setMaxRecordsCount(int maxRecordsCount) {
this.maxRecordsCount = maxRecordsCount;
}
@Override
public void setDataFetchingStrategy(DataFetchingStrategy dataFetchingStrategy){ public void setDataFetchingStrategy(DataFetchingStrategy dataFetchingStrategy){
this.dataFetchingStrategy = dataFetchingStrategy; this.dataFetchingStrategy = dataFetchingStrategy;
} }