Skip to content

Commit

Permalink
[fix](multi-catalog) SecureRandom is used to replace Random in Federa…
Browse files Browse the repository at this point in the history
…tionBackendPolicy to enhance security (apache#24860)
  • Loading branch information
zy-kkk authored Sep 26, 2023
1 parent e887653 commit 33630e1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
import org.apache.logging.log4j.Logger;

import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.stream.Collectors;

public class FederationBackendPolicy {
private static final Logger LOG = LogManager.getLogger(FederationBackendPolicy.class);
private final List<Backend> backends = Lists.newArrayList();
private final Map<String, List<Backend>> backendMap = Maps.newHashMap();
private final Random random = new Random(System.currentTimeMillis());
private final SecureRandom random = new SecureRandom();
private ConsistentHash<TScanRangeLocations, Backend> consistentHash;

private int nextBe = 0;
Expand Down

0 comments on commit 33630e1

Please sign in to comment.