Errant Error Log Message
When replicating bags, after storage allocation has occurred an error will be logged indicating that no space was allocated. This is a lie as the tasks it needs to run are executed right after.
2019-07-29 14:05:01.839 ERROR 144320 --- [ForkJoinPool.commonPool-worker-51] o.chronopolis.replicate.batch.Submitter : [test-collection] No bucket allocated for bag!
The issue here is that the code in the Submitter class is using Optional.orElse
and it should be using Optional.orElseGet
in order to have the method invoked only when the result is not present.