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
043a1aab
Commit
043a1aab
authored
Nov 30, 2021
by
Pramod S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated invalidation polling
parent
2b6c1a94
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
84 additions
and
68 deletions
+84
-68
code/hpdos_rdma_offloaded/app.config
code/hpdos_rdma_offloaded/app.config
+0
-24
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/ExperimentStatistics.java
.../main/java/hpdos_rdma_offloaded/ExperimentStatistics.java
+3
-2
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/MetadataServer.java
...ed/src/main/java/hpdos_rdma_offloaded/MetadataServer.java
+6
-4
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/NetworkHandler.java
...ain/java/hpdos_rdma_offloaded/handler/NetworkHandler.java
+3
-2
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/NetworkHandlerM.java
...in/java/hpdos_rdma_offloaded/handler/NetworkHandlerM.java
+48
-23
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/RegistrationHandler.java
...ava/hpdos_rdma_offloaded/handler/RegistrationHandler.java
+1
-4
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/StorageHandler.java
...ain/java/hpdos_rdma_offloaded/handler/StorageHandler.java
+7
-2
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/service/FollowerMetadataService.java
...hpdos_rdma_offloaded/service/FollowerMetadataService.java
+11
-3
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/service/MetadataServiceMaster.java
...a/hpdos_rdma_offloaded/service/MetadataServiceMaster.java
+5
-4
No files found.
code/hpdos_rdma_offloaded/app.config
deleted
100644 → 0
View file @
2b6c1a94
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
=
4
//
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/ExperimentStatistics.java
View file @
043a1aab
...
...
@@ -3,10 +3,11 @@ package hpdos_rdma_offloaded;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.log4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
class
ExperimentStatistics
{
final
static
Logger
logger
=
Logger
.
getLogger
(
ExperimentStatistics
.
class
);
final
static
Logger
logger
=
Logger
Factory
.
getLogger
(
"ExperimentStatistics"
);
public
static
void
collectStatistics
(
long
latency
,
String
path
){
if
(
path
.
equals
(
"localWriteTime"
))
{
BenchmarkingProperties
.
localWriteTime
=
BenchmarkingProperties
.
localWriteTime
+
latency
;
...
...
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/MetadataServer.java
View file @
043a1aab
...
...
@@ -10,9 +10,9 @@ import com.ibm.darpc.DaRPCServerEndpoint;
import
com.ibm.darpc.DaRPCServerGroup
;
import
com.ibm.disni.RdmaServerEndpoint
;
import
org.apache.log4j.BasicConfigurator
;
import
org.apache.log4j.Logger
;
import
org.rocksdb.RocksDB
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
hpdos_rdma_offloaded.handler.NetworkHandlerM
;
import
hpdos_rdma_offloaded.handler.StorageHandler
;
...
...
@@ -30,7 +30,7 @@ public class MetadataServer{
MetadataServiceMaster
metadataService
;
FollowerMetadataService
followerMetadataService
;
final
static
Logger
logger
=
Logger
.
getLogger
(
MetadataServer
.
class
);
final
static
Logger
logger
=
Logger
Factory
.
getLogger
(
"MetadataServer"
);
public
void
run
(
Property
property
){
try
...
...
@@ -48,6 +48,8 @@ public class MetadataServer{
endpoint
.
connect
(
new
InetSocketAddress
(
property
.
followersIP
[
i
],
property
.
port
),
100
);
if
(
endpoint
.
isConnected
())
networkHandler
.
addReplicationStream
(
endpoint
.
createStream
());
else
logger
.
error
(
"Follower Not connected"
,
property
.
followersIP
[
i
]);
}
var
metadataServerService
=
new
MetadataServiceMaster
(
networkHandler
,
storageHandler
);
group
=
DaRPCServerGroup
.
createServerGroup
(
metadataServerService
,
property
.
clusterAffinities
,
...
...
@@ -91,7 +93,7 @@ public class MetadataServer{
{
Property
property
=
new
Property
(
args
[
0
]);
RocksDB
.
loadLibrary
();
BasicConfigurator
.
configure
();
//
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/NetworkHandler.java
View file @
043a1aab
...
...
@@ -23,8 +23,9 @@ import com.ibm.darpc.DaRPCFuture;
import
com.ibm.darpc.DaRPCStream
;
import
com.ibm.disni.util.StopWatch
;
import
org.apache.log4j.Logger
;
import
org.rocksdb.RocksDBException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
hpdos_rdma_offloaded.lib.Follower
;
import
hpdos_rdma_offloaded.lib.Packet
;
...
...
@@ -36,7 +37,7 @@ import hpdos_rdma_offloaded.protocol.Response;
import
hpdos_rdma_offloaded.protocol.RpcProtocol
;
public
class
NetworkHandler
{
final
static
Logger
logger
=
Logger
.
getLogger
(
NetworkHandler
.
class
);
final
static
Logger
logger
=
Logger
Factory
.
getLogger
(
"NetworkHandler"
);
private
ExecutorService
executorService
;
// public HashMap<String, DaRPCStream<Request, Response>> streams;
public
static
ConcurrentHashMap
<
String
,
DaRPCStream
<
InvalidationRequest
,
InvalidationResponse
>>
invalidationStreams
=
new
ConcurrentHashMap
<>();
...
...
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/NetworkHandlerM.java
View file @
043a1aab
package
hpdos_rdma_offloaded.handler
;
import
java.io.IOException
;
import
org.
apache.log
4j.Logger
;
import
org.
checkerframework.checker.units.qual.degrees
;
import
org.
slf
4j.Logger
;
import
org.
slf4j.LoggerFactory
;
import
java.lang.System.Logger.Level
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.concurrent.ConcurrentLinkedQueue
;
import
com.ibm.disni.util.NativeAffinity
;
...
...
@@ -18,22 +17,24 @@ import hpdos_rdma_offloaded.rdma.DaRPCStreamM;
public
class
NetworkHandlerM
implements
Runnable
{
private
Co
pyOnWriteArrayList
<
DaRPCStreamM
<
InvalidationRequest
,
InvalidationResponse
>>
invalidationStreams
;
private
Co
pyOnWriteArrayList
<
DaRPCStreamM
<
Request
,
Response
>>
replicationStreams
;
final
static
Logger
logger
=
Logger
.
getLogger
(
NetworkHandlerM
.
class
);
private
Co
ncurrentLinkedQueue
<
DaRPCStreamM
<
InvalidationRequest
,
InvalidationResponse
>>
invalidationStreams
;
private
Co
ncurrentLinkedQueue
<
DaRPCStreamM
<
Request
,
Response
>>
replicationStreams
;
final
static
Logger
logger
=
Logger
Factory
.
getLogger
(
"NetworkHandler"
);
public
NetworkHandlerM
()
{
this
.
invalidationStreams
=
new
Co
pyOnWriteArrayList
<>();
this
.
replicationStreams
=
new
Co
pyOnWriteArrayList
<>();
this
.
invalidationStreams
=
new
Co
ncurrentLinkedQueue
<>();
this
.
replicationStreams
=
new
Co
ncurrentLinkedQueue
<>();
}
public
void
addInvalidationStream
(
DaRPCStreamM
<
InvalidationRequest
,
InvalidationResponse
>
stream
){
this
.
invalidationStreams
.
add
(
stream
);
}
public
void
addReplicationStream
(
DaRPCStreamM
<
Request
,
Response
>
stream
)
{
this
.
replicationStreams
.
add
(
stream
);
}
void
processCloseInvalidationStream
(
DaRPCStreamM
<
InvalidationRequest
,
InvalidationResponse
>
stream
)
{
stream
.
completedList
.
forEach
(
future
->
...
...
@@ -46,7 +47,7 @@ public class NetworkHandlerM implements Runnable{
future
.
metadataResponse
.
event
.
triggerResponse
();
}
catch
(
IOException
ex
)
{
logger
.
error
(
ex
);
logger
.
error
(
ex
.
toString
()
);
}
}
});
...
...
@@ -59,7 +60,7 @@ public class NetworkHandlerM implements Runnable{
future
.
metadataResponse
.
event
.
triggerResponse
();
}
catch
(
IOException
ex
)
{
logger
.
error
(
ex
);
logger
.
error
(
ex
.
toString
()
);
}
}
});
...
...
@@ -94,7 +95,7 @@ public class NetworkHandlerM implements Runnable{
future
.
metadataResponse
.
event
.
triggerResponse
();
}
catch
(
IOException
ex
)
{
logger
.
error
(
ex
);
logger
.
error
(
ex
.
toString
()
);
}
}
});
...
...
@@ -107,7 +108,7 @@ public class NetworkHandlerM implements Runnable{
future
.
metadataResponse
.
event
.
triggerResponse
();
}
catch
(
IOException
ex
)
{
logger
.
error
(
ex
);
logger
.
error
(
ex
.
toString
()
);
}
}
});
...
...
@@ -164,23 +165,35 @@ public class NetworkHandlerM implements Runnable{
InvalidationRequest
inRequest
=
new
InvalidationRequest
();
//logger.debug("invdlidation send "+invalidationStreams.size());
inRequest
.
setKey
(
request
.
getKey
());
response
.
invalidationTotal
=
invalidationStreams
.
size
();
int
i
=
0
;
for
(
var
stream
:
invalidationStreams
)
{
try
{
stream
.
request
(
inRequest
,
new
InvalidationResponse
(),
response
,
true
);
++
i
;
}
catch
(
IOException
ex
)
{
logger
.
error
(
ex
);
logger
.
error
(
ex
.
toString
()
);
}
}
if
(
i
nvalidationStreams
.
size
()
==
0
)
response
.
invalidationTotal
=
i
;
if
(
i
==
0
)
{
logger
.
debug
(
"Zero invalidation"
);
response
.
state
.
incrementAndGet
();
if
(
response
.
state
.
get
()
==
Response
.
DONE
)
{
try
{
response
.
event
.
triggerResponse
();
}
catch
(
IOException
e
)
{
logger
.
error
(
e
.
getMessage
());
}
}
}
}
...
...
@@ -196,25 +209,37 @@ public class NetworkHandlerM implements Runnable{
{
repRequest.setValue(request.getValue());
}
*/
response
.
replicatonTotal
=
replicationStreams
.
size
();
int
i
=
0
;
for
(
var
stream
:
replicationStreams
)
{
try
{
stream
.
request
(
request
,
new
Response
(),
response
,
true
);
++
i
;
}
catch
(
IOException
ex
)
{
logger
.
error
(
ex
);
logger
.
error
(
ex
.
toString
()
);
}
}
if
(
replicationStreams
.
size
()
==
0
)
response
.
replicatonTotal
=
i
;
//This is because when there are no followers
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
.
get
()
==
Response
.
DONE
)
{
try
{
response
.
event
.
triggerResponse
();
}
catch
(
IOException
ex
)
{
logger
.
error
(
ex
.
getMessage
());
}
}
}
}
}
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/RegistrationHandler.java
View file @
043a1aab
...
...
@@ -4,12 +4,9 @@ import java.io.IOException;
import
java.io.ObjectInputStream
;
import
java.io.ObjectOutputStream
;
import
java.io.OutputStream
;
import
java.lang.ClassNotFoundException
;
import
java.net.InetAddress
;
import
java.net.ServerSocket
;
import
java.net.Socket
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.UUID
;
import
org.apache.log4j.Logger
;
...
...
@@ -25,7 +22,7 @@ public class RegistrationHandler {
int
follower_registration_port
;
int
sal_registration_port
;
NetworkHandler
networkHandler
;
final
static
Logger
logger
=
Logger
.
getLogger
(
RegistrationHandler
.
class
);
final
static
Logger
logger
=
Logger
.
getLogger
(
"RegistrationHandler"
);
public
RegistrationHandler
(
boolean
isMaster
,
String
registrationServerIP
,
String
masterIp
,
int
registrationPort
,
NetworkHandler
networkHandler
)
throws
IOException
{
this
.
registrationServerIp
=
registrationServerIP
;
this
.
follower_registration_port
=
9876
;
...
...
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/handler/StorageHandler.java
View file @
043a1aab
package
hpdos_rdma_offloaded.handler
;
import
org.rocksdb.RocksDB
;
import
org.apache.log4j.Logger
;
import
com.ibm.disni.util.DiSNILogger
;
import
org.rocksdb.Options
;
import
org.rocksdb.RocksDBException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
hpdos_rdma_offloaded.protocol.Request
;
...
...
@@ -12,7 +16,8 @@ public class StorageHandler implements AutoCloseable{
RocksDB
rocksDB
;
Options
rockDbOptions
;
final
static
Logger
logger
=
Logger
.
getLogger
(
StorageHandler
.
class
);
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
"StorageHandler"
);
public
StorageHandler
(
String
dbpath
)
throws
RocksDBException
{
logger
.
warn
(
"Creating RocksDB"
);
...
...
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/service/FollowerMetadataService.java
View file @
043a1aab
...
...
@@ -7,8 +7,10 @@ import com.ibm.darpc.DaRPCServerEndpoint;
import
com.ibm.darpc.DaRPCServerEvent
;
import
com.ibm.darpc.DaRPCService
;
import
org.apache.log4j.Logger
;
import
org.rocksdb.RocksDBException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
hpdos_rdma_offloaded.handler.StorageHandler
;
import
hpdos_rdma_offloaded.protocol.AckType
;
...
...
@@ -21,7 +23,7 @@ import hpdos_rdma_offloaded.protocol.RpcProtocol;
public
class
FollowerMetadataService
extends
RpcProtocol
implements
DaRPCService
<
Request
,
Response
>{
StorageHandler
storageHandler
;
final
static
Logger
logger
=
Logger
.
getLogger
(
FollowerMetadataService
.
class
);
final
static
Logger
logger
=
Logger
Factory
.
getLogger
(
"Metadata service"
);
DaRPCClientGroup
<
InvalidationRequest
,
InvalidationResponse
>
invalidationClientGroup
;
public
FollowerMetadataService
(
StorageHandler
storageHandler
)
throws
Exception
{
logger
.
debug
(
"New MetadataServerService Created"
);
...
...
@@ -72,7 +74,13 @@ public class FollowerMetadataService extends RpcProtocol implements DaRPCService
@Override
public
void
open
(
DaRPCServerEndpoint
<
Request
,
Response
>
rpcClientEndpoint
)
{
logger
.
debug
(
"Received new connection "
);
try
{
logger
.
debug
(
"Received new connection "
+
rpcClientEndpoint
.
getDstAddr
());
}
catch
(
Exception
ex
)
{
logger
.
error
(
ex
.
getMessage
());
}
}
@Override
...
...
code/hpdos_rdma_offloaded/src/main/java/hpdos_rdma_offloaded/service/MetadataServiceMaster.java
View file @
043a1aab
...
...
@@ -11,8 +11,10 @@ import com.ibm.darpc.DaRPCServerEndpoint;
import
com.ibm.darpc.DaRPCServerEvent
;
import
com.ibm.darpc.DaRPCService
;
import
org.apache.log4j.Logger
;
import
org.rocksdb.RocksDBException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
//import hpdos_rdma_offloaded.ExperimentStatistics;
import
hpdos_rdma_offloaded.handler.NetworkHandlerM
;
...
...
@@ -31,9 +33,8 @@ public class MetadataServiceMaster extends RpcProtocol implements DaRPCService<R
NetworkHandlerM
networkHandler
;
StorageHandler
storageHandler
;
DaRPCClientGroupM
<
InvalidationRequest
,
InvalidationResponse
>
invalidationClientGroup
;
final
static
Logger
logger
=
Logger
.
getLogger
(
MasterMetadataServerService
.
class
);
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
"MetadataService"
);
public
MetadataServiceMaster
(
NetworkHandlerM
networkHandler
,
StorageHandler
storageHandler
)
throws
Exception
{
logger
.
debug
(
"New MetadataServerService Created"
);
this
.
networkHandler
=
networkHandler
;
...
...
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