public static RegionTable decodeRegionTable(KVMemoryStream stream) { RegionTable table =new RegionTable(); int size = stream.ReadInt(); for (int i = 0; i < size; i++) { Region region = decodeRegion(stream); Address addr = decodeAddress(stream); table.addRegion(region, addr); } return table; }
public static RegionTable decodeRegionTable(KVMemoryStream stream) { RegionTable table = new RegionTable(); int size = stream.ReadInt(); for (int i = 0; i < size; i++) { Region region = decodeRegion(stream); Address addr = decodeAddress(stream); table.addRegion(region, addr); } return(table); }
public void UpdateRegionTable() { Socket socket = getMasterConnection(); SocketUtil.WriteUpdateRegionTableRequest(socket); RegionTable newTable = null; int ret = SocketUtil.ReadRegionTableResponse(socket, out newTable); if (ret != ProtocolCode.Success) { throw new KVException(ProtocolCode.getMessage(ret)); } this.table = newTable; }
internal static int ReadRegionTableResponse(Socket socket, out RegionTable table) { using (KVMemoryStream stream = ReadResponse(socket)) { int len = stream.ReadInt(); int type = stream.ReadInt(); int retCode = stream.ReadInt(); if (retCode == ProtocolCode.Success) { table = DecoderUtil.decodeRegionTable(stream); } else { table = null; } return(retCode); } }
internal static int ReadRegionTableResponse(Socket socket,out RegionTable table) { using (KVMemoryStream stream = ReadResponse(socket)) { int len = stream.ReadInt(); int type = stream.ReadInt(); int retCode = stream.ReadInt(); if (retCode == ProtocolCode.Success) { table = DecoderUtil.decodeRegionTable(stream); } else { table = null; } return retCode; } }