public static ClusterConfiguration fromBytes(ByteBuffer buffer){ ClusterConfiguration configuration = new ClusterConfiguration(); configuration.setLogIndex(buffer.getLong()); configuration.setLastLogIndex(buffer.getLong()); while(buffer.hasRemaining()){ configuration.getServers().add(new ClusterServer(buffer)); } return configuration; }
/** * De-serialize the data stored in buffer to cluster configuration * this is used for the peers to get the cluster configuration from log entry value * @param buffer the binary data * @return cluster configuration */ public static ClusterConfiguration fromBytes(ByteBuffer buffer){ ClusterConfiguration configuration = new ClusterConfiguration(); configuration.setLogIndex(buffer.getLong()); configuration.setLastLogIndex(buffer.getLong()); while(buffer.hasRemaining()){ configuration.getServers().add(new ClusterServer(buffer)); } return configuration; }
/** * De-serialize the data stored in buffer to cluster configuration * this is used for the peers to get the cluster configuration from log entry value * @param buffer the binary data * @return cluster configuration */ public static ClusterConfiguration fromBytes(ByteBuffer buffer){ ClusterConfiguration configuration = new ClusterConfiguration(); configuration.setLogIndex(buffer.getLong()); configuration.setLastLogIndex(buffer.getLong()); while(buffer.hasRemaining()){ configuration.getServers().add(new ClusterServer(buffer)); } return configuration; }
ClusterServer server = new ClusterServer(); server.setEndpoint(values.get(2)); server.setId(Integer.parseInt(values.get(1)));
ClusterServer server = new ClusterServer(); server.setEndpoint(values.get(2)); server.setId(Integer.parseInt(values.get(1)));
ClusterServer server = new ClusterServer(); server.setEndpoint(values.get(1)); server.setId(Integer.parseInt(values.get(0)));
ClusterServer server = new ClusterServer(); server.setEndpoint(values.get(1)); server.setId(Integer.parseInt(values.get(0)));
ClusterServer server = new ClusterServer(ByteBuffer.wrap(logEntries[0].getValue())); if(this.peers.containsKey(server.getId()) || this.id == server.getId()){ this.logger.warning("the server to be added has a duplicated id with existing server %d", server.getId());
ClusterServer server = new ClusterServer(ByteBuffer.wrap(logEntries[0].getValue())); if(this.peers.containsKey(server.getId()) || this.id == server.getId()){ this.logger.warning("the server to be added has a duplicated id with existing server %d", server.getId());
ClusterServer server = new ClusterServer(ByteBuffer.wrap(logEntries[0].getValue())); if(this.peers.containsKey(server.getId()) || this.id == server.getId()){ this.logger.warning("the server to be added has a duplicated id with existing server %d", server.getId());