use of io.s4.client.ClientStub.Info in project core by s4.
the class Handshake method clientInit.
private void clientInit(ByteArrayIOChannel io) throws IOException {
String uuid = UUID.randomUUID().toString();
Info proto = clientStub.getProtocolInfo();
HashMap<String, Object> info = new HashMap<String, Object>();
info.put("uuid", uuid);
info.put("protocol", proto);
String response = gson.toJson(info) + "\n";
io.send(response.getBytes());
}
use of io.s4.client.ClientStub.Info in project core by s4.
the class Response method partition.
public List<CompoundKeyInfo> partition(int partCount) {
// partition id is available from the request info object
int p = this.getRInfo().getPartition();
List<CompoundKeyInfo> partitionInfoList = null;
if (p >= 0 && p < partCount) {
CompoundKeyInfo partitionInfo = new CompoundKeyInfo();
partitionInfo.setPartitionId(p);
partitionInfoList = new ArrayList<CompoundKeyInfo>();
partitionInfoList.add(partitionInfo);
}
return partitionInfoList;
}
Aggregations