Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
K
key_value-server
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
amir.yosef
key_value-server
Commits
eb57815b
Commit
eb57815b
authored
Aug 13, 2024
by
amir.yosef
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding Director
parent
5c89bdef
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
Main.java
src/Main.java
+8
-7
Director.java
src/builder/Director.java
+11
-0
No files found.
src/Main.java
View file @
eb57815b
import
builder.Director
;
import
builder.ServerBuilder
;
import
server.Server
;
import
java.io.IOException
;
public
class
Main
{
public
static
void
main
(
String
[]
args
)
{
try
{
Server
.
getInstance
().
start
();
}
catch
(
IOException
e
)
{
System
.
err
.
println
(
"Server failed to start: "
+
e
.
getMessage
());
}
Director
director
=
new
Director
();
ServerBuilder
builder
=
new
ServerBuilder
();
director
.
buildMaster
(
builder
);
builder
.
port
(
16379
);
Server
server
=
builder
.
build
();
server
.
start
();
}
}
\ No newline at end of file
src/builder/Director.java
0 → 100644
View file @
eb57815b
package
builder
;
public
class
Director
{
public
void
buildMaster
(
ServerBuilder
builder
)
{
builder
.
role
(
"Master"
);
}
public
void
buildReplica
(
ServerBuilder
builder
)
{
builder
.
role
(
"Replica"
);
}
}
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