BUG-8403: do not throttle purge requests
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / actors / dds / ClientLocalHistory.java
index 26b03e39b092c57d00876b030df15d1aeda015e8..493eb4089eb86cf9f119bfdf5589f780404b3715 100644 (file)
@@ -25,18 +25,14 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
  * @author Robert Varga
  */
 @Beta
-public final class ClientLocalHistory extends AbstractClientHistory implements AutoCloseable {
+public class ClientLocalHistory extends AbstractClientHistory implements AutoCloseable {
     ClientLocalHistory(final AbstractDataStoreClientBehavior client, final LocalHistoryIdentifier historyId) {
         super(client, historyId);
     }
 
     @Override
     public void close() {
-        final State local = state();
-        if (local != State.CLOSED) {
-            Preconditions.checkState(local == State.IDLE, "Local history %s has an open transaction", this);
-            updateState(local, State.CLOSED);
-        }
+        doClose();
     }
 
     private State ensureIdleState() {
@@ -92,6 +88,6 @@ public final class ClientLocalHistory extends AbstractClientHistory implements A
     @Override
     ProxyHistory createHistoryProxy(final LocalHistoryIdentifier historyId,
             final AbstractClientConnection<ShardBackendInfo> connection) {
-        return ProxyHistory.createClient(connection, historyId);
+        return ProxyHistory.createClient(this, connection, historyId);
     }
 }