Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
and now a dht package + cmake factoring
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 29 Mar 2016 20:02:48 +0000 (22:02 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 29 Mar 2016 20:02:48 +0000 (22:02 +0200)
32 files changed:
.gitignore
examples/java/CMakeLists.txt
examples/java/chord/CMakeLists.txt [deleted file]
examples/java/chord/chord.tesh [deleted file]
examples/java/dht/chord/ChordTask.java [moved from examples/java/chord/ChordTask.java with 93% similarity]
examples/java/dht/chord/Common.java [moved from examples/java/chord/Common.java with 97% similarity]
examples/java/dht/chord/FindSuccessorAnswerTask.java [moved from examples/java/chord/FindSuccessorAnswerTask.java with 96% similarity]
examples/java/dht/chord/FindSuccessorTask.java [moved from examples/java/chord/FindSuccessorTask.java with 96% similarity]
examples/java/dht/chord/GetPredecessorAnswerTask.java [moved from examples/java/chord/GetPredecessorAnswerTask.java with 96% similarity]
examples/java/dht/chord/GetPredecessorTask.java [moved from examples/java/chord/GetPredecessorTask.java with 95% similarity]
examples/java/dht/chord/Main.java [moved from examples/java/chord/Chord.java with 95% similarity]
examples/java/dht/chord/Node.java [moved from examples/java/chord/Node.java with 99% similarity]
examples/java/dht/chord/NotifyTask.java [moved from examples/java/chord/NotifyTask.java with 96% similarity]
examples/java/dht/chord/chord.xml [moved from examples/java/chord/chord.xml with 82% similarity]
examples/java/dht/chord/dht_chord.tesh [new file with mode: 0644]
examples/java/dht/kademlia/Answer.java [moved from examples/java/kademlia/Answer.java with 98% similarity]
examples/java/dht/kademlia/Bucket.java [moved from examples/java/kademlia/Bucket.java with 98% similarity]
examples/java/dht/kademlia/Common.java [moved from examples/java/kademlia/Common.java with 98% similarity]
examples/java/dht/kademlia/Contact.java [moved from examples/java/kademlia/Contact.java with 97% similarity]
examples/java/dht/kademlia/FindNodeAnswerTask.java [moved from examples/java/kademlia/FindNodeAnswerTask.java with 93% similarity]
examples/java/dht/kademlia/FindNodeTask.java [moved from examples/java/kademlia/FindNodeTask.java with 97% similarity]
examples/java/dht/kademlia/KademliaTask.java [moved from examples/java/kademlia/KademliaTask.java with 92% similarity]
examples/java/dht/kademlia/Main.java [moved from examples/java/kademlia/Kademlia.java with 95% similarity]
examples/java/dht/kademlia/Node.java [moved from examples/java/kademlia/Node.java with 99% similarity]
examples/java/dht/kademlia/PingAnswerTask.java [moved from examples/java/kademlia/PingAnswerTask.java with 94% similarity]
examples/java/dht/kademlia/PingTask.java [moved from examples/java/kademlia/PingTask.java with 94% similarity]
examples/java/dht/kademlia/RoutingTable.java [moved from examples/java/kademlia/RoutingTable.java with 99% similarity]
examples/java/dht/kademlia/dht_kademlia.tesh [new file with mode: 0644]
examples/java/dht/kademlia/kademlia.xml [moved from examples/java/kademlia/kademlia.xml with 76% similarity]
examples/java/kademlia/CMakeLists.txt [deleted file]
examples/java/kademlia/kademlia.tesh [deleted file]
tools/cmake/DefinePackages.cmake

index 9e829bd..7e48eed 100644 (file)
@@ -972,17 +972,17 @@ tools/tesh/tesh
 ## touched files to track the dependencies of java examples
 examples/java/async/java_async_compiled
 examples/java/bittorrent/java_bittorrent_compiled
-examples/java/chord/java_chord_compiled
+examples/java/dht/chord/java_dht_chord_compiled
+examples/java/dht/kademlia/java_dht_kademlia_compiled
 examples/java/cloud/java_cloud_compiled
 examples/java/cloud/energy/java_cloud_energy_compiled
 examples/java/cloud/migration/java_cloud_migration_compiled
 examples/java/commTime/java_commTime_compiled
 examples/java/energy/java_energy_compiled
 examples/java/io/java_io_compiled
-examples/java/kademlia/java_kademlia_compiled
 examples/java/process/kill/java_process_kill_compiled
 examples/java/process/migration/java_process_migration_compiled
-examples/java/process_suspend/java_process_suspend_compiled
+examples/java/process/suspend/java_process_suspend_compiled
 examples/java/masterworker/java_masterworker_compiled
 examples/java/mutualExclusion/java_mutualExclusion_compiled
 examples/java/pingPong/java_pingPong_compiled
index 407da43..37fca90 100644 (file)
@@ -1,3 +1,24 @@
+set(dht_chord_sources         ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/Main.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/ChordTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/Common.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/FindSuccessorAnswerTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/FindSuccessorTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/GetPredecessorAnswerTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/GetPredecessorTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/Node.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/NotifyTask.java)
+set(dht_kademlia_sources      ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Main.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Answer.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Bucket.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Common.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Contact.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/FindNodeAnswerTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/FindNodeTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/KademliaTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Node.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/PingAnswerTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/PingTask.java
+                              ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/RoutingTable.java)
 set(process_kill_sources      ${CMAKE_CURRENT_SOURCE_DIR}/process/kill/Main.java
                               ${CMAKE_CURRENT_SOURCE_DIR}/process/kill/Killer.java
                               ${CMAKE_CURRENT_SOURCE_DIR}/process/kill/Victim.java)
@@ -8,7 +29,7 @@ set(process_suspend_sources   ${CMAKE_CURRENT_SOURCE_DIR}/process/suspend/Main.j
                               ${CMAKE_CURRENT_SOURCE_DIR}/process/suspend/DreamMaster.java
                               ${CMAKE_CURRENT_SOURCE_DIR}/process/suspend/LazyGuy.java)
 
-foreach (example process_kill process_migration process_suspend)
+foreach (example dht_chord dht_kademlia process_kill process_migration process_suspend)
   string (REPLACE "_" "/" example_dir ${example})
   if(enable_java)
 
@@ -26,11 +47,13 @@ foreach (example process_kill process_migration process_suspend)
   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}/${example}.tesh)
 endforeach()
 
-set(examples_src  ${examples_src}  PARENT_SCOPE)
-set(tesh_files    ${tesh_files}    PARENT_SCOPE)
+set(examples_src  ${examples_src}                                                          PARENT_SCOPE)
+set(tesh_files    ${tesh_files}                                                            PARENT_SCOPE)
+set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/chord.xml
+                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/kademlia.xml   PARENT_SCOPE)
 
 if(enable_java)
-  foreach (example process_kill process_migration process_suspend)
+  foreach (example dht_chord dht_kademlia process_kill process_migration process_suspend)
     string (REPLACE "_" "/" example_dir ${example})
     ADD_TESH(java-${example}  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/${example_dir}/${example}.tesh)
   endforeach()
diff --git a/examples/java/chord/CMakeLists.txt b/examples/java/chord/CMakeLists.txt
deleted file mode 100644 (file)
index 7bc76b8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-set(example java_chord)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/Chord.java   ${CMAKE_CURRENT_SOURCE_DIR}/ChordTask.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/Common.java  ${CMAKE_CURRENT_SOURCE_DIR}/FindSuccessorAnswerTask.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/FindSuccessorTask.java ${CMAKE_CURRENT_SOURCE_DIR}/GetPredecessorAnswerTask.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/GetPredecessorTask.java ${CMAKE_CURRENT_SOURCE_DIR}/Node.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/NotifyTask.java)
-
-if(enable_java)
-  add_custom_command(
-    COMMENT "Building ${example}..."
-    OUTPUT ${example}_compiled
-    DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
-    COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources}
-    COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled
-    COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled
-  )
-  add_custom_target(${example} ALL DEPENDS ${example}_compiled)
-  ADD_TESH(java-chord --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/chord/chord.tesh)
-endif()
-
-set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/chord.tesh  PARENT_SCOPE)
-set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/chord.xml   PARENT_SCOPE)
-set(examples_src  ${examples_src}  ${sources}                              PARENT_SCOPE)
diff --git a/examples/java/chord/chord.tesh b/examples/java/chord/chord.tesh
deleted file mode 100644 (file)
index 01dc891..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#! tesh
-
-! output sort 19
-
-$ java -classpath ${classpath:=.} chord/Chord ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/chord/chord.xml
-> [0.000000] [jmsg/INFO] Using regular java threads.
-> [652.540924] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
-> [Boivin:chord.Node:(7) 0.000000] [jmsg/INFO] Joining the ring with id 8 knowing node 1
-> [Gatien:chord.Node:(1) 0.000000] [jmsg/INFO] Joining the ring with id 48 knowing node 1
-> [Geoff:chord.Node:(4) 0.000000] [jmsg/INFO] Joining the ring with id 32 knowing node 1
-> [Jean_Yves:chord.Node:(6) 0.000000] [jmsg/INFO] Joining the ring with id 14 knowing node 1
-> [McGee:chord.Node:(2) 0.000000] [jmsg/INFO] Joining the ring with id 42 knowing node 1
-> [TeX:chord.Node:(5) 0.000000] [jmsg/INFO] Joining the ring with id 21 knowing node 1
-> [iRMX:chord.Node:(3) 0.000000] [jmsg/INFO] Joining the ring with id 38 knowing node 1
similarity index 93%
rename from examples/java/chord/ChordTask.java
rename to examples/java/dht/chord/ChordTask.java
index b78bb8f..0e5edfc 100644 (file)
@@ -4,9 +4,9 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package chord;
+package dht.chord;
 
-import chord.Common;
+import dht.chord.Common;
 import org.simgrid.msg.Task;
 
 public class ChordTask extends Task {
similarity index 97%
rename from examples/java/chord/Common.java
rename to examples/java/dht/chord/Common.java
index 2bda081..25672cd 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package chord;
+package dht.chord;
 
 public class Common {
   public final static int COMM_SIZE = 10;
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package chord;
+package dht.chord;
 
 public class FindSuccessorAnswerTask extends ChordTask {
   public int answerId;
similarity index 96%
rename from examples/java/chord/FindSuccessorTask.java
rename to examples/java/dht/chord/FindSuccessorTask.java
index b8f84c2..0c78f8b 100644 (file)
@@ -4,11 +4,11 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package chord;
+package dht.chord;
 
 public class FindSuccessorTask extends ChordTask {
   public int requestId;
-  
+
   public FindSuccessorTask(String issuerHostname, String answerTo,  int requestId) {
     super(issuerHostname, answerTo);
     this.requestId = requestId;
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package chord;
+package dht.chord;
 
 public class GetPredecessorAnswerTask extends ChordTask {
   public int answerId;
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package chord;
+package dht.chord;
 
 public class GetPredecessorTask extends ChordTask {
   public GetPredecessorTask(String issuerHostName, String answerTo) {
similarity index 95%
rename from examples/java/chord/Chord.java
rename to examples/java/dht/chord/Main.java
index 954b50f..44e2425 100644 (file)
@@ -4,11 +4,11 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package chord;
+package dht.chord;
 
 import org.simgrid.msg.Msg;
 
-public class Chord {
+public class Main {
   public static void main(String[] args) {
     Msg.init(args);
     if(args.length < 2) {
similarity index 99%
rename from examples/java/chord/Node.java
rename to examples/java/dht/chord/Node.java
index 6456b6b..0216108 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package chord;
+package dht.chord;
 
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Comm;
similarity index 96%
rename from examples/java/chord/NotifyTask.java
rename to examples/java/dht/chord/NotifyTask.java
index b7b6919..daf4129 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package chord;
+package dht.chord;
 
 public class NotifyTask extends ChordTask {
   public int requestId;
similarity index 82%
rename from examples/java/chord/chord.xml
rename to examples/java/dht/chord/chord.xml
index 6aa3bdf..7ef7e66 100644 (file)
@@ -1,49 +1,49 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
-  <process host="Gatien" function="chord.Node">
+  <process host="Gatien" function="dht.chord.Node">
     <argument value="48"/>        <!-- my id -->
     <argument value="1"/>         <!-- known id -->
     <argument value="400"/>        <!-- time to sleep before it starts-->
     <argument value ="600"/>    <!-- deadline -->
   </process>
-  <process host="McGee" function="chord.Node">
+  <process host="McGee" function="dht.chord.Node">
     <argument value="42"/>        <!-- my id -->
     <argument value="1"/>         <!-- known id -->
     <argument value="300"/>        <!-- time to sleep before it starts-->
     <argument value ="600"/>    <!-- deadline -->
   </process>
-  <process host="iRMX" function="chord.Node">
+  <process host="iRMX" function="dht.chord.Node">
     <argument value="38"/>        <!-- my id -->
     <argument value="1"/>         <!-- known id -->
     <argument value="200"/>         <!-- time to sleep before it starts-->
     <argument value ="600"/>    <!-- deadline -->
   </process>
-  <process host="Geoff" function="chord.Node">
+  <process host="Geoff" function="dht.chord.Node">
     <argument value="32"/>        <!-- my id -->
     <argument value="1"/>         <!-- known id -->
     <argument value="100"/>         <!-- time to sleep before it starts-->
     <argument value ="600"/>    <!-- deadline -->
   </process>
-  <process host="TeX" function="chord.Node">
+  <process host="TeX" function="dht.chord.Node">
     <argument value="21"/>        <!-- my id -->
     <argument value="1"/>         <!-- known id -->
     <argument value="40"/>        <!-- time to sleep before it starts-->
     <argument value ="600"/>    <!-- deadline -->
   </process>
-  <process host="Jean_Yves" function="chord.Node">
+  <process host="Jean_Yves" function="dht.chord.Node">
     <argument value="14"/>        <!-- my id -->
     <argument value="1"/>         <!-- known id -->
     <argument value="16"/>        <!-- time to sleep before it starts-->
     <argument value ="600"/>    <!-- deadline -->
   </process>
-  <process host="Boivin" function="chord.Node">
+  <process host="Boivin" function="dht.chord.Node">
     <argument value="8"/>         <!-- my id -->
     <argument value="1"/>         <!-- known id -->
     <argument value="1"/>         <!-- time to sleep before it starts-->
     <argument value ="600"/>    <!-- deadline -->
   </process>
-  <process host="Jacquelin" function="chord.Node">
+  <process host="Jacquelin" function="dht.chord.Node">
     <argument value="1"/>         <!-- my id -->
     <argument value ="600"/>    <!-- deadline -->
   </process>
diff --git a/examples/java/dht/chord/dht_chord.tesh b/examples/java/dht/chord/dht_chord.tesh
new file mode 100644 (file)
index 0000000..92fc55a
--- /dev/null
@@ -0,0 +1,14 @@
+#! tesh
+
+! output sort 19
+
+$ java -classpath ${classpath:=.} dht/chord/Main ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/dht/chord/chord.xml
+> [0.000000] [jmsg/INFO] Using regular java threads.
+> [652.540924] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
+> [Boivin:dht.chord.Node:(7) 0.000000] [jmsg/INFO] Joining the ring with id 8 knowing node 1
+> [Gatien:dht.chord.Node:(1) 0.000000] [jmsg/INFO] Joining the ring with id 48 knowing node 1
+> [Geoff:dht.chord.Node:(4) 0.000000] [jmsg/INFO] Joining the ring with id 32 knowing node 1
+> [Jean_Yves:dht.chord.Node:(6) 0.000000] [jmsg/INFO] Joining the ring with id 14 knowing node 1
+> [McGee:dht.chord.Node:(2) 0.000000] [jmsg/INFO] Joining the ring with id 42 knowing node 1
+> [TeX:dht.chord.Node:(5) 0.000000] [jmsg/INFO] Joining the ring with id 21 knowing node 1
+> [iRMX:dht.chord.Node:(3) 0.000000] [jmsg/INFO] Joining the ring with id 38 knowing node 1
similarity index 98%
rename from examples/java/kademlia/Answer.java
rename to examples/java/dht/kademlia/Answer.java
index 24164a4..1421529 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 import java.util.ArrayList;
 import java.util.Collections;
 
similarity index 98%
rename from examples/java/kademlia/Bucket.java
rename to examples/java/dht/kademlia/Bucket.java
index 41d391d..51f6712 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 import java.util.ArrayList;
 
 public class Bucket {
similarity index 98%
rename from examples/java/kademlia/Common.java
rename to examples/java/dht/kademlia/Common.java
index 0c3d425..9ec3d57 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 
 public class Common {
   /* Common constants used all over the simulation */
similarity index 97%
rename from examples/java/kademlia/Contact.java
rename to examples/java/dht/kademlia/Contact.java
index 0f95358..b52dcfb 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 
 public class Contact implements Comparable<Object> {
   private int id;
@@ -4,8 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
-import kademlia.Answer;
+package dht.kademlia;
+import dht.kademlia.Answer;
 
 public class FindNodeAnswerTask extends KademliaTask {
   protected int destinationId;
similarity index 97%
rename from examples/java/kademlia/FindNodeTask.java
rename to examples/java/dht/kademlia/FindNodeTask.java
index f2020aa..c7c2886 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 
 /**
  * @brief Find node tasks sent by a node to another "Find Node" task sent by a node to another. Ask him for its closest
similarity index 92%
rename from examples/java/kademlia/KademliaTask.java
rename to examples/java/dht/kademlia/KademliaTask.java
index 0a549b4..ebb4670 100644 (file)
@@ -4,8 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
-import kademlia.Common;
+package dht.kademlia;
+import dht.kademlia.Common;
 
 import org.simgrid.msg.Task;
 
similarity index 95%
rename from examples/java/kademlia/Kademlia.java
rename to examples/java/dht/kademlia/Main.java
index 01fcef2..ffb9dd4 100644 (file)
@@ -4,11 +4,11 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.MsgException;
 
-public class Kademlia {
+public class Main {
   public static void main(String[] args) throws MsgException {
     Msg.init(args);
     if(args.length < 2) {
similarity index 99%
rename from examples/java/kademlia/Node.java
rename to examples/java/dht/kademlia/Node.java
index 5dd2ae2..5b570ec 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 
 import org.simgrid.msg.Host;
 
similarity index 94%
rename from examples/java/kademlia/PingAnswerTask.java
rename to examples/java/dht/kademlia/PingAnswerTask.java
index d6dd4a0..5a804d5 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 
 public class PingAnswerTask extends KademliaTask {
   public PingAnswerTask(int senderId) {
similarity index 94%
rename from examples/java/kademlia/PingTask.java
rename to examples/java/dht/kademlia/PingTask.java
index eacfb1d..a9dbab3 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 
 public class PingTask extends KademliaTask {
   public PingTask(int senderId) {
similarity index 99%
rename from examples/java/kademlia/RoutingTable.java
rename to examples/java/dht/kademlia/RoutingTable.java
index 961d38f..9dc08f8 100644 (file)
@@ -4,7 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-package kademlia;
+package dht.kademlia;
 import java.util.Collections;
 import java.util.Vector;
 
diff --git a/examples/java/dht/kademlia/dht_kademlia.tesh b/examples/java/dht/kademlia/dht_kademlia.tesh
new file mode 100644 (file)
index 0000000..19dc2c3
--- /dev/null
@@ -0,0 +1,16 @@
+#! tesh
+
+! output sort 19
+
+$ java -classpath ${classpath:=.} dht/kademlia/Main ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/dht/kademlia/kademlia.xml
+> [0.000000] [jmsg/INFO] Using regular java threads.
+> [900.000000] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
+> [Boivin:dht.kademlia.Node:(2) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 1!
+> [Boivin:dht.kademlia.Node:(2) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
+> [Jacquelin:dht.kademlia.Node:(1) 0.000000] [jmsg/INFO] Hi, I'm going to create the network with the id 0!
+> [Jacquelin:dht.kademlia.Node:(1) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
+> [Jean_Yves:dht.kademlia.Node:(3) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 2!
+> [Jean_Yves:dht.kademlia.Node:(3) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
+> [TeX:dht.kademlia.Node:(4) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 4!
+> [TeX:dht.kademlia.Node:(4) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
+
similarity index 76%
rename from examples/java/kademlia/kademlia.xml
rename to examples/java/dht/kademlia/kademlia.xml
index 4ea6551..61a828b 100644 (file)
@@ -1,21 +1,21 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
-  <process host="Jacquelin" function="kademlia.Node">
+  <process host="Jacquelin" function="dht.kademlia.Node">
     <argument value="0"/>        <!-- my id -->
     <argument value ="900"/>     <!-- deadline -->
   </process>
-  <process host="Boivin" function="kademlia.Node">
+  <process host="Boivin" function="dht.kademlia.Node">
     <argument value="1"/>        <!-- my id -->
     <argument value="0"/>        <!-- known id -->
     <argument value ="900"/>     <!-- deadline -->
   </process>
-  <process host="Jean_Yves" function="kademlia.Node">
+  <process host="Jean_Yves" function="dht.kademlia.Node">
     <argument value="2"/>        <!-- my id -->
     <argument value="0"/>        <!-- known id -->
     <argument value ="900"/>     <!-- deadline -->
   </process>
-  <process host="TeX" function="kademlia.Node">
+  <process host="TeX" function="dht.kademlia.Node">
     <argument value="4"/>        <!-- my id -->
     <argument value="0"/>        <!-- known id -->
     <argument value ="900"/>     <!-- deadline -->  
diff --git a/examples/java/kademlia/CMakeLists.txt b/examples/java/kademlia/CMakeLists.txt
deleted file mode 100644 (file)
index bd2b6f6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-set(example java_kademlia)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/Kademlia.java      ${CMAKE_CURRENT_SOURCE_DIR}/Answer.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/Bucket.java        ${CMAKE_CURRENT_SOURCE_DIR}/Common.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/Contact.java       ${CMAKE_CURRENT_SOURCE_DIR}/FindNodeAnswerTask.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/FindNodeTask.java  ${CMAKE_CURRENT_SOURCE_DIR}/KademliaTask.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/Node.java          ${CMAKE_CURRENT_SOURCE_DIR}/PingAnswerTask.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/PingTask.java      ${CMAKE_CURRENT_SOURCE_DIR}/RoutingTable.java)
-
-if(enable_java)
-  add_custom_command(
-    COMMENT "Building ${example}..."
-    OUTPUT ${example}_compiled
-    DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
-    COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources}
-    COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled
-    COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled
-  )
-  add_custom_target(${example} ALL DEPENDS ${example}_compiled)
-  ADD_TESH(java-kademlia --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/kademlia/kademlia.tesh)
-endif()
-
-set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/kademlia.tesh  PARENT_SCOPE)
-set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/kademlia.xml   PARENT_SCOPE)
-set(examples_src  ${examples_src}  ${sources}                                 PARENT_SCOPE)
diff --git a/examples/java/kademlia/kademlia.tesh b/examples/java/kademlia/kademlia.tesh
deleted file mode 100644 (file)
index 3adbb56..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#! tesh
-
-! output sort 19
-
-$ java -classpath ${classpath:=.} kademlia/Kademlia ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/kademlia/kademlia.xml
-> [0.000000] [jmsg/INFO] Using regular java threads.
-> [900.000000] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
-> [Boivin:kademlia.Node:(2) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 1!
-> [Boivin:kademlia.Node:(2) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
-> [Jacquelin:kademlia.Node:(1) 0.000000] [jmsg/INFO] Hi, I'm going to create the network with the id 0!
-> [Jacquelin:kademlia.Node:(1) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
-> [Jean_Yves:kademlia.Node:(3) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 2!
-> [Jean_Yves:kademlia.Node:(3) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
-> [TeX:kademlia.Node:(4) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 4!
-> [TeX:kademlia.Node:(4) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
-
index c554038..0f569a8 100644 (file)
@@ -926,14 +926,12 @@ set(CMAKEFILES_TXT
   examples/java/CMakeLists.txt
   examples/java/async/CMakeLists.txt
   examples/java/bittorrent/CMakeLists.txt
-  examples/java/chord/CMakeLists.txt
   examples/java/cloud/CMakeLists.txt
   examples/java/cloud/energy/CMakeLists.txt
   examples/java/cloud/migration/CMakeLists.txt
   examples/java/commTime/CMakeLists.txt
   examples/java/energy/CMakeLists.txt
   examples/java/io/CMakeLists.txt
-  examples/java/kademlia/CMakeLists.txt
   examples/java/masterworker/CMakeLists.txt
   examples/java/mutualExclusion/CMakeLists.txt
   examples/java/pingPong/CMakeLists.txt