Enforce memory percentage
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / DatastoreContext.java
index 6af96221998aabf68614098fa7fc507929c53760..cf14ebe28d11b0c39e105ab6396f8aff4c37903a 100644 (file)
@@ -220,6 +220,8 @@ public class DatastoreContext {
     }
 
     private void setSnapshotDataThresholdPercentage(int shardSnapshotDataThresholdPercentage) {
+        Preconditions.checkArgument(shardSnapshotDataThresholdPercentage >= 0
+                && shardSnapshotDataThresholdPercentage <= 100);
         raftConfig.setSnapshotDataThresholdPercentage(shardSnapshotDataThresholdPercentage);
     }