import akka.actor.ActorRef;
import akka.actor.Address;
import akka.actor.Props;
-import akka.actor.UntypedActor;
import akka.event.Logging;
import akka.event.LoggingAdapter;
import akka.japi.Creator;
* <li> When a local shard replica comes alive
* </p>
*/
-public class ShardManager extends UntypedActor {
+public class ShardManager extends AbstractUntypedActor {
// Stores a mapping between a shard name and the address of the current primary
private final Map<String, Address> shardNameToPrimaryAddress = new HashMap<>();
* configuration or operational
*/
private ShardManager(String type){
- ActorRef actor = getContext().actorOf(Shard.props(Shard.DEFAULT_NAME + "-" + type));
+ ActorRef actor = getContext().actorOf(Shard.props("shard-" + Shard.DEFAULT_NAME + "-" + type), "shard-" + Shard.DEFAULT_NAME + "-" + type);
defaultShardPath = actor.path();
}
}
@Override
- public void onReceive(Object message) throws Exception {
+ public void handleReceive(Object message) throws Exception {
if (message instanceof FindPrimary) {
FindPrimary msg = ((FindPrimary) message);
String shardName = msg.getShardName();
getSender().tell(new PrimaryNotFound(shardName), getSelf());
}
} else if(message instanceof UpdateSchemaContext){
- // FIXME : Notify all local shards of a context change
+ // FIXME : Notify all local shards of a schemaContext change
getContext().system().actorSelection(defaultShardPath).forward(message, getContext());
}
}