Interface ReplicationFilter
@EnableReplicationFilter annotation to the
KeyValueEntity class, and use the updateReplicationFilter in the entity effects.
State is by default replicated to all regions that have been enabled for the service. For regulatory reasons or as cost optimization, it is possible to filter which regions participate in the replication for a specific entity. This can be changed at runtime by the entity itself.
The replication filter can only be updated from the primary region of the entity, or the
entity will become the primary if using the request-region primary selection strategy.
The filter is durable for the specific entity instance and can be changed without deploying a new
version.
When you define the replication filter, you specify the regions to be included or excluded in the replication. The region where the update is made (the self region) is automatically included in the replication filter. The changes are additive, meaning that if you first update the filter to include one region and then later make another update to include a different region from the same entity, both regions are included.
After enabling replication filter with the @EnableReplicationFilter annotation, the
entity will still replicate to all regions until specific regions are defined with the
updateReplicationFilter effect.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCreate theBuilderwithReplicationFilter.includeRegionor the other factory methods in ReplicationFilter. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ReplicationFilter.Builderempty()Creates an empty replication filter.static ReplicationFilter.BuilderexcludeRegion(String region) Creates a replication filter that excludes the specified region.static ReplicationFilter.BuilderexcludeRegions(Set<String> regions) Creates a replication filter that excludes the specified regions.static ReplicationFilter.BuilderincludeRegion(String region) Creates a replication filter that includes the specified region.static ReplicationFilter.BuilderincludeRegions(Set<String> regions) Creates a replication filter that includes the specified regions.
-
Method Details
-
empty
Creates an empty replication filter.- Returns:
- an empty replication filter
-
includeRegion
Creates a replication filter that includes the specified region.- Parameters:
region- the region to include in the replication filter- Returns:
- a replication filter with the specified region included
-
includeRegions
Creates a replication filter that includes the specified regions.- Parameters:
regions- the regions to include in the replication filter- Returns:
- a replication filter with the specified regions included
-
excludeRegion
Creates a replication filter that excludes the specified region.- Parameters:
region- the region to exclude from the replication filter- Returns:
- a replication filter with the specified region excluded
-
excludeRegions
Creates a replication filter that excludes the specified regions.- Parameters:
regions- the regions to exclude from the replication filter- Returns:
- a replication filter with the specified regions excluded
-