Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
e2e959b9
Commit
e2e959b9
authored
4 years ago
by
Lorenz Boguhn
Browse files
Options
Downloads
Plain Diff
merge zookeeper
parents
647f5b71
bdeadef8
No related branches found
No related tags found
4 merge requests
!159
Re-implementation of Theodolite with Kotlin/Quarkus
,
!157
Update Graal Image in CI pipeline
,
!83
WIP: Re-implementation of Theodolite with Kotlin/Quarkus
,
!78
Resolve "Implement Quarkus/Kotlin protype"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theodolite-quarkus/src/main/kotlin/theodolite/Main.kt
+0
-3
0 additions, 3 deletions
theodolite-quarkus/src/main/kotlin/theodolite/Main.kt
theodolite-quarkus/src/main/kotlin/theodolite/WorkloadGeneratorStateCleaner.kt
+58
-0
58 additions, 0 deletions
...c/main/kotlin/theodolite/WorkloadGeneratorStateCleaner.kt
with
58 additions
and
3 deletions
theodolite-quarkus/src/main/kotlin/theodolite/Main.kt
+
0
−
3
View file @
e2e959b9
...
...
@@ -6,9 +6,6 @@ import io.quarkus.runtime.annotations.QuarkusMain
object
Main
{
@JvmStatic
fun
main
(
args
:
Array
<
String
>)
{
println
(
"Running main method"
)
//Quarkus.run()
}
}
This diff is collapsed.
Click to expand it.
theodolite-quarkus/src/main/kotlin/theodolite/WorkloadGeneratorStateCleaner.kt
0 → 100644
+
58
−
0
View file @
e2e959b9
package
theodolite
import
org.apache.zookeeper.KeeperException
import
org.apache.zookeeper.WatchedEvent
import
org.apache.zookeeper.Watcher
import
org.apache.zookeeper.ZooKeeper
class
WorkloadGeneratorStateCleaner
(
ip
:
String
)
{
val
path
=
"/workload-generation"
val
sessionTimeout
=
60
val
retryTime
=
3000L
lateinit
var
zookeeperClient
:
ZooKeeper
init
{
try
{
val
watcher
:
Watcher
=
ZookeperWatcher
()
// defined below
zookeeperClient
=
ZooKeeper
(
ip
,
sessionTimeout
,
watcher
)
}
catch
(
e
:
Exception
)
{
System
.
out
.
println
(
e
.
toString
())
}
}
fun
deleteAll
()
{
var
deleted
=
false
while
(!
deleted
)
{
//
try
{
zookeeperClient
.
delete
(
path
,
-
1
)
}
catch
(
ex
:
Exception
)
{
System
.
out
.
println
(
ex
.
toString
())
}
try
{
val
clients
=
zookeeperClient
.
getChildren
(
path
,
true
)
if
(
clients
.
isEmpty
()){
break
;
}
}
catch
(
ex
:
Exception
)
{
when
(
ex
)
{
is
KeeperException
->
{
deleted
=
true
}
is
InterruptedException
->
{
System
.
out
.
println
(
ex
.
toString
())
}
}
}
Thread
.
sleep
(
retryTime
)
System
.
out
.
println
(
"ZooKeeper reset was not successful. Retrying in 5s"
)
}
System
.
out
.
println
(
"ZooKeeper reset was successful"
)
}
}
private
class
ZookeperWatcher
:
Watcher
{
override
fun
process
(
event
:
WatchedEvent
)
{}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment