Mercurial > hg > Database > Alice
changeset 647:e321c5ec9b58
fix toplogy manager; ring worked
line wrap: on
line diff
--- a/Alice.iml Sun Dec 31 12:06:45 2017 +0900 +++ b/Alice.iml Sun Dec 31 19:32:27 2017 +0900 @@ -1,13 +1,363 @@ <?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="true"> + <component name="NewModuleRootManager" inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/build/classes/main" /> + <output-test url="file://$MODULE_DIR$/build/classes/test" /> <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.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> + <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> </component> </module> \ No newline at end of file
--- a/src/main/java/alice/codesegment/CodeSegment.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/codesegment/CodeSegment.java Sun Dec 31 19:32:27 2017 +0900 @@ -25,32 +25,32 @@ private ArrayList<MetaReceiver> receivers = new ArrayList<MetaReceiver>();//all Receivers private Field[] fields; - public CodeSegment(){ + public CodeSegment() { createReceiver(); setKey(); } - public void createReceiver(){ + public void createReceiver() { this.fields = this.getClass().getDeclaredFields(); for (Field field : fields) { - if (field.isAnnotationPresent(Take.class)){ + if (field.isAnnotationPresent(Take.class)) { receivers.add(new MetaReceiver(field.getType(), ids.create(CommandType.TAKE))); } - else if (field.isAnnotationPresent(Peek.class)){ + else if (field.isAnnotationPresent(Peek.class)) { receivers.add(new MetaReceiver(field.getType(), ids.create(CommandType.PEEK))); } } } - public void setKey(){ + public void setKey() { int i = 0; for (Field field : fields) { - if (field.isAnnotationPresent(Take.class)){ + if (field.isAnnotationPresent(Take.class)) { Take ano = field.getAnnotation(Take.class); receivers.get(i).getReceiver().setKey(ano.value()); i++; } - else if (field.isAnnotationPresent(Peek.class)){ + else if (field.isAnnotationPresent(Peek.class)) { Peek ano = field.getAnnotation(Peek.class); receivers.get(i).getReceiver().setKey(ano.value()); i++; @@ -58,7 +58,7 @@ } } - public void setValue(){ + public void setValue() { int i = 0; for (Field field : fields){ if (field.isAnnotationPresent(Take.class) || field.isAnnotationPresent(Peek.class)) {
--- a/src/main/java/alice/test/codesegment/remote/RemoteIncrement.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/test/codesegment/remote/RemoteIncrement.java Sun Dec 31 19:32:27 2017 +0900 @@ -3,10 +3,17 @@ import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; +import org.msgpack.type.ValueFactory; public class RemoteIncrement extends CodeSegment { public Receiver num = ids.create(CommandType.TAKE);//true でCompressedDSMからtake + public Receiver nullValue = ids.create(CommandType.TAKE);//true でCompressedDSMからtake + + RemoteIncrement() { + num.setKey("compressedlocal", "num"); + nullValue.setKey("null-value"); + } /** * Increment DataSegment value up to 10 @@ -18,6 +25,11 @@ z = "zMP"; } int num = this.num.asInteger(); + if ( nullValue.getVal() == null ) { + System.out.println("get null value"); + } + ods.put("null-value", ValueFactory.createNilValue()); + System.out.println("[CodeSegment" + z + "] " + num++); if (num == 10) System.exit(0);
--- a/src/main/java/alice/test/codesegment/remote/RemoteIncrement1.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/test/codesegment/remote/RemoteIncrement1.java Sun Dec 31 19:32:27 2017 +0900 @@ -3,13 +3,16 @@ import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; +import org.msgpack.type.ValueFactory; public class RemoteIncrement1 extends CodeSegment { public Receiver num = ids.create(CommandType.TAKE); + public Receiver nullValue = ids.create(CommandType.TAKE); RemoteIncrement1() { num.setKey("remote","num2"); + nullValue.setKey("remote","remote-null-value"); } /** @@ -21,6 +24,11 @@ int num = this.num.asInteger(); System.out.println("remote " + num++); if (num == 5) return ; + if ( nullValue.getVal() == null ) { + System.out.println("get remote null value"); + } + + ods.put("remote","remote-null-value", ValueFactory.createNilValue()); new RemoteIncrement1(); ods.put("remote", "num2", num);
--- a/src/main/java/alice/test/codesegment/remote/RemoteStartCodeSegment.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/test/codesegment/remote/RemoteStartCodeSegment.java Sun Dec 31 19:32:27 2017 +0900 @@ -1,6 +1,7 @@ package alice.test.codesegment.remote; import alice.codesegment.CodeSegment; +import org.msgpack.type.ValueFactory; public class RemoteStartCodeSegment extends CodeSegment { @@ -9,7 +10,10 @@ RemoteIncrement cs = new RemoteIncrement(); ods.put("compressedremote", "num", 0); ods.put("num2",0); + + ods.put("remote","null-value", ValueFactory.createNilValue()); + ods.put("remote-null-value", ValueFactory.createNilValue()); + new RemoteIncrement1(); - cs.num.setKey("compressedlocal", "num"); } } \ No newline at end of file
--- a/src/main/java/alice/test/topology/localTestTopology/LocalTestTopology.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/test/topology/localTestTopology/LocalTestTopology.java Sun Dec 31 19:32:27 2017 +0900 @@ -26,8 +26,8 @@ for (LocalTestTopologyConfig conf: configs ) { new AliceDaemon(conf).listen(); - DataSegment.connect(conf.key,conf.key,"localhost",conf.localPort); - String[] csarg = {"-port ", Integer.toString(topologyManagerConfig.localPort), "-host","localhost","-localKey",conf.key }; + DataSegment.connect(conf.key,conf.key,"localhost",conf.connectPort); + String[] csarg = {"-p", Integer.toString(conf.localPort), "-host","localhost","-localKey",conf.key }; TopologyNodeConfig cs = new TopologyNodeConfig(csarg); cs.setLocalKey(conf.key); cs.setManagerKey("manager");
--- a/src/main/java/alice/test/topology/localTestTopology/LocalTestTopologyConfig.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/test/topology/localTestTopology/LocalTestTopologyConfig.java Sun Dec 31 19:32:27 2017 +0900 @@ -10,9 +10,9 @@ public LocalTestTopologyConfig(String[] args,int port, String dsmName) { super(args); - hostname = "127.0.0.1"; + hostname = dsmName; connectPort = port; - localPort = port; + localPort = 0; // local test mode for create tree topology key = dsmName; }
--- a/src/main/java/alice/topology/HostMessage.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/HostMessage.java Sun Dec 31 19:32:27 2017 +0900 @@ -1,5 +1,6 @@ package alice.topology; + import org.msgpack.annotation.Message; @Message @@ -32,4 +33,10 @@ public boolean isAlive() { return alive; } + + public String toString() { + return "HostMessage : name = " + name + ", port = " + Integer.toString(port) + " connectionName = " + + connectionName + " absName = " + absName + "reverseName = " + reverseName + " remoteAbsName = " + remoteAbsName + + " cokkie = " + cookie ; + } }
--- a/src/main/java/alice/topology/manager/CheckComingHost.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/manager/CheckComingHost.java Sun Dec 31 19:32:27 2017 +0900 @@ -12,7 +12,7 @@ private Receiver absCookieTable = ids.create(CommandType.PEEK); // cookie, AbsName HashMap public CheckComingHost(){ - this.host.setKey("host"); + this.host.setKey("hostMessage"); this.absCookieTable.setKey("absCookieTable"); }
--- a/src/main/java/alice/topology/manager/CreateTreeTopology.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/manager/CreateTreeTopology.java Sun Dec 31 19:32:27 2017 +0900 @@ -1,6 +1,8 @@ package alice.topology.manager; import java.util.HashMap; + +import alice.datasegment.DataSegmentManager; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; @@ -17,6 +19,7 @@ private Receiver info3 = ids.create(CommandType.TAKE); // MD5 private Receiver info4 = ids.create(CommandType.TAKE); private Receiver info6 = ids.create(CommandType.TAKE); + private Receiver info7 = ids.create(CommandType.PEEK); public CreateTreeTopology(){ info.setKey("newHost"); @@ -25,6 +28,7 @@ info3.setKey("MD5"); info4.setKey("absCookieTable"); info6.setKey("parentManager"); + info7.setKey("config"); } @SuppressWarnings("unchecked") @@ -35,13 +39,19 @@ HostMessage host = info.asClass(HostMessage.class); int comingHostCount = info1.asInteger(); ParentManager manager = info6.asClass(ParentManager.class); - + TopologyManagerConfig topologyManagerConfig = info7.asClass(TopologyManagerConfig.class); HashMap<String, HostMessage> nameTable = info2.asClass(HashMap.class); HashMap<String, String> absCookieTable = info4.asClass(HashMap.class); String nodeName = "node"+comingHostCount; // Manager connect to Node - DataSegment.connect(nodeName, nodeName, host.name, host.port); + if (host.port == 0) { + // local test mode + DataSegmentManager dsm = DataSegment.get(host.name); + DataSegment.register(nodeName, dsm); + } else { + DataSegment.connect(nodeName, nodeName, host.name, host.port); + } ods.put(nodeName, "host", nodeName); ods.put(nodeName, "cookie", cookie); @@ -79,7 +89,7 @@ ods.put(info2.key, nameTable); ods.put(info6.key, manager); - ods.put(nodeName, ValueFactory.createNilValue()); + ods.put(nodeName, new HostMessage("",0,"","") ); if (comingHostCount==0) ods.put("start", ValueFactory.createNilValue()); }
--- a/src/main/java/alice/topology/manager/IncomingHosts.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/manager/IncomingHosts.java Sun Dec 31 19:32:27 2017 +0900 @@ -61,13 +61,17 @@ ods.put("nodeInfo", newHost); ods.put(nodeInfo.sourceNodeName, newHost); + log.info(" write to " + nodeInfo.sourceNodeName + " config message =" + newHost.toString() + " remain " + + Integer.toString((nodeNames.size()))); new RecordTopology(); } + log.info(" remaining configure host = " + Integer.toString(nodeNames.size())); if (nodeNames.isEmpty()) { // configuration finish for (String key : topology.keySet()) { - ods.put("local", key, ValueFactory.createNilValue()); + log.info(" write to " + key + " end message =" + (new HostMessage("",0,"","")).toString()); + ods.put("local", key, new HostMessage("",0,"","")); // end mark } }
--- a/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Sun Dec 31 19:32:27 2017 +0900 @@ -19,7 +19,7 @@ return instance; } - public void setKey() { + public void taskExecutorSetKey() { ids.init(); info.setKey("_SCHEDULER"); } @@ -77,7 +77,7 @@ nowTask = null; startTime = 0; } - setKey(); + taskExecutorSetKey(); } public synchronized void skip() {
--- a/src/main/java/alice/topology/node/ClosedEventManager.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/node/ClosedEventManager.java Sun Dec 31 19:32:27 2017 +0900 @@ -6,7 +6,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class ClosedEventManager extends CodeSegment{ +public class ClosedEventManager extends CodeSegment { private Receiver info = ids.create(CommandType.PEEK); private static ClosedEventManager instance = new ClosedEventManager(); @@ -19,7 +19,7 @@ return instance; } - public void setKey() { + public void ceSetKey() { ids.init(); info.setKey("_DISCONNECT"); } @@ -28,7 +28,7 @@ @Override public void run() { new ExecuteEvent(); - setKey(); + ceSetKey(); } @SuppressWarnings("rawtypes")
--- a/src/main/java/alice/topology/node/ConfigurationFinish.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/node/ConfigurationFinish.java Sun Dec 31 19:32:27 2017 +0900 @@ -1,5 +1,6 @@ package alice.topology.node; +import alice.daemon.Config; import alice.topology.manager.TopologyManagerConfig; import org.msgpack.type.ValueFactory; @@ -16,14 +17,19 @@ private CodeSegment startCS; public ConfigurationFinish(CodeSegment startCS) { + // System.err.println("config finish ...") ; this.startCS = startCS; + reverseCount.setKey("local", "reverseCount"); + configNodeNum.setKey("local", "configNodeNum"); + config.setKey("local","config"); } @Override public void run() { int rcount = reverseCount.asInteger(); int ncount = configNodeNum.asInteger(); - TopologyManagerConfig tconfig = config.asClass(TopologyManagerConfig.class); + Config tconfig = config.asClass(Config.class); + // System.err.println(" rcount = " + Integer.toString(rcount) + " " + Integer.toString(ncount)); if (rcount == ncount) { ods.put("manager", "done", ValueFactory.createNilValue()); Start cs = new Start(startCS); @@ -37,9 +43,6 @@ return; } - ConfigurationFinish cs3 = new ConfigurationFinish(startCS); - cs3.reverseCount.setKey("local", "reverseCount", this.reverseCount.index); - cs3.configNodeNum.setKey("local", "configNodeNum"); + new ConfigurationFinish(startCS); } - }
--- a/src/main/java/alice/topology/node/IncomingAbstractHostName.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/node/IncomingAbstractHostName.java Sun Dec 31 19:32:27 2017 +0900 @@ -16,8 +16,7 @@ @Override public void run() { String absName = this.absName.asString(); - IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, 0); - cs.hostInfo.setKey(conf.getManagerKey(), absName); + IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, 0, conf.getManagerKey()); } }
--- a/src/main/java/alice/topology/node/IncomingConnectionInfo.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/node/IncomingConnectionInfo.java Sun Dec 31 19:32:27 2017 +0900 @@ -13,35 +13,39 @@ private String absName; private int count; private Logger log = Logger.getLogger(IncomingConnectionInfo.class); + private String managerKey; - public IncomingConnectionInfo(String absName, int count) { + public IncomingConnectionInfo(String absName, int count, String managerKey) { this.absName = absName; this.count = count; + this.managerKey = managerKey; + hostInfo.setKey(managerKey,absName); } + + @Override public void run() { - if (this.hostInfo.getVal() == null) { + HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); + log.info(hostInfo.toString()); + if ( hostInfo.name.equals("")) { // end case + log.info(" topology node finished " + absName); ods.put("local", "configNodeNum", count); + return ; + } + 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); } 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); - } else { - DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); - ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); - count++; + DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); + ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); + count++; - ods.put("cMember", hostInfo.connectionName); - new CreateConnectionList(); - } - + ods.put("cMember", hostInfo.connectionName); + new CreateConnectionList(); } - - IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, count); - cs.hostInfo.setKey(absName); + new IncomingConnectionInfo(absName, count, managerKey); } }
--- a/src/main/java/alice/topology/node/IncomingReverseKey.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/node/IncomingReverseKey.java Sun Dec 31 19:32:27 2017 +0900 @@ -1,6 +1,7 @@ package alice.topology.node; import alice.codesegment.CodeSegment; +import alice.daemon.IncomingTcpConnection; import alice.datasegment.CommandType; import alice.datasegment.DataSegment; import alice.datasegment.Receiver; @@ -14,7 +15,9 @@ public void run() { String reverseKey = this.reverseKey.asString(); String from = this.reverseKey.from; - DataSegment.getAccept(from).setReverseKey(reverseKey); + IncomingTcpConnection s = DataSegment.getAccept(from); + if (s != null) + s.setReverseKey(reverseKey); int reverseCount = this.reverseCount.asInteger(); reverseCount++;
--- a/src/main/java/alice/topology/node/StartTopologyNode.java Sun Dec 31 12:06:45 2017 +0900 +++ b/src/main/java/alice/topology/node/StartTopologyNode.java Sun Dec 31 19:32:27 2017 +0900 @@ -32,10 +32,15 @@ e.printStackTrace(); } new SaveCookie(); + if (conf.localPort == 0) { + // local test mode + localHostName = conf.getLocalKey(); + } + ods.put("config" , conf ); HostMessage host = new HostMessage(localHostName, conf.localPort); host.cookie = conf.cookie; - ods.put(manager, "host", host); + ods.put(manager, "hostMessage", host); ods.put(local,"_CLIST", new ArrayList<String>()); @@ -49,8 +54,6 @@ ods.put(local, "reverseCount", 0); ConfigurationFinish cs3 = new ConfigurationFinish(startCS); - cs3.reverseCount.setKey(local, "reverseCount"); - cs3.configNodeNum.setKey(local, "configNodeNum"); }