X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FCohortEntry.java;h=84535b593eebb5da9b4df5f7353336ed5b287cd2;hp=767749af29900a2c298758ec78e54e26768b8dc7;hb=057b787289f7b909d7013c22ac73a1c91c860af8;hpb=a47dd7a5d21ca68804a6d0e2e3ca765f223c2ef4 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/CohortEntry.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/CohortEntry.java index 767749af29..84535b593e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/CohortEntry.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/CohortEntry.java @@ -21,7 +21,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification final class CohortEntry { private final ReadWriteShardDataTreeTransaction transaction; - private final TransactionIdentifier transactionID; + private final TransactionIdentifier transactionId; private final short clientVersion; private RuntimeException lastBatchedModificationsException; @@ -33,13 +33,13 @@ final class CohortEntry { private CohortEntry(final ReadWriteShardDataTreeTransaction transaction, final short clientVersion) { this.transaction = Preconditions.checkNotNull(transaction); - this.transactionID = transaction.getId(); + this.transactionId = transaction.getId(); this.clientVersion = clientVersion; } private CohortEntry(final ShardDataTreeCohort cohort, final short clientVersion) { this.cohort = Preconditions.checkNotNull(cohort); - this.transactionID = cohort.getIdentifier(); + this.transactionId = cohort.getIdentifier(); this.transaction = null; this.clientVersion = clientVersion; } @@ -52,8 +52,8 @@ final class CohortEntry { return new CohortEntry(cohort, clientVersion); } - TransactionIdentifier getTransactionID() { - return transactionID; + TransactionIdentifier getTransactionId() { + return transactionId; } short getClientVersion() { @@ -80,16 +80,17 @@ final class CohortEntry { return lastBatchedModificationsException; } + @SuppressWarnings("checkstyle:IllegalCatch") void applyModifications(final Iterable modifications) { totalBatchedModificationsReceived++; - if(lastBatchedModificationsException == null) { + if (lastBatchedModificationsException == null) { for (Modification modification : modifications) { - try { - modification.apply(transaction.getSnapshot()); - } catch (RuntimeException e) { - lastBatchedModificationsException = e; - throw e; - } + try { + modification.apply(transaction.getSnapshot()); + } catch (RuntimeException e) { + lastBatchedModificationsException = e; + throw e; + } } } } @@ -115,9 +116,9 @@ final class CohortEntry { cohort = transaction.ready(); - if(cohortDecorator != null) { + if (cohortDecorator != null) { // Call the hook for unit tests. - cohort = cohortDecorator.decorate(transactionID, cohort); + cohort = cohortDecorator.decorate(transactionId, cohort); } } @@ -148,8 +149,8 @@ final class CohortEntry { @Override public String toString() { final StringBuilder builder = new StringBuilder(); - builder.append("CohortEntry [transactionID=").append(transactionID).append(", doImmediateCommit=") + builder.append("CohortEntry [transactionId=").append(transactionId).append(", doImmediateCommit=") .append(doImmediateCommit).append("]"); return builder.toString(); } -} \ No newline at end of file +}