Mercurial > hg > Database > Alice
changeset 552:767d93626b88 dispose
add compressed to DSM name
line wrap: on
line diff
--- a/src/main/java/alice/datasegment/ReceiveData.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/datasegment/ReceiveData.java Mon Nov 16 18:33:23 2015 +0900 @@ -100,8 +100,6 @@ * @return */ public <T> T asClass(Class<T> clazz) {///javasist - System.out.println("in asClass val:" + val + ", MP:" + messagePack + ", zMP:" + zMessagePack); - try { if (val != null) { return (T) val; @@ -151,7 +149,6 @@ } public void zip() throws IOException { - System.out.println("in zip"); LinkedList<ByteBuffer> inputs = new LinkedList<ByteBuffer>(); int inputIndex = 0; LinkedList<ByteBuffer> outputs = new LinkedList<ByteBuffer>(); @@ -197,23 +194,12 @@ System.arraycopy(outputs.get(i).array(), 0, zMessagePack, 0 + tmp, outputs.get(i).limit());//limit? remaining? tmp += outputs.get(i).limit(); } - System.out.print("in make zMessagePack2: "); - for (int i = 0; i < zMessagePack.length; i++) { - System.out.print(Integer.toHexString(zMessagePack[i] & 0xff)); - } - System.out.print("\n"); } protected byte[] unzip(byte[] input, int zippedLength) {///read header & unzip int length = input.length; Inflater inflater = new Inflater(); - System.out.print("unziped input: "); - for (int i = 0; i < input.length; i++) { - System.out.print(Integer.toHexString(input[i] & 0xff)); - } - System.out.print("\n"); - byte [] output = new byte [zippedLength];///byteArray for unziped data inflater.setInput(input, 0, length);///set unzip data without header @@ -225,12 +211,6 @@ inflater.reset(); - System.out.print("unziped: "); - for (int i = 0; i < output.length; i++) { - System.out.print(Integer.toHexString(output[i] & 0xff)); - } - System.out.print("\n"); - return output; }
--- a/src/main/java/alice/datasegment/RemoteDataSegmentManager.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/datasegment/RemoteDataSegmentManager.java Mon Nov 16 18:33:23 2015 +0900 @@ -18,7 +18,7 @@ public RemoteDataSegmentManager(){} - public RemoteDataSegmentManager(String connectionKey, final String reverseKey, final String hostName, final int port) { + public RemoteDataSegmentManager(final String connectionKey, final String reverseKey, final String hostName, final int port) { logger = Logger.getLogger(connectionKey); connection = new Connection(); connection.name = connectionKey;
--- a/src/main/java/alice/test/topology/aquarium/fx/Aquarium.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/Aquarium.java Mon Nov 16 18:33:23 2015 +0900 @@ -31,7 +31,7 @@ @Override public void start(Stage primaryStage) throws IOException { - String myName = getParameters().getRaw().get(0); // name + final String myName = getParameters().getRaw().get(0); // name primaryStage.setTitle("Aquarium "+ myName); primaryStage.setResizable(false); primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>(){
--- a/src/main/java/alice/test/topology/fish/SendWidth.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/test/topology/fish/SendWidth.java Mon Nov 16 18:33:23 2015 +0900 @@ -11,12 +11,12 @@ @Override public void run() { int width = this.width.asInteger(); - ods.put("parent", "widths", width); + ods.put("compressedparent", "widths", width); - System.out.println("send widths: " + width); + System.out.println("send widths: " + width); SendWidth cs = new SendWidth(); - cs.width.setKey("width", this.width.index); + cs.width.setKey("compressedwidth", this.width.index); } }
--- a/src/main/java/alice/test/topology/share/CheckLocalIndex.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/test/topology/share/CheckLocalIndex.java Mon Nov 16 18:33:23 2015 +0900 @@ -14,9 +14,9 @@ public CheckLocalIndex(String key, int index) { - this.host.setKey("host"); - this.list.setKey("_CLIST"); - this.data.setKey(key, index); + this.host.setKey("compressedlocal", "host"); + this.list.setKey("compressedlocal", "_CLIST"); + this.data.setKey("compressedlocal", key, index); } @Override @@ -30,12 +30,12 @@ flag = true; } if (!node.equals(this.data.from)) { - ods.update(node, data.key, data.getVal()); + ods.update("compressed" + node, data.key, data.getVal()); count++; } } if (count == 0 && flag) { - ods.put("parent", "data", data.getVal()); + ods.put("compressedparent", "data", data.getVal()); } new CheckLocalIndex(data.key, data.index);
--- a/src/main/java/alice/test/topology/share/SendData.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/test/topology/share/SendData.java Mon Nov 16 18:33:23 2015 +0900 @@ -8,13 +8,13 @@ private Receiver data = ids.create(CommandType.PEEK); public SendData(int index){ - this.data.setKey("data", index); + this.data.setKey("compressedlocal","data", index); } @Override public void run(){ new SendData(this.data.index); - ods.put("parent", "data", this.data.getVal()); + ods.put("compressedparent", "data", this.data.getVal()); } } \ No newline at end of file
--- a/src/main/java/alice/topology/fix/FixTopology.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/fix/FixTopology.java Mon Nov 16 18:33:23 2015 +0900 @@ -19,10 +19,10 @@ private Receiver info4 = ids.create(CommandType.TAKE); // parentManager public FixTopology() { - info.setKey("_DISCONNECTNODE"); - info1.setKey("topology"); - info3.setKey("nameTable"); - info4.setKey("parentManager"); + info.setKey("compressedlocal", "_DISCONNECTNODE"); + info1.setKey("compressedlocal", "topology"); + info3.setKey("compressedlocal", "nameTable"); + info4.setKey("compressedlocal", "parentManager"); } @SuppressWarnings("unchecked") @@ -65,9 +65,9 @@ if (!lastJoinNodeName.equals(lostNodeName)) { if (!lostNodeName.equals(parentNode.remoteAbsName)) { // send close message to lastJoinedNode - ods.put(lastJoinNodeName, "_CLOSEMESSEAGE", parentNode.connectionName); + ods.put("compressed" + lastJoinNodeName, "_CLOSEMESSEAGE", parentNode.connectionName); // send close message to lastJoinedNode's parent - ods.put(parentNode.absName, "_CLOSEMESSEAGE", parentNode.reverseName); + ods.put("compressed" + parentNode.absName, "_CLOSEMESSEAGE", parentNode.reverseName); } HostMessage lastJoinNode = nameTable.get(lastJoinNodeName); @@ -82,19 +82,19 @@ node1.name = lastJoinNode.name; node1.port = lastJoinNode.port; node1.absName = lastJoinNodeName; - ods.put(node1.remoteAbsName, node1); + ods.put("compressedlocal", node1.remoteAbsName, node1); break; } } node.remoteAbsName = lastJoinNodeName; - ods.put(node.remoteAbsName, node); + ods.put("compressedlocal",node.remoteAbsName, node); connectionList.add(node); } else { for (HostMessage node1 :disconnectionList) { if ("parent".equals(node1.connectionName)) { node1.reverseName = lastJoinNodeName; list.add(node1); - ods.put(node1.remoteAbsName, node1); + ods.put("compressedlocal", node1.remoteAbsName, node1); break; } } @@ -135,8 +135,8 @@ // disconnect message already received. } - ods.put(info1.key, topology); - ods.put(info3.key, nameTable); - ods.put(info4.key, manager); + ods.put("compressedlocal", info1.key, topology); + ods.put("compressedlocal", info3.key, nameTable); + ods.put("compressedlocal", info4.key, manager); } }
--- a/src/main/java/alice/topology/fix/ReceiveDisconnectMessage.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/fix/ReceiveDisconnectMessage.java Mon Nov 16 18:33:23 2015 +0900 @@ -8,7 +8,7 @@ private Receiver info = ids.create(CommandType.PEEK); public ReceiveDisconnectMessage() { - info.setKey("_DISCONNECTNODE"); + info.setKey("compressedlocal", "_DISCONNECTNODE"); } @Override
--- a/src/main/java/alice/topology/manager/CheckComingHost.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/CheckComingHost.java Mon Nov 16 18:33:23 2015 +0900 @@ -12,8 +12,8 @@ private Receiver absCookieTable = ids.create(CommandType.PEEK); // cookie, AbsName HashMap public CheckComingHost(){ - this.host.setKey("host"); - this.absCookieTable.setKey("absCookieTable"); + this.host.setKey("compressedlocal", "host"); + this.absCookieTable.setKey("compressedlocal", "absCookieTable"); } @Override @@ -33,11 +33,11 @@ if (match){ // coming host has ever joined this App - ods.put("reconnectHost", host); + ods.put("compressedlocal", "reconnectHost", host); new SearchHostName(); } else { - ods.put("orderHash", "order"); - ods.put("newHost", host); + ods.put("compressedlocal", "orderHash", "order"); + ods.put("compressedlocal", "newHost", host); } new CheckComingHost();
--- a/src/main/java/alice/topology/manager/ComingServiceHosts.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/ComingServiceHosts.java Mon Nov 16 18:33:23 2015 +0900 @@ -9,7 +9,7 @@ private Receiver info = ids.create(CommandType.PEEK); public ComingServiceHosts(){ - info.setKey("newHost"); + info.setKey("compressedlocal", "newHost"); } @Override
--- a/src/main/java/alice/topology/manager/ConfigWaiter.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/ConfigWaiter.java Mon Nov 16 18:33:23 2015 +0900 @@ -19,12 +19,12 @@ public void run() { count--; if (count == 0) { - ods.put("local", "start", ValueFactory.createNilValue()); - ods.update("running", true); + ods.put("compressedlocal", "start", ValueFactory.createNilValue()); + ods.update("compressedlocal", "running", true); return; } ConfigWaiter cs3 = new ConfigWaiter(count); - cs3.done.setKey("local", "done"); + cs3.done.setKey("compressedlocal", "done"); } }
--- a/src/main/java/alice/topology/manager/CreateHash.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/CreateHash.java Mon Nov 16 18:33:23 2015 +0900 @@ -17,8 +17,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); public CreateHash(){ - info.setKey("orderHash"); - info1.setKey("createdList"); + info.setKey("compressedlocal", "orderHash"); + info1.setKey("compressedlocal", "createdList"); } @Override @@ -40,12 +40,12 @@ checkNewStr = true; } createdRawList.add(raw); - ods.put(info1.key, createdRawList); + ods.put("compressedlocal", info1.key, createdRawList); try { // convert to MD5 String MD5 = convertMD5(raw); - ods.put("MD5", MD5); + ods.put("compressedlocal", "MD5", MD5); } catch (NoSuchAlgorithmException e) { } new CreateHash();
--- a/src/main/java/alice/topology/manager/CreateTreeTopology.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/CreateTreeTopology.java Mon Nov 16 18:33:23 2015 +0900 @@ -19,12 +19,12 @@ private Receiver info6 = ids.create(CommandType.TAKE); public CreateTreeTopology(){ - info.setKey("newHost"); - info1.setKey("hostCount"); - info2.setKey("nameTable"); - info3.setKey("MD5"); - info4.setKey("absCookieTable"); - info6.setKey("parentManager"); + info.setKey("compressedlocal", "newHost"); + info1.setKey("compressedlocal", "hostCount"); + info2.setKey("compressedlocal", "nameTable"); + info3.setKey("compressedlocal", "MD5"); + info4.setKey("compressedlocal", "absCookieTable"); + info6.setKey("compressedlocal", "parentManager"); } @SuppressWarnings("unchecked") @@ -42,12 +42,12 @@ String nodeName = "node"+comingHostCount; // Manager connect to Node DataSegment.connect(nodeName, nodeName, host.name, host.port); - ods.put(nodeName, "host", nodeName); - ods.put(nodeName, "cookie", cookie); + ods.put("compressed" + nodeName, "host", nodeName); + ods.put("compressed" + nodeName, "cookie", cookie); absCookieTable.put(cookie, nodeName); - ods.put(info4.key, absCookieTable); - ods.put(info1.key, comingHostCount+1); + ods.put("compressedlocal", info4.key, absCookieTable); + ods.put("compressedlocal", info1.key, comingHostCount+1); host.alive = true; nameTable.put(nodeName, host); manager.register(nodeName); @@ -61,9 +61,9 @@ HostMessage newHost = new HostMessage(parent.name, parent.port, "parent", "child"+num); newHost.absName = parentAbsName; newHost.remoteAbsName = nodeName; // address - ods.put(newHost.remoteAbsName, newHost); + ods.put("compressedlocal", newHost.remoteAbsName, newHost); - ods.put("nodeInfo", newHost); + ods.put("compressedlocal", "nodeInfo", newHost); new RecodeTopology(); // put own information parent @@ -71,16 +71,16 @@ newHost.absName = nodeName; newHost.remoteAbsName = parentAbsName; - ods.put(newHost.remoteAbsName, newHost); - ods.put("nodeInfo", newHost); + ods.put("compressedlocal", newHost.remoteAbsName, newHost); + ods.put("compressedlocal", "nodeInfo", newHost); new RecodeTopology(); } - ods.put(info2.key, nameTable); - ods.put(info6.key, manager); - ods.put(nodeName, ValueFactory.createNilValue()); + ods.put("compressedlocal", info2.key, nameTable); + ods.put("compressedlocal", info6.key, manager); + ods.put("compressedlocal", nodeName, ValueFactory.createNilValue()); if (comingHostCount==0) - ods.put("start", ValueFactory.createNilValue()); + ods.put("compressedlocal", "start", ValueFactory.createNilValue()); } } \ No newline at end of file
--- a/src/main/java/alice/topology/manager/IncomingHosts.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/IncomingHosts.java Mon Nov 16 18:33:23 2015 +0900 @@ -20,11 +20,11 @@ private Receiver cookie = ids.create(CommandType.TAKE); // MD5 public IncomingHosts() { - this.topology.setKey("resultParse"); - this.nodeNames.setKey("nodeNames"); - this.host.setKey("newHost"); - this.absCookieTable.setKey("absCookieTable"); - this.cookie.setKey("MD5"); + this.topology.setKey("compressedlocal", "resultParse"); + this.nodeNames.setKey("compressedlocal", "nodeNames"); + this.host.setKey("compressedlocal", "newHost"); + this.absCookieTable.setKey("compressedlocal", "absCookieTable"); + this.cookie.setKey("compressedlocal", "MD5"); } @Override @@ -41,13 +41,13 @@ String nodeName = nodeNames.poll(); // Manager connect to Node DataSegment.connect(nodeName, "", host.name, host.port); - ods.put(nodeName, "host", nodeName); + ods.put("compressed" + nodeName, "host", nodeName); String cookie = this.cookie.asString(); absCookieTable.put(cookie, nodeName); - ods.put(this.absCookieTable.key, absCookieTable); + ods.put("compressedlocal",this.absCookieTable.key, absCookieTable); - ods.put(nodeName, "cookie", cookie); + ods.put("compressed" + nodeName, "cookie", cookie); LinkedList<NodeInfo> nodes = topology.get(nodeName); for (NodeInfo nodeInfo : nodes) { @@ -56,20 +56,20 @@ newHost.absName = nodeName; newHost.remoteAbsName = nodeInfo.sourceNodeName; - ods.put("nodeInfo", newHost); - ods.put(nodeInfo.sourceNodeName, newHost); + ods.put("compressedlocal","nodeInfo", newHost); + ods.put("compressedlocal",nodeInfo.sourceNodeName, newHost); new RecodeTopology(); } if (nodeNames.isEmpty()) { // configuration finish for (String key : topology.keySet()) { - ods.put("local", key, ValueFactory.createNilValue()); + ods.put("compressedlocal", key, ValueFactory.createNilValue()); } } - ods.put(this.nodeNames.key, nodeNames); - ods.put(this.topology.key, topology); + ods.put("compressedlocal",this.nodeNames.key, nodeNames); + ods.put("compressedlocal",this.topology.key, topology); new IncomingHosts(); }
--- a/src/main/java/alice/topology/manager/RecodeTopology.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/RecodeTopology.java Mon Nov 16 18:33:23 2015 +0900 @@ -14,8 +14,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); // HashMap public RecodeTopology(){ - info.setKey("nodeInfo"); - info1.setKey("topology"); + info.setKey("compressedlocal", "nodeInfo"); + info1.setKey("compressedlocal", "topology"); } @Override @@ -39,7 +39,7 @@ // } // System.out.println(); // } - ods.update(info1.key, topology); + ods.update("compressedlocal", info1.key, topology); } }
--- a/src/main/java/alice/topology/manager/SearchHostName.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/SearchHostName.java Mon Nov 16 18:33:23 2015 +0900 @@ -18,9 +18,9 @@ private Receiver info2 = ids.create(CommandType.PEEK); // check App running public SearchHostName(){ - info.setKey("reconnectHost"); - info1.setKey("topology"); - info2.setKey("running"); + info.setKey("compressedlocal", "reconnectHost"); + info1.setKey("compressedlocal", "topology"); + info2.setKey("compressedlocal", "running"); } @Override @@ -32,18 +32,18 @@ DataSegment.remove(hostInfo.absName); DataSegment.connect(hostInfo.absName, "", hostInfo.name, hostInfo.port); - ods.put(hostInfo.absName, "host", hostInfo.absName); + ods.put("compressed" + hostInfo.absName, "host", hostInfo.absName); // put Host dataSegment on reconnect node if (topology.containsKey(hostInfo.absName)) { LinkedList<HostMessage> clist = topology.get(hostInfo.absName); - ods.put(hostInfo.absName, "dummy"); // this is bug + ods.put("compressedlocal", hostInfo.absName, "dummy"); // this is bug if (running){ - ods.put(hostInfo.absName, ValueFactory.createNilValue()); + ods.put("compressedlocal", hostInfo.absName, ValueFactory.createNilValue()); } for (HostMessage node : clist){ - ods.put("local" ,hostInfo.absName, node); - System.out.println("put data in "+ hostInfo.absName); + ods.put("compressedlocal" ,hostInfo.absName, node); + System.out.println("put data in " + hostInfo.absName); } } @@ -57,7 +57,7 @@ host.name = hostInfo.name; host.port = hostInfo.port; - ods.put(host.remoteAbsName, host); + ods.put("compressedlocal", host.remoteAbsName, host); } else { // nothing to do ? @@ -73,7 +73,7 @@ } System.out.println(); } - ods.put("topology", topology); + ods.put("compressedlocal", "topology", topology); } }
--- a/src/main/java/alice/topology/manager/StartTopologyManager.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/StartTopologyManager.java Mon Nov 16 18:33:23 2015 +0900 @@ -31,7 +31,7 @@ @Override public void run() { new CheckComingHost(); - ods.put("absCookieTable", new HashMap<String, String>()); + ods.put("compressedlocal", "absCookieTable", new HashMap<String, String>()); if (!conf.dynamic) { LinkedList<String> nodeNames = new LinkedList<String>(); @@ -82,37 +82,37 @@ // for recode topology information // cookie List - ods.put("running", false); - ods.put("resultParse", topology); - ods.put("nodeNames", nodeNames); + ods.put("compressedlocal", "running", false); + ods.put("compressedlocal", "resultParse", topology); + ods.put("compressedlocal", "nodeNames", nodeNames); new IncomingHosts(); ConfigWaiter cs3 = new ConfigWaiter(nodeNum); - cs3.done.setKey("local", "done"); + cs3.done.setKey("compresedlocal", "done"); } else { - ods.put("running", true); + ods.put("compressedlocal", "running", true); HashMap<String, HostMessage> nameTable = new HashMap<String, HostMessage>(); if (conf.type == TopologyType.Tree) { int cominghostCount = 0; ParentManager manager = new ParentManager(conf.hasChild); - ods.put("parentManager", manager); - ods.put("nameTable", nameTable); - ods.put("hostCount", cominghostCount); + ods.put("compressedlocal", "parentManager", manager); + ods.put("compressedlocal", "nameTable", nameTable); + ods.put("compressedlocal", "hostCount", cominghostCount); new ComingServiceHosts(); new ReceiveDisconnectMessage(); } } - ods.put("topology", new HashMap<String, LinkedList<HostMessage>>()); - ods.put("createdList", new LinkedList<String>()); + ods.put("compressedlocal", "topology", new HashMap<String, LinkedList<HostMessage>>()); + ods.put("compressedlocal", "createdList", new LinkedList<String>()); new CreateHash(); TopologyFinish cs2 = new TopologyFinish(); - cs2.finish.setKey("local", "finish"); + cs2.finish.setKey("compressedlocal", "finish"); } }
--- a/src/main/java/alice/topology/manager/keeparive/CreateTask.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/CreateTask.java Mon Nov 16 18:33:23 2015 +0900 @@ -12,8 +12,8 @@ public static int INTERVAL = 5; public CreateTask(){ - info.setKey("_CLIST"); - info1.setKey("_SCHEDULER"); + info.setKey("compressedlocal", "_CLIST"); + info1.setKey("compressedlocal", "_SCHEDULER"); } @Override @@ -29,7 +29,7 @@ list.addTask(task); i +=INTERVAL; } - ods.update(info1.key, list); + ods.update("compressedlocal", info1.key, list); } }
--- a/src/main/java/alice/topology/manager/keeparive/RemoveTask.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/RemoveTask.java Mon Nov 16 18:33:23 2015 +0900 @@ -9,8 +9,8 @@ private Receiver info2 = ids.create(CommandType.TAKE); // remove task public RemoveTask(){ - info1.setKey("_SCHEDULER"); - info2.setKey("_REMOVETASK"); + info1.setKey("compressedlocal", "_SCHEDULER"); + info2.setKey("compressedlocal", "_REMOVETASK"); } @Override @@ -22,9 +22,9 @@ // case: remove task is still in the waiting queue. boolean removeFlag = list.deleteTask(task); if (!removeFlag){ - ods.put("_REMOVETASK", task); + ods.put("compressedlocal", "_REMOVETASK", task); } } - ods.update("_SCHEDULER", list); + ods.update("compressedlocal", "_SCHEDULER", list); } }
--- a/src/main/java/alice/topology/manager/keeparive/RespondPing.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/RespondPing.java Mon Nov 16 18:33:23 2015 +0900 @@ -9,7 +9,7 @@ // private long pingedTime = System.currentTimeMillis(); public RespondPing(String key) { - respond.setKey(key); + respond.setKey("compressedlocal", key); } @Override @@ -24,7 +24,7 @@ task.setInfo(d.from, null, 0); if (!exec.compareAndSkip(task)){ // case: remove task is still in the waiting queue. - ods.put("_REMOVETASK",task); + ods.put("compressedlocal", "_REMOVETASK",task); new RemoveTask(); } }
--- a/src/main/java/alice/topology/manager/keeparive/StartKeepAlive.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/StartKeepAlive.java Mon Nov 16 18:33:23 2015 +0900 @@ -6,7 +6,7 @@ @Override public void run() { - ods.put("_SCHEDULER", new ListManager()); + ods.put("compressedlocal", "_SCHEDULER", new ListManager()); TaskExecuter.getInstance().setKey(); }
--- a/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Mon Nov 16 18:33:23 2015 +0900 @@ -21,7 +21,7 @@ public void setKey() { ids.init(); - info.setKey("_SCHEDULER"); + info.setKey("compressedlocal", "_SCHEDULER"); } @Override @@ -31,12 +31,12 @@ TaskInfo task = new TaskInfo(TaskType.CREATE); task.setSleepTime(3000); list.addTask(task); - ods.update("_SCHEDULER", list); + ods.update("compressedlocal", "_SCHEDULER", list); remainingTime = 0; } else { nowTask = list.getTaskList().poll(); if (nowTask.getType() !=TaskType.PING) - ods.update("_SCHEDULER", list); + ods.update("compressedlocal", "_SCHEDULER", list); if (skipFlag) { skipFlag = false; nowTask.setSleepTime(remainingTime + nowTask.getSleepTime()); @@ -60,7 +60,7 @@ TaskInfo task = new TaskInfo(TaskType.CLOSE); task.setInfo(nowTask.getManagerKey(), 10 * 1000); list.addTask(task); - ods.update("_SCHEDULER", list); + ods.update("compressedlocal", "_SCHEDULER", list); new RespondPing(nowTask.getReturnKey()); } else if (nowTask.getType() == TaskType.CLOSE) { // no response from the Remote DataSegment. So close this connection.
--- a/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Mon Nov 16 18:33:23 2015 +0900 @@ -14,10 +14,10 @@ private Receiver info3 = ids.create(CommandType.TAKE); public CloseRemoteDataSegment() { - info.setKey("_CLOSEMESSEAGE"); - info1.setKey("_CLOSEREADY"); - info2.setKey("_CLOSEREADY"); - info3.setKey("_SCHEDULER"); + info.setKey("compressedlocal", "_CLOSEMESSEAGE"); + info1.setKey("compressedlocal", "_CLOSEREADY"); + info2.setKey("compressedlocal", "_CLOSEREADY"); + info3.setKey("compressedlocal", "_SCHEDULER"); } @Override @@ -30,7 +30,7 @@ manager.deleteAll(managerKey); } - ods.update(info3.key, manager); + ods.update("compressedlocal", info3.key, manager); new ReceiveCloseMessage(CommandType.PEEK); }
--- a/src/main/java/alice/topology/node/ClosedEventManager.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/ClosedEventManager.java Mon Nov 16 18:33:23 2015 +0900 @@ -12,7 +12,7 @@ private static ClosedEventManager instance = new ClosedEventManager(); private <T> ClosedEventManager() { - ods.put("_DEVENTLIST", new ArrayList<Class<T>>()); + ods.put("compressedlocal", "_DEVENTLIST", new ArrayList<Class<T>>()); } public static ClosedEventManager getInstance() { @@ -21,7 +21,7 @@ public void setKey() { ids.init(); - info.setKey("_DISCONNECT"); + info.setKey("compressedlocal", "_DISCONNECT"); } @SuppressWarnings("rawtypes") @@ -33,7 +33,7 @@ @SuppressWarnings("rawtypes") public synchronized <T> void register(Class<T> clazz) { - ods.put("_REGISTERDEVENT", clazz); + ods.put("compressedlocal", "_REGISTERDEVENT", clazz); new RegisterEvent(); } }
--- a/src/main/java/alice/topology/node/ConfigurationFinish.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/ConfigurationFinish.java Mon Nov 16 18:33:23 2015 +0900 @@ -22,9 +22,9 @@ int rcount = reverseCount.asInteger(); int ncount = configNodeNum.asInteger(); if (rcount == ncount) { - ods.put("manager", "done", ValueFactory.createNilValue()); + ods.put("compressedmanager", "done", ValueFactory.createNilValue()); Start cs = new Start(startCS); - cs.done.setKey("manager", "start"); + cs.done.setKey("compressedmanager", "start"); new StartKeepAlive().execute(); new ReceiveCloseMessage(CommandType.PEEK); @@ -34,8 +34,8 @@ } ConfigurationFinish cs3 = new ConfigurationFinish(startCS); - cs3.reverseCount.setKey("local", "reverseCount", this.reverseCount.index); - cs3.configNodeNum.setKey("local", "configNodeNum"); + cs3.reverseCount.setKey("compressedlocal", "reverseCount", this.reverseCount.index); + cs3.configNodeNum.setKey("compressedlocal", "configNodeNum"); } }
--- a/src/main/java/alice/topology/node/CreateConnectionList.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/CreateConnectionList.java Mon Nov 16 18:33:23 2015 +0900 @@ -11,8 +11,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); // connection names public CreateConnectionList() { - info.setKey("_CLIST"); - info1.setKey("cMember"); + info.setKey("compressedlocal", "_CLIST"); + info1.setKey("compressedlocal", "cMember"); } @Override @@ -21,7 +21,7 @@ List<String> cList = info.asClass(List.class); String name = info1.asString(); cList.add(name); - ods.update(info.key, cList); + ods.update("compressedlocal", info.key, cList); }
--- a/src/main/java/alice/topology/node/DeleteConnection.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/DeleteConnection.java Mon Nov 16 18:33:23 2015 +0900 @@ -14,8 +14,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); public DeleteConnection() { - info.setKey("_CLIST"); - info1.setKey("_SCHEDULER"); + info.setKey("compressedlocal", "_CLIST"); + info1.setKey("compressedlocal", "_SCHEDULER"); } @Override @@ -32,8 +32,8 @@ } ListManager manager = info1.asClass(ListManager.class); manager.deleteAll(name); - ods.update(info.key, list); - ods.update(info1.key, manager); + ods.update("compressedlocal", info.key, list); + ods.update("compressedlocal", info1.key, manager); } }
--- a/src/main/java/alice/topology/node/ExecuteEvent.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/ExecuteEvent.java Mon Nov 16 18:33:23 2015 +0900 @@ -13,8 +13,8 @@ public Receiver info1 = ids.create(CommandType.TAKE); public ExecuteEvent() { - info.setKey("_DEVENTLIST"); - info1.setKey("_DISCONNECT"); + info.setKey("compressedlocal", "_DEVENTLIST"); + info1.setKey("compressedlocal", "_DISCONNECT"); } @SuppressWarnings("unchecked") @@ -40,7 +40,7 @@ } catch (SecurityException e) { e.printStackTrace(); } - ods.put(info.key, info.getReceiveData()); + ods.put("compressedlocal", info.key, info.getReceiveData()); } }
--- a/src/main/java/alice/topology/node/IncomingAbstractHostName.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/IncomingAbstractHostName.java Mon Nov 16 18:33:23 2015 +0900 @@ -12,7 +12,7 @@ public void run() { String absName = this.absName.asString(); IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, 0); - cs.hostInfo.setKey("manager", absName); + cs.hostInfo.setKey("compressedmanager", absName); } }
--- a/src/main/java/alice/topology/node/IncomingConnectionInfo.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/IncomingConnectionInfo.java Mon Nov 16 18:33:23 2015 +0900 @@ -21,25 +21,25 @@ @Override public void run() { if (this.hostInfo.getVal() == null) { - ods.put("local", "configNodeNum", count); + ods.put("compressedlocal", "configNodeNum", count); } else { HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); if (DataSegment.contains(hostInfo.connectionName)) { // need to wait remove by DeleteConnection - ods.put("manager", absName, hostInfo); + ods.put("compressedmanager", absName, hostInfo); } else { DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); - ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); + ods.put("compressed" + hostInfo.connectionName, "reverseKey", hostInfo.reverseName); count++; - ods.put("cMember", hostInfo.connectionName); + ods.put("compressedlocal", "cMember", hostInfo.connectionName); new CreateConnectionList(); } } IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, count); - cs.hostInfo.setKey("manager", absName); + cs.hostInfo.setKey("compressedmanager", absName); } }
--- a/src/main/java/alice/topology/node/IncomingReverseKey.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/IncomingReverseKey.java Mon Nov 16 18:33:23 2015 +0900 @@ -18,11 +18,11 @@ int reverseCount = this.reverseCount.asInteger(); reverseCount++; - ods.update("local", "reverseCount", reverseCount); + ods.update("compressedlocal", "reverseCount", reverseCount); IncomingReverseKey cs = new IncomingReverseKey(); - cs.reverseKey.setKey("local", "reverseKey"); - cs.reverseCount.setKey("local", "reverseCount"); + cs.reverseKey.setKey("compressedlocal", "reverseKey"); + cs.reverseCount.setKey("compressedlocal", "reverseCount"); } }
--- a/src/main/java/alice/topology/node/PrepareToAddList.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/PrepareToAddList.java Mon Nov 16 18:33:23 2015 +0900 @@ -10,14 +10,14 @@ public Receiver info2 = ids.create(CommandType.TAKE); public PrepareToAddList(String key) { - info.setKey("connection"+key); - info2.setKey("connection"+key); + info.setKey("compressedlocal", "connection"+key); + info2.setKey("compressedlocal", "connection"+key); } @Override public void run() { String connectionName = info.asString(); - ods.put("cMember", connectionName); + ods.put("compressedlocal", "cMember", connectionName); new CreateConnectionList(); }
--- a/src/main/java/alice/topology/node/PrepareToClose.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/PrepareToClose.java Mon Nov 16 18:33:23 2015 +0900 @@ -14,8 +14,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); public PrepareToClose() { - info.setKey("_CLOSEMESSEAGE"); - info1.setKey("_CLIST"); + info.setKey("compressedlocal", "_CLOSEMESSEAGE"); + info1.setKey("compressedlocal", "_CLIST"); } @SuppressWarnings("unchecked") @@ -28,15 +28,15 @@ DataSegmentManager manager = DataSegment.get(managerKey); manager.setSendError(false); - ods.put(managerKey, "_CLOSEREADY", managerKey); - ods.put("_CLOSEREADY", managerKey); + ods.put("compressed" + managerKey, "_CLOSEREADY", managerKey); + ods.put("compressedlocal", "_CLOSEREADY", managerKey); new CloseRemoteDataSegment(); } else { // lost node is this node's parent, so already removed new ReceiveCloseMessage(CommandType.TAKE); } - ods.put(info1.key, list); + ods.put("compressedlocal", info1.key, list); }
--- a/src/main/java/alice/topology/node/ReceiveCloseMessage.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/ReceiveCloseMessage.java Mon Nov 16 18:33:23 2015 +0900 @@ -10,7 +10,7 @@ public ReceiveCloseMessage(CommandType type) { info = ids.create(type); - info.setKey("_CLOSEMESSEAGE"); + info.setKey("compressedlocal", "_CLOSEMESSEAGE"); } @Override
--- a/src/main/java/alice/topology/node/RegisterEvent.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/RegisterEvent.java Mon Nov 16 18:33:23 2015 +0900 @@ -12,8 +12,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); // event list public RegisterEvent() { - info.setKey("_REGISTERDEVENT"); - info1.setKey("_DEVENTLIST"); + info.setKey("compressedlocal", "_REGISTERDEVENT"); + info1.setKey("compressedlocal", "_DEVENTLIST"); } @SuppressWarnings("unchecked") @@ -28,7 +28,7 @@ eventList.add(clazz); } - ods.put(info1.key, eventList); + ods.put("compressedlocal", info1.key, eventList); } }
--- a/src/main/java/alice/topology/node/SaveCookie.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/SaveCookie.java Mon Nov 16 18:33:23 2015 +0900 @@ -9,7 +9,7 @@ private Receiver info = ids.create(CommandType.PEEK); public SaveCookie(){ - info.setKey("cookie"); + info.setKey("compressedlocal", "cookie"); } @Override
--- a/src/main/java/alice/topology/node/StartTopologyNode.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/StartTopologyNode.java Mon Nov 16 18:33:23 2015 +0900 @@ -31,22 +31,22 @@ HostMessage host = new HostMessage(localHostName, conf.localPort); host.cookie = conf.cookie; - ods.put("manager", "host", host); + ods.put("compressedmanager", "host", host); - ods.put("_CLIST", new ArrayList<String>()); + ods.put("compressedlocal", "_CLIST", new ArrayList<String>()); IncomingAbstractHostName cs = new IncomingAbstractHostName(); cs.absName.setKey("local", "host"); IncomingReverseKey cs2 = new IncomingReverseKey(); - cs2.reverseKey.setKey("local", "reverseKey"); + cs2.reverseKey.setKey("compressedlocal", "reverseKey"); cs2.reverseCount.setKey("local", "reverseCount"); - ods.put("local", "reverseCount", 0); + ods.put("compressedlocal", "reverseCount", 0); ConfigurationFinish cs3 = new ConfigurationFinish(startCS); - cs3.reverseCount.setKey("local", "reverseCount"); - cs3.configNodeNum.setKey("local", "configNodeNum"); + cs3.reverseCount.setKey("compressedlocal", "reverseCount"); + cs3.configNodeNum.setKey("compressedlocal", "configNodeNum"); }
--- a/src/main/java/alice/topology/node/TopologyNodeConfig.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/main/java/alice/topology/node/TopologyNodeConfig.java Mon Nov 16 18:33:23 2015 +0900 @@ -49,8 +49,10 @@ for (Class clazz : eventList) try { clazz.newInstance(); - } catch (InstantiationException | IllegalAccessException e) { + } catch (InstantiationException e) { e.printStackTrace(); + } catch (IllegalAccessException e){ + } }
--- a/src/test/java/alice/daemon/MulticastStartCodeSegment.java Fri Jun 19 14:06:10 2015 +0900 +++ b/src/test/java/alice/daemon/MulticastStartCodeSegment.java Mon Nov 16 18:33:23 2015 +0900 @@ -17,20 +17,20 @@ if (MulticastTest.type == SocketType.Both) { // in this case "multicast" key mean local. MulticastIncrement cs = new MulticastIncrement(); - cs.num.setKey("multicast","num"); + cs.num.setKey("compressedmulticast","num"); - ods.put("multicast", "num", 0); + ods.put("compressedlmulticast", "num", 0); } else if (MulticastTest.type == SocketType.Receiver){ DataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Sender); ReceiveInteger cs = new ReceiveInteger(); - cs.num.setKey("num"); + cs.num.setKey("compressedlocal","num"); } else if (MulticastTest.type == SocketType.Sender){ DataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Receiver); ReceiveString cs = new ReceiveString(); - cs.str.setKey("str"); + cs.str.setKey("compressedlocal","str"); for (int i=0;i < 11; i++) - ods.put("multicast", "num", i); + ods.put("compressedmulticast", "num", i); } }