2 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.datastore;
10 import akka.actor.ActorSelection;
11 import org.opendaylight.controller.cluster.datastore.identifiers.TransactionIdentifier;
12 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
13 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16 import scala.concurrent.Future;
19 * Context for a write-only transaction.
21 * @author Thomas Pantelis
23 public class WriteOnlyTransactionContextImpl extends TransactionContextImpl {
24 private static final Logger LOG = LoggerFactory.getLogger(WriteOnlyTransactionContextImpl.class);
26 public WriteOnlyTransactionContextImpl(ActorSelection actor, TransactionIdentifier identifier,
27 String transactionChainId, ActorContext actorContext, SchemaContext schemaContext, boolean isTxActorLocal,
28 short remoteTransactionVersion, OperationCompleter operationCompleter) {
29 super(actor, identifier, transactionChainId, actorContext, schemaContext, isTxActorLocal,
30 remoteTransactionVersion, operationCompleter);
34 public Future<ActorSelection> readyTransaction() {
35 LOG.debug("Tx {} readyTransaction called with {} previous recorded operations pending",
36 identifier, recordedOperationFutures.size());
38 // Send the remaining batched modifications if any.
40 Future<Object> lastModificationsFuture = sendBatchedModifications(true);
42 return combineRecordedOperationsFutures(lastModificationsFuture);