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
b2170bd2
Commit
b2170bd2
authored
Oct 12, 2021
by
Pramod S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug. BUG: Upon disconnection, the client stream was not removed.
parent
1df83a44
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/NetworkHandler.java
...ain/java/hpdos_rdma_offloaded/handler/NetworkHandler.java
+5
-5
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/service/MasterMetadataServerService.java
...s_rdma_offloaded/service/MasterMetadataServerService.java
+16
-1
No files found.
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/NetworkHandler.java
View file @
b2170bd2
...
...
@@ -35,10 +35,10 @@ import hpdos_rdma_offloaded.protocol.RpcProtocol;
public
class
NetworkHandler
{
private
ExecutorService
executorService
;
// public HashMap<String, DaRPCStream<Request, Response>> streams;
public
static
List
<
DaRPCStream
<
InvalidationRequest
,
InvalidationResponse
>>
invalidationStreams
=
new
ArrayList
<>();
public
static
ConcurrentHashMap
<
String
,
DaRPCStream
<
InvalidationRequest
,
InvalidationResponse
>>
invalidationStreams
=
new
ConcurrentHashMap
<>();
public
static
List
<
Follower
>
followers
=
new
ArrayList
<>();
boolean
isMaster
;
ConcurrentHashMap
<
SocketAddress
,
DaRPCStream
<
InvalidationRequest
,
InvalidationResponse
>>
invalidationClientEpStreams
;
//
ConcurrentHashMap<SocketAddress,DaRPCStream<InvalidationRequest, InvalidationResponse>> invalidationClientEpStreams;
public
NetworkHandler
(
boolean
isMaster
){
this
.
executorService
=
Executors
.
newFixedThreadPool
(
10
);
...
...
@@ -49,7 +49,7 @@ public class NetworkHandler {
public
void
setClientStreams
(
ConcurrentHashMap
<
SocketAddress
,
DaRPCStream
<
InvalidationRequest
,
InvalidationResponse
>>
invalidationClientEpStreams
)
{
this
.
invalidationClientEpStreams
=
invalidationClientEpStreams
;
//
this.invalidationClientEpStreams = invalidationClientEpStreams;
}
public
void
connectToSal
(
String
ip
)
throws
Exception
{
...
...
@@ -64,7 +64,7 @@ public class NetworkHandler {
DaRPCClientEndpoint
<
InvalidationRequest
,
InvalidationResponse
>
clientEp
=
group
.
createEndpoint
();
clientEp
.
connect
(
address
,
1000
);
DaRPCStream
<
InvalidationRequest
,
InvalidationResponse
>
stream
=
clientEp
.
createStream
();
NetworkHandler
.
invalidationStreams
.
add
(
stream
);
NetworkHandler
.
invalidationStreams
.
put
(
ip
,
stream
);
}
public
void
connectToFollower
(
String
uid
,
String
ip
)
throws
Exception
{
...
...
@@ -185,7 +185,7 @@ public class NetworkHandler {
invalidationRequest
.
setKey
(
request
.
getKey
());
Set
<
Callable
<
DaRPCFuture
<
InvalidationRequest
,
InvalidationResponse
>>>
callables
=
new
HashSet
<>();
ArrayList
<
DaRPCFuture
<
InvalidationRequest
,
InvalidationResponse
>>
requestFutures
=
new
ArrayList
<>();;
for
(
DaRPCStream
<
InvalidationRequest
,
InvalidationResponse
>
invalidationStream
:
NetworkHandler
.
invalidationStreams
)
{
for
(
DaRPCStream
<
InvalidationRequest
,
InvalidationResponse
>
invalidationStream
:
NetworkHandler
.
invalidationStreams
.
values
()
)
{
callables
.
add
(()->{
InvalidationResponse
response
=
new
InvalidationResponse
();
DaRPCFuture
<
InvalidationRequest
,
InvalidationResponse
>
future
=
invalidationStream
.
request
(
invalidationRequest
,
response
,
false
);
...
...
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/service/MasterMetadataServerService.java
View file @
b2170bd2
...
...
@@ -121,8 +121,23 @@ public class MasterMetadataServerService extends RpcProtocol implements DaRPCSer
@Override
public
void
close
(
DaRPCServerEndpoint
<
Request
,
Response
>
rpcClientEndpoint
)
{
System
.
out
.
println
(
"Closing Connection"
);
try
{
SocketAddress
socketAddress
=
rpcClientEndpoint
.
getDstAddr
();
String
ipAddress
=
socketAddress
.
toString
();
int
startIndex
=
ipAddress
.
indexOf
(
"/"
)
+
1
;
int
endIndex
=
ipAddress
.
indexOf
(
":"
);
ipAddress
=
ipAddress
.
substring
(
startIndex
,
endIndex
);
System
.
out
.
println
(
"Closing Connection for ip address: "
+
ipAddress
);
NetworkHandler
.
invalidationStreams
.
remove
(
ipAddress
);
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
// TODO : Remove the connection from the static lists stores in Network Handler
// NetworkHandler.invalidationStreams.remove(rpcClientEndpoint.)
}
...
...
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