Commit 9860ac41 authored by mohammad.salama's avatar mohammad.salama

All Working - No Web Interface - printing files number

parent 885c047e
...@@ -11,8 +11,10 @@ ...@@ -11,8 +11,10 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="b8bcd35c-99f3-44c8-a866-59f81c3c8bd0" name="Changes" comment="Working as Strings, no json, problem in coordinator address"> <list default="true" id="b8bcd35c-99f3-44c8-a866-59f81c3c8bd0" name="Changes" comment="Working as Strings, no json, problem in coordinator address">
<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$/SearchFiles/f (1).txt" beforeDir="false" afterPath="$PROJECT_DIR$/SearchFiles/f (1).txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/app.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/app.log" afterDir="false" /> <change beforePath="$PROJECT_DIR$/logs/app.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/app.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/WebSide/WebServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/WebSide/WebServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/org/AutoHealerAndClusterSearch/AutoHealerAndClusterSearch/TransientWorker.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/org/AutoHealerAndClusterSearch/AutoHealerAndClusterSearch/TransientWorker.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/org/AutoHealerAndClusterSearch/AutoHealerAndClusterSearch/TransientWorker.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/org/AutoHealerAndClusterSearch/AutoHealerAndClusterSearch/TransientWorker.class" 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" />
...@@ -105,6 +107,13 @@ ...@@ -105,6 +107,13 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Node4" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application" />
<module name="Distributed-Search" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="WebClient" type="Application" factoryName="Application"> <configuration name="WebClient" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="WebSide.ClientApplication" /> <option name="MAIN_CLASS_NAME" value="WebSide.ClientApplication" />
<module name="Distributed-Search" /> <module name="Distributed-Search" />
...@@ -127,6 +136,7 @@ ...@@ -127,6 +136,7 @@
<item itemvalue="Application.WebServer" /> <item itemvalue="Application.WebServer" />
<item itemvalue="Application.WebClient" /> <item itemvalue="Application.WebClient" />
<item itemvalue="Application.Node1" /> <item itemvalue="Application.Node1" />
<item itemvalue="Application.Node4" />
<item itemvalue="Application.Node2" /> <item itemvalue="Application.Node2" />
<item itemvalue="Application.Node3" /> <item itemvalue="Application.Node3" />
<item itemvalue="JAR Application.Distributed-Search.jar" /> <item itemvalue="JAR Application.Distributed-Search.jar" />
...@@ -169,21 +179,11 @@ ...@@ -169,21 +179,11 @@
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
<breakpoints> <breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/WebSide/WebServer.java</url>
<line>85</line>
<option name="timeStamp" value="22" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line"> <line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/GRPCConnection/GRPCClient/GRPCClient.java</url> <url>file://$PROJECT_DIR$/src/main/java/GRPCConnection/GRPCClient/GRPCClient.java</url>
<line>37</line> <line>37</line>
<option name="timeStamp" value="24" /> <option name="timeStamp" value="24" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/org/AutoHealerAndClusterSearch/AutoHealerAndClusterSearch/TransientWorker.java</url>
<line>120</line>
<option name="timeStamp" value="25" />
</line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
</component> </component>
......
...@@ -937,3 +937,84 @@ java.lang.NullPointerException: Cannot invoke "java.util.List.isEmpty()" because ...@@ -937,3 +937,84 @@ java.lang.NullPointerException: Cannot invoke "java.util.List.isEmpty()" because
2024-02-01 01:54:32,317 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [] 2024-02-01 01:54:32,317 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-02-01 01:54:32,321 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] Registered to be Coordinator and I am Master ! 2024-02-01 01:54:32,321 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] Registered to be Coordinator and I am Master !
2024-02-01 01:54:38,275 WARN org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Coordinator [grpc-default-executor-0] No Nodes Are Working , Search Cannot Be Done 2024-02-01 01:54:38,275 WARN org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Coordinator [grpc-default-executor-0] No Nodes Are Working , Search Cannot Be Done
2024-02-01 12:17:42,034 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main-EventThread] Successfully connected to Zookeeper
2024-02-01 12:17:42,105 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] My Node under Election is/election/c_0000000239
2024-02-01 12:17:42,113 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] I am LEADER
2024-02-01 12:17:42,117 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] The cluster addresses are: []
2024-02-01 12:17:42,121 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] Registered to be Coordinator and I am Master !
2024-02-01 12:17:42,726 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main] Starting Application using Java 17.0.5 on M-Salameh with PID 1080 (D:\HIAST\FIY\FS\Distributed Systems\Lab\8\Distributed-Search\target\classes started by M_Salameh in D:\HIAST\FIY\FS\Distributed Systems\Lab\8\Distributed-Search)
2024-02-01 12:17:42,726 DEBUG org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main] Running with Spring Boot v2.6.8, Spring v5.3.20
2024-02-01 12:17:42,726 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main] No active profile set, falling back to 1 default profile: "default"
2024-02-01 12:17:44,503 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main] Started Application in 2.203 seconds (JVM running for 22.136)
2024-02-01 12:17:49,851 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main-EventThread] Successfully connected to Zookeeper
2024-02-01 12:17:49,877 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] My Node under Election is/election/c_0000000240
2024-02-01 12:17:49,883 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] I am NOT LEADER
2024-02-01 12:17:49,892 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] Registered to service registry
2024-02-01 12:17:49,898 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Server started on port 66
2024-02-01 12:17:49,948 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [127.0.0.1:66]
2024-02-01 12:17:57,668 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main-EventThread] Successfully connected to Zookeeper
2024-02-01 12:17:57,695 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] My Node under Election is/election/c_0000000241
2024-02-01 12:17:57,700 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] I am NOT LEADER
2024-02-01 12:17:57,705 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] Registered to service registry
2024-02-01 12:17:57,711 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Server started on port 77
2024-02-01 12:17:57,717 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [127.0.0.1:66, 127.0.0.1:77]
2024-02-01 12:18:04,077 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main-EventThread] Successfully connected to Zookeeper
2024-02-01 12:18:04,103 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] My Node under Election is/election/c_0000000242
2024-02-01 12:18:04,108 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] I am NOT LEADER
2024-02-01 12:18:04,115 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] Registered to service registry
2024-02-01 12:18:04,124 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Server started on port 88
2024-02-01 12:18:04,134 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [127.0.0.1:66, 127.0.0.1:77, 127.0.0.1:88]
2024-02-01 12:19:19,568 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:19:19,569 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:19:19,569 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:21:49,015 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main-EventThread] Successfully connected to Zookeeper
2024-02-01 12:21:49,035 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] My Node under Election is/election/c_0000000243
2024-02-01 12:21:49,038 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] I am LEADER
2024-02-01 12:21:49,041 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] The cluster addresses are: []
2024-02-01 12:21:49,044 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] Registered to be Coordinator and I am Master !
2024-02-01 12:21:49,566 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main] Starting Application using Java 17.0.5 on M-Salameh with PID 11940 (D:\HIAST\FIY\FS\Distributed Systems\Lab\8\Distributed-Search\target\classes started by M_Salameh in D:\HIAST\FIY\FS\Distributed Systems\Lab\8\Distributed-Search)
2024-02-01 12:21:49,566 DEBUG org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main] Running with Spring Boot v2.6.8, Spring v5.3.20
2024-02-01 12:21:49,567 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main] No active profile set, falling back to 1 default profile: "default"
2024-02-01 12:21:50,945 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main] Started Application in 1.757 seconds (JVM running for 3.978)
2024-02-01 12:21:56,667 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main-EventThread] Successfully connected to Zookeeper
2024-02-01 12:21:56,687 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] My Node under Election is/election/c_0000000244
2024-02-01 12:21:56,690 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] I am NOT LEADER
2024-02-01 12:21:56,697 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] Registered to service registry
2024-02-01 12:21:56,707 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Server started on port 66
2024-02-01 12:21:56,715 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [127.0.0.1:66]
2024-02-01 12:22:03,868 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main-EventThread] Successfully connected to Zookeeper
2024-02-01 12:22:03,893 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] My Node under Election is/election/c_0000000245
2024-02-01 12:22:03,897 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] I am NOT LEADER
2024-02-01 12:22:03,904 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] Registered to service registry
2024-02-01 12:22:03,912 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Server started on port 77
2024-02-01 12:22:03,915 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [127.0.0.1:66, 127.0.0.1:77]
2024-02-01 12:22:09,544 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main-EventThread] Successfully connected to Zookeeper
2024-02-01 12:22:09,562 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] My Node under Election is/election/c_0000000246
2024-02-01 12:22:09,566 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] I am NOT LEADER
2024-02-01 12:22:09,571 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] Registered to service registry
2024-02-01 12:22:09,578 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Server started on port 88
2024-02-01 12:22:09,586 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [127.0.0.1:88, 127.0.0.1:66, 127.0.0.1:77]
2024-02-01 12:22:25,121 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:22:25,121 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:22:25,121 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:30:05,496 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:30:05,496 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:30:05,496 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:31:03,233 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [127.0.0.1:88, 127.0.0.1:77]
2024-02-01 12:31:03,263 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main-EventThread] I am NOT LEADER
2024-02-01 12:31:03,265 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] Already registered to service registry
2024-02-01 12:31:03,277 ERROR org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.OnElectionAction [main-EventThread] Could Not Register To Cluster
2024-02-01 12:31:03,282 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main-EventThread] Watching znode c_0000000243 in ELECTION
2024-02-01 12:31:08,176 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:31:08,176 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:32:35,310 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.Application [main-EventThread] Successfully connected to Zookeeper
2024-02-01 12:32:35,335 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] My Node under Election is/election/c_0000000247
2024-02-01 12:32:35,340 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main] I am NOT LEADER
2024-02-01 12:32:35,346 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main] Registered to service registry
2024-02-01 12:32:35,355 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Server started on port 66
2024-02-01 12:32:35,365 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [127.0.0.1:88, 127.0.0.1:66, 127.0.0.1:77]
2024-02-01 12:32:45,245 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.LeaderElection [main-EventThread] I am LEADER
2024-02-01 12:32:45,338 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] The cluster addresses are: [127.0.0.1:88, 127.0.0.1:66]
2024-02-01 12:32:45,356 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.ServiceRegistry [main-EventThread] Registered to be Coordinator and I am Master !
2024-02-01 12:33:33,227 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
2024-02-01 12:33:33,227 INFO org.AutoHealerAndClusterSearch.AutoHealerAndClusterSearch.TransientWorker [main] Coordinator connected: /127.0.0.1
...@@ -89,7 +89,10 @@ public class WebServer ...@@ -89,7 +89,10 @@ public class WebServer
{ {
files.add("Some Thing Went Wrong !!"); files.add("Some Thing Went Wrong !!");
} }
if (files.size() == 0)
{
files.add("NO MATCH FOUND");
}
sendResponse(files, exchange); sendResponse(files, exchange);
} }
......
...@@ -128,6 +128,8 @@ public class TransientWorker ...@@ -128,6 +128,8 @@ public class TransientWorker
} }
int startIndex = Math.min(filesOffset, fileNames.size()); int startIndex = Math.min(filesOffset, fileNames.size());
int endIndex = Math.min(filesOffset + numberOfFilesToScan, fileNames.size()); int endIndex = Math.min(filesOffset + numberOfFilesToScan, fileNames.size());
System.out.println("My Share of Files : " + (endIndex-startIndex));
return fileNames.subList(startIndex, endIndex); return fileNames.subList(startIndex, endIndex);
} }
......
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