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
421e3afe
Commit
421e3afe
authored
Apr 11, 2021
by
NILANJAN DAW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor bug fixes
parent
484668c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
code/hpdos_client/app/src/main/java/HpdosClient/ClientRunner.java
...os_client/app/src/main/java/HpdosClient/ClientRunner.java
+23
-11
code/hpdos_server/app/src/main/java/hpdos/handler/IOHandler.java
...dos_server/app/src/main/java/hpdos/handler/IOHandler.java
+2
-1
No files found.
code/hpdos_client/app/src/main/java/HpdosClient/ClientRunner.java
View file @
421e3afe
...
...
@@ -120,6 +120,7 @@ public class ClientRunner {
String
key
=
Integer
.
toString
((
int
)
(
Math
.
random
()
*
Integer
.
MAX_VALUE
));
StorageModel
model
=
new
StorageModel
(
0
,
value
.
length
(),
key
,
MessageConstants
.
METADATA_ACCESS_PRIVATE
,
clientID
,
0
,
value
);
final
long
createStart
=
System
.
currentTimeMillis
();
ListenableFuture
<
Packet
>
res
=
storageService
.
create
(
model
.
getKey
(),
model
.
getValue
(),
model
.
getAccessType
());
res
.
addListener
(()
->
{
try
{
...
...
@@ -129,18 +130,21 @@ public class ClientRunner {
if
(
response
.
getStatus
()
==
MessageConstants
.
STATUS_OK
)
{
model
.
updateData
(
response
.
getAck
());
generatedPacket
.
add
(
model
);
}
else
System
.
out
.
println
(
"error packet "
+
response
);
}
// else
// System.out.println("error packet " + response);
}
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
e
.
printStackTrace
();
}
this
.
createTime
.
add
(
System
.
currentTimeMillis
()
-
createStart
);
limiter
.
release
();
},
MoreExecutors
.
directExecutor
());
}
else
if
(
toss
<
readBracket
)
{
// System.out.println("read");
int
index
=
(
int
)
(
Math
.
random
()
*
generatedPacket
.
size
());
StorageModel
sendPacket
=
this
.
generatedPacket
.
get
(
index
);
final
long
readStart
=
System
.
currentTimeMillis
();
ListenableFuture
<
Packet
>
res
=
storageService
.
read
(
sendPacket
.
getKey
());
res
.
addListener
(()
->
{
try
{
...
...
@@ -155,12 +159,13 @@ public class ClientRunner {
sendPacket
.
updateData
(
response
.
getAck
());
}
}
else
System
.
out
.
println
(
"error packet "
+
response
);
//
else
//
System.out.println("error packet " + response);
}
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
e
.
printStackTrace
();
}
readTime
.
add
(
System
.
currentTimeMillis
()
-
readStart
);
limiter
.
release
();
},
MoreExecutors
.
directExecutor
());
}
else
if
(
toss
<
updateBracket
)
{
...
...
@@ -168,6 +173,7 @@ public class ClientRunner {
int
index
=
(
int
)
(
Math
.
random
()
*
generatedPacket
.
size
());
StorageModel
sendPacket
=
this
.
generatedPacket
.
get
(
index
);
final
long
updateStart
=
System
.
currentTimeMillis
();
ListenableFuture
<
Packet
>
res
=
storageService
.
update
(
sendPacket
.
getKey
(),
updatedValue
,
sendPacket
.
getVersion
());
res
.
addListener
(()
->
{
...
...
@@ -183,9 +189,10 @@ public class ClientRunner {
sendPacket
.
updateData
(
response
.
getAck
());
}
}
else
System
.
out
.
println
(
"error packet "
+
response
);
//
else
//
System.out.println("error packet " + response);
}
updateTime
.
add
(
System
.
currentTimeMillis
()
-
updateStart
);
limiter
.
release
();
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
e
.
printStackTrace
();
...
...
@@ -195,6 +202,7 @@ public class ClientRunner {
// System.out.println("delete");
int
index
=
(
int
)
(
Math
.
random
()
*
generatedPacket
.
size
());
StorageModel
sendPacket
=
this
.
generatedPacket
.
get
(
index
);
final
long
deleteStart
=
System
.
currentTimeMillis
();
ListenableFuture
<
Packet
>
res
=
storageService
.
delete
(
sendPacket
.
getKey
(),
sendPacket
.
getVersion
());
res
.
addListener
(()
->
{
try
{
...
...
@@ -209,9 +217,10 @@ public class ClientRunner {
generatedPacket
.
remove
(
sendPacket
);
}
}
else
System
.
out
.
println
(
"error packet "
+
response
);
//
else
//
System.out.println("error packet " + response);
}
deleteTime
.
add
(
System
.
currentTimeMillis
()
-
deleteStart
);
limiter
.
release
();
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
e
.
printStackTrace
();
...
...
@@ -309,9 +318,12 @@ public class ClientRunner {
System
.
out
.
println
(
"Experiment ended"
);
});
clientRunner
.
runExperiment
(
storageService
);
// long endTime = System.currentTimeMillis();
// double totalRuntime = endTime - startTime;
//// clientRunner.printStatistics(totalRuntime);
long
endTime
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"Waiting for system to settle down"
);
Thread
.
sleep
(
2000
);
double
totalRuntime
=
endTime
-
startTime
;
clientRunner
.
printStatistics
(
totalRuntime
);
clientRunner
.
cleanupExperiment
(
storageService
);
executorService
.
shutdown
();
boolean
status
=
executorService
.
awaitTermination
(
1000
,
TimeUnit
.
MICROSECONDS
);
...
...
code/hpdos_server/app/src/main/java/hpdos/handler/IOHandler.java
View file @
421e3afe
...
...
@@ -130,7 +130,8 @@ public class IOHandler {
nack
=
ResponseBuilder
.
buildNack
(
MessageConstants
.
INVALID_VERSION
,
request
.
getKey
());
}
else
if
(
readData
.
getData
().
getAccessType
()
==
MessageConstants
.
METADATA_ACCESS_PRIVATE
&&
}
else
if
(
readData
.
getData
()
!=
null
&&
readData
.
getData
().
getAccessType
()
==
MessageConstants
.
METADATA_ACCESS_PRIVATE
&&
!
request
.
getClientID
().
equals
(
readData
.
getData
().
getOwner
()))
{
status
=
MessageConstants
.
STATUS_UNAUTHORIZED_PRIVATE_KEY_ACCESS
;
nack
=
ResponseBuilder
.
buildNack
(
MessageConstants
.
INVALID_VERSION
,
...
...
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