Commit 49ec3d3f authored by mohammad.salama's avatar mohammad.salama

Fifth Commit - Cluster only - Testing Distributed Reading Files

parent e39b8a01
<component name="ArtifactManager"> <component name="ArtifactManager">
<artifact type="jar" name="AutoHealer:jar"> <artifact type="jar" name="Distributed-Search:jar">
<output-path>$PROJECT_DIR$/out/artifacts/AutoHealer_jar</output-path> <output-path>$PROJECT_DIR$/out/artifacts/Distributed_Search_jar</output-path>
<root id="archive" name="Registration&amp;Discovery-AutoHealer.jar"> <root id="archive" name="Distributed-Search.jar">
<element id="module-output" name="Registration&amp;Discovery-AutoHealer" /> <element id="module-output" name="Distributed-Search" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-linux-x86_64.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/3.18.0/protobuf-java-3.18.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-osx-aarch_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-handler/4.1.94.Final/netty-handler-4.1.94.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-handler/4.1.94.Final/netty-handler-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-buffer/4.1.94.Final/netty-buffer-4.1.94.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/grpc/grpc-api/1.40.1/grpc-api-1.40.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-linux-aarch_64.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-resolver/4.1.94.Final/netty-resolver-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-osx-x86_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport-native-unix-common/4.1.94.Final/netty-transport-native-unix-common-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport-classes-epoll/4.1.94.Final/netty-transport-classes-epoll-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-linux-x86_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/perfmark/perfmark-api/0.23.0/perfmark-api-0.23.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-codec/4.1.94.Final/netty-codec-4.1.94.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-codec/4.1.94.Final/netty-codec-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/yetus/audience-annotations/0.12.0/audience-annotations-0.12.0.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/zookeeper/zookeeper-jute/3.9.1/zookeeper-jute-3.9.1.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/errorprone/error_prone_annotations/2.4.0/error_prone_annotations-2.4.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-common/4.1.94.Final/netty-common-4.1.94.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-common/4.1.94.Final/netty-common-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-windows-x86_64.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-windows-x86_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport-classes-epoll/4.1.94.Final/netty-transport-classes-epoll-4.1.94.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/guava/guava/30.1-android/guava-30.1-android.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-classes/2.0.61.Final/netty-tcnative-classes-2.0.61.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-osx-aarch_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-osx-x86_64.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/api/grpc/proto-google-common-protos/2.0.1/proto-google-common-protos-2.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/codehaus/mojo/animal-sniffer-annotations/1.19/animal-sniffer-annotations-1.19.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.32/slf4j-api-1.7.32.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.32/slf4j-api-1.7.32.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/grpc/grpc-protobuf-lite/1.40.1/grpc-protobuf-lite-1.40.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport-native-unix-common/4.1.94.Final/netty-transport-native-unix-common-4.1.94.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/grpc/grpc-netty-shaded/1.40.1/grpc-netty-shaded-1.40.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/yetus/audience-annotations/0.12.0/audience-annotations-0.12.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/grpc/grpc-core/1.40.1/grpc-core-1.40.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/zookeeper/zookeeper/3.9.1/zookeeper-3.9.1.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/zookeeper/zookeeper/3.9.1/zookeeper-3.9.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/ch/qos/logback/logback-core/1.2.10/logback-core-1.2.10.jar" path-in-jar="/" /> <element id="dir-copy" path="$PROJECT_DIR$/../apache-maven-3.9.5" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-resolver/4.1.94.Final/netty-resolver-4.1.94.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/zookeeper/zookeeper-jute/3.9.1/zookeeper-jute-3.9.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/grpc/grpc-protobuf/1.40.1/grpc-protobuf-1.40.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport-native-epoll/4.1.94.Final/netty-transport-native-epoll-4.1.94.Final-linux-x86_64.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport-native-epoll/4.1.94.Final/netty-transport-native-epoll-4.1.94.Final-linux-x86_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/ch/qos/logback/logback-core/1.2.10/logback-core-1.2.10.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-linux-aarch_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-classes/2.0.61.Final/netty-tcnative-classes-2.0.61.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/grpc/grpc-context/1.40.1/grpc-context-1.40.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-buffer/4.1.94.Final/netty-buffer-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport/4.1.94.Final/netty-transport-4.1.94.Final.jar" path-in-jar="/" /> <element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport/4.1.94.Final/netty-transport-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/grpc/grpc-stub/1.40.1/grpc-stub-1.40.1.jar" path-in-jar="/" />
</root> </root>
</artifact> </artifact>
</component> </component>
\ No newline at end of file
<component name="ArtifactManager">
<artifact type="jar" build-on-make="true" name="TransientWorker:jar">
<output-path>$PROJECT_DIR$/out/artifacts/TransientWorker_jar</output-path>
<root id="archive" name="Registration&amp;Discovery-AutoHealer.jar">
<element id="module-output" name="Registration&amp;Discovery-AutoHealer" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport/4.1.94.Final/netty-transport-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport-classes-epoll/4.1.94.Final/netty-transport-classes-epoll-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-windows-x86_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport-native-epoll/4.1.94.Final/netty-transport-native-epoll-4.1.94.Final-linux-x86_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-codec/4.1.94.Final/netty-codec-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-resolver/4.1.94.Final/netty-resolver-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-handler/4.1.94.Final/netty-handler-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/zookeeper/zookeeper-jute/3.9.1/zookeeper-jute-3.9.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-classes/2.0.61.Final/netty-tcnative-classes-2.0.61.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/ch/qos/logback/logback-classic/1.2.10/logback-classic-1.2.10.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-transport-native-unix-common/4.1.94.Final/netty-transport-native-unix-common-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-common/4.1.94.Final/netty-common-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-linux-aarch_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/ch/qos/logback/logback-core/1.2.10/logback-core-1.2.10.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/zookeeper/zookeeper/3.9.1/zookeeper-3.9.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-osx-x86_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/yetus/audience-annotations/0.12.0/audience-annotations-0.12.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-linux-x86_64.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-buffer/4.1.94.Final/netty-buffer-4.1.94.Final.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-osx-aarch_64.jar" path-in-jar="/" />
</root>
</artifact>
</component>
\ No newline at end of file
...@@ -10,13 +10,17 @@ ...@@ -10,13 +10,17 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="b8bcd35c-99f3-44c8-a866-59f81c3c8bd0" name="Changes" comment=""> <list default="true" id="b8bcd35c-99f3-44c8-a866-59f81c3c8bd0" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/src/main/java/WordsCountingInFiles/WordsCountingInFiles.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/artifacts/AutoHealer_jar.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/artifacts/TransientWorker_jar.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/Coordinator.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/Coordinator.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/Coordinator.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/Coordinator.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/OnElectionAction.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/OnElectionAction.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/ServiceRegistry.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/ServiceRegistry.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/TransientWorker.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/TransientWorker.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/TransientWorker.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/TransientWorker.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/FileWordPair.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/FileWordPair.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/AutoHealerAndClusterSearch/TransientWorkerApplication.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/Request.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/SearchQueryRequest.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/SearchQueryRequest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/SearchQueryRequest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/Response.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/SearchQueryResponse.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/SearchQueryResponse.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ObjectExchangeInCluster/SearchQueryResponse.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/generalTesting/test.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/generalTesting/test.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -58,7 +62,7 @@ ...@@ -58,7 +62,7 @@
"SHARE_PROJECT_CONFIGURATION_FILES": "true", "SHARE_PROJECT_CONFIGURATION_FILES": "true",
"jdk.selected.JAVA_MODULE": "17 (2)", "jdk.selected.JAVA_MODULE": "17 (2)",
"last_opened_file_path": "D:/HIAST/FIY/FS/Parallel Programming/Lab/2/pp-02-executorservice-master", "last_opened_file_path": "D:/HIAST/FIY/FS/Parallel Programming/Lab/2/pp-02-executorservice-master",
"project.structure.last.edited": "Modules", "project.structure.last.edited": "Artifacts",
"project.structure.proportion": "0.15", "project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.2", "project.structure.side.proportion": "0.2",
"settings.editor.selected.configurable": "reference.settings.project.maven.repository.indices" "settings.editor.selected.configurable": "reference.settings.project.maven.repository.indices"
......
to run Distributed-Search:
java -jar Distributed-Search.jar <ip:port>
note:
the jar file must be within the same directory as the SearchFiles directory
example: directory x must contain: Distributed-Search.jar and SearchFiles/
\ No newline at end of file
...@@ -140,7 +140,7 @@ public class Coordinator ...@@ -140,7 +140,7 @@ public class Coordinator
/** /**
* response from cluster node is tree-map where the keys are words * response from cluster node is map where the keys are words
* and values are list of pair<fileName,Number Of Appearance of the word in it> * and values are list of pair<fileName,Number Of Appearance of the word in it>
* we now must calculate the importance of each file for every word we got * we now must calculate the importance of each file for every word we got
* */ * */
...@@ -148,7 +148,7 @@ public class Coordinator ...@@ -148,7 +148,7 @@ public class Coordinator
{ {
for (SearchQueryResponse searchQueryResponse : respons) for (SearchQueryResponse searchQueryResponse : respons)
{ {
TreeMap<String , List<FileWordPair>> treeMap = searchQueryResponse.getWordFrequencies(); Map<String, List<FileWordPair>> treeMap = searchQueryResponse.getWordFrequencies();
for(Map.Entry<String, List<FileWordPair>> mapEntry : treeMap.entrySet()) for(Map.Entry<String, List<FileWordPair>> mapEntry : treeMap.entrySet())
{ {
System.out.println("The word " + mapEntry.getKey() + " is :"); System.out.println("The word " + mapEntry.getKey() + " is :");
...@@ -185,7 +185,7 @@ public class Coordinator ...@@ -185,7 +185,7 @@ public class Coordinator
* and tells them what files are every node responsible for !! * and tells them what files are every node responsible for !!
* and try to distribute responsibility as much as possible !!! * and try to distribute responsibility as much as possible !!!
* then receive response from every node * then receive response from every node
* response is tree-map here the keys are words * response is map here the keys are words
* and values are list of pair<fileName,Number Of Appearance of the word in it> * and values are list of pair<fileName,Number Of Appearance of the word in it>
* */ * */
public List<SearchQueryResponse> spreadQuery(String query) throws InterruptedException, KeeperException, IOException, ExecutionException public List<SearchQueryResponse> spreadQuery(String query) throws InterruptedException, KeeperException, IOException, ExecutionException
......
...@@ -4,6 +4,8 @@ import org.apache.zookeeper.KeeperException; ...@@ -4,6 +4,8 @@ import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.IOException;
public class OnElectionAction implements OnElectionCallback public class OnElectionAction implements OnElectionCallback
{ {
...@@ -27,7 +29,7 @@ public class OnElectionAction implements OnElectionCallback ...@@ -27,7 +29,7 @@ public class OnElectionAction implements OnElectionCallback
serviceRegistry.registerToCoordinator(IP); serviceRegistry.registerToCoordinator(IP);
//start the server //start the server
} }
catch (InterruptedException | KeeperException e) catch (InterruptedException | KeeperException | IOException e)
{ {
logger.error("Could Not Register to be Coordinator"); logger.error("Could Not Register to be Coordinator");
throw new RuntimeException(e); throw new RuntimeException(e);
...@@ -41,7 +43,7 @@ public class OnElectionAction implements OnElectionCallback ...@@ -41,7 +43,7 @@ public class OnElectionAction implements OnElectionCallback
{ {
serviceRegistry.registerToCluster(IP); serviceRegistry.registerToCluster(IP);
} }
catch (InterruptedException | KeeperException e) catch (InterruptedException | KeeperException | IOException e)
{ {
logger.error("Could Not Register To Cluster"); logger.error("Could Not Register To Cluster");
e.printStackTrace(); e.printStackTrace();
......
...@@ -52,7 +52,7 @@ public class ServiceRegistry implements Watcher ...@@ -52,7 +52,7 @@ public class ServiceRegistry implements Watcher
} }
} }
public void registerToCluster(String metadata) throws KeeperException, InterruptedException { public void registerToCluster(String metadata) throws KeeperException, InterruptedException, IOException {
if (this.currentZnode != null) if (this.currentZnode != null)
{ {
...@@ -63,16 +63,16 @@ public class ServiceRegistry implements Watcher ...@@ -63,16 +63,16 @@ public class ServiceRegistry implements Watcher
ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);
logger.info("Registered to service registry"); logger.info("Registered to service registry");
} }
//transientWorker = new TransientWorker(metadata); transientWorker = new TransientWorker(metadata);
transientWorker.start();
} }
public void registerToCoordinator(String metadata) throws InterruptedException, KeeperException public void registerToCoordinator(String metadata) throws InterruptedException, KeeperException, IOException {
{
this.currentZnode = zooKeeper.create(COORDINATOR_ZNODE_PATH + "/coordinator_", metadata.getBytes(), this.currentZnode = zooKeeper.create(COORDINATOR_ZNODE_PATH + "/coordinator_", metadata.getBytes(),
ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);
logger.info("Registered to be Coordinator and I am Master !"); logger.info("Registered to be Coordinator and I am Master !");
coordinator = new Coordinator(this.zooKeeper , metadata); coordinator = new Coordinator(this.zooKeeper , metadata);
coordinator.start();
} }
public void registerForUpdates() { public void registerForUpdates() {
try try
......
...@@ -2,6 +2,7 @@ package AutoHealerAndClusterSearch; ...@@ -2,6 +2,7 @@ package AutoHealerAndClusterSearch;
import ObjectExchangeInCluster.SearchQueryRequest; import ObjectExchangeInCluster.SearchQueryRequest;
import ObjectExchangeInCluster.SearchQueryResponse; import ObjectExchangeInCluster.SearchQueryResponse;
import WordsCountingInFiles.WordsCountingInFiles;
import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.ZooDefs;
...@@ -9,11 +10,9 @@ import org.apache.zookeeper.ZooKeeper; ...@@ -9,11 +10,9 @@ import org.apache.zookeeper.ZooKeeper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
import java.math.BigInteger; import java.io.ObjectOutputStream;
import java.net.ServerSocket; import java.net.ServerSocket;
import java.net.Socket; import java.net.Socket;
import java.nio.file.DirectoryStream; import java.nio.file.DirectoryStream;
...@@ -65,12 +64,14 @@ public class TransientWorker ...@@ -65,12 +64,14 @@ public class TransientWorker
Thread clientThread = new Thread(() -> Thread clientThread = new Thread(() ->
{ {
SearchQueryResponse searchQueryResponseMap = null; SearchQueryResponse searchQueryResponse = null;
try try
{ {
searchQueryResponseMap = handleCoordinator(clientSocket); searchQueryResponse = handleCoordinator(clientSocket);
sendResponsesToClient(clientSocket, searchQueryResponseMap); sendResponsesToClient(clientSocket, searchQueryResponse);
} catch (IOException | ClassNotFoundException e) { }
catch (IOException | ClassNotFoundException e)
{
throw new RuntimeException(e); throw new RuntimeException(e);
} }
...@@ -80,16 +81,25 @@ public class TransientWorker ...@@ -80,16 +81,25 @@ public class TransientWorker
} }
} }
private void sendResponsesToClient(Socket clientSocket, SearchQueryResponse searchQueryResponseMap) private void sendResponsesToClient(Socket clientSocket, SearchQueryResponse searchQueryResponseMap) throws IOException
{ {
ObjectOutputStream objectOutputStream = new ObjectOutputStream(clientSocket.getOutputStream());
objectOutputStream.writeObject(searchQueryResponseMap);
objectOutputStream.close();
} }
private SearchQueryResponse handleCoordinator(Socket clientSocket) throws IOException, ClassNotFoundException private SearchQueryResponse handleCoordinator(Socket clientSocket) throws IOException, ClassNotFoundException
{ {
SearchQueryRequest searchQueryRequest = extractRequest(clientSocket); SearchQueryRequest searchQueryRequest = extractRequest(clientSocket);
double score = getScore(searchQueryRequest, getMyFiles(searchQueryRequest.getNumberOfFilesToScan() , searchQueryRequest.getFilesOffset()));
return null; int numberOfFilesToScan = searchQueryRequest.getNumberOfFilesToScan();
int filesOffset= searchQueryRequest.getFilesOffset();
List<String> myPortionOfFiles = getMyFiles(numberOfFilesToScan , filesOffset);
SearchQueryResponse response = processFiles(searchQueryRequest, myPortionOfFiles);
return response;
} }
private SearchQueryRequest extractRequest(Socket clientSocket) throws IOException, ClassNotFoundException private SearchQueryRequest extractRequest(Socket clientSocket) throws IOException, ClassNotFoundException
...@@ -120,62 +130,15 @@ public class TransientWorker ...@@ -120,62 +130,15 @@ public class TransientWorker
return fileNames.subList(startIndex, endIndex); return fileNames.subList(startIndex, endIndex);
} }
private double getScore(SearchQueryRequest query, List<String> myFiles) private SearchQueryResponse processFiles(SearchQueryRequest query, List<String> myFiles)
{ {
String[] wordsToCount = query.getQueryWords(); List<String> words = query.getQueryWords();
Map<String , BigInteger> numberOfWordsInFile = new HashMap<>(); SearchQueryResponse searchQueryResponse = new SearchQueryResponse();
Map<String, Integer> wordFrequency = new HashMap<>();
Map<String, Integer> fileCount = new HashMap<>();
Path filePath = Paths.get(filesLocation);
try (BufferedReader reader = new BufferedReader(new FileReader(filePath.toFile())))
{
Set<String> uniqueWords = new HashSet<>();
String line;
while ((line = reader.readLine()) != null)
{
String[] words = line.split(" ");
for (String word : words) {
if (Arrays.asList(wordsToCount).contains(word))
{
wordFrequency.put(word, wordFrequency.getOrDefault(word, 0) + 1);
uniqueWords.add(word);
}
}
}
for (String word : uniqueWords) searchQueryResponse.setWordFrequencies
{ (WordsCountingInFiles.countWordsInFiles(words , myFiles));
fileCount.put(word, fileCount.getOrDefault(word, 0) + 1);
}
return 0.0; return searchQueryResponse;
}
catch (IOException e)
{
logger.error("Could not Read Files , Path Problem!");
e.printStackTrace();
return 0.0;
}
}
private void addChildZnode(int numberOfFilesToScan, int filesOffset) throws KeeperException, InterruptedException {
String info = numberOfFilesToScan + regex + filesOffset;
myName = zooKeeper.create(WORKERS_ZNODES_PATH + "/worker_",
info.getBytes(),
ZooDefs.Ids.OPEN_ACL_UNSAFE,
CreateMode.EPHEMERAL_SEQUENTIAL);
}
public void work(String nodeNum, String query, int numberOfFilesToScan, int filesOffset) throws KeeperException, InterruptedException
{
filesLocation = System.getProperty("user.dir") + "/SearchFiles";
//addChildZnode(numberOfFilesToScan, filesOffset);
logger.info(myName + " is Working and responsible for " + numberOfFilesToScan + " Files");
List<String> myFiles = getMyFiles(numberOfFilesToScan, filesOffset);
//double score = getScore(query, myFiles);
/// send them to coordinator
} }
} }
package AutoHealerAndClusterSearch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
public class TransientWorkerApplication
{
private static final Logger logger = LoggerFactory.getLogger(TransientWorkerApplication.class);
public static void main(String[] args)
{
/**
*
* String sshCommand = "ssh " + remoteUser + " \"java -jar " +
* remoteJarFilePath + " " +
* physicalNode+ " " + ///arg[0]
* modifiedQuery + " " + ///arg[1]
* numberOfFilesToScan + " "+ ///arg[2]
* filesOffset+"\""; ///arg[3]
*
TransientWorker worker = new TransientWorker(args[0]);
String nodeNum = args[0];
String query = args[1];
int numberOfFilesToScan = Integer.parseInt(args[2]);
int filesOffset = Integer.parseInt(args[3]);
try
{
worker.connectToZookeeper();
}
catch (IOException e)
{
logger.warn("Cannot Connect To ZooKeeper");
throw new RuntimeException(e);
}
/* try
{
worker.work(nodeNum , query , numberOfFilesToScan , filesOffset);
}
catch (Exception e)
{
logger.error("Worker Shut Down");
System.exit(1);
}*/
}
}
package ObjectExchangeInCluster; package ObjectExchangeInCluster;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class SearchQueryRequest implements Serializable public class SearchQueryRequest implements Serializable
{ {
...@@ -13,9 +15,15 @@ public class SearchQueryRequest implements Serializable ...@@ -13,9 +15,15 @@ public class SearchQueryRequest implements Serializable
this.filesOffset = filesOffset; this.filesOffset = filesOffset;
this.query = query; this.query = query;
} }
public String[] getQueryWords() public List<String> getQueryWords()
{ {
return query.split(" "); String[] qs = query.split(" ");
List<String> words = new ArrayList<>();
for (String w : qs)
{
words.add(w);
}
return words;
} }
public int getNumberOfFilesToScan() public int getNumberOfFilesToScan()
{ {
......
package ObjectExchangeInCluster; package ObjectExchangeInCluster;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.TreeMap;
public class SearchQueryResponse implements Serializable { public class SearchQueryResponse implements Serializable {
private TreeMap<String, List<FileWordPair>> wordFrequencies; private Map<String, List<FileWordPair>> wordFrequencies;
public SearchQueryResponse() { public SearchQueryResponse()
wordFrequencies = new TreeMap<>(); {
wordFrequencies = new HashMap<>();
} }
/* public void addFileWordPair(String fileName, String word, long freq) public void setWordFrequencies(Map<String , List<FileWordPair>> preCalced)
{ {
FileWordPair fileWordPair = new FileWordPair(); wordFrequencies = preCalced;
fileWordPair.fileName = fileName; }
fileWordPair.freq = freq;
List<FileWordPair> temp = wordFrequencies.getOrDefault(word, new ArrayList<>()); public Map<String, List<FileWordPair>> getWordFrequencies()
temp.add(fileWordPair);
wordFrequencies.put(word, temp);
}*/
public TreeMap<String, List<FileWordPair>> getWordFrequencies()
{ {
return wordFrequencies; return wordFrequencies;
} }
......
package WordsCountingInFiles;
import ObjectExchangeInCluster.FileWordPair;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.*;
public class WordsCountingInFiles
{
public static Map<String, List<FileWordPair>> countWordsInFiles(List<String> words, List<String> filePaths)
{
Map<String, List<FileWordPair>> wordOccurrences = new HashMap<>();
for (String filePath : filePaths)
{
try (BufferedReader reader = new BufferedReader(new FileReader(filePath)))
{
StringBuilder textBuilder = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
textBuilder.append(line).append("\n");
}
String text = textBuilder.toString();
// Count occurrences of words in the text
for (String word : words)
{
int count = countWordOccurrencesInText(word, text);
List<FileWordPair> FileWordPair = wordOccurrences.getOrDefault(word, new ArrayList<>());
FileWordPair.add(new FileWordPair(filePath, count));
wordOccurrences.put(word, FileWordPair);
}
} catch (IOException e) {
e.printStackTrace();
}
}
return wordOccurrences;
}
public static int countWordOccurrencesInText(String word, String text)
{
int count = 0;
int index = text.toLowerCase().indexOf(word.toLowerCase());
while (index != -1)
{
count++;
index = text.toLowerCase().indexOf(word.toLowerCase(), index + 1);
}
return count;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment