[TRANSLOG] Remove useless random translog directory selection
Using ThreadLocalRandom only prevents reproducibilty but doesn't buy us anything. In production different datapaths won't have the same since anyway or at least with a low likelyhood.
This commit is contained in:
parent
906d0ee369
commit
210f6c7b33
|
@ -49,7 +49,6 @@ import java.nio.file.*;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.regex.Matcher;
|
||||
|
@ -237,8 +236,6 @@ public class FsTranslog extends AbstractIndexShardComponent implements Translog
|
|||
if (currentFree < size) {
|
||||
size = currentFree;
|
||||
location = file;
|
||||
} else if (currentFree == size && ThreadLocalRandom.current().nextBoolean()) {
|
||||
location = file;
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
@ -266,8 +263,6 @@ public class FsTranslog extends AbstractIndexShardComponent implements Translog
|
|||
if (currentFree < size) {
|
||||
size = currentFree;
|
||||
location = file;
|
||||
} else if (currentFree == size && ThreadLocalRandom.current().nextBoolean()) {
|
||||
location = file;
|
||||
}
|
||||
}
|
||||
this.trans = type.create(shardId, id, new InternalChannelReference(location.resolve(getPath(id)), StandardOpenOption.READ, StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW), transientBufferSize);
|
||||
|
|
Loading…
Reference in New Issue