Support a weak read consistency mode for distributed set

Change-Id: I2b72795f083421ecce2c7f7cb932d2ec3e15a960
diff --git a/core/api/src/main/java/org/onosproject/store/service/DistributedSetBuilder.java b/core/api/src/main/java/org/onosproject/store/service/DistributedSetBuilder.java
index 1706c8f..f5a44c9 100644
--- a/core/api/src/main/java/org/onosproject/store/service/DistributedSetBuilder.java
+++ b/core/api/src/main/java/org/onosproject/store/service/DistributedSetBuilder.java
@@ -74,6 +74,17 @@
     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
diff --git a/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/DefaultDistributedSetBuilder.java b/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/DefaultDistributedSetBuilder.java
index 07b59ad..f7957f3 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/DefaultDistributedSetBuilder.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/DefaultDistributedSetBuilder.java
@@ -69,6 +69,12 @@
     }
 
     @Override
+    public DistributedSetBuilder<E> withRelaxedReadConsistency() {
+        mapBuilder.withRelaxedReadConsistency();
+        return this;
+    }
+
+    @Override
     public DistributedSetBuilder<E> withPartitionsDisabled() {
         mapBuilder.withPartitionsDisabled();
         return this;