* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.datastore;
+import static java.util.Objects.requireNonNull;
+
import akka.actor.ActorRef;
import akka.actor.PoisonPill;
import akka.actor.Props;
import akka.actor.ReceiveTimeout;
import akka.japi.Creator;
-import com.google.common.base.Preconditions;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.controller.cluster.common.actor.AbstractUntypedActorWithMetering;
-import org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard.ShardStats;
import org.opendaylight.controller.cluster.datastore.messages.CloseTransaction;
import org.opendaylight.controller.cluster.datastore.messages.CloseTransactionReply;
import org.opendaylight.controller.cluster.datastore.messages.DataExists;
import org.opendaylight.controller.cluster.datastore.messages.DataExistsReply;
-import org.opendaylight.controller.cluster.datastore.messages.PersistAbortTransactionPayload;
import org.opendaylight.controller.cluster.datastore.messages.ReadData;
import org.opendaylight.controller.cluster.datastore.messages.ReadDataReply;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
/**
super("shard-tx");
this.shardActor = shardActor;
this.shardStats = shardStats;
- this.transactionId = Preconditions.checkNotNull(transactionId);
+ this.transactionId = requireNonNull(transactionId);
}
public static Props props(final TransactionType type, final AbstractShardDataTreeTransaction<?> transaction,
final ActorRef shardActor, final DatastoreContext datastoreContext, final ShardStats shardStats) {
- return Props.create(new ShardTransactionCreator(type, transaction, shardActor, datastoreContext, shardStats));
+ return Props.create(ShardTransaction.class,
+ new ShardTransactionCreator(type, transaction, shardActor, datastoreContext, shardStats));
}
protected abstract AbstractShardDataTreeTransaction<?> getDOMStoreTransaction();
private void closeTransaction(final boolean sendReply) {
getDOMStoreTransaction().abortFromTransactionActor();
- shardActor.tell(new PersistAbortTransactionPayload(transactionId), ActorRef.noSender());
if (sendReply && returnCloseTransactionReply()) {
getSender().tell(new CloseTransactionReply(), getSelf());
ShardTransactionCreator(final TransactionType type, final AbstractShardDataTreeTransaction<?> transaction,
final ActorRef shardActor, final DatastoreContext datastoreContext, final ShardStats shardStats) {
- this.transaction = Preconditions.checkNotNull(transaction);
+ this.transaction = requireNonNull(transaction);
this.shardActor = shardActor;
this.shardStats = shardStats;
this.datastoreContext = datastoreContext;
}
@Override
- public ShardTransaction create() throws Exception {
+ public ShardTransaction create() {
final ShardTransaction tx;
switch (type) {
case READ_ONLY: