Mercurial > hg > Database > Alice
changeset 641:646f705e65b1
setkey on remote
line wrap: on
line diff
--- a/Alice.iml Sat Dec 30 20:33:06 2017 +0900 +++ b/Alice.iml Sun Dec 31 01:08:52 2017 +0900 @@ -1,362 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <module external.linked.project.id="Alice" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="cr.ie.u_ryukyu.ac.jp" external.system.module.version="1.1" type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" inherit-compiler-output="false"> - <output url="file://$MODULE_DIR$/build/classes/main" /> - <output-test url="file://$MODULE_DIR$/build/classes/test" /> + <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> - <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> - <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> <excludeFolder url="file://$MODULE_DIR$/build" /> + <excludeFolder url="file://$MODULE_DIR$/out" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="module-library"> - <library name="Gradle: com.alexmerz.graphviz"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/com.alexmerz.graphviz.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: commons-lang3-3.3.2"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-lang3-3.3.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: j3dcore"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/j3dcore.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: j3dutils"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/j3dutils.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: javassist"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/javassist.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: jimColModelImporterJFX"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jimColModelImporterJFX.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: jimObjModelImporterJFX"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jimObjModelImporterJFX.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: log4j-1.2.16"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.16.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: msgpack-0.6.13-SNAPSHOT-sources"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/msgpack-0.6.13-SNAPSHOT-sources.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: msgpack-0.6.13-SNAPSHOT"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/msgpack-0.6.13-SNAPSHOT.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: slf4j-api-1.6.1-sources"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/slf4j-api-1.6.1-sources.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: slf4j-api-1.6.1"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/slf4j-api-1.6.1.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: slf4j-log4j12-1.6.1-sources"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/slf4j-log4j12-1.6.1-sources.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: slf4j-log4j12-1.6.1"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/slf4j-log4j12-1.6.1.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: vecmath"> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/vecmath.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: com.massisframework.j3d:java3d-core:1.6.0"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.massisframework.j3d/java3d-core/1.6.0/c8a1cba5eede24ab84f0d6f56f6a31ed53fcc6d3/java3d-core-1.6.0.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.massisframework.j3d/java3d-core/1.6.0/58b98bae3ad674b95a3e71567578276afaa46f7d/java3d-core-1.6.0-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: com.massisframework.j3d:vecmath:1.6.0.1"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.massisframework.j3d/vecmath/1.6.0.1/84e7e3805868372eb0c4a28dda21232b49f354e9/vecmath-1.6.0.1.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.massisframework.j3d/vecmath/1.6.0.1/1fe6123b11f21fe1deb95076c52f2adc9512fefe/vecmath-1.6.0.1-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.msgpack:msgpack:0.6.12"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.msgpack/msgpack/0.6.12/6a0c88fe022993c490011c3dce7127b29f9a9b3b/msgpack-0.6.12.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.msgpack/msgpack/0.6.12/d884987a52e47f566c6356ce948edbf546616072/msgpack-0.6.12-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/99e0f64bb8882f054825ae4a8a527a17b544a0b5/jogl-all-2.3.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-android-aarch64"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/166147f43cf7419c4d858cd31f4b5922d6d10c81/jogl-all-2.3.2-natives-android-aarch64.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-android-armv6"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/ab2c18b8a1327255cc354c19c720807d262baa75/jogl-all-2.3.2-natives-android-armv6.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-linux-amd64"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/ffd1c6bd5f6fb088df6cad25e25721eb55ad2228/jogl-all-2.3.2-natives-linux-amd64.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-linux-armv6"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/6d14f46336be9e2dc5f85d5df17490cee5d09a90/jogl-all-2.3.2-natives-linux-armv6.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-linux-armv6hf"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/2c434c560dbd821b0ed569e44d3d441727491dac/jogl-all-2.3.2-natives-linux-armv6hf.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-linux-i586"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/59b7a336c0ee54161e33662d2ca8ac9d8f6c476d/jogl-all-2.3.2-natives-linux-i586.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-macosx-universal"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/2da2215dbe1091c54cb83cf2484f8a54a4d0cf7a/jogl-all-2.3.2-natives-macosx-universal.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-solaris-amd64"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/bde11ff064181af9c307180d8f3f1744b7bdc11d/jogl-all-2.3.2-natives-solaris-amd64.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-solaris-i586"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/94d1ed501fe53b7f75eab0f712f39802390d0f5b/jogl-all-2.3.2-natives-solaris-i586.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-windows-amd64"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/becd519b1f741176561d93645abd90971ca0dca0/jogl-all-2.3.2-natives-windows-amd64.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all:2.3.2:natives-windows-i586"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/5db8db5eca6b4445db6cd14f68938736630ae976/jogl-all-2.3.2-natives-windows-i586.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.jogl:jogl-all-main:2.3.2"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all-main/2.3.2/6a86a9ce357c085e3052efcf639447f9957b82b8/jogl-all-main-2.3.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all-main/2.3.2/6a86a9ce357c085e3052efcf639447f9957b82b8/jogl-all-main-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.jogamp.gluegen:gluegen:2.3.2"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.gluegen/gluegen/2.3.2/4380476a44397a70b2e4dadd9336cf914f724fac/gluegen-2.3.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jogamp.gluegen/gluegen/2.3.2/1e6c7836f978e8c96734b12600f800dff20c628b/gluegen-2.3.2-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: com.googlecode.json-simple:json-simple:1.1.1"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.googlecode.json-simple/json-simple/1.1.1/c9ad4a0850ab676c5c64461a05ca524cdfff59f1/json-simple-1.1.1.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.googlecode.json-simple/json-simple/1.1.1/15bba08e3a239d54b68209c001f9c911559d2fed/json-simple-1.1.1-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="Gradle: org.javassist:javassist:3.18.1-GA"> - <CLASSES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.javassist/javassist/3.18.1-GA/d9a09f7732226af26bf99f19e2cffe0ae219db5b/javassist-3.18.1-GA.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.javassist/javassist/3.18.1-GA/d8d089f3a8845cce22d3006e02ab1403dd73b5b6/javassist-3.18.1-GA-sources.jar!/" /> - </SOURCES> - </library> - </orderEntry> </component> </module> \ No newline at end of file
--- a/src/main/java/alice/daemon/AliceDaemon.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/daemon/AliceDaemon.java Sun Dec 31 01:08:52 2017 +0900 @@ -7,7 +7,7 @@ import java.net.ServerSocket; import java.nio.channels.ServerSocketChannel; -//import org.apache.log4j.Logger; +import org.apache.log4j.Logger; //import org.apache.log4j.PatternLayout; //import org.apache.log4j.WriterAppender; @@ -15,7 +15,7 @@ private Config conf; private AcceptThread acceptThread; - //private Logger log = Logger.getLogger(AliceDaemon.class); + private Logger log = Logger.getLogger(AliceDaemon.class); public AliceDaemon(Config conf) { this.conf = conf; @@ -50,7 +50,7 @@ // listen on any address ipv4/ipv6 InetSocketAddress a = new InetSocketAddress("::", conf.localPort); - System.out.println("AliceDaemon.listen: bind to " + a); + log.info("AliceDaemon.listen: bind to " + a); ss.bind(a); acceptThread = new AcceptThread(ss, "ACCEPT" + conf.localPort); acceptThread.start();
--- a/src/main/java/alice/daemon/Connection.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/daemon/Connection.java Sun Dec 31 01:08:52 2017 +0900 @@ -56,7 +56,7 @@ } public void putConnectionInfo() { - if (name!=null){ + if (name!=null) { ConnectionInfo c = new ConnectionInfo(name, socket); ReceiveData rData = new ReceiveData(c); DataSegment.getLocal().put("_DISCONNECT", rData, false);
--- a/src/main/java/alice/daemon/IncomingTcpConnection.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/daemon/IncomingTcpConnection.java Sun Dec 31 01:08:52 2017 +0900 @@ -56,11 +56,12 @@ ReceiveData rData = null; CommandMessage msg = unpacker.read(CommandMessage.class);///read header CommandType type = CommandType.getCommandTypeFromId(msg.type); - int dataSize = unpacker.readInt(); - byte[] data = new byte[dataSize]; + switch (type) { case UPDATE: case PUT: + int dataSize = unpacker.readInt(); + byte[] data = new byte[dataSize]; connection.socket.getInputStream().read(data); rData = new ReceiveData(data, msg.compressed, msg.dataSize); @@ -108,10 +109,12 @@ lmanager.getDataSegmentKey(msg.key).runCommand(cmd);//ToDo:fix break; case REPLY: + int dataSize1 = unpacker.readInt(); + byte[] data1 = new byte[dataSize1]; cmd = manager.getAndRemoveCmd(msg.seq); - connection.socket.getInputStream().read(data); - rData = new ReceiveData(data, msg.compressed, msg.dataSize); + connection.socket.getInputStream().read(data1); + rData = new ReceiveData(data1, msg.compressed, msg.dataSize); Command rCmd = new Command(type, null, null, rData, msg.index, msg.seq, null, null, ""); cmd.setCompressFlag(msg.compressed);
--- a/src/main/java/alice/daemon/OutboundTcpConnection.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/daemon/OutboundTcpConnection.java Sun Dec 31 01:08:52 2017 +0900 @@ -27,7 +27,7 @@ default: break; } - connection.write(cmd);//ここでconvert()がよばれてる + connection.write(cmd); //ここでconvert()がよばれてる } catch (InterruptedException e) { e.printStackTrace(); }
--- a/src/main/java/alice/datasegment/DataSegment.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/datasegment/DataSegment.java Sun Dec 31 01:08:52 2017 +0900 @@ -13,6 +13,7 @@ private CompressedLocalDataSegmentManager compressedLocal = new CompressedLocalDataSegmentManager(local);//追加 private ConcurrentHashMap<String, DataSegmentManager> dataSegmentManagers = new ConcurrentHashMap<String, DataSegmentManager>(); //TODO Over Head private ConcurrentHashMap<String, IncomingTcpConnection> acceptHash = new ConcurrentHashMap<String, IncomingTcpConnection>(); + private static Logger log = Logger.getLogger(DataSegment.class); private DataSegment() { dataSegmentManagers.put("local", local); @@ -50,7 +51,7 @@ register(connectionKey, manager); register("compressed" + connectionKey, compressedManager); - System.out.println("connected to " + hostName + " DSMkey: " + connectionKey); + log.info("connected to " + hostName + " DSMkey: " + connectionKey); return manager; }
--- a/src/main/java/alice/datasegment/DataSegmentKey.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/datasegment/DataSegmentKey.java Sun Dec 31 01:08:52 2017 +0900 @@ -89,7 +89,7 @@ if (cFlag && !data.rData.compressed()){ try { data.rData.zip(); - System.out.println("in reply zip"); + // System.out.println("in reply zip"); } catch (IOException e) { e.printStackTrace(); }
--- a/src/main/java/alice/test/codesegment/remote/RemoteIncrement.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/test/codesegment/remote/RemoteIncrement.java Sun Dec 31 01:08:52 2017 +0900 @@ -19,12 +19,14 @@ } int num = this.num.asInteger(); System.out.println("[CodeSegment" + z + "] " + num++); - if (num == 5) System.exit(0); + if (num == 10) System.exit(0); RemoteIncrement cs = new RemoteIncrement(); - ods.put("compressedremote", "num", num); - ods.put("remote", "num", num); + if ( num % 2 == 0 ) + ods.put("compressedremote", "num", num); + else + ods.put("remote", "num", num); cs.num.setKey("compressedlocal", "num"); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/test/codesegment/remote/RemoteIncrement1.java Sun Dec 31 01:08:52 2017 +0900 @@ -0,0 +1,29 @@ +package alice.test.codesegment.remote; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class RemoteIncrement1 extends CodeSegment { + + public Receiver num = ids.create(CommandType.TAKE); + + RemoteIncrement1() { + num.setKey("remote","num2"); + } + + /** + * Increment DataSegment value up to 10 + */ + @Override + public void run() { + + int num = this.num.asInteger(); + System.out.println("remote " + num++); + if (num == 5) return ; + + new RemoteIncrement1(); + ods.put("remote", "num2", num); + } + +} \ No newline at end of file
--- a/src/main/java/alice/test/codesegment/remote/RemoteStartCodeSegment.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/test/codesegment/remote/RemoteStartCodeSegment.java Sun Dec 31 01:08:52 2017 +0900 @@ -7,9 +7,9 @@ @Override public void run() { RemoteIncrement cs = new RemoteIncrement(); - ods.put("compressedremote", "num", 0); - + ods.put("num2",0); + new RemoteIncrement1(); cs.num.setKey("compressedlocal", "num"); } } \ No newline at end of file
--- a/src/main/java/alice/test/codesegment/remote/TestRemoteAlice.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/test/codesegment/remote/TestRemoteAlice.java Sun Dec 31 01:08:52 2017 +0900 @@ -8,7 +8,7 @@ public static void main(String[] args) { TestRemoteConfig conf = new TestRemoteConfig(args);//トポロジー設定をコマンドライン引数からとって設定? - new AliceDaemon(conf).listen();//構成開始?TopMはない + new AliceDaemon(conf).listen(); DataSegment.connect(conf.key, "", conf.hostname, conf.connectPort); new RemoteStartCodeSegment().execute(); }
--- a/src/main/java/alice/topology/manager/IncomingHosts.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/topology/manager/IncomingHosts.java Sun Dec 31 01:08:52 2017 +0900 @@ -3,6 +3,7 @@ import java.util.HashMap; import java.util.LinkedList; +import org.apache.log4j.Logger; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; @@ -18,6 +19,7 @@ private Receiver host = ids.create(CommandType.TAKE); // new coming host info private Receiver absCookieTable = ids.create(CommandType.TAKE); // cookie, AbsName HashMap private Receiver cookie = ids.create(CommandType.TAKE); // MD5 + private Logger log = Logger.getLogger(IncomingHosts.class); public IncomingHosts() { this.topology.setKey("resultParse"); @@ -48,6 +50,7 @@ ods.put(this.absCookieTable.key, absCookieTable); ods.put(nodeName, "cookie", cookie); + log.info( "toplology manager connected from " + nodeName); LinkedList<NodeInfo> nodes = topology.get(nodeName); for (NodeInfo nodeInfo : nodes) {
--- a/src/main/java/alice/topology/node/IncomingConnectionInfo.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/topology/node/IncomingConnectionInfo.java Sun Dec 31 01:08:52 2017 +0900 @@ -5,25 +5,27 @@ import alice.datasegment.DataSegment; import alice.datasegment.Receiver; import alice.topology.HostMessage; +import org.apache.log4j.Logger; public class IncomingConnectionInfo extends CodeSegment { public Receiver hostInfo = ids.create(CommandType.TAKE); private String absName; private int count; + private Logger log = Logger.getLogger(IncomingConnectionInfo.class); public IncomingConnectionInfo(String absName, int count) { this.absName = absName; this.count = count; } - @Override public void run() { if (this.hostInfo.getVal() == null) { ods.put("local", "configNodeNum", count); } else { HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); + log.info("topology node " + absName + " will connect to " + hostInfo.name ); if (DataSegment.contains(hostInfo.connectionName)) { // need to wait remove by DeleteConnection ods.put("manager", absName, hostInfo);
--- a/src/main/java/alice/topology/node/SaveCookie.java Sat Dec 30 20:33:06 2017 +0900 +++ b/src/main/java/alice/topology/node/SaveCookie.java Sun Dec 31 01:08:52 2017 +0900 @@ -3,10 +3,13 @@ import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; +import org.apache.log4j.Logger; + public class SaveCookie extends CodeSegment{ private Receiver info = ids.create(CommandType.PEEK); + private Logger logger = Logger.getLogger(SaveCookie.class); public SaveCookie(){ info.setKey("cookie"); @@ -14,8 +17,7 @@ @Override public void run() { - System.out.println("SaveCookie:" + info.asString()); - + logger.info("SaveCookie:" + info.asString()); }