com.sleepycat.je.rep.impl
Class GroupService

java.lang.Object
  extended by com.sleepycat.je.rep.utilint.ServiceDispatcher.ExecutingService
      extended by com.sleepycat.je.rep.impl.GroupService

public class GroupService
extends ServiceDispatcher.ExecutingService


Nested Class Summary
(package private)  class GroupService.GroupServiceRunnable
           
 
Field Summary
(package private)  RepGroupProtocol protocol
           
(package private)  RepNode repNode
           
static String SERVICE_NAME
           
 
Constructor Summary
GroupService(ServiceDispatcher dispatcher, RepNode repNode)
           
 
Method Summary
protected  void cancel()
          Cancel the service as part of the registration being canceled.
 Runnable getRunnable(SocketChannel socketChannel)
           
 TextProtocol.ResponseMessage process(RepGroupProtocol.EnsureNode ensureNode)
          Ensures that the Monitor node, as described in the request, is a member of the group.
 TextProtocol.ResponseMessage process(RepGroupProtocol.GroupRequest groupRequest)
          Wraps the replication group as currently cached on this node in a Response message and returns it.
 TextProtocol.ResponseMessage process(RepGroupProtocol.RemoveMember removeMember)
          Removes a current member from the group.
 TextProtocol.ResponseMessage process(RepGroupProtocol.TransferMaster transferMaster)
          Transfer the master role from the current master to one of the specified replicas.
 TextProtocol.ResponseMessage process(RepGroupProtocol.UpdateAddress updateAddress)
          Update the network address for a dead replica.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

repNode

final RepNode repNode

protocol

final RepGroupProtocol protocol

SERVICE_NAME

public static final String SERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

GroupService

public GroupService(ServiceDispatcher dispatcher,
                    RepNode repNode)
Method Detail

cancel

protected void cancel()
Cancel the service as part of the registration being canceled.

Overrides:
cancel in class ServiceDispatcher.ExecutingService

process

public TextProtocol.ResponseMessage process(RepGroupProtocol.GroupRequest groupRequest)
Wraps the replication group as currently cached on this node in a Response message and returns it.


process

public TextProtocol.ResponseMessage process(RepGroupProtocol.EnsureNode ensureNode)
Ensures that the Monitor node, as described in the request, is a member of the group.

Parameters:
ensureNode - the request message describing the monitor node
Returns:
EnsureOK message if the monitor node is already part of the rep group, or was just made a part of the replication group. It returns a Fail message if it could not be made part of the group. The message associated with the response provides further details.

process

public TextProtocol.ResponseMessage process(RepGroupProtocol.RemoveMember removeMember)
Removes a current member from the group.

Parameters:
removeMember - the request identifying the member to be removed.
Returns:
OK message if the member was removed from the group.

process

public TextProtocol.ResponseMessage process(RepGroupProtocol.UpdateAddress updateAddress)
Update the network address for a dead replica.

Parameters:
updateAddress - the request identifying the new network address for the node.
Returns:
OK message if the address is successfully updated.

process

public TextProtocol.ResponseMessage process(RepGroupProtocol.TransferMaster transferMaster)
Transfer the master role from the current master to one of the specified replicas.

Parameters:
transferMaster - the request identifying nodes to be considered for the role of new master
Returns:
null

getRunnable

public Runnable getRunnable(SocketChannel socketChannel)
Specified by:
getRunnable in class ServiceDispatcher.ExecutingService


Copyright (c) 2004-2012 Oracle. All rights reserved.