Skip to content

Commit 490b26e

Browse files
committed
benchmarks: fix byte[] => Opaque migration
1 parent ac71ad7 commit 490b26e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

benchmarks/src/main/java/org/dcache/nfs/benchmarks/ConcurrentLockManagerBenchmark.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package org.dcache.nfs.benchmarks;
22

33
import java.nio.charset.StandardCharsets;
4-
import java.util.Random;
54
import java.util.concurrent.ThreadLocalRandom;
65
import java.util.concurrent.TimeUnit;
76

7+
import org.dcache.nfs.util.Opaque;
88
import org.dcache.nfs.v4.StateOwner;
99
import org.dcache.nfs.v4.nlm.LockException;
1010
import org.dcache.nfs.v4.nlm.LockManager;
@@ -41,15 +41,15 @@ public LockManager getLockManager() {
4141
*/
4242
@State(Scope.Thread)
4343
public static class FileHolder {
44-
45-
private final Random random = ThreadLocalRandom.current();
46-
private final byte[] file1 = new byte[16];
44+
private final Opaque file1;
4745

4846
public FileHolder() {
49-
random.nextBytes(file1);
47+
byte[] bytes = new byte[16];
48+
ThreadLocalRandom.current().nextBytes(bytes);
49+
file1 = Opaque.forBytes(bytes);
5050
}
5151

52-
public byte[] getFile() {
52+
public Opaque getFile() {
5353
return file1;
5454
}
5555

0 commit comments

Comments
 (0)