Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hpdos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SYNERG
hpdos
Commits
cfb4eeec
Commit
cfb4eeec
authored
Apr 17, 2022
by
Pramod S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added config
parent
043a1aab
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
18 deletions
+69
-18
code/hpdos_rdma_offloaded/app.config
code/hpdos_rdma_offloaded/app.config
+24
-0
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/MetadataServer.java
...ed/src/main/java/hpdos_rdma_offloaded/MetadataServer.java
+14
-4
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/NetworkHandlerM.java
...in/java/hpdos_rdma_offloaded/handler/NetworkHandlerM.java
+8
-6
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/service/MetadataServiceMaster.java
...a/hpdos_rdma_offloaded/service/MetadataServiceMaster.java
+23
-8
No files found.
code/hpdos_rdma_offloaded/app.config
0 → 100644
View file @
cfb4eeec
app
.
HOST
=
192
.
168
.
200
.
20
app
.
MASTER
=
true
app
.
NFOLLOWER
=
1
app
.
FOLLOWER1
=
192
.
168
.
200
.
40
app
.
FOLLOWER2
=
app
.
MASTER_IP
=
NA
#this is how to pair threads to cpu cores
app
.
cpu_affinity
=
6
//
No
of
thread
for
each
connectin
app
.
rdma_cluster_size
=
4
app
.
rdma_receive_queue
=
32
app
.
rdma_send_queue
=
32
app
.
rdma_polling
=
false
app
.
rdma_max_inline
=
0
app
.
rdma_server_port
=
1920
app
.
NETWORK_HANDLER_THREADS
=
10
app
.
REPLICATION_HANDLER_THREADS
=
10
app
.
db_path
=/
tmp
/
rocks
#The below properties are for master node only.
app
.
follower_registration_port
=
9876
app
.
sal_registration_port
=
9875
#Below properties are for followers only.
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/MetadataServer.java
View file @
cfb4eeec
...
...
@@ -44,10 +44,14 @@ public class MetadataServer{
DaRPCClientGroupM
<
Request
,
Response
>
followerClientGroup
=
DaRPCClientGroupM
.
createClientGroup
(
rpcProtocol
,
100
,
10
,
16
,
16
);
for
(
int
i
=
0
;
i
<
property
.
nFollowers
;
i
++)
{
logger
.
debug
(
"connecting to follower"
);
var
endpoint
=
followerClientGroup
.
createEndpoint
();
endpoint
.
connect
(
new
InetSocketAddress
(
property
.
followersIP
[
i
],
property
.
port
),
100
);
if
(
endpoint
.
isConnected
())
networkHandler
.
addReplicationStream
(
endpoint
.
createStream
());
{
logger
.
debug
(
"follower connected"
,
property
.
followersIP
[
i
]);
networkHandler
.
addReplicationStream
(
endpoint
.
createStream
());
}
else
logger
.
error
(
"Follower Not connected"
,
property
.
followersIP
[
i
]);
}
...
...
@@ -55,7 +59,9 @@ public class MetadataServer{
group
=
DaRPCServerGroup
.
createServerGroup
(
metadataServerService
,
property
.
clusterAffinities
,
1000
,
property
.
maxinline
,
property
.
polling
,
property
.
recvQueue
,
property
.
sendQueue
,
property
.
wqSize
,
property
.
clusterSize
);
ForkJoinPool
.
commonPool
().
execute
(
networkHandler
);
Thread
networkhandlerThread
=
new
Thread
(
networkHandler
);
networkhandlerThread
.
setName
(
"networkHandlerThread"
);;
networkhandlerThread
.
start
();
}
else
{
...
...
@@ -71,11 +77,13 @@ public class MetadataServer{
InetSocketAddress
address
=
new
InetSocketAddress
(
property
.
host
,
property
.
port
);
serverEp
.
bind
(
address
,
100
);
while
(
true
){
while
(
true
)
{
try
{
logger
.
debug
(
"Listening to RDMA requests a, IP: "
+
property
.
host
+
" , PORT: "
+
property
.
port
);
serverEp
.
accept
();
Thread
.
getAllStackTraces
();
logger
.
debug
(
"Accepted connection."
);
}
catch
(
IOException
e
)
...
...
@@ -91,11 +99,13 @@ public class MetadataServer{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Property
property
=
new
Property
(
args
[
0
]);
Property
property
=
new
Property
(
"./app.config"
);
//Property property = new Property(args[0]);
RocksDB
.
loadLibrary
();
//BasicConfigurator.configure();
var
server
=
new
MetadataServer
();
server
.
storageHandler
=
new
StorageHandler
(
property
.
dbPath
);
server
.
run
(
property
);
}
}
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/NetworkHandlerM.java
View file @
cfb4eeec
...
...
@@ -32,7 +32,9 @@ public class NetworkHandlerM implements Runnable{
public
void
addReplicationStream
(
DaRPCStreamM
<
Request
,
Response
>
stream
)
{
logger
.
debug
(
"size"
+
replicationStreams
.
size
());
this
.
replicationStreams
.
add
(
stream
);
logger
.
debug
(
"size"
+
replicationStreams
.
size
());
}
void
processCloseInvalidationStream
(
DaRPCStreamM
<
InvalidationRequest
,
InvalidationResponse
>
stream
)
...
...
@@ -85,6 +87,7 @@ public class NetworkHandlerM implements Runnable{
}
void
processCloseReplicationStream
(
DaRPCStreamM
<
Request
,
Response
>
stream
)
{
logger
.
info
(
"stream closed"
);
stream
.
completedList
.
forEach
(
future
->
{
if
(
future
.
metadataResponse
.
replicationDone
.
incrementAndGet
()
==
future
.
metadataResponse
.
replicatonTotal
)
...
...
@@ -148,7 +151,7 @@ public class NetworkHandlerM implements Runnable{
});
replicationStreams
.
forEach
(
stream
->
{
if
(
!
stream
.
endpoint
.
isClosed
())
if
(
stream
.
endpoint
.
isClosed
())
{
processCloseReplicationStream
(
stream
);
replicationStreams
.
remove
(
stream
);
...
...
@@ -183,8 +186,7 @@ public class NetworkHandlerM implements Runnable{
if
(
i
==
0
)
{
logger
.
debug
(
"Zero invalidation"
);
response
.
state
.
incrementAndGet
();
if
(
response
.
state
.
get
()
==
Response
.
DONE
)
if
(
response
.
state
.
incrementAndGet
()
==
Response
.
DONE
)
{
try
{
...
...
@@ -200,7 +202,6 @@ public class NetworkHandlerM implements Runnable{
public
void
sendReplications
(
Request
request
,
Response
response
)
{
logger
.
debug
(
"replication send "
+
replicationStreams
.
size
());
/*Request repRequest = new Request();
repRequest.setRequestType(request.getRequestType());
repRequest.setKey(request.getKey());
...
...
@@ -211,6 +212,7 @@ public class NetworkHandlerM implements Runnable{
}
*/
int
i
=
0
;
logger
.
debug
(
"sending Replication "
+
replicationStreams
.
size
());
for
(
var
stream
:
replicationStreams
)
{
try
...
...
@@ -228,11 +230,11 @@ public class NetworkHandlerM implements Runnable{
if
(
i
==
0
)
{
logger
.
debug
(
"Zero replication"
);
response
.
state
.
incrementAndGet
();
//This will happens only when there are no followers
//and when this thread get delayed and invalidations got succesuful
if
(
response
.
state
.
g
et
()
==
Response
.
DONE
)
if
(
response
.
state
.
incrementAndG
et
()
==
Response
.
DONE
)
{
logger
.
debug
(
"sending Response"
);
try
{
response
.
event
.
triggerResponse
();
}
catch
(
IOException
ex
)
...
...
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/service/MetadataServiceMaster.java
View file @
cfb4eeec
...
...
@@ -62,10 +62,13 @@ public class MetadataServiceMaster extends RpcProtocol implements DaRPCService<R
this
.
storageHandler
.
create
(
request
);
endTime
=
System
.
nanoTime
();
timeTaken
=
(
endTime
-
startTime
)
/
1000
;
response
.
state
.
getAndIncrement
();
//ExperimentStatistics.collectStatistics(timeTaken, "localWriteTime");
logger
.
debug
(
"Time to write to local cache: "
+
timeTaken
);
if
(
response
.
state
.
incrementAndGet
()
==
Response
.
DONE
)
{
logger
.
debug
(
"sendingResponse"
);
event
.
triggerResponse
();
}
response
.
setAck
(
AckType
.
SUCCESS
);
response
.
setKey
(
null
);
response
.
setValue
(
null
);
...
...
@@ -93,7 +96,11 @@ public class MetadataServiceMaster extends RpcProtocol implements DaRPCService<R
stopwatch
.
start
();
this
.
storageHandler
.
delete
(
request
);
stopwatch
.
stop
();
response
.
state
.
getAndIncrement
();
if
(
response
.
state
.
incrementAndGet
()
==
Response
.
DONE
)
{
logger
.
debug
(
"sendingResponse"
);
event
.
triggerResponse
();
}
logger
.
debug
(
"Time to delete to local cache: "
+
stopwatch
.
elapsed
(
TimeUnit
.
MICROSECONDS
));
stopwatch
.
reset
();
...
...
@@ -106,11 +113,16 @@ public class MetadataServiceMaster extends RpcProtocol implements DaRPCService<R
event
.
triggerResponse
();
}
}
catch
(
RocksDBException
ex
){
ex
.
printStackTrace
();
catch
(
RocksDBException
ex
)
{
logger
.
debug
(
ex
.
getMessage
());
response
.
setAck
(
AckType
.
DBFAILED
);
event
.
triggerResponse
();
}
catch
(
IOException
ex
)
{
logger
.
debug
(
ex
.
getMessage
());
}
}
@Override
...
...
@@ -124,13 +136,16 @@ public class MetadataServiceMaster extends RpcProtocol implements DaRPCService<R
InetSocketAddress
clientSocketAddress
=
new
InetSocketAddress
(
clientIP
,
1921
);
logger
.
debug
(
"Creating Endpoint"
);
var
invalidationClientEp
=
invalidationClientGroup
.
createEndpoint
();
logger
.
debug
(
"Connecting Endpoint"
);
invalidationClientEp
.
connect
(
clientSocketAddress
,
1000
);
if
(
invalidationClientEp
.
isConnected
()){
logger
.
debug
(
"connect call success"
);
if
(
invalidationClientEp
.
isConnected
())
{
logger
.
debug
(
"accepted"
);
this
.
networkHandler
.
addInvalidationStream
(
invalidationClientEp
.
createStream
());
}
else
{
else
{
logger
.
error
(
"Not able to Connect to client for invalidation"
);
}
}
...
...
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