Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ public Result run() {
+ BenchmarkUtils.formatLongValue((long) scanRps));

return new Result(writeMetric, scanRps);
} catch (IOException e) {
} catch (IOException | InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,18 @@ public boolean isJobRunning(String jobId) {
}
}

public void waitUntilNumberOfRows(String jobId, long numberOfRows) {
public void waitUntilNumberOfRows(String jobId, long numberOfRows) throws InterruptedException {
while (true) {
String sourceVertexId = getSourceVertexId(jobId);
double actualNumRecords = getTotalNumRecords(jobId, sourceVertexId);
if (actualNumRecords >= numberOfRows) {
return;
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// ignore
}
Thread.sleep(1000);
}
}

public long waitUntilJobFinished(String jobId) {
public long waitUntilJobFinished(String jobId) throws InterruptedException {
while (true) {
String url = String.format("http://%s/jobs/%s", jmEndpoint, jobId);
String response = executeAsString(url);
Expand All @@ -136,11 +132,7 @@ public long waitUntilJobFinished(String jobId) {
throw new RuntimeException(
"The response is not a valid JSON string:\n" + response, e);
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// ignore
}
Thread.sleep(1000);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private void waitFor(Duration duration) {
try {
Thread.sleep(100L);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
if (error != null) {
Expand All @@ -84,7 +85,7 @@ private void waitFor(Duration duration) {
}
}

public JobBenchmarkMetric reportMetric(String name, String jobId) {
public JobBenchmarkMetric reportMetric(String name, String jobId) throws InterruptedException {
System.out.printf("Monitor metrics after %s seconds.%n", monitorDelay.getSeconds());
waitFor(monitorDelay);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ public Long readHint(String fileName) {
try {
TimeUnit.MILLISECONDS.sleep(READ_HINT_RETRY_INTERVAL);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand Down