Skip to content

Commit 4a713e2

Browse files
committed
Extracted BenchStandBuilder
1 parent 7a542c0 commit 4a713e2

9 files changed

Lines changed: 488 additions & 803 deletions

File tree

benchmark/ansible/flamestream.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
- name: Run the benchmark
4848
hosts: bench
4949
roles:
50-
- { role: flamestream-bench , bench_class: com.spbsu.flamestream.example.benchmark.LentaBenchStand }
50+
- { role: flamestream-lenta-bench , bench_class: com.spbsu.flamestream.example.benchmark.LentaBenchStand }
5151

5252
- name: Destroy flamestream
5353
hosts: workers

benchmark/ansible/group_vars/all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tarball_dir: /opt/src
1212

1313
results_dir: results/{{ lookup("pipe", "git rev-parse --short HEAD") }}/{{ groups['workers'] | length }}/{{ rate }}/{{ guarantees }}/{{ millis_between_commits }}
1414

15-
zookeeper_version: 3.4.13
15+
zookeeper_version: 3.4.14
1616
zookeeper_client_port: 2181
1717

1818
flamestream_worker_port: 5412

benchmark/flink-benchmark/src/main/java/com/spbsu/benchmark/flink/index/FlinkBench.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.spbsu.benchmark.flink.index.ops.OrderEnforcer;
77
import com.spbsu.benchmark.flink.index.ops.TwoPCKryoSocketSink;
88
import com.spbsu.benchmark.flink.index.ops.WikipediaPageToWordPositions;
9-
import com.spbsu.flamestream.example.benchmark.BenchStand;
9+
import com.spbsu.flamestream.example.benchmark.WikiBenchStand;
1010
import com.spbsu.flamestream.example.benchmark.GraphDeployer;
1111
import com.typesafe.config.Config;
1212
import com.typesafe.config.ConfigFactory;
@@ -24,7 +24,7 @@
2424
import java.nio.file.Paths;
2525

2626
public class FlinkBench {
27-
public static void main(String[] args) throws IOException, InterruptedException {
27+
public static void main(String[] args) throws Exception {
2828
final Config benchConfig;
2929
final Config deployerConfig;
3030
if (args.length == 2) {
@@ -34,9 +34,8 @@ public static void main(String[] args) throws IOException, InterruptedException
3434
benchConfig = ConfigFactory.load("flink-bench.conf").getConfig("benchmark");
3535
deployerConfig = ConfigFactory.load("flink-deployer.conf").getConfig("deployer");
3636
}
37-
final BenchStand.StandConfig standConfig = new BenchStand.StandConfig(benchConfig);
38-
39-
final GraphDeployer deployer = new GraphDeployer() {
37+
WikiBenchStand wikiBenchStand = new WikiBenchStand(benchConfig);
38+
wikiBenchStand.run(new GraphDeployer() {
4039
@Override
4140
public void deploy() {
4241
final int parallelism = deployerConfig.getInt("parallelism");
@@ -59,12 +58,12 @@ public void deploy() {
5958
final SinkFunction<Result> sinkFunction;
6059
if (guarantees.equals("EXACTLY_ONCE")) {
6160
sinkFunction = new TwoPCKryoSocketSink(
62-
standConfig.benchHost(),
63-
standConfig.rearPort(),
61+
wikiBenchStand.benchHost,
62+
wikiBenchStand.rearPort,
6463
environment.getConfig()
6564
);
6665
} else {
67-
sinkFunction = new KryoSocketSink(standConfig.benchHost(), standConfig.rearPort());
66+
sinkFunction = new KryoSocketSink(wikiBenchStand.benchHost, wikiBenchStand.rearPort);
6867
}
6968

7069
if (guarantees.equals("EXACTLY_ONCE") || guarantees.equals("AT_LEAST_ONCE")) {
@@ -81,7 +80,7 @@ public void deploy() {
8180

8281

8382
environment
84-
.addSource(new KryoSocketSource(standConfig.benchHost(), standConfig.frontPort()))
83+
.addSource(new KryoSocketSource(wikiBenchStand.benchHost, wikiBenchStand.frontPort))
8584
.setParallelism(parallelism)
8685
.shuffle()
8786
.flatMap(new WikipediaPageToWordPositions())
@@ -105,11 +104,7 @@ public void deploy() {
105104
public void close() {
106105
// It will close itself on completion
107106
}
108-
};
109-
110-
try (BenchStand benchStand = new BenchStand(standConfig, deployer)) {
111-
benchStand.run();
112-
}
107+
});
113108
System.exit(0);
114109
}
115110
}

0 commit comments

Comments
 (0)