commit | 2bb988bf7228afd81cf3fea53ee7333fad3b0050 | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Tue Jan 20 13:45:35 2015 -0800 |
committer | Ray Milkey <ray@onlab.us> | Wed Jan 21 17:56:24 2015 +0000 |
tree | a76994fecd0ad1db58e1d4c8dcb5d1eeda20afac | |
parent | abeb7fa4a1ce8055b908125eba2dc2d677ffd511 [diff] [blame] |
Return immediately when the given BatchWrite is empty This revision aims to remove empty check of BatchWrite in the caller side of this method Change-Id: Ic0d659a6da221a052ad135eba18a783caa81ec42
diff --git a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/HazelcastIntentStore.java b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/HazelcastIntentStore.java index 39255c8..667d2a8 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/HazelcastIntentStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/HazelcastIntentStore.java
@@ -54,6 +54,7 @@ import org.slf4j.Logger; import java.util.ArrayList; +import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Map; @@ -394,6 +395,10 @@ @Override public List<Operation> batchWrite(BatchWrite batch) { + if (batch.isEmpty()) { + return Collections.emptyList(); + } + // Hazelcast version will never fail for conditional failure now. List<Operation> failed = new ArrayList<>();