Skip to content

Commit 9f39559

Browse files
committed
Remove defaults for max age/size
1 parent 97039b4 commit 9f39559

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

core-event-processor/src/main/java/com/optimizely/ab/processor/BatchBlock.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,10 @@ public BatchOptions getOptions() {
134134
}
135135

136136
protected Supplier<BatchTask<T, ?>> createBatchTaskFactory(BatchOptions opts) {
137-
int maxSize = opts.getMaxSize();
138-
139137
// TODO should this live on BatchOptions?
140-
final Supplier<Collection<T>> bufferSupplier = (maxSize == BatchOptions.UNBOUNDED_SIZE) ?
141-
() -> new ArrayList<>(maxSize) : // bounded
142-
ArrayList::new; // unbounded
138+
final Supplier<Collection<T>> bufferSupplier = BatchOptions.hasMaxSize(opts) ?
139+
() -> new ArrayList<>(opts.getMaxSize()) :
140+
ArrayList::new;
143141

144142
return () -> new BatchTask<>(
145143
bufferSupplier,

core-event-processor/src/main/java/com/optimizely/ab/processor/BatchOptions.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,8 @@ static <T> Builder<T> builder() {
6464
}
6565

6666
class Builder<T> implements BatchOptions {
67-
static int MAX_SIZE_DEFAULT = 10;
68-
static long MAX_AGE_DEFAULT = 250L;
69-
70-
private int maxBatchSize = MAX_SIZE_DEFAULT;
71-
private long maxBatchAge = MAX_AGE_DEFAULT;
67+
private int maxBatchSize = UNBOUNDED_SIZE;
68+
private long maxBatchAge = UNBOUNDED_AGE;
7269
private Integer maxBatchInFlight = null;
7370
private boolean flushOnShutdown = true;
7471

0 commit comments

Comments
 (0)