File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
core-event-processor/src/main/java/com/optimizely/ab/processor Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -134,12 +134,10 @@ public BatchOptions getOptions() {
134
134
}
135
135
136
136
protected Supplier <BatchTask <T , ?>> createBatchTaskFactory (BatchOptions opts ) {
137
- int maxSize = opts .getMaxSize ();
138
-
139
137
// 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 ;
143
141
144
142
return () -> new BatchTask <>(
145
143
bufferSupplier ,
Original file line number Diff line number Diff line change @@ -64,11 +64,8 @@ static <T> Builder<T> builder() {
64
64
}
65
65
66
66
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 ;
72
69
private Integer maxBatchInFlight = null ;
73
70
private boolean flushOnShutdown = true ;
74
71
You can’t perform that action at this time.
0 commit comments