Java 类org.apache.zookeeper.proto.ReconfigRequest 实例源码

项目:https-github.com-apache-zookeeper    文件:ZooKeeperAdmin.java   
/**
 * The Asynchronous version of reconfig.
 *
 * @see #reconfigure
 *
 **/
public void reconfigure(String joiningServers, String leavingServers,
                        String newMembers, long fromConfig, DataCallback cb, Object ctx) {
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.reconfig);
    ReconfigRequest request = new ReconfigRequest(joiningServers, leavingServers, newMembers, fromConfig);
    GetDataResponse response = new GetDataResponse();
    cnxn.queuePacket(h, new ReplyHeader(), request, response, cb,
           ZooDefs.CONFIG_NODE, ZooDefs.CONFIG_NODE, ctx, null);
}
项目:SecureKeeper    文件:ZooKeeper.java   
/**
 * The Asynchronous version of reconfig. 
 *
 * @see #reconfig
 *      
 **/
public void reconfig(String joiningServers, String leavingServers,
    String newMembers, long fromConfig, DataCallback cb, Object ctx)
{
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.reconfig);       
    ReconfigRequest request = new ReconfigRequest(joiningServers, leavingServers, newMembers, fromConfig);
    GetDataResponse response = new GetDataResponse();
    cnxn.queuePacket(h, new ReplyHeader(), request, response, cb,
           ZooDefs.CONFIG_NODE, ZooDefs.CONFIG_NODE, ctx, null);
}
项目:SecureKeeper    文件:ZooKeeper.java   
/**
 * The Asynchronous version of reconfig. 
 *
 * @see #reconfig
 *      
 **/
public void reconfig(String joiningServers, String leavingServers,
    String newMembers, long fromConfig, DataCallback cb, Object ctx)
{
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.reconfig);       
    ReconfigRequest request = new ReconfigRequest(joiningServers, leavingServers, newMembers, fromConfig);
    GetDataResponse response = new GetDataResponse();
    cnxn.queuePacket(h, new ReplyHeader(), request, response, cb,
           ZooDefs.CONFIG_NODE, ZooDefs.CONFIG_NODE, ctx, null);
}
项目:https-github.com-apache-zookeeper    文件:ZooKeeperAdmin.java   
/**
 * Reconfigure - add/remove servers. Return the new configuration.
 * @param joiningServers
 *                a comma separated list of servers being added (incremental reconfiguration)
 * @param leavingServers
 *                a comma separated list of servers being removed (incremental reconfiguration)
 * @param newMembers
 *                a comma separated list of new membership (non-incremental reconfiguration)
 * @param fromConfig
 *                version of the current configuration
 *                (optional - causes reconfiguration to throw an exception if configuration is no longer current)
 * @param stat the stat of /zookeeper/config znode will be copied to this
 *             parameter if not null.
 * @return new configuration
 * @throws InterruptedException If the server transaction is interrupted.
 * @throws KeeperException If the server signals an error with a non-zero error code.
 */
public byte[] reconfigure(String joiningServers, String leavingServers,
                          String newMembers, long fromConfig, Stat stat) throws KeeperException, InterruptedException {
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.reconfig);
    ReconfigRequest request = new ReconfigRequest(joiningServers, leavingServers, newMembers, fromConfig);
    GetDataResponse response = new GetDataResponse();
    ReplyHeader r = cnxn.submitRequest(h, request, response, null);
    if (r.getErr() != 0) {
        throw KeeperException.create(KeeperException.Code.get(r.getErr()), "");
    }
    if (stat != null) {
        DataTree.copyStat(response.getStat(), stat);
    }
    return response.getData();
}
项目:SecureKeeper    文件:ZooKeeper.java   
/**
 * Reconfigure - add/remove servers. Return the new configuration.
 * @param joiningServers
 *                a comma separated list of servers being added (incremental reconfiguration)
 * @param leavingServers
 *                a comma separated list of servers being removed (incremental reconfiguration)
 * @param newMembers
 *                a comma separated list of new membership (non-incremental reconfiguration)
 * @param fromConfig
 *                version of the current configuration (optional - causes reconfiguration to throw an exception if configuration is no longer current)
 * @param stat the stat of /zookeeper/config znode will be copied to this
 *             parameter if not null.
 * @return new configuration
 * @throws InterruptedException If the server transaction is interrupted.
 * @throws KeeperException If the server signals an error with a non-zero error code.     
 */
public byte[] reconfig(String joiningServers, String leavingServers, String newMembers, long fromConfig, Stat stat) throws KeeperException, InterruptedException
{
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.reconfig);       
    ReconfigRequest request = new ReconfigRequest(joiningServers, leavingServers, newMembers, fromConfig);        
    GetDataResponse response = new GetDataResponse();       
    ReplyHeader r = cnxn.submitRequest(h, request, response, null);
    if (r.getErr() != 0) {
        throw KeeperException.create(KeeperException.Code.get(r.getErr()), "");
    }
    if (stat != null) {
        DataTree.copyStat(response.getStat(), stat);
    }
    return response.getData();
}
项目:SecureKeeper    文件:ZooKeeper.java   
/**
 * Reconfigure - add/remove servers. Return the new configuration.
 * @param joiningServers
 *                a comma separated list of servers being added (incremental reconfiguration)
 * @param leavingServers
 *                a comma separated list of servers being removed (incremental reconfiguration)
 * @param newMembers
 *                a comma separated list of new membership (non-incremental reconfiguration)
 * @param fromConfig
 *                version of the current configuration (optional - causes reconfiguration to throw an exception if configuration is no longer current)
 * @param stat the stat of /zookeeper/config znode will be copied to this
 *             parameter if not null.
 * @return new configuration
 * @throws InterruptedException If the server transaction is interrupted.
 * @throws KeeperException If the server signals an error with a non-zero error code.     
 */
public byte[] reconfig(String joiningServers, String leavingServers, String newMembers, long fromConfig, Stat stat) throws KeeperException, InterruptedException
{
    RequestHeader h = new RequestHeader();
    h.setType(ZooDefs.OpCode.reconfig);       
    ReconfigRequest request = new ReconfigRequest(joiningServers, leavingServers, newMembers, fromConfig);        
    GetDataResponse response = new GetDataResponse();       
    ReplyHeader r = cnxn.submitRequest(h, request, response, null);
    if (r.getErr() != 0) {
        throw KeeperException.create(KeeperException.Code.get(r.getErr()), "");
    }
    if (stat != null) {
        DataTree.copyStat(response.getStat(), stat);
    }
    return response.getData();
}
项目:zookeeper-lite    文件:IReconfigRequest.java   
public IReconfigRequest() {
    this(new ReconfigRequest());
}
项目:zookeeper-lite    文件:IReconfigRequest.java   
public IReconfigRequest(String joiningServers, String leavingServers,
        String newMembers, long curConfigId) {
    this(new ReconfigRequest(joiningServers, leavingServers, newMembers, curConfigId));
}
项目:zookeeper-lite    文件:IReconfigRequest.java   
public IReconfigRequest(ReconfigRequest record) {
    super(record);
}