Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
evaluation-orchestrator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mowgli
evaluation-orchestrator
Commits
8e1d6c25
Commit
8e1d6c25
authored
Aug 21, 2019
by
Daniel Seybold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
limited memory for cassandra get record count command
parent
2b89662a
Pipeline
#54368
passed with stage
in 12 minutes and 38 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
124 additions
and
22 deletions
+124
-22
pom.xml
pom.xml
+1
-1
src/main/java/de/uulm/omi/dbms/evlautor/server/api/impl/ScenarioApiServiceImpl.java
...dbms/evlautor/server/api/impl/ScenarioApiServiceImpl.java
+12
-0
src/main/java/de/uulm/omi/evaluation/jungle/MakiExecutor.java
...main/java/de/uulm/omi/evaluation/jungle/MakiExecutor.java
+78
-0
src/main/java/de/uulm/omi/evaluation/task/RemoteCommand.java
src/main/java/de/uulm/omi/evaluation/task/RemoteCommand.java
+33
-21
No files found.
pom.xml
View file @
8e1d6c25
...
...
@@ -184,7 +184,7 @@
<version>
1.0.0
</version>
</dependency>
<!-- Maki Manager client -->
<!-- Maki
Executor
Manager client -->
<dependency>
<groupId>
de.uulm.omi.mowgli.maki
</groupId>
<artifactId>
maki-manager-client
</artifactId>
...
...
src/main/java/de/uulm/omi/dbms/evlautor/server/api/impl/ScenarioApiServiceImpl.java
View file @
8e1d6c25
...
...
@@ -50,6 +50,18 @@ public class ScenarioApiServiceImpl extends ScenarioApiService {
NoiseyNeighbour
noiseyNeighbour
=
new
NoiseyNeighbour
(
scenarioName
,
runs
,
scenarioSpec
,
cleanUp
.
booleanValue
());
noiseyNeighbour
.
execute
();
/*
EvaluationContext evaluationContext = new EvaluationContext();
evaluationContext.setRunCounter(0);
evaluationContext.setStartTime(System.currentTimeMillis());
ClusterContext clusterContext = new ClusterContext();
clusterContext.setIdApplicationInstance("1245185");
RemoteCommand remoteCommand = new RemoteCommand(evaluationContext,clusterContext,"cassandra");
remoteCommand.call();
*/
return
Response
.
ok
().
entity
(
new
ApiResponseMessage
(
ApiResponseMessage
.
OK
,
"Evaluation started!"
)).
build
();
}
...
...
src/main/java/de/uulm/omi/evaluation/jungle/MakiExecutor.java
0 → 100644
View file @
8e1d6c25
package
de.uulm.omi.evaluation.jungle
;
import
com.google.common.io.CharStreams
;
import
com.jcraft.jsch.ChannelExec
;
import
com.jcraft.jsch.JSch
;
import
com.jcraft.jsch.JSchException
;
import
com.jcraft.jsch.Session
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* Created by Daniel Seybold on 21.08.2019.
*/
public
class
MakiExecutor
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
MakiExecutor
.
class
);
private
static
String
MAKI_SECRET
=
"TopSecret"
;
private
static
String
USER
=
"ubuntu"
;
private
static
int
PORT
=
22
;
private
Session
makiSession
;
public
MakiExecutor
(
String
privateKey
,
String
publicKey
,
String
enpoint
){
JSch
jsch
=
new
JSch
();
try
{
jsch
.
addIdentity
(
"maki_rsa"
,
privateKey
.
getBytes
(),
publicKey
.
getBytes
(),
MAKI_SECRET
.
getBytes
());
makiSession
=
jsch
.
getSession
(
USER
,
enpoint
,
PORT
);
makiSession
.
setConfig
(
"StrictHostKeyChecking"
,
"no"
);
makiSession
.
connect
();
LOGGER
.
debug
(
"MakiExecutor session connected!"
);
}
catch
(
JSchException
e
)
{
LOGGER
.
error
(
"Error while adding identity!"
,
e
);
}
}
public
String
execute
(
String
command
){
String
result
=
null
;
ChannelExec
channel
=
null
;
try
{
channel
=
(
ChannelExec
)
makiSession
.
openChannel
(
"exec"
);
channel
.
setInputStream
(
null
);
InputStream
output
=
channel
.
getInputStream
();
channel
.
setErrStream
(
System
.
err
);
channel
.
setCommand
(
command
);
channel
.
connect
();
result
=
CharStreams
.
toString
(
new
InputStreamReader
(
output
));
channel
.
disconnect
();
LOGGER
.
debug
(
"The remote clusterState command is: "
+
result
);
}
catch
(
JSchException
e
)
{
LOGGER
.
error
(
"Error while executing ssh command!"
,
e
);
}
catch
(
IOException
e
)
{
LOGGER
.
error
(
"Error while reading ssh result!"
,
e
);
}
return
result
;
}
public
void
close
(){
makiSession
.
disconnect
();
}
}
src/main/java/de/uulm/omi/evaluation/task/RemoteCommand.java
View file @
8e1d6c25
...
...
@@ -100,18 +100,20 @@ public class RemoteCommand extends EvaluationTask {
//TODO: refactor into a generic ssh command helper tool and make this task the getNumberOfRecords task
JSch
jsch
=
new
JSch
();
final
String
user
=
"ubuntu"
;
final
int
port
=
22
;
try
{
jsch
.
addIdentity
(
"test_rsa"
,
privateKeyPlain
.
getBytes
(),
publicKeyPlain
.
getBytes
(),
"secret"
.
getBytes
());
/**
* get cluster state session
*/
JSch
jsch
=
new
JSch
();
jsch
.
addIdentity
(
"test_rsa"
,
privateKeyPlain
.
getBytes
(),
publicKeyPlain
.
getBytes
(),
"secret"
.
getBytes
());
Session
session
=
jsch
.
getSession
(
user
,
seedEnpoint
,
port
);
session
.
setConfig
(
"StrictHostKeyChecking"
,
"no"
);
LOGGER
.
debug
(
"session created."
);
...
...
@@ -125,52 +127,60 @@ public class RemoteCommand extends EvaluationTask {
channel
.
connect
();
String
clusterStateResult
=
CharStreams
.
toString
(
new
InputStreamReader
(
output
));
//printOutput(channel);
channel
.
disconnect
();
LOGGER
.
debug
(
this
.
loggerPrefix
+
"The remote clusterState command is: "
+
clusterStateResult
);
session
.
disconnect
();
/**
* Log the total number of records
*/
logCustomEntry
(
"CLUSTER_STATE"
,
clusterStateResult
);
JSch
jsch2
=
new
JSch
();
jsch2
.
addIdentity
(
"test_rsa"
,
privateKeyPlain
.
getBytes
(),
publicKeyPlain
.
getBytes
(),
"secret"
.
getBytes
());
/**
* get record count session
*/
session
=
jsch
.
getSession
(
user
,
seedEnpoint
,
port
);
session
.
setConfig
(
"StrictHostKeyChecking"
,
"no"
);
LOGGER
.
debug
(
"session created."
);
session
.
connect
(
);
Session
session2
=
jsch2
.
getSession
(
user
,
seedEnpoint
,
port
);
session
2
.
setConfig
(
"StrictHostKeyChecking"
,
"no"
);
session2
.
connect
(
);
LOGGER
.
debug
(
"session2 connected!"
);
channel
=
(
ChannelExec
)
session
.
openChannel
(
"exec"
);
channel
.
setInputStream
(
null
);
output
=
channel
.
getInputStream
();
channel
.
setErrStream
(
System
.
err
);
channel
.
setCommand
(
recordCountCommand
);
ChannelExec
channel2
=
(
ChannelExec
)
session2
.
openChannel
(
"exec"
);
channel2
.
setInputStream
(
null
);
InputStream
output2
=
channel2
.
getInputStream
();
channel2
.
setErrStream
(
System
.
err
);
LOGGER
.
debug
(
recordCountCommand
);
channel2
.
setCommand
(
recordCountCommand
);
channel
.
connect
(
300000
);
String
recordCountResult
=
CharStreams
.
toString
(
new
InputStreamReader
(
output
));
//printOutput(channel);
channel
.
disconnect
();
channel2
.
connect
();
String
recordCountResult
=
CharStreams
.
toString
(
new
InputStreamReader
(
output2
));
channel2
.
disconnect
();
LOGGER
.
debug
(
this
.
loggerPrefix
+
"The remote recordCount command result is: "
+
recordCountResult
);
session2
.
disconnect
();
/**
* Log the total number of records
*/
logCustomEntry
(
"RECORD_COUNT"
,
recordCountResult
);
logCustomEntry
(
"RECORD_COUNT"
,
recordCountResult
);
session
.
disconnect
();
}
catch
(
JSchException
e
)
{
LOGGER
.
error
(
e
.
getStackTrace
().
toString
()
);
LOGGER
.
error
(
"Error while executing SSH command!"
,
e
);
return
new
DefaultWorkReport
(
WorkStatus
.
FAILED
);
}
catch
(
IOException
e
)
{
LOGGER
.
error
(
e
.
getStackTrace
().
toString
()
);
LOGGER
.
error
(
"Error while reading command result!"
,
e
);
return
new
DefaultWorkReport
(
WorkStatus
.
FAILED
);
}
...
...
@@ -213,8 +223,10 @@ public class RemoteCommand extends EvaluationTask {
*/
int
numOfSplits
=
256
;
String
command
=
"source /etc/environment && sudo -E ./cassandra-count -host $LOCAL_ADDRESS -keyspace ycsb -table usertable -splitSize "
+
splitSize
+
" -numSplits "
+
numOfSplits
;
//String command = "source /etc/environment && sudo -E ./cassandra-count -Xmx512m -host $LOCAL_ADDRESS -keyspace ycsb -table usertable -splitSize " + splitSize + " -numSplits " + numOfSplits;
String
command
=
"source /etc/environment && sudo -E java -Xmx512m -jar cassandra-count -host $LOCAL_ADDRESS -keyspace ycsb -table usertable -splitSize "
+
splitSize
+
" -numSplits "
+
numOfSplits
;
return
command
;
}
...
...
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