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
731e788d
Commit
731e788d
authored
Nov 29, 2021
by
Paras Garg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated files
parent
a155b14c
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
144 additions
and
123 deletions
+144
-123
code/hpdos_rdma_sal/app.config
code/hpdos_rdma_sal/app.config
+1
-1
code/hpdos_rdma_sal/build.gradle
code/hpdos_rdma_sal/build.gradle
+2
-2
code/hpdos_rdma_sal/src/main/java/BenchmarkingClient.java
code/hpdos_rdma_sal/src/main/java/BenchmarkingClient.java
+88
-84
code/hpdos_rdma_sal/src/main/java/MetadataClient.java
code/hpdos_rdma_sal/src/main/java/MetadataClient.java
+12
-9
code/hpdos_rdma_sal/src/main/java/StandaloneRDMAClient.java
code/hpdos_rdma_sal/src/main/java/StandaloneRDMAClient.java
+2
-3
code/hpdos_rdma_sal/src/main/java/hpdos/handlers/NetworkHandlerM.java
...dma_sal/src/main/java/hpdos/handlers/NetworkHandlerM.java
+2
-0
code/hpdos_rdma_sal/src/main/java/hpdos/invalidationServer/InvalidationServer.java
...ain/java/hpdos/invalidationServer/InvalidationServer.java
+3
-3
code/hpdos_rdma_sal/src/main/java/hpdos/protocol/BenchmarkingProperties.java
.../src/main/java/hpdos/protocol/BenchmarkingProperties.java
+12
-12
code/hpdos_rdma_sal/src/main/java/hpdos/protocol/ByteArray.java
...pdos_rdma_sal/src/main/java/hpdos/protocol/ByteArray.java
+16
-3
code/hpdos_rdma_sal/src/main/java/hpdos/protocol/Property.java
...hpdos_rdma_sal/src/main/java/hpdos/protocol/Property.java
+1
-1
code/hpdos_rdma_sal/src/main/java/hpdos/services/InvalidationService.java
...sal/src/main/java/hpdos/services/InvalidationService.java
+5
-5
No files found.
code/hpdos_rdma_sal/app.config
View file @
731e788d
app
.
HOST
=
192
.
168
.
200
.
20
app
.
NO_OF_MASTERS
=
1
app
.
MASTER_HOST1
=
192
.
168
.
200
.
20
#app.MASTER_HOST2=192.168.200.51
app
.
MASTER_HOST2
=
192
.
168
.
200
.
40
app
.
INVALIDATION_PORT
=
1922
app
.
CACHE_SIZE
=
1
code/hpdos_rdma_sal/build.gradle
View file @
731e788d
...
...
@@ -40,8 +40,8 @@ apply plugin: "application"
apply
plugin:
"java-library"
//mainClassName = "MetadataClient"
mainClassName
=
"BenchmarkingClient"
//
mainClassName= "StandaloneRDMAClient"
//
mainClassName = "BenchmarkingClient"
mainClassName
=
"StandaloneRDMAClient"
version
'1.0-SNAPSHOT'
repositories
{
...
...
code/hpdos_rdma_sal/src/main/java/BenchmarkingClient.java
View file @
731e788d
This diff is collapsed.
Click to expand it.
code/hpdos_rdma_sal/src/main/java/MetadataClient.java
View file @
731e788d
...
...
@@ -23,7 +23,7 @@ public class MetadataClient
public
MetadataClient
(
Property
properties
)
throws
Exception
{
String
invalidationServerIP
=
properties
.
invalidationServerIP
;
logger
.
debug
(
"Invalidation server ip: "
+
invalidationServerIP
);
logger
.
info
(
"Invalidation server ip: "
+
invalidationServerIP
);
this
.
cache
=
Caffeine
.
newBuilder
()
.
expireAfterWrite
(
300
,
TimeUnit
.
SECONDS
)
...
...
@@ -37,14 +37,15 @@ public class MetadataClient
public
byte
[]
get
(
byte
[]
key
)
throws
Exception
{
logger
.
debug
(
"Getting From local cache"
);
logger
.
info
(
"Getting From local cache"
);
byte
[]
value
=
this
.
cache
.
getIfPresent
(
new
ByteArray
(
key
));
if
(
value
!=
null
)
return
value
;
logger
.
debug
(
"Not found in cache Getting from server"
);
logger
.
info
(
"Not found in cache Getting from server"
);
var
futureResponse
=
networkHandlerM
.
get
(
key
).
get
(
1
00
,
TimeUnit
.
MILLISECONDS
);
//var futureResponse = networkHandlerM.get(key).get(10
00, TimeUnit.MILLISECONDS);
var
futureResponse
=
networkHandlerM
.
get
(
key
).
get
();
if
(
futureResponse
.
getAck
()
==
AckType
.
SUCCESS_WITH_VALUE
){
System
.
out
.
println
(
"Adding to cache"
);
this
.
cache
.
put
(
new
ByteArray
(
key
),
futureResponse
.
getValue
());
...
...
@@ -55,8 +56,9 @@ public class MetadataClient
public
int
put
(
byte
[]
key
,
byte
[]
value
)
throws
Exception
{
var
response
=
networkHandlerM
.
put
(
key
,
value
).
get
(
100
,
TimeUnit
.
MILLISECONDS
);
logger
.
debug
(
"Putting KV pair on server ...."
);
//var response = networkHandlerM.put(key,value).get(1000, TimeUnit.MILLISECONDS);
var
response
=
networkHandlerM
.
put
(
key
,
value
).
get
();
logger
.
info
(
"Putting KV pair on server ...."
);
if
(
response
.
getAck
()
==
AckType
.
SUCCESS
){
this
.
cache
.
put
(
new
ByteArray
(
key
),
value
);
System
.
out
.
println
(
"Updating cache.."
);
...
...
@@ -66,9 +68,10 @@ public class MetadataClient
public
int
delete
(
byte
[]
key
)
throws
Exception
{
logger
.
debug
(
"Invalidating Local Cache and sending delete request to server"
);
logger
.
info
(
"Invalidating Local Cache and sending delete request to server"
);
//this.cache.invalidate(key);
var
response
=
this
.
networkHandlerM
.
delete
(
key
).
get
(
100
,
TimeUnit
.
MILLISECONDS
);
// var response = this.networkHandlerM.delete(key).get(1000,TimeUnit.MILLISECONDS);
var
response
=
this
.
networkHandlerM
.
delete
(
key
).
get
();
return
response
.
getAck
();
}
}
\ No newline at end of file
code/hpdos_rdma_sal/src/main/java/StandaloneRDMAClient.java
View file @
731e788d
...
...
@@ -10,13 +10,12 @@ public class StandaloneRDMAClient {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Scanner
scanner
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Enter Invalidation Server IP to bind"
);
Property
properties
=
new
Property
(
args
[
0
]);
// String address = scanner.nextLine();
System
.
out
.
println
(
"prepare"
);
MetadataClient
client
=
new
MetadataClient
(
properties
);
System
.
out
.
println
(
"starting"
);
int
option
;
while
(
true
)
{
System
.
out
.
println
(
"Enter 1. for read and 2 for write 3 for delete: "
);
...
...
code/hpdos_rdma_sal/src/main/java/hpdos/handlers/NetworkHandlerM.java
View file @
731e788d
...
...
@@ -24,6 +24,8 @@ public class NetworkHandlerM {
public
NetworkHandlerM
(
Property
properties
)
throws
Exception
{
streams
=
new
ArrayList
<>();
eps
=
new
ArrayList
<>();
RpcProtocol
rpcProtocol
=
new
RpcProtocol
();
group
=
DaRPCClientGroup
.
createClientGroup
(
rpcProtocol
,
100
,
0
,
16
,
16
);
for
(
var
ip
:
properties
.
masters
)
...
...
code/hpdos_rdma_sal/src/main/java/hpdos/invalidationServer/InvalidationServer.java
View file @
731e788d
...
...
@@ -49,12 +49,12 @@ public class InvalidationServer
try
{
int
conns
=
numOfConnections
;
logger
.
debug
(
"Waiting for server to send connection request for invalidation"
);
logger
.
info
(
"Waiting for server to send connection request for invalidation"
);
while
(
conns
>
0
)
{
serverEp
.
accept
();
conns
--
;
}
logger
.
debug
(
"Got Connected for Invalidation"
);
logger
.
info
(
"Got Connected for Invalidation"
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
...
...
@@ -63,7 +63,7 @@ public class InvalidationServer
var
t
=
new
Thread
(
runnable
);
t
.
setName
(
"Server Connection"
);
t
.
start
();
logger
.
debug
(
"started Invalidation server"
);
logger
.
info
(
"started Invalidation server"
);
}
public
void
sendInvalidationRegistrationRequest
(
String
masterIpAddress
,
String
hostIpAddress
,
NetworkHandler
networkHandler
)
throws
IOException
,
ClassNotFoundException
{
...
...
code/hpdos_rdma_sal/src/main/java/hpdos/protocol/BenchmarkingProperties.java
View file @
731e788d
...
...
@@ -25,24 +25,24 @@ public class BenchmarkingProperties {
final
static
Logger
logger
=
Logger
.
getLogger
(
BenchmarkingProperties
.
class
);
public
void
printStatistics
(){
logger
.
debug
(
"Total writes: "
+
writeCount
);
logger
.
debug
(
"Total reads: "
+
readCount
);
logger
.
debug
(
"Total deletes: "
+
deleteCount
);
logger
.
info
(
"Total writes: "
+
writeCount
);
logger
.
info
(
"Total reads: "
+
readCount
);
logger
.
info
(
"Total deletes: "
+
deleteCount
);
logger
.
debug
(
"Total write time: "
+
writeTime
);
logger
.
debug
(
"Total read time: "
+
readTime
);
logger
.
debug
(
"Total delete time: "
+
deleteTime
);
logger
.
info
(
"Total write time: "
+
writeTime
);
logger
.
info
(
"Total read time: "
+
readTime
);
logger
.
info
(
"Total delete time: "
+
deleteTime
);
logger
.
debug
(
"Average write time in microseconds: "
+
(
writeTime
/
writeCount
));
logger
.
debug
(
"Average read time in microseconds: "
+
(
readTime
/
readCount
));
logger
.
debug
(
"Average delete time in microseconds: "
+
(
deleteTime
/
deleteCount
));
logger
.
info
(
"Average write time in microseconds: "
+
(
writeTime
/
writeCount
));
logger
.
info
(
"Average read time in microseconds: "
+
(
readTime
/
readCount
));
logger
.
info
(
"Average delete time in microseconds: "
+
(
deleteTime
/
deleteCount
));
// logger.
debug
("Average Time/Request : " + timePerRequest/(writeCount + readCount + deleteCount));
// logger.
info
("Average Time/Request : " + timePerRequest/(writeCount + readCount + deleteCount));
// long avgTimePerReq = timePerRequest/(writeCount + readCount + deleteCount);
// logger.
debug
("Actual Requests/second : " + (1000000/avgTimePerReq));
// logger.
info
("Actual Requests/second : " + (1000000/avgTimePerReq));
}
public
void
collectExperimentStatistics
(
long
time
,
int
type
){
// logger.
debug
("Time: " + time);
// logger.
info
("Time: " + time);
if
(
type
==
100
)
{
writeCount
++;
writeTime
=
writeTime
+
time
;
...
...
code/hpdos_rdma_sal/src/main/java/hpdos/protocol/ByteArray.java
View file @
731e788d
...
...
@@ -3,9 +3,12 @@ package hpdos.protocol;
public
class
ByteArray
{
public
byte
[]
key
;
private
int
h
;
public
ByteArray
(
byte
[]
key
)
{
this
.
key
=
key
;
System
.
out
.
println
(
"new butearray"
);
h
=
0
;
}
@Override
public
boolean
equals
(
Object
other
)
...
...
@@ -14,18 +17,28 @@ public class ByteArray {
return
false
;
if
(
this
.
key
==
other
)
return
true
;
ByteArray
b
=
(
ByteArray
)
other
;
int
length
=
b
.
key
.
length
;
if
(
this
.
key
.
length
!=
length
)
return
false
;
for
(
int
i
=
0
;
i
<
length
;
i
++)
if
(
this
.
key
[
i
]
!=
b
.
key
[
i
])
return
false
;
return
true
;
}
@Override
public
int
hashCode
()
{
if
(
h
==
0
&&
key
.
length
>
0
)
{
for
(
int
i
=
0
;
i
<
key
.
length
;
i
++)
{
h
=
31
*
h
+
key
[
i
];
}
}
return
h
;
}
}
code/hpdos_rdma_sal/src/main/java/hpdos/protocol/Property.java
View file @
731e788d
...
...
@@ -25,7 +25,7 @@ public class Property {
masters
=
new
String
[
numberOfMasters
];
for
(
int
i
=
1
;
i
<=
numberOfMasters
;
i
++)
{
masters
[
i
]
=
properties
.
getProperty
(
"app.MASTER_HOST"
+
i
);
masters
[
i
-
1
]
=
properties
.
getProperty
(
"app.MASTER_HOST"
+
i
);
}
}
...
...
code/hpdos_rdma_sal/src/main/java/hpdos/services/InvalidationService.java
View file @
731e788d
...
...
@@ -27,7 +27,7 @@ public class InvalidationService extends InvalidationRpcProtocol implements DaRP
@Override
public
void
processServerEvent
(
DaRPCServerEvent
<
InvalidationRequest
,
InvalidationResponse
>
event
)
throws
IOException
{
logger
.
debug
(
"Got Invalidation Request"
);
logger
.
info
(
"Got Invalidation Request"
);
InvalidationRequest
request
=
event
.
getReceiveMessage
();
InvalidationResponse
response
=
event
.
getSendMessage
();
try
...
...
@@ -46,17 +46,17 @@ public class InvalidationService extends InvalidationRpcProtocol implements DaRP
public
void
open
(
DaRPCServerEndpoint
<
InvalidationRequest
,
InvalidationResponse
>
serverEp
)
{
logger
.
debug
(
"Recieved New Connection for invalidation"
);
logger
.
info
(
"Recieved New Connection for invalidation"
);
try
{
logger
.
debug
(
serverEp
.
getDstAddr
());
logger
.
info
(
serverEp
.
getDstAddr
());
}
catch
(
Exception
e
){}
}
public
void
close
(
DaRPCServerEndpoint
<
InvalidationRequest
,
InvalidationResponse
>
serverEp
)
{
logger
.
debug
(
"Closing Connection for invalidation"
);
logger
.
info
(
"Closing Connection for invalidation"
);
try
{
logger
.
debug
(
serverEp
.
getDstAddr
());
logger
.
info
(
serverEp
.
getDstAddr
());
}
catch
(
Exception
e
){}
}
}
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