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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Support expected cluster name with validation in CCS Sniff mode ([#20532](https://github.com/opensearch-project/OpenSearch/pull/20532))

### Changed
- Move Randomness from server to libs/common ([#20570](https://github.com/opensearch-project/OpenSearch/pull/20570))

### Fixed
- Fix flaky test failures in ShardsLimitAllocationDeciderIT ([#20375](https://github.com/opensearch-project/OpenSearch/pull/20375))
Expand Down
2 changes: 1 addition & 1 deletion distribution/tools/fips-demo-installer-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ apply plugin: 'opensearch.build'

dependencies {
api project(":libs:opensearch-cli")
api project(":server")
api project(":libs:opensearch-common")
api project(':distribution:tools:java-version-checker')
api "info.picocli:picocli:${versions.picocli}"
api "org.bouncycastle:bc-fips:${versions.bouncycastle_jce}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@

package org.opensearch.common;

import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Settings;

import java.lang.reflect.Method;
import java.security.GeneralSecurityException;
import java.security.NoSuchAlgorithmException;
Expand Down Expand Up @@ -82,22 +79,6 @@ public final class Randomness {

private Randomness() {}

/**
* Provides a reproducible source of randomness seeded by a long
* seed in the settings with the key setting.
*
* @param settings the settings containing the seed
* @param setting the setting to access the seed
* @return a reproducible source of randomness
*/
public static Random get(Settings settings, Setting<Long> setting) {
if (setting.exists(settings)) {
return new Random(setting.get(settings));
} else {
return get();
}
}

/**
* Provides a source of randomness that is reproducible when
* running under the OpenSearch test suite, and otherwise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ private static NodeMetadata loadNodeMetadata(Settings settings, Logger logger, N
}

public static String generateNodeId(Settings settings) {
Random random = Randomness.get(settings, NODE_ID_SEED_SETTING);
Random random = NODE_ID_SEED_SETTING.exists(settings) ? new Random(NODE_ID_SEED_SETTING.get(settings)) : Randomness.get();
return UUIDs.randomBase64UUID(random);
}

Expand Down
Loading