X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatabroker%2Factors%2Fdds%2FSingleClientHistory.java;h=db57f1aed51bb08ce23c73c4ba86a2639c9eb0b5;hb=HEAD;hp=6fa3cdf2a9088c4c19288c6a0f075b7e3f18418e;hpb=cc1ec4a8e2ec99ad7711d0e5e649b34d37d87da0;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/SingleClientHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/SingleClientHistory.java index 6fa3cdf2a9..db57f1aed5 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/SingleClientHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/SingleClientHistory.java @@ -7,7 +7,7 @@ */ package org.opendaylight.controller.cluster.databroker.actors.dds; -import java.util.Optional; +import org.opendaylight.controller.cluster.access.client.AbstractClientConnection; import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.slf4j.Logger; @@ -19,12 +19,20 @@ import org.slf4j.LoggerFactory; * @author Robert Varga */ final class SingleClientHistory extends AbstractClientHistory { - private static final Logger LOG = LoggerFactory.getLogger(AbstractClientHistory.class); + private static final Logger LOG = LoggerFactory.getLogger(SingleClientHistory.class); - SingleClientHistory(final DistributedDataStoreClientBehavior client, final LocalHistoryIdentifier identifier) { + SingleClientHistory(final AbstractDataStoreClientBehavior client, final LocalHistoryIdentifier identifier) { super(client, identifier); } + @Override + ClientSnapshot doCreateSnapshot() { + final TransactionIdentifier txId = new TransactionIdentifier(getIdentifier(), nextTx()); + LOG.debug("{}: creating a new snapshot {}", this, txId); + + return new ClientSnapshot(this, txId); + } + @Override ClientTransaction doCreateTransaction() { final TransactionIdentifier txId = new TransactionIdentifier(getIdentifier(), nextTx()); @@ -34,8 +42,8 @@ final class SingleClientHistory extends AbstractClientHistory { } @Override - AbstractProxyHistory createHistoryProxy(final LocalHistoryIdentifier historyId, - final Optional backendInfo) { - return AbstractProxyHistory.createSingle(getClient(), backendInfo, historyId); + ProxyHistory createHistoryProxy(final LocalHistoryIdentifier historyId, + final AbstractClientConnection connection) { + return ProxyHistory.createSingle(this, connection, historyId); } }