@ThreadSafe public class MutableLightblueDocumentEventRepositoryConfig extends Object implements LightblueDocumentEventRepositoryConfig
| Constructor and Description |
|---|
MutableLightblueDocumentEventRepositoryConfig()
Uses empty default values, which will configure a repository to never retrieve anything.
|
MutableLightblueDocumentEventRepositoryConfig(Collection<String> initialCanonicalTypesToProcess,
int initialDocumentEventsBatchSize,
java.time.Duration processingTimeout,
java.time.Duration expireThreshold)
Uses provided as initial values.
|
MutableLightblueDocumentEventRepositoryConfig(Collection<String> initialCanonicalTypesToProcess,
int initialDocumentEventsBatchSize,
Optional<Integer> maxDocumentEventsPerInsert,
java.time.Duration processingTimeout,
java.time.Duration expireThreshold)
Uses provided as initial values.
|
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getCanonicalTypesToProcess()
Returns a new
Set with the current state of the canonical types. |
java.time.Duration |
getDocumentEventExpireThreshold()
How long before a document event is available for retrieval do we drop the event and let it
be reprocessed?
|
java.time.Duration |
getDocumentEventProcessingTimeout()
How long can a document event remain processing before we allow it to be retrieved again for
reprocessing?
|
Integer |
getDocumentEventsBatchSize()
Not to be confused with the maximum number of document events passed to
DocumentEventRepository.retrievePriorityDocumentEventsUpTo(int), this governs the
max batch size of events fetched from lightblue and available for optimization. |
Optional<Integer> |
getOptionalMaxDocumentEventsPerInsert()
When adding new document events, we can make (total new events) / (max events per insert)
requests, instead of one request with all new events in a single call.
|
MutableLightblueDocumentEventRepositoryConfig |
setCanonicalTypesToProcess(Collection<String> types) |
MutableLightblueDocumentEventRepositoryConfig |
setDocumentEventExpireThreshold(java.time.Duration expireThreshold) |
MutableLightblueDocumentEventRepositoryConfig |
setDocumentEventProcessingTimeout(java.time.Duration processingTimeout) |
MutableLightblueDocumentEventRepositoryConfig |
setDocumentEventsBatchSize(int batchSize) |
MutableLightblueDocumentEventRepositoryConfig |
setMaxDocumentEventsPerInsert(Optional<Integer> maxDocumentEventsPerInsert) |
public MutableLightblueDocumentEventRepositoryConfig()
public MutableLightblueDocumentEventRepositoryConfig(Collection<String> initialCanonicalTypesToProcess, int initialDocumentEventsBatchSize, java.time.Duration processingTimeout, java.time.Duration expireThreshold)
public MutableLightblueDocumentEventRepositoryConfig(Collection<String> initialCanonicalTypesToProcess, int initialDocumentEventsBatchSize, Optional<Integer> maxDocumentEventsPerInsert, java.time.Duration processingTimeout, java.time.Duration expireThreshold)
public Set<String> getCanonicalTypesToProcess()
Set with the current state of the canonical types. Updates to
configured canonical types will not be visible to the returned Set.getCanonicalTypesToProcess in interface LightblueDocumentEventRepositoryConfigpublic MutableLightblueDocumentEventRepositoryConfig setCanonicalTypesToProcess(Collection<String> types)
public Integer getDocumentEventsBatchSize()
LightblueDocumentEventRepositoryConfigDocumentEventRepository.retrievePriorityDocumentEventsUpTo(int), this governs the
max batch size of events fetched from lightblue and available for optimization.
For example, if you ask for 50 document events to be retrieved, and your batch size is 100, we will initially fetch 100 document events (assuming there are <= 100 events waiting to be processed) from lightblue. Among those 100, we will try to optimize away as many events as possible by checking for events which can be merged or superseded. Finally, among those left, we will return the 50 highest priority events. Any remaining events past 50 will be untouched, available for future retrievals.
getDocumentEventsBatchSize in interface LightblueDocumentEventRepositoryConfigDocumentEvent.couldMergeWith(DocumentEvent),
DocumentEvent.isSupersededBy(DocumentEvent)public MutableLightblueDocumentEventRepositoryConfig setDocumentEventsBatchSize(int batchSize)
public java.time.Duration getDocumentEventProcessingTimeout()
LightblueDocumentEventRepositoryConfiggetDocumentEventProcessingTimeout in interface LightblueDocumentEventRepositoryConfigpublic MutableLightblueDocumentEventRepositoryConfig setDocumentEventProcessingTimeout(java.time.Duration processingTimeout)
public java.time.Duration getDocumentEventExpireThreshold()
LightblueDocumentEventRepositoryConfigIn other words, this governs when we stop processing an event in flight because we're too
near when another retrieval may see it is past its
LightblueDocumentEventRepositoryConfig.getDocumentEventProcessingTimeout() and retrieve it for reprocessing.
N.B. The existence of this configuration is a function of our current transaction scheme. This could go away, for instance, if we either atomically updated an event's processing timestamp before publishing its document. Other alternative schemes are possible.
getDocumentEventExpireThreshold in interface LightblueDocumentEventRepositoryConfigpublic MutableLightblueDocumentEventRepositoryConfig setDocumentEventExpireThreshold(java.time.Duration expireThreshold)
public Optional<Integer> getOptionalMaxDocumentEventsPerInsert()
LightblueDocumentEventRepositoryConfigSetting a limit is recommended as it protects against potentially extremely significant notifications producing a huge quantity of document events and failing to insert them all in one call.
getOptionalMaxDocumentEventsPerInsert in interface LightblueDocumentEventRepositoryConfigpublic MutableLightblueDocumentEventRepositoryConfig setMaxDocumentEventsPerInsert(Optional<Integer> maxDocumentEventsPerInsert)
Copyright © 2017. All rights reserved.