Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
D
DS_Project_Part1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ali.saeed
DS_Project_Part1
Commits
0bd9cfe5
Commit
0bd9cfe5
authored
Jan 29, 2024
by
Ali Saeed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Application class to read port from user not from jar
parent
b31a795c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Application.java
...ers/src/main/java/Registration_Discovery/Application.java
+6
-2
No files found.
registration-discovery-leader-reelection-cordinator-workers/src/main/java/Registration_Discovery/Application.java
View file @
0bd9cfe5
...
@@ -8,6 +8,7 @@ import org.slf4j.Logger;
...
@@ -8,6 +8,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Scanner
;
public
class
Application
implements
Watcher
{
public
class
Application
implements
Watcher
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Application
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Application
.
class
);
...
@@ -17,8 +18,11 @@ public class Application implements Watcher {
...
@@ -17,8 +18,11 @@ public class Application implements Watcher {
private
ZooKeeper
zooKeeper
;
private
ZooKeeper
zooKeeper
;
public
static
void
main
(
String
[]
args
)
throws
IOException
,
InterruptedException
,
KeeperException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
,
InterruptedException
,
KeeperException
{
System
.
out
.
println
(
"Enter Port!!!"
);
int
currentServerPort
=
args
.
length
==
1
?
Integer
.
parseInt
(
args
[
0
])
:
DEFAULT_PORT
;
Scanner
scanner
=
new
Scanner
(
System
.
in
);
int
currentServerPort
=
0
;
currentServerPort
=
scanner
.
nextInt
();
// int currentServerPort = args.length == 1 ? Integer.parseInt(args[0]) : DEFAULT_PORT;
Application
application
=
new
Application
();
Application
application
=
new
Application
();
ZooKeeper
zooKeeper
=
application
.
connectToZookeeper
();
ZooKeeper
zooKeeper
=
application
.
connectToZookeeper
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment