Skip to content

Commit

Permalink
Support Hash Algorithms Benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaozihao committed Mar 8, 2024
1 parent bd3b6f1 commit 717013a
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,6 @@ public void prepare() throws Exception {
for (int i = 0; i < mParameters.mFileNum; i++) {
mFileNamesList.add(randomString(10));
}

// Generate simulated Worker.
mWorkerInfos = new ArrayList<>();
for (int i = 0; i < mParameters.mWorkerNum; i++) {
mWorkerInfos.add(
new WorkerInfo()
.setIdentity(ofLegacyId(i))
.setAddress(new WorkerNetAddress()
.setHost("worker" + i).setRpcPort(29998).setDataPort(29999).setWebPort(30000))
.setCapacityBytes(1024)
.setUsedBytes(0)
);
}
mWorkers = new WorkerClusterView(mWorkerInfos);
}

/**
Expand Down Expand Up @@ -230,6 +216,20 @@ private HashTaskResult runHashBench() throws Exception {
// Test a hash algorithm
private HashTaskResult.SingleTestResult testHashPolicy(String hashPolicy)
throws ResourceExhaustedException {
// Generate simulated Worker.
mWorkerInfos = new ArrayList<>();
for (int i = 0; i < mParameters.mWorkerNum; i++) {
mWorkerInfos.add(
new WorkerInfo()
.setIdentity(ofLegacyId(i))
.setAddress(new WorkerNetAddress()
.setHost("worker" + i).setRpcPort(29998).setDataPort(29999).setWebPort(30000))
.setCapacityBytes(1024)
.setUsedBytes(0)
);
}
mWorkers = new WorkerClusterView(mWorkerInfos);

long startTime = System.currentTimeMillis();

// Add the parameters set by the user to the conf file.
Expand Down

0 comments on commit 717013a

Please sign in to comment.