Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Distributed File System
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tmp1u19
Distributed File System
Commits
f0101c8f
Commit
f0101c8f
authored
4 years ago
by
tmp1u19
Browse files
Options
Downloads
Patches
Plain Diff
Modify the classes, add a main function to each of it
parent
6a49dec7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Client.java
+0
-12
0 additions, 12 deletions
src/Client.java
src/Controller.java
+10
-16
10 additions, 16 deletions
src/Controller.java
src/Dstore.java
+9
-15
9 additions, 15 deletions
src/Dstore.java
with
19 additions
and
43 deletions
src/Client.java
deleted
100644 → 0
+
0
−
12
View file @
6a49dec7
public
class
Client
{
// controller port to communicate with
int
cport
;
// timeout in milliseconds
long
timeout
;
public
Client
(
int
cport
,
long
timeout
)
{
this
.
cport
=
cport
;
this
.
timeout
=
timeout
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Controller.java
+
10
−
16
View file @
f0101c8f
...
@@ -3,22 +3,6 @@ import java.net.*;
...
@@ -3,22 +3,6 @@ import java.net.*;
public
class
Controller
{
public
class
Controller
{
// port to listen on
private
int
cport
;
// replication factor => number of Dstores to join
private
int
R
;
// timeout in milliseconds
private
long
timeout
;
// how long to wait to start the next rebalance operation
private
long
rebalance_period
;
public
Controller
(
int
cport
,
int
R
,
long
timeout
,
long
rebalance_period
)
{
this
.
cport
=
cport
;
this
.
R
=
R
;
this
.
timeout
=
timeout
;
this
.
rebalance_period
=
rebalance_period
;
}
// orchestrates client requests
// orchestrates client requests
// maintains an index with the allocation of files to Dstores
// maintains an index with the allocation of files to Dstores
// waits for Dstores to join the datastore (rebalance operation)
// waits for Dstores to join the datastore (rebalance operation)
...
@@ -26,5 +10,15 @@ public class Controller {
...
@@ -26,5 +10,15 @@ public class Controller {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// port to listen on
final
int
cport
=
Integer
.
parseInt
(
args
[
0
]);
// replication factor => number of Dstores to join
int
R
=
Integer
.
parseInt
(
args
[
1
]);
// timeout in milliseconds
int
timeout
=
Integer
.
parseInt
(
args
[
2
]);
// how long to wait to start the next rebalance operation
int
rebalance_period
=
Integer
.
parseInt
(
args
[
3
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Dstore.java
+
9
−
15
View file @
f0101c8f
public
class
Dstore
{
public
class
Dstore
{
// port to listen on
public
static
void
main
(
String
[]
args
)
{
int
port
;
// controller's port to talk to
int
cport
;
// timeout in milliseconds
long
timeout
;
// where to store the data locally
String
file_folder
;
public
Dstore
(
int
port
,
int
cport
,
long
timeout
,
String
file_folder
)
{
// port to listen on
this
.
port
=
port
;
final
int
port
=
Integer
.
parseInt
(
args
[
0
]);
this
.
cport
=
cport
;
// controller's port to talk to
this
.
timeout
=
timeout
;
final
int
cport
=
Integer
.
parseInt
(
args
[
1
]);
this
.
file_folder
=
file_folder
;
// timeout in milliseconds
}
int
timeout
=
Integer
.
parseInt
(
args
[
2
]);
// where to store the data locally
String
file_folder
=
args
[
3
];
public
static
void
main
(
String
[]
args
)
{
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment