Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / AbstractShardedTransaction.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.databroker;
9
10 import static java.util.Objects.requireNonNull;
11
12 import org.opendaylight.controller.cluster.databroker.actors.dds.ClientTransaction;
13 import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransaction;
14
15 /**
16  * Abstract base class for concrete {@link DOMStoreTransaction} implementations. It holds a reference to the associated
17  * {@link ClientTransaction}. This abstraction layer is needed to isolate end users, who interact with
18  * {@link DOMStoreTransaction} from the internal implementation.
19  *
20  * @author Robert Varga
21  */
22 abstract class AbstractShardedTransaction implements DOMStoreTransaction {
23     private final ClientTransaction tx;
24
25     AbstractShardedTransaction(final ClientTransaction tx) {
26         this.tx = requireNonNull(tx);
27     }
28
29     @Override
30     public final Object getIdentifier() {
31         return tx.getIdentifier();
32     }
33
34     final ClientTransaction transaction() {
35         return tx;
36     }
37 }