Madan Jampani
Committed by Gerrit Code Review

Support a weak read consistency mode for distributed set

Change-Id: I2b72795f083421ecce2c7f7cb932d2ec3e15a960
......@@ -74,6 +74,17 @@ public interface DistributedSetBuilder<E> {
DistributedSetBuilder<E> withUpdatesDisabled();
/**
* Provides weak consistency for set reads.
* <p>
* While this can lead to improved read performance, it can also make the behavior
* heard to reason. Only turn this on if you know what you are doing. By default
* reads are strongly consistent.
*
* @return this DistributedSetBuilder
*/
DistributedSetBuilder<E> withRelaxedReadConsistency();
/**
* Disables distribution of set entries across multiple database partitions.
* <p>
* When partitioning is disabled, the returned set will have a single partition
......
......@@ -69,6 +69,12 @@ public class DefaultDistributedSetBuilder<E> implements DistributedSetBuilder<E>
}
@Override
public DistributedSetBuilder<E> withRelaxedReadConsistency() {
mapBuilder.withRelaxedReadConsistency();
return this;
}
@Override
public DistributedSetBuilder<E> withPartitionsDisabled() {
mapBuilder.withPartitionsDisabled();
return this;
......