@EntityName(value="eventHandlerConfig")
@Version(value="0.1.0",
preferImplementationVersion=false,
changelog="Initial domain-specific config")
public class EventHandlerConfigEntity
extends Object
implements LightblueNotificationRepositoryConfig, LightblueDocumentEventRepositoryConfig
| Modifier and Type | Field and Description |
|---|---|
static String |
ENTITY_NAME |
static String |
ENTITY_VERSION |
| Constructor and Description |
|---|
EventHandlerConfigEntity() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getCanonicalTypesToProcess()
Governs whether or not document events are processed based on their type.
|
java.time.Duration |
getDocumentEventExpireThreshold()
How long before a document event is available for retrieval do we drop the event and let it
be reprocessed?
|
Integer |
getDocumentEventExpireThresholdSeconds() |
java.time.Duration |
getDocumentEventProcessingTimeout()
How long can a document event remain processing before we allow it to be retrieved again for
reprocessing?
|
Integer |
getDocumentEventProcessingTimeoutSeconds() |
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. |
String |
getDomain() |
Set<String> |
getEntityNamesToProcess()
Governs whether or not notifications are processed based on their associated entity's name.
|
Integer |
getMaxDocumentEventsPerInsert() |
java.time.Duration |
getNotificationExpireThreshold()
How long before a notification is available for retrieval do we drop the notification and
let it be reprocessed?
|
Integer |
getNotificationExpireThresholdSeconds() |
java.time.Duration |
getNotificationProcessingTimeout()
How long can a notification remain processing before we allow it to be retrieved again for
reprocessing?
|
Integer |
getNotificationProcessingTimeoutSeconds() |
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.
|
void |
setCanonicalTypesToProcess(Set<String> canonicalTypesToProcess) |
void |
setDocumentEventExpireThresholdSeconds(Integer documentEventExpireThresholdSeconds) |
void |
setDocumentEventProcessingTimeoutSeconds(Integer documentEventProcessingTimeoutSeconds) |
void |
setDocumentEventsBatchSize(Integer documentEventsBatchSize) |
void |
setDomain(String domain) |
void |
setEntityNamesToProcess(Set<String> entityNamesToProcess) |
void |
setMaxDocumentEventsPerInsert(Integer maxDocumentEventsPerInsert) |
void |
setNotificationExpireThresholdSeconds(Integer notificationExpireThresholdSeconds) |
void |
setNotificationProcessingTimeoutSeconds(Integer notificationProcessingTimeoutSeconds) |
public static final String ENTITY_NAME
public static final String ENTITY_VERSION
public String getDomain()
@Identity @Required @Description(value="Identifies a set of configuration values. Since all config is contained in a single document in a collection, it is necessary to know how to refer to that document: you refer to it by its domain.") public void setDomain(String domain)
public Set<String> getCanonicalTypesToProcess()
LightblueDocumentEventRepositoryConfigA repository will never process types which it is not configured to support.
getCanonicalTypesToProcess in interface LightblueDocumentEventRepositoryConfig@Description(value="Governs whether or not document events are processed based on their type.") public void setCanonicalTypesToProcess(Set<String> canonicalTypesToProcess)
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)@Description(value="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.\nFor 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.") public void setDocumentEventsBatchSize(Integer documentEventsBatchSize)
@Transient public java.time.Duration getDocumentEventProcessingTimeout()
LightblueDocumentEventRepositoryConfiggetDocumentEventProcessingTimeout in interface LightblueDocumentEventRepositoryConfigpublic Integer getDocumentEventProcessingTimeoutSeconds()
@Description(value="How long can a document event remain processing before we allow it to be retrieved again for reprocessing?") public void setDocumentEventProcessingTimeoutSeconds(Integer documentEventProcessingTimeoutSeconds)
@Transient 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 Integer getDocumentEventExpireThresholdSeconds()
@Description(value="How long before a document event is available for retrieval do we drop the event and let it be reprocessed?\nIn 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 getDocumentEventProcessingTimeout() and retrieve it for reprocessing.\nN.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.") public void setDocumentEventExpireThresholdSeconds(Integer documentEventExpireThresholdSeconds)
@Transient 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 Integer getMaxDocumentEventsPerInsert()
@Description(value="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. If no integer is provided, we will do one request with all new events.\nSetting 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.") public void setMaxDocumentEventsPerInsert(@Nullable Integer maxDocumentEventsPerInsert)
public Set<String> getEntityNamesToProcess()
LightblueNotificationRepositoryConfiggetEntityNamesToProcess in interface LightblueNotificationRepositoryConfig@Description(value="Governs whether or not notifications are processed based on their associated entity\'s name.") public void setEntityNamesToProcess(Set<String> entityNamesToProcess)
@Transient public java.time.Duration getNotificationProcessingTimeout()
LightblueNotificationRepositoryConfiggetNotificationProcessingTimeout in interface LightblueNotificationRepositoryConfigpublic Integer getNotificationProcessingTimeoutSeconds()
@Description(value="How long can a notification remain processing before we allow it to be retrieved again for reprocessing?") public void setNotificationProcessingTimeoutSeconds(Integer notificationProcessingTimeoutSeconds)
@Transient public java.time.Duration getNotificationExpireThreshold()
LightblueNotificationRepositoryConfigIn other words, this governs when we stop processing a notification in flight because
we're too near when another retrieval may see it is past its
LightblueNotificationRepositoryConfig.getNotificationProcessingTimeout() 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 a notification's processing timestamp before adding its document events. Other alternative schemes are possible.
getNotificationExpireThreshold in interface LightblueNotificationRepositoryConfigpublic Integer getNotificationExpireThresholdSeconds()
@Description(value="How long before a notification is available for retrieval do we drop the event and let it be reprocessed?\nIn other words, this governs when we stop processing a notification in flight because we\'re too near when another retrieval may see it is past its getNotificationProcessingTimeout() and retrieve it for reprocessing.\nN.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 a notification\'s processing timestamp before adding its document events. Other alternative schemes are possible.") public void setNotificationExpireThresholdSeconds(Integer notificationExpireThresholdSeconds)
Copyright © 2017. All rights reserved.