/** * 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); }
/** * 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); }
/** * 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(); }
/** * 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(); }
public IReconfigRequest() { this(new ReconfigRequest()); }
public IReconfigRequest(String joiningServers, String leavingServers, String newMembers, long curConfigId) { this(new ReconfigRequest(joiningServers, leavingServers, newMembers, curConfigId)); }
public IReconfigRequest(ReconfigRequest record) { super(record); }