public class ActorContext extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BOUNDED_MAILBOX |
static String |
COMMIT |
Constructor and Description |
---|
ActorContext(akka.actor.ActorSystem actorSystem,
akka.actor.ActorRef shardManager,
ClusterWrapper clusterWrapper,
Configuration configuration) |
ActorContext(akka.actor.ActorSystem actorSystem,
akka.actor.ActorRef shardManager,
ClusterWrapper clusterWrapper,
Configuration configuration,
DatastoreContext datastoreContext,
PrimaryShardInfoFutureCache primaryShardInfoCache) |
Modifier and Type | Method and Description |
---|---|
void |
acquireTxCreationPermit()
Try to acquire a transaction creation permit.
|
akka.actor.ActorSelection |
actorSelection(akka.actor.ActorPath actorPath) |
akka.actor.ActorSelection |
actorSelection(String actorPath) |
void |
broadcast(Function<Short,Object> messageSupplier,
Class<?> messageClass)
Send the message to each and every shard.
|
protected scala.concurrent.Future<Object> |
doAsk(akka.actor.ActorRef actorRef,
Object message,
akka.util.Timeout timeout) |
protected scala.concurrent.Future<Object> |
doAsk(akka.actor.ActorSelection actorRef,
Object message,
akka.util.Timeout timeout) |
Object |
executeOperation(akka.actor.ActorRef actor,
Object message)
Executes an operation on a local actor and wait for it's response.
|
Object |
executeOperation(akka.actor.ActorSelection actor,
Object message)
Execute an operation on a remote actor and wait for it's response.
|
scala.concurrent.Future<Object> |
executeOperationAsync(akka.actor.ActorRef actor,
Object message,
akka.util.Timeout timeout) |
scala.concurrent.Future<Object> |
executeOperationAsync(akka.actor.ActorSelection actor,
Object message)
Execute an operation on a remote actor asynchronously.
|
scala.concurrent.Future<Object> |
executeOperationAsync(akka.actor.ActorSelection actor,
Object message,
akka.util.Timeout timeout)
Execute an operation on a remote actor asynchronously.
|
com.google.common.base.Optional<akka.actor.ActorRef> |
findLocalShard(String shardName)
Finds a local shard given its shard name and return it's ActorRef.
|
scala.concurrent.Future<akka.actor.ActorRef> |
findLocalShardAsync(String shardName)
Finds a local shard async given its shard name and return a Future from which to obtain the
ActorRef.
|
scala.concurrent.Future<PrimaryShardInfo> |
findPrimaryShardAsync(String shardName) |
akka.actor.ActorSystem |
getActorSystem() |
scala.concurrent.ExecutionContext |
getClientDispatcher()
An akka dispatcher that is meant to be used when processing ask Futures which were triggered by client
code on the datastore.
|
ClusterWrapper |
getClusterWrapper() |
Configuration |
getConfiguration() |
MemberName |
getCurrentMemberName() |
DatastoreContext |
getDatastoreContext() |
String |
getDataStoreName()
Get the name of the data store to which this ActorContext belongs.
|
String |
getNotificationDispatcherPath() |
scala.concurrent.duration.FiniteDuration |
getOperationDuration() |
akka.util.Timeout |
getOperationTimeout() |
com.codahale.metrics.Timer |
getOperationTimer(String operationName)
This is a utility method that lets us get a Timer object for any operation.
|
com.codahale.metrics.Timer |
getOperationTimer(String dataStoreType,
String operationName) |
PrimaryShardInfoFutureCache |
getPrimaryShardInfoCache() |
org.opendaylight.yangtools.yang.model.api.SchemaContext |
getSchemaContext() |
akka.actor.ActorRef |
getShardManager() |
ShardStrategyFactory |
getShardStrategyFactory() |
akka.util.Timeout |
getTransactionCommitOperationTimeout()
Returns the operation timeout to be used when committing transactions.
|
double |
getTxCreationLimit()
Get the current transaction creation rate limit.
|
boolean |
isPathLocal(String path) |
void |
sendOperationAsync(akka.actor.ActorSelection actor,
Object message)
Sends an operation to be executed by a remote actor asynchronously without waiting for a
reply (essentially set and forget).
|
void |
setDatastoreContext(DatastoreContextFactory contextFactory) |
void |
setSchemaContext(org.opendaylight.yangtools.yang.model.api.SchemaContext schemaContext) |
void |
shutdown() |
public static final String BOUNDED_MAILBOX
public static final String COMMIT
public ActorContext(akka.actor.ActorSystem actorSystem, akka.actor.ActorRef shardManager, ClusterWrapper clusterWrapper, Configuration configuration)
public ActorContext(akka.actor.ActorSystem actorSystem, akka.actor.ActorRef shardManager, ClusterWrapper clusterWrapper, Configuration configuration, DatastoreContext datastoreContext, PrimaryShardInfoFutureCache primaryShardInfoCache)
public DatastoreContext getDatastoreContext()
public akka.actor.ActorSystem getActorSystem()
public akka.actor.ActorRef getShardManager()
public akka.actor.ActorSelection actorSelection(String actorPath)
public akka.actor.ActorSelection actorSelection(akka.actor.ActorPath actorPath)
public void setSchemaContext(org.opendaylight.yangtools.yang.model.api.SchemaContext schemaContext)
public void setDatastoreContext(DatastoreContextFactory contextFactory)
public org.opendaylight.yangtools.yang.model.api.SchemaContext getSchemaContext()
public scala.concurrent.Future<PrimaryShardInfo> findPrimaryShardAsync(String shardName)
public com.google.common.base.Optional<akka.actor.ActorRef> findLocalShard(String shardName)
shardName
- the name of the local shard that needs to be foundpublic scala.concurrent.Future<akka.actor.ActorRef> findLocalShardAsync(String shardName)
shardName
- the name of the local shard that needs to be foundpublic Object executeOperation(akka.actor.ActorRef actor, Object message)
actor
- the actormessage
- the message to sendpublic Object executeOperation(akka.actor.ActorSelection actor, Object message)
actor
- the actormessage
- the messagepublic scala.concurrent.Future<Object> executeOperationAsync(akka.actor.ActorRef actor, Object message, akka.util.Timeout timeout)
public scala.concurrent.Future<Object> executeOperationAsync(akka.actor.ActorSelection actor, Object message, akka.util.Timeout timeout)
actor
- the ActorSelectionmessage
- the message to sendtimeout
- the operation timeoutpublic scala.concurrent.Future<Object> executeOperationAsync(akka.actor.ActorSelection actor, Object message)
actor
- the ActorSelectionmessage
- the message to sendpublic void sendOperationAsync(akka.actor.ActorSelection actor, Object message)
actor
- the ActorSelectionmessage
- the message to sendpublic void shutdown()
public ClusterWrapper getClusterWrapper()
public MemberName getCurrentMemberName()
public void broadcast(Function<Short,Object> messageSupplier, Class<?> messageClass)
public scala.concurrent.duration.FiniteDuration getOperationDuration()
public akka.util.Timeout getOperationTimeout()
public boolean isPathLocal(String path)
public com.codahale.metrics.Timer getOperationTimer(String operationName)
operationName
- the name of the operationpublic com.codahale.metrics.Timer getOperationTimer(String dataStoreType, String operationName)
public String getDataStoreName()
public double getTxCreationLimit()
public void acquireTxCreationPermit()
public akka.util.Timeout getTransactionCommitOperationTimeout()
public scala.concurrent.ExecutionContext getClientDispatcher()
public String getNotificationDispatcherPath()
public Configuration getConfiguration()
public ShardStrategyFactory getShardStrategyFactory()
protected scala.concurrent.Future<Object> doAsk(akka.actor.ActorRef actorRef, Object message, akka.util.Timeout timeout)
protected scala.concurrent.Future<Object> doAsk(akka.actor.ActorSelection actorRef, Object message, akka.util.Timeout timeout)
public PrimaryShardInfoFutureCache getPrimaryShardInfoCache()
Copyright © 2019 OpenDaylight. All rights reserved.