Commit a86e4d16 authored by abdullh.alsoleman's avatar abdullh.alsoleman

Second

parent 0b9c3a4b
...@@ -60,17 +60,17 @@ ...@@ -60,17 +60,17 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"RunOnceActivity.OpenProjectViewOnStart": "true", &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"SHARE_PROJECT_CONFIGURATION_FILES": "true", &quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
"last_opened_file_path": "C:/Users/Abdullah/Downloads/network-communication-master/Cordinator_Worker/src/main/resources", &quot;last_opened_file_path&quot;: &quot;C:/Users/Abdullah/Downloads/network-communication-master/Cordinator_Worker/src/main/resources&quot;,
"project.structure.last.edited": "Artifacts", &quot;project.structure.last.edited&quot;: &quot;Artifacts&quot;,
"project.structure.proportion": "0.0", &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
"project.structure.side.proportion": "0.0" &quot;project.structure.side.proportion&quot;: &quot;0.0&quot;
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\Abdullah\Downloads\network-communication-master\Cordinator_Worker\src\main\resources" /> <recent name="C:\Users\Abdullah\Downloads\network-communication-master\Cordinator_Worker\src\main\resources" />
...@@ -84,6 +84,28 @@ ...@@ -84,6 +84,28 @@
<recent name="" /> <recent name="" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Application.Application">
<configuration name="Application" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Application" />
<module name="Cordinator_Worker" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="Cordinator_Worker" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Application" />
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
...@@ -106,20 +128,4 @@ ...@@ -106,20 +128,4 @@
</map> </map>
</option> </option>
</component> </component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/Coordinator_Worker/Worker.java</url>
<line>40</line>
<option name="timeStamp" value="9" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/Coordinator_Worker/Coordinator.java</url>
<line>85</line>
<option name="timeStamp" value="12" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project> </project>
\ No newline at end of file
...@@ -481,3 +481,827 @@ Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperE ...@@ -481,3 +481,827 @@ Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperE
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74) at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108) at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted ... 2 common frames omitted
2024-01-26 09:33:37,786 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 09:33:37,852 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 09:33:38,043 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 09:39:58,073 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 09:40:32,520 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 09:40:33,053 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 09:41:02,229 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 09:41:15,814 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 09:41:15,991 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 09:41:37,050 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 09:41:50,208 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 09:42:07,177 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:32)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 09:47:36,040 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 09:47:51,936 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 09:47:52,073 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 09:48:11,175 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 09:48:41,207 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:32)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 09:48:43,171 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 09:50:14,761 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 09:50:19,167 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 09:50:19,299 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 09:50:49,022 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 09:51:19,032 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:32)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 09:51:24,004 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 09:52:46,157 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 09:52:46,237 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 09:52:46,424 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 09:53:21,037 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 09:54:11,085 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 09:54:42,485 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 09:54:56,991 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 09:54:57,106 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 09:55:17,257 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 09:55:37,375 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 09:58:58,599 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 09:59:12,243 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 09:59:12,358 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 09:59:33,184 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 09:59:42,274 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:01:20,106 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:01:20,200 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:01:20,326 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:01:33,319 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:01:57,500 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:01:57,566 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:01:57,677 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:02:31,172 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:03:36,908 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:03:36,983 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:03:37,119 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:04:11,175 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:05:06,189 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:05:06,267 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:05:06,388 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:07:22,666 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:07:22,755 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:07:22,890 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:07:57,104 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:08:08,177 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:13:59,815 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:14:27,575 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:14:27,605 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:14:27,728 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:15:15,097 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:16:33,650 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:17:00,812 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:17:00,932 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:17:05,001 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:17:07,515 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:18:07,146 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:18:18,457 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:18:44,376 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:18:44,487 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:18:49,009 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:18:51,035 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:19:37,943 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:19:38,016 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:19:38,126 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:19:43,010 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:19:43,295 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:21:08,826 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:21:43,700 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:21:48,072 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:21:48,192 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:22:17,367 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:22:18,988 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:23:29,418 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:23:42,652 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:23:42,761 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:24:03,011 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:24:03,702 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:33:45,482 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:34:53,712 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:35:10,924 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:35:11,211 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:35:29,028 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:35:32,099 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:35:32,375 ERROR Application [main-EventThread] Closed Successfully
2024-01-26 10:36:49,933 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:37:15,792 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:37:15,899 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:37:24,982 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:37:30,445 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:44:59,096 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:45:28,546 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:45:28,662 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:45:37,697 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:46:21,612 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:46:32,179 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:46:32,399 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:46:57,664 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:48:46,256 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:48:46,347 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:48:46,482 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:49:21,065 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:49:51,074 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 10:56:01,856 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:56:01,882 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:56:02,045 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116, 192.168.56.116]
2024-01-26 10:56:17,035 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:56:47,775 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 10:56:47,852 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 10:56:48,035 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 10:57:23,009 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 10:57:33,226 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 10:57:53,018 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 11:08:14,624 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:08:14,658 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:08:14,845 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:08:59,950 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:09:11,246 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:09:11,373 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:09:19,043 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:09:48,899 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:09:48,959 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:09:49,072 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:10:36,917 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:10:41,277 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:10:41,441 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:11:11,036 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:11:13,794 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 11:11:41,064 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 11:14:10,806 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:14:21,882 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:14:21,994 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:14:29,169 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:15:08,108 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:15:12,568 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:15:12,683 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:15:43,004 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:15:45,967 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 11:16:13,010 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 11:20:03,576 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:20:03,676 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:20:03,788 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:20:39,056 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:20:45,621 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 11:21:11,202 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:21:30,303 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:21:30,416 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:21:46,972 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:22:34,873 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 11:23:24,103 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:23:28,474 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:23:28,592 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:23:58,974 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:24:12,345 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 11:24:44,161 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:25:10,870 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:25:10,985 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:25:18,986 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:25:49,036 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 11:33:24,209 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:33:35,685 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:34:07,132 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:34:10,981 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:35:01,523 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:35:28,047 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:35:28,180 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:35:34,971 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:35:37,841 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 11:36:04,982 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 11:38:24,615 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:38:35,768 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:38:35,878 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:39:10,911 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:39:28,422 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:39:28,557 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:39:44,958 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:40:06,611 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 11:42:51,171 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:43:14,386 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:43:14,494 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:43:26,930 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:50:43,059 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 11:53:10,578 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:55:45,196 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:55:45,494 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:55:45,614 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:56:21,556 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:56:22,818 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 11:56:51,581 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 11:58:44,228 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 11:59:08,724 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 11:59:08,838 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 11:59:18,961 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 11:59:48,966 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 12:00:02,480 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 12:02:20,667 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:02:31,904 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:02:32,022 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:02:54,981 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 12:03:07,549 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 12:03:24,985 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 12:03:49,250 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 12:03:50,008 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 12:03:50,010 ERROR Application [main-EventThread] Closed Successfully
2024-01-26 12:03:50,403 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 12:06:10,882 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:06:26,900 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:06:27,031 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:06:44,974 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 12:07:14,982 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 12:08:59,545 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:09:10,830 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:09:10,975 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:09:35,014 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 12:10:13,668 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:10:13,751 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:10:13,869 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:10:49,000 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 12:11:19,017 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 12:14:15,053 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:14:15,135 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:14:15,246 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:14:48,949 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 12:15:18,964 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 12:16:08,234 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:16:08,265 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:16:08,391 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:17:50,960 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 12:20:00,896 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:20:26,179 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:20:26,252 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:20:26,431 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:26:13,924 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:26:13,972 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:26:14,129 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:28:57,753 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:28:57,836 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:28:57,993 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:36:12,178 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:36:12,213 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:36:12,320 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:36:20,948 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 12:36:50,765 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:37:13,747 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:37:13,883 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:37:24,995 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 12:37:25,620 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 12:37:55,061 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 12:37:59,258 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 12:37:59,258 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 12:37:59,259 ERROR Application [main-EventThread] Closed Successfully
2024-01-26 12:37:59,259 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 12:43:01,698 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:43:28,115 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:43:28,225 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 12:43:36,981 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 12:44:07,003 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 12:48:16,805 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 12:48:28,003 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 12:48:28,112 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:14:04,158 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:14:19,311 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:14:19,500 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:14:38,661 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:14:41,049 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 17:15:08,770 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 17:15:14,047 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:101)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 17:17:35,808 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:17:56,510 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:18:06,899 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:18:07,016 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:18:30,658 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:18:33,844 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 17:19:00,666 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 17:19:31,405 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:19:39,872 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:19:39,991 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:20:06,705 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:20:27,775 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 17:20:36,710 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 17:22:45,975 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:22:52,738 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:22:52,858 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:23:20,656 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:23:27,822 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 17:23:38,878 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 17:23:38,971 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 17:23:50,667 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 17:24:59,854 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:25:07,912 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:25:08,045 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:25:12,667 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:25:13,433 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 17:25:54,974 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:26:09,133 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:26:09,249 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:26:28,622 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:26:32,232 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 17:31:18,945 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:31:19,053 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:31:23,990 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:31:24,095 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116, 192.168.56.116]
2024-01-26 17:32:00,697 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:32:10,634 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:32:25,926 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:32:31,745 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:32:31,853 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:33:00,656 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:33:30,665 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:35)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 17:34:15,524 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 17:34:26,139 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 17:34:26,139 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 17:34:26,139 ERROR Application [main-EventThread] Closed Successfully
2024-01-26 17:34:26,140 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 17:37:15,493 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:37:15,610 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:37:22,116 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:37:22,219 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116, 192.168.56.116]
2024-01-26 17:37:42,629 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:37:52,233 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:37:52,336 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116, 192.168.56.116]
2024-01-26 17:39:39,175 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:39:39,282 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116, 192.168.56.116, 192.168.56.116]
2024-01-26 17:39:42,515 INFO Zookeeper.ServiceRegistry [main-EventThread] Already registered to service registry
2024-01-26 17:39:42,628 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116, 192.168.56.116]
2024-01-26 17:39:49,496 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:39:49,606 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116, 192.168.56.116, 192.168.56.116]
2024-01-26 17:40:10,611 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116, 192.168.56.116]
2024-01-26 17:40:14,632 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:40:38,089 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:40:38,207 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116, 192.168.56.116]
2024-01-26 17:40:46,654 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:42:07,806 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:42:07,807 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:42:30,871 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:42:36,581 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:42:36,683 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:42:36,692 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:42:37,846 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:35)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 17:42:37,957 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:43:06,686 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:43:06,686 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:43:06,692 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:43:36,802 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 17:44:00,713 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:44:16,079 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:46:04,172 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:46:08,253 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:46:08,356 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:46:08,356 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:46:08,368 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:46:38,658 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:46:38,661 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:46:38,663 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:46:42,636 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 17:46:53,355 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 17:46:53,442 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.RuntimeException: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:113)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /service_registry
at org.apache.zookeeper.KeeperException.create(KeeperException.java:133)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
at Zookeeper.ServiceRegistry.updateAddresses(ServiceRegistry.java:74)
at Zookeeper.ServiceRegistry.process(ServiceRegistry.java:108)
... 2 common frames omitted
2024-01-26 17:47:08,692 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:35)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 17:48:59,778 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:49:04,962 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:49:05,066 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:49:05,066 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:49:05,084 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:51:14,628 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:51:14,628 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:51:23,278 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:51:27,478 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:51:27,583 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:51:27,583 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:51:27,599 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:52:14,604 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:52:14,605 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 17:59:14,193 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 17:59:18,766 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 17:59:18,872 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:59:18,872 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 17:59:18,894 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:01:00,660 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:01:00,660 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:01:00,701 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:01:15,506 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:01:22,622 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:01:22,722 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:01:22,725 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:01:22,732 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:02:28,633 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:02:28,634 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:02:28,633 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:02:45,542 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:02:48,556 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:02:48,663 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:02:48,663 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:02:48,669 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:04:10,593 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:04:10,593 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:04:10,593 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:04:34,810 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:04:43,998 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:04:44,099 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:04:44,099 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:04:44,105 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:06:16,677 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:06:16,678 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:06:16,679 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:06:46,688 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:35)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 18:07:48,404 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:07:51,697 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:07:51,799 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:07:51,799 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:07:51,810 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:08:50,601 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:08:50,601 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:10:39,294 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:10:46,121 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:10:46,229 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:10:46,230 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:10:46,252 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:11:14,659 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:11:14,659 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:11:14,661 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:11:44,668 ERROR org.apache.zookeeper.ClientCnxn [main-EventThread] Error while calling watcher.
java.lang.ArithmeticException: / by zero
at Coordinator_Worker.Coordinator.startCoordinator(Coordinator.java:33)
at Zookeeper.OnElectionAction.onElectedToBeLeader(OnElectionAction.java:23)
at Zookeeper.LeaderElection.reelectLeader(LeaderElection.java:44)
at Zookeeper.LeaderElection.process(LeaderElection.java:65)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:563)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:538)
2024-01-26 18:13:08,272 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:13:13,478 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:13:13,580 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:13:13,580 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:13:13,584 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:13:42,613 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:13:42,613 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:13:42,614 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:14:41,982 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 18:15:02,486 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:15:07,525 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:15:07,627 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:15:07,627 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:15:07,639 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:15:36,610 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:15:36,611 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:15:36,611 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:17:14,172 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:17:24,252 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:17:24,362 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:17:24,361 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:17:24,382 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:17:48,606 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:17:48,606 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:17:48,613 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:19:26,658 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:19:31,561 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:19:31,674 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:19:31,676 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:19:31,694 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:20:02,589 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:20:02,589 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:20:02,590 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:20:20,442 ERROR Application [main-EventThread] Disconnected from Zookeeper
2024-01-26 18:21:27,324 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:21:31,062 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:21:31,149 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:21:31,168 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:21:31,185 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:22:28,596 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:22:28,597 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:22:28,596 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: []
2024-01-26 18:23:53,585 INFO Zookeeper.ServiceRegistry [main] The cluster addresses are: []
2024-01-26 18:23:55,781 INFO Zookeeper.ServiceRegistry [main] Registered to service registry
2024-01-26 18:23:55,883 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:23:55,883 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
2024-01-26 18:23:55,891 INFO Zookeeper.ServiceRegistry [main-EventThread] The cluster addresses are: [192.168.56.116]
...@@ -55,7 +55,7 @@ public class Application implements Watcher { ...@@ -55,7 +55,7 @@ public class Application implements Watcher {
} }
} }
private void close() throws InterruptedException { void close() throws InterruptedException {
this.zooKeeper.close(); this.zooKeeper.close();
} }
......
...@@ -4,22 +4,23 @@ import java.io.*; ...@@ -4,22 +4,23 @@ import java.io.*;
import java.net.Socket; import java.net.Socket;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentLinkedQueue;
public class Communication { public class Communication {
public static void sendData(Socket socket, String dataString, List<String> fileNames) throws IOException { public static void sendData(Socket socket, String dataString, List<String> fileNames) throws IOException {
ObjectOutputStream objectOutputStream = new ObjectOutputStream(socket.getOutputStream()); ObjectOutputStream objectOutputStream = new ObjectOutputStream(socket.getOutputStream());
objectOutputStream.writeObject(new DataObject(dataString, fileNames)); objectOutputStream.writeObject(new DataObject(dataString, fileNames));
} }
public static List<Document> receiveResult(Socket socket) throws IOException, ClassNotFoundException { public static ConcurrentLinkedQueue<Document> receiveResult(Socket socket) throws IOException, ClassNotFoundException {
ObjectInputStream objectInputStream = new ObjectInputStream(socket.getInputStream()); ObjectInputStream objectInputStream = new ObjectInputStream(socket.getInputStream());
return (List<Document>) objectInputStream.readObject(); return (ConcurrentLinkedQueue <Document>) objectInputStream.readObject();
} }
public static DataObject receiveData(Socket socket) throws IOException, ClassNotFoundException { public static DataObject receiveData(Socket socket) throws IOException, ClassNotFoundException {
ObjectInputStream objectInputStream = new ObjectInputStream(socket.getInputStream()); ObjectInputStream objectInputStream = new ObjectInputStream(socket.getInputStream());
return (DataObject) objectInputStream.readObject(); return (DataObject) objectInputStream.readObject();
} }
public static void sendResult(Socket socket, List<Document> response) throws IOException { public static void sendResult(Socket socket, ConcurrentLinkedQueue<Document> response) throws IOException {
ObjectOutputStream objectOutputStream = new ObjectOutputStream(socket.getOutputStream()); ObjectOutputStream objectOutputStream = new ObjectOutputStream(socket.getOutputStream());
objectOutputStream.writeObject(response); objectOutputStream.writeObject(response);
} }
......
...@@ -4,6 +4,7 @@ import Zookeeper.ServiceRegistry; ...@@ -4,6 +4,7 @@ import Zookeeper.ServiceRegistry;
import java.io.IOException; import java.io.IOException;
import java.net.Socket; import java.net.Socket;
import java.net.UnknownHostException;
import java.nio.file.DirectoryStream; import java.nio.file.DirectoryStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
...@@ -12,21 +13,20 @@ import java.util.*; ...@@ -12,21 +13,20 @@ import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
public class Coordinator { public class Coordinator {
private static final int PORT = 4444; private static final int PORT = 12363;
public static void startCoordinator() { public static void startCoordinator() {
ConcurrentLinkedQueue<Document> workersResult = new ConcurrentLinkedQueue<>();
try { try {
List<Future<List<Document>>> futures = new ArrayList<>();
List<Document> resultFromAllWorkers=new ArrayList<>();
String dataString = "the car"; String dataString = "the car";
String [] parts = dataString.split("\\s"); String[] parts = dataString.split("\\s");
List<Term> terms = new ArrayList<>(); List<Term> terms = new ArrayList<>();
for (String part:parts) { for (String part : parts) {
terms.add(new Term(part)); terms.add(new Term(part));
} }
TreeMap<String,Double> response= new TreeMap<>(); TreeMap<String, Double> response = new TreeMap<>();
List<String> fileNames = getFileNamesInDirectory("src/main/resources"); List<String> fileNames = getFileNamesInDirectory("src/main/resources");
...@@ -36,71 +36,54 @@ public class Coordinator { ...@@ -36,71 +36,54 @@ public class Coordinator {
int index = 0; int index = 0;
List<CoordinatorHandler> handlerList = new ArrayList<>();
ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
if(ServiceRegistry.getWorkers().size()==1){ for (Worker worker : ServiceRegistry.getWorkers()) {
List<String> workerFilesList = new ArrayList<>();
for (int i = 0; i < eachWorkerFiles; i++) {
workerFilesList.add(fileNames.get(index));
index++;
if (mode != 0) {
if (index != fileNames.size()) {
workerFilesList.add(fileNames.get(index));
index++;
}
}
}
// Connect to worker // Connect to worker
Socket workerSocket = new Socket("127.0.0.1", PORT); Socket workerSocket = new Socket("127.0.0.1", PORT);
// Create a CoordinatorHandler instance for each worker // Create a CoordinatorHandler instance for each worker
CoordinatorHandler handler = new CoordinatorHandler(dataString,workerSocket, fileNames); Runnable task = () -> processRequest(workerSocket, workerFilesList, dataString, workersResult);
handlerList.add(handler);
// Start the CoordinatorHandler thread // Start the CoordinatorHandler thread
futures.add(executorService.submit(handler)); executorService.submit(task);
}else {
for (Worker worker : ServiceRegistry.getWorkers()) {
List<String> workerFilesList = new ArrayList<>();
for (int i = 0; i < eachWorkerFiles; i++) {
workerFilesList.add(fileNames.get(index));
index++;
if (mode != 0) {
if (index != fileNames.size()) {
workerFilesList.add(fileNames.get(index));
index++;
}
}
// Connect to worker
Socket workerSocket = new Socket("127.0.0.1", PORT);
// Create a CoordinatorHandler instance for each worker
CoordinatorHandler handler = new CoordinatorHandler(dataString, workerSocket, workerFilesList);
handlerList.add(handler);
// Start the CoordinatorHandler thread
futures.add(executorService.submit(handler));
}
}
}
for (Future<List<Document>> future : futures) {
try {
List<Document> documents = future.get();
resultFromAllWorkers.addAll(documents);
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
} }
executorService.awaitTermination(5,TimeUnit.MICROSECONDS); executorService.awaitTermination(5, TimeUnit.SECONDS);
// Shut down the executor after all tasks are submitted for (int i = 0; i < terms.size(); i++) {
executorService.shutdown(); for (Document document : workersResult) {
Map<String, Double> tf = document.getTf();
for (int i=0 ; i<terms.size();i++) { if (tf.get(terms.get(i).getTermName()) > 0) ;
for (Document document:resultFromAllWorkers) { terms.get(i).increase();
Map<String,Double> tf = document.getTf();
if(tf.get(terms.get(i))>0);
terms.get(i).increase();
} }
} }
TreeMap<String,Double> IDF = new TreeMap<>();
for (Document document: resultFromAllWorkers) { TreeMap<String, Double> IDF = new TreeMap<>();
for (Document document : workersResult) {
document.setTerms(terms); document.setTerms(terms);
document.CalculateIDF(fileNames.size()); document.CalculateIDF(fileNames.size());
IDF.put(document.getName(),document.getIDF()); IDF.put(document.getName(), document.getIDF());
} }
System.out.println("IDF Files: "+ IDF); System.out.println("IDF Files: " + IDF);
executorService.shutdown();
} catch (UnknownHostException e) {
throw new RuntimeException(e);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); throw new RuntimeException(e);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
}finally {
} }
} }
...@@ -130,46 +113,23 @@ public class Coordinator { ...@@ -130,46 +113,23 @@ public class Coordinator {
} }
} }
static class CoordinatorHandler implements Callable<List<Document>> { private static void processRequest(Socket clientSocket, List<String> fileNames,
private Socket clientSocket; String dataString, ConcurrentLinkedQueue<Document> documents) {
private List<String> fileNames = new ArrayList<>();
// private List<Document> result = new ArrayList<>();
String dataString= "";
public CoordinatorHandler(String dataString,Socket socket, List<String> fileNames) {
this.clientSocket = socket;
this.fileNames.addAll(fileNames);
this.dataString=dataString;
}
@Override
public List<Document> call() {
List<Document> result=new ArrayList<>();
try {
// Assume the coordinator sends a string and a list of file names
// Send data to worker try {
Communication.sendData(clientSocket, dataString, fileNames); // Send data to worker
Communication.sendData(clientSocket, dataString, fileNames);
// Receive results from worker // Receive results from worker
result = Communication.receiveResult(clientSocket); ConcurrentLinkedQueue<Document> d = Communication.receiveResult(clientSocket);
System.out.println("Received result from worker: " + result); documents.addAll(d);
clientSocket.close(); clientSocket.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
return result;
}
} }
// public List<Document> getResult() {
// return result;
// }
} }
} }
...@@ -8,12 +8,13 @@ import java.util.Map; ...@@ -8,12 +8,13 @@ import java.util.Map;
public class Document implements Serializable { public class Document implements Serializable {
private String name; private String name;
private Map<String,Double> tf; private Map<String,Double> tf=new HashMap<>();
private List<Term> terms; private List<Term> terms;
private Double IDF=0.0; private Double IDF=0.0;
public Document(String name) public Document(String name)
{ {
this.name = name; this.name = name;
this.terms = new ArrayList<>(); // Initialize the terms list
} }
public String getName() { public String getName() {
return name; return name;
......
...@@ -5,31 +5,32 @@ import java.io.IOException; ...@@ -5,31 +5,32 @@ import java.io.IOException;
import java.net.ServerSocket; import java.net.ServerSocket;
import java.net.Socket; import java.net.Socket;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.*; import java.util.concurrent.*;
public class Worker { public class Worker {
private static final int PORT = 4444; private static final int PORT = 12363;
private String nodeName; private String nodeName;
private String ipAddress; private String ipAddress;
private String userName; private String userName;
private static List<Document> documents = new ArrayList<>();
public Worker(String fullPathNode) { public Worker(String fullPathNode) {
this.nodeName = fullPathNode; this.nodeName = fullPathNode;
} }
public static void startWorker() { public static void startWorker() {
// Step 1: Set up server socket to listen for connections ServerSocket serverSocket = null;
try {
// Step 1: Set up server socket to listen for connections
serverSocket = new ServerSocket(PORT);
} catch (IOException e) {
throw new RuntimeException(e);
}
while (true) { while (true) {
try { try {
ServerSocket serverSocket = new ServerSocket(PORT); System.out.println("Waiting Request");
// Step 2: Accept connection from coordinator // Step 2: Accept connection from coordinator
Socket coordinatorSocket = serverSocket.accept(); Socket coordinatorSocket = serverSocket.accept();
...@@ -38,14 +39,14 @@ public class Worker { ...@@ -38,14 +39,14 @@ public class Worker {
System.out.println("Received data from coordinator: " + data.getDataString() + ", " + data.getFileNames()); System.out.println("Received data from coordinator: " + data.getDataString() + ", " + data.getFileNames());
// Step 4: Process the data using IDF algorithm // Step 4: Process the data using IDF algorithm
List<Document> response = IDF(data); ConcurrentLinkedQueue<Document> response = new ConcurrentLinkedQueue<>();
response.addAll(IDF(data));
// Step 5: Send the result back to the coordinator // Step 5: Send the result back to the coordinator
Communication.sendResult(coordinatorSocket, response); Communication.sendResult(coordinatorSocket, response);
// Step 6: Close sockets // Step 6: Close sockets
coordinatorSocket.close(); coordinatorSocket.close();
serverSocket.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
...@@ -56,48 +57,36 @@ public class Worker { ...@@ -56,48 +57,36 @@ public class Worker {
// Function to calculate IDF for each term in the search query across files // Function to calculate IDF for each term in the search query across files
private static List<Document> IDF(DataObject data) { private static ConcurrentLinkedQueue<Document> IDF(DataObject data) {
ConcurrentLinkedQueue<Document> documents=new ConcurrentLinkedQueue<>();
String searchQuery = data.getDataString(); String searchQuery = data.getDataString();
List<Document> r=new ArrayList<>();
String[] terms = searchQuery.split("\\s+"); String[] terms = searchQuery.split("\\s+");
// Step 2: Use ExecutorService for parallel processing // Step 2: Use ExecutorService for parallel processing
ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
try { try {
List<Callable<Document>> tasks=new ArrayList<>();
List<Future<Document>> futures = new ArrayList<>(); // Step 3: Submit a task for each file to the ExecutorService
for (String fileName : data.getFileNames()) { for (String fileName : data.getFileNames()) {
File file = new File("C:\\Users\\Abdullah\\Downloads\\network-communication-master\\Cordinator_Worker\\src\\main\\resources\\" + fileName); File file = new File("C:\\Users\\Abdullah\\Downloads\\network-communication-master\\Cordinator_Worker\\src\\main\\resources\\" + fileName);
Callable<Document> task = () -> processFile(file, terms); Runnable task = () -> processFile(file, terms,documents);
tasks.add(task); executorService.submit(task);
futures.add(executorService.submit(task));
}
executorService.awaitTermination(2, TimeUnit.MILLISECONDS);
// Step 4: Retrieve results from Future and merge into the 'r' list
for (Future<Document> future : futures) {
try {
Document document = future.get();
r.add(document);
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
} }
executorService.awaitTermination(2, TimeUnit.SECONDS);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); throw new RuntimeException(e);
} finally { } finally {
// Step 5: Shutdown the ExecutorService //Step 5: Shutdown the ExecutorService
executorService.shutdown(); executorService.shutdown();
} }
// Step 6: Return the final IDF map // Step 6: Return the final IDF map
return r; return documents;
} }
// Function to process each file and calculate term frequencies // Function to process each file and calculate term frequencies
private static Document processFile(File file, String[] terms) { private static void processFile(File file, String[] terms,ConcurrentLinkedQueue<Document>documents) {
Document document = new Document(file.getName()); Document document = new Document(file.getName());
int totalWords = 0; double totalWords = 0;
try { try {
// Read content from the file // Read content from the file
...@@ -106,27 +95,22 @@ public class Worker { ...@@ -106,27 +95,22 @@ public class Worker {
// Calculate term frequencies in the file // Calculate term frequencies in the file
for (String term : terms) { for (String term : terms) {
int frequency = 0; double frequency = 0;
for (String word : words) { for (String word : words) {
if (word.equals(term)) { if (word.equals(term)) {
frequency++; frequency++;
} }
totalWords++; totalWords++;
} }
document.setTf(term, (double) (frequency / totalWords)); Double d= frequency/totalWords;
document.setTf(term, d);
documents.offer(document);
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
// Handle file reading exception // Handle file reading exception
}finally {
return document;
} }
} }
private static synchronized void addToDocuments(Document document) {
documents.add(document);
}
public void setIpAddress(String ipAddress) { public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress; this.ipAddress = ipAddress;
} }
......
...@@ -30,7 +30,9 @@ public class OnElectionAction implements OnElectionCallback { ...@@ -30,7 +30,9 @@ public class OnElectionAction implements OnElectionCallback {
String currentServerAddress = String currentServerAddress =
"192.168.56.116"+","+username+"," +port; "192.168.56.116"+","+username+"," +port;
serviceRegistry.registerToCluster(currentServerAddress); serviceRegistry.registerToCluster(currentServerAddress);
Worker.startWorker(); Runnable task = ()->Worker.startWorker();
Thread thread =new Thread(task);
thread.start();
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
}catch (KeeperException e) { }catch (KeeperException e) {
......
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