Rename META_DATA to METADATA
This is a follow up to a previous commit that renamed MetaData to Metadata in all of the places. In that commit in master, we renamed META_DATA to METADATA, but lost this on the backport. This commit addresses that.
This commit is contained in:
parent
5fcda57b37
commit
63e5f2b765
|
@ -554,7 +554,7 @@ public class ClusterState implements ToXContentFragment, Diffable<ClusterState>
|
|||
private final ClusterName clusterName;
|
||||
private long version = 0;
|
||||
private String uuid = UNKNOWN_UUID;
|
||||
private Metadata metadata = Metadata.EMPTY_META_DATA;
|
||||
private Metadata metadata = Metadata.EMPTY_METADATA;
|
||||
private RoutingTable routingTable = RoutingTable.EMPTY_ROUTING_TABLE;
|
||||
private DiscoveryNodes nodes = DiscoveryNodes.EMPTY_NODES;
|
||||
private ClusterBlocks blocks = ClusterBlocks.EMPTY_CLUSTER_BLOCK;
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class CoordinationMetadata implements Writeable, ToXContentFragment {
|
||||
|
||||
public static final CoordinationMetadata EMPTY_META_DATA = builder().build();
|
||||
public static final CoordinationMetadata EMPTY_METADATA = builder().build();
|
||||
|
||||
private final long term;
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class UnsafeBootstrapMasterCommand extends ElasticsearchNodeCommand {
|
|||
|
||||
static final String MASTER_NODE_BOOTSTRAPPED_MSG = "Master node was successfully bootstrapped";
|
||||
static final Setting<String> UNSAFE_BOOTSTRAP =
|
||||
ClusterService.USER_DEFINED_META_DATA.getConcreteSetting("cluster.metadata.unsafe-bootstrap");
|
||||
ClusterService.USER_DEFINED_METADATA.getConcreteSetting("cluster.metadata.unsafe-bootstrap");
|
||||
|
||||
UnsafeBootstrapMasterCommand() {
|
||||
super("Forces the successful election of the current node after the permanent loss of the half or more master-eligible nodes");
|
||||
|
|
|
@ -148,7 +148,7 @@ public class Metadata implements Iterable<IndexMetadata>, Diffable<Metadata>, To
|
|||
false, false, true, RestStatus.FORBIDDEN,
|
||||
EnumSet.of(ClusterBlockLevel.WRITE, ClusterBlockLevel.METADATA_WRITE));
|
||||
|
||||
public static final Metadata EMPTY_META_DATA = builder().build();
|
||||
public static final Metadata EMPTY_METADATA = builder().build();
|
||||
|
||||
public static final String CONTEXT_MODE_PARAM = "context_mode";
|
||||
|
||||
|
@ -909,7 +909,7 @@ public class Metadata implements Iterable<IndexMetadata>, Diffable<Metadata>, To
|
|||
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
|
||||
coordinationMetadata = new CoordinationMetadata(in);
|
||||
} else {
|
||||
coordinationMetadata = CoordinationMetadata.EMPTY_META_DATA;
|
||||
coordinationMetadata = CoordinationMetadata.EMPTY_METADATA;
|
||||
}
|
||||
transientSettings = Settings.readSettingsFromStream(in);
|
||||
persistentSettings = Settings.readSettingsFromStream(in);
|
||||
|
@ -1045,7 +1045,7 @@ public class Metadata implements Iterable<IndexMetadata>, Diffable<Metadata>, To
|
|||
private boolean clusterUUIDCommitted;
|
||||
private long version;
|
||||
|
||||
private CoordinationMetadata coordinationMetadata = CoordinationMetadata.EMPTY_META_DATA;
|
||||
private CoordinationMetadata coordinationMetadata = CoordinationMetadata.EMPTY_METADATA;
|
||||
private Settings transientSettings = Settings.Builder.EMPTY_SETTINGS;
|
||||
private Settings persistentSettings = Settings.Builder.EMPTY_SETTINGS;
|
||||
private DiffableStringMap hashesOfConsistentSettings = new DiffableStringMap(Collections.emptyMap());
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ClusterService extends AbstractLifecycleComponent {
|
|||
|
||||
private final ClusterApplierService clusterApplierService;
|
||||
|
||||
public static final org.elasticsearch.common.settings.Setting.AffixSetting<String> USER_DEFINED_META_DATA =
|
||||
public static final org.elasticsearch.common.settings.Setting.AffixSetting<String> USER_DEFINED_METADATA =
|
||||
Setting.prefixKeySetting("cluster.metadata.", (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope));
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ public class ClusterService extends AbstractLifecycleComponent {
|
|||
this.clusterSettings = clusterSettings;
|
||||
this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings);
|
||||
// Add a no-op update consumer so changes are logged
|
||||
this.clusterSettings.addAffixUpdateConsumer(USER_DEFINED_META_DATA, (first, second) -> {}, (first, second) -> {});
|
||||
this.clusterSettings.addAffixUpdateConsumer(USER_DEFINED_METADATA, (first, second) -> {}, (first, second) -> {});
|
||||
this.clusterApplierService = clusterApplierService;
|
||||
}
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ public final class ClusterSettings extends AbstractScopedSettings {
|
|||
HierarchyCircuitBreakerService.ACCOUNTING_CIRCUIT_BREAKER_OVERHEAD_SETTING,
|
||||
IndexModule.NODE_STORE_ALLOW_MMAP,
|
||||
ClusterApplierService.CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING,
|
||||
ClusterService.USER_DEFINED_META_DATA,
|
||||
ClusterService.USER_DEFINED_METADATA,
|
||||
MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING,
|
||||
SearchService.DEFAULT_SEARCH_TIMEOUT_SETTING,
|
||||
SearchService.DEFAULT_ALLOW_PARTIAL_SEARCH_RESULTS,
|
||||
|
|
|
@ -49,8 +49,8 @@ public class MetaStateService {
|
|||
private final NamedXContentRegistry namedXContentRegistry;
|
||||
|
||||
// we allow subclasses in tests to redefine formats, e.g. to inject failures
|
||||
protected MetadataStateFormat<Metadata> META_DATA_FORMAT = Metadata.FORMAT;
|
||||
protected MetadataStateFormat<IndexMetadata> INDEX_META_DATA_FORMAT = IndexMetadata.FORMAT;
|
||||
protected MetadataStateFormat<Metadata> METADATA_FORMAT = Metadata.FORMAT;
|
||||
protected MetadataStateFormat<IndexMetadata> INDEX_METADATA_FORMAT = IndexMetadata.FORMAT;
|
||||
protected MetadataStateFormat<Manifest> MANIFEST_FORMAT = Manifest.FORMAT;
|
||||
|
||||
public MetaStateService(NodeEnvironment nodeEnv, NamedXContentRegistry namedXContentRegistry) {
|
||||
|
@ -79,7 +79,7 @@ public class MetaStateService {
|
|||
if (manifest.isGlobalGenerationMissing()) {
|
||||
metadataBuilder = Metadata.builder();
|
||||
} else {
|
||||
final Metadata globalMetadata = META_DATA_FORMAT.loadGeneration(logger, namedXContentRegistry, manifest.getGlobalGeneration(),
|
||||
final Metadata globalMetadata = METADATA_FORMAT.loadGeneration(logger, namedXContentRegistry, manifest.getGlobalGeneration(),
|
||||
nodeEnv.nodeDataPaths());
|
||||
if (globalMetadata != null) {
|
||||
metadataBuilder = Metadata.builder(globalMetadata);
|
||||
|
@ -92,7 +92,7 @@ public class MetaStateService {
|
|||
final Index index = entry.getKey();
|
||||
final long generation = entry.getValue();
|
||||
final String indexFolderName = index.getUUID();
|
||||
final IndexMetadata indexMetadata = INDEX_META_DATA_FORMAT.loadGeneration(logger, namedXContentRegistry, generation,
|
||||
final IndexMetadata indexMetadata = INDEX_METADATA_FORMAT.loadGeneration(logger, namedXContentRegistry, generation,
|
||||
nodeEnv.resolveIndexFolder(indexFolderName));
|
||||
if (indexMetadata != null) {
|
||||
metadataBuilder.put(indexMetadata, false);
|
||||
|
@ -113,7 +113,7 @@ public class MetaStateService {
|
|||
Metadata.Builder metadataBuilder;
|
||||
|
||||
Tuple<Metadata, Long> metadataAndGeneration =
|
||||
META_DATA_FORMAT.loadLatestStateWithGeneration(logger, namedXContentRegistry, nodeEnv.nodeDataPaths());
|
||||
METADATA_FORMAT.loadLatestStateWithGeneration(logger, namedXContentRegistry, nodeEnv.nodeDataPaths());
|
||||
Metadata globalMetadata = metadataAndGeneration.v1();
|
||||
long globalStateGeneration = metadataAndGeneration.v2();
|
||||
|
||||
|
@ -129,7 +129,7 @@ public class MetaStateService {
|
|||
|
||||
for (String indexFolderName : nodeEnv.availableIndexFolders()) {
|
||||
Tuple<IndexMetadata, Long> indexMetadataAndGeneration =
|
||||
INDEX_META_DATA_FORMAT.loadLatestStateWithGeneration(logger, namedXContentRegistry,
|
||||
INDEX_METADATA_FORMAT.loadLatestStateWithGeneration(logger, namedXContentRegistry,
|
||||
nodeEnv.resolveIndexFolder(indexFolderName));
|
||||
assert Version.CURRENT.major < 8 : "failed to find manifest file, which is mandatory staring with Elasticsearch version 8.0";
|
||||
IndexMetadata indexMetadata = indexMetadataAndGeneration.v1();
|
||||
|
@ -156,7 +156,7 @@ public class MetaStateService {
|
|||
*/
|
||||
@Nullable
|
||||
public IndexMetadata loadIndexState(Index index) throws IOException {
|
||||
return INDEX_META_DATA_FORMAT.loadLatestState(logger, namedXContentRegistry, nodeEnv.indexPaths(index));
|
||||
return INDEX_METADATA_FORMAT.loadLatestState(logger, namedXContentRegistry, nodeEnv.indexPaths(index));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -167,7 +167,7 @@ public class MetaStateService {
|
|||
for (String indexFolderName : nodeEnv.availableIndexFolders(excludeIndexPathIdsPredicate)) {
|
||||
assert excludeIndexPathIdsPredicate.test(indexFolderName) == false :
|
||||
"unexpected folder " + indexFolderName + " which should have been excluded";
|
||||
IndexMetadata indexMetadata = INDEX_META_DATA_FORMAT.loadLatestState(logger, namedXContentRegistry,
|
||||
IndexMetadata indexMetadata = INDEX_METADATA_FORMAT.loadLatestState(logger, namedXContentRegistry,
|
||||
nodeEnv.resolveIndexFolder(indexFolderName));
|
||||
if (indexMetadata != null) {
|
||||
final String indexPathId = indexMetadata.getIndex().getUUID();
|
||||
|
@ -198,7 +198,7 @@ public class MetaStateService {
|
|||
* Loads the global state, *without* index state, see {@link #loadFullState()} for that.
|
||||
*/
|
||||
Metadata loadGlobalState() throws IOException {
|
||||
return META_DATA_FORMAT.loadLatestState(logger, namedXContentRegistry, nodeEnv.nodeDataPaths());
|
||||
return METADATA_FORMAT.loadLatestState(logger, namedXContentRegistry, nodeEnv.nodeDataPaths());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -229,7 +229,7 @@ public class MetaStateService {
|
|||
final Index index = indexMetadata.getIndex();
|
||||
logger.trace("[{}] writing state, reason [{}]", index, reason);
|
||||
try {
|
||||
long generation = INDEX_META_DATA_FORMAT.write(indexMetadata,
|
||||
long generation = INDEX_METADATA_FORMAT.write(indexMetadata,
|
||||
nodeEnv.indexPaths(indexMetadata.getIndex()));
|
||||
logger.trace("[{}] state written", index);
|
||||
return generation;
|
||||
|
@ -247,7 +247,7 @@ public class MetaStateService {
|
|||
long writeGlobalState(String reason, Metadata metadata) throws WriteStateException {
|
||||
logger.trace("[_global] writing state, reason [{}]", reason);
|
||||
try {
|
||||
long generation = META_DATA_FORMAT.write(metadata, nodeEnv.nodeDataPaths());
|
||||
long generation = METADATA_FORMAT.write(metadata, nodeEnv.nodeDataPaths());
|
||||
logger.trace("[_global] state written");
|
||||
return generation;
|
||||
} catch (WriteStateException ex) {
|
||||
|
@ -261,7 +261,7 @@ public class MetaStateService {
|
|||
* @param currentGeneration current state generation to keep in the directory.
|
||||
*/
|
||||
void cleanupGlobalState(long currentGeneration) {
|
||||
META_DATA_FORMAT.cleanupOldFiles(currentGeneration, nodeEnv.nodeDataPaths());
|
||||
METADATA_FORMAT.cleanupOldFiles(currentGeneration, nodeEnv.nodeDataPaths());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -271,7 +271,7 @@ public class MetaStateService {
|
|||
* @param currentGeneration current state generation to keep in the index directory.
|
||||
*/
|
||||
public void cleanupIndex(Index index, long currentGeneration) {
|
||||
INDEX_META_DATA_FORMAT.cleanupOldFiles(currentGeneration, nodeEnv.indexPaths(index));
|
||||
INDEX_METADATA_FORMAT.cleanupOldFiles(currentGeneration, nodeEnv.indexPaths(index));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -280,7 +280,7 @@ public class MetaStateService {
|
|||
*/
|
||||
public void unreferenceAll() throws IOException {
|
||||
MANIFEST_FORMAT.writeAndCleanup(Manifest.empty(), nodeEnv.nodeDataPaths()); // write empty file so that indices become unreferenced
|
||||
META_DATA_FORMAT.cleanupOldFiles(Long.MAX_VALUE, nodeEnv.nodeDataPaths());
|
||||
METADATA_FORMAT.cleanupOldFiles(Long.MAX_VALUE, nodeEnv.nodeDataPaths());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -227,7 +227,7 @@ public class PersistedClusterStateService {
|
|||
}
|
||||
|
||||
public static class OnDiskState {
|
||||
private static final OnDiskState NO_ON_DISK_STATE = new OnDiskState(null, null, 0L, 0L, Metadata.EMPTY_META_DATA);
|
||||
private static final OnDiskState NO_ON_DISK_STATE = new OnDiskState(null, null, 0L, 0L, Metadata.EMPTY_METADATA);
|
||||
|
||||
private final String nodeId;
|
||||
private final Path dataPath;
|
||||
|
|
|
@ -240,7 +240,7 @@ public class IndexService extends AbstractIndexComponent implements IndicesClust
|
|||
|
||||
public enum IndexCreationContext {
|
||||
CREATE_INDEX,
|
||||
META_DATA_VERIFICATION
|
||||
METADATA_VERIFICATION
|
||||
}
|
||||
|
||||
public int numberOfShards() {
|
||||
|
|
|
@ -168,7 +168,7 @@ import static org.elasticsearch.common.collect.MapBuilder.newMapBuilder;
|
|||
import static org.elasticsearch.common.util.CollectionUtils.arrayAsArrayList;
|
||||
import static org.elasticsearch.common.util.concurrent.EsExecutors.daemonThreadFactory;
|
||||
import static org.elasticsearch.index.IndexService.IndexCreationContext.CREATE_INDEX;
|
||||
import static org.elasticsearch.index.IndexService.IndexCreationContext.META_DATA_VERIFICATION;
|
||||
import static org.elasticsearch.index.IndexService.IndexCreationContext.METADATA_VERIFICATION;
|
||||
import static org.elasticsearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder;
|
||||
import static org.elasticsearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES;
|
||||
|
||||
|
@ -725,7 +725,7 @@ public class IndicesService extends AbstractLifecycleComponent
|
|||
closeables.add(indicesQueryCache);
|
||||
// this will also fail if some plugin fails etc. which is nice since we can verify that early
|
||||
final IndexService service =
|
||||
createIndexService(META_DATA_VERIFICATION, metadata, indicesQueryCache, indicesFieldDataCache, emptyList());
|
||||
createIndexService(METADATA_VERIFICATION, metadata, indicesQueryCache, indicesFieldDataCache, emptyList());
|
||||
closeables.add(() -> service.close("metadata verification", false));
|
||||
service.mapperService().merge(metadata, MapperService.MergeReason.MAPPING_RECOVERY);
|
||||
if (metadata.equals(metadataUpdate) == false) {
|
||||
|
|
|
@ -107,7 +107,7 @@ public class TransportBulkActionIndicesThatCannotBeCreatedTests extends ESTestCa
|
|||
BulkRequest bulkRequest, Function<String, Boolean> shouldAutoCreate) {
|
||||
ClusterService clusterService = mock(ClusterService.class);
|
||||
ClusterState state = mock(ClusterState.class);
|
||||
when(state.getMetadata()).thenReturn(Metadata.EMPTY_META_DATA);
|
||||
when(state.getMetadata()).thenReturn(Metadata.EMPTY_METADATA);
|
||||
when(clusterService.state()).thenReturn(state);
|
||||
DiscoveryNodes discoveryNodes = mock(DiscoveryNodes.class);
|
||||
when(state.getNodes()).thenReturn(discoveryNodes);
|
||||
|
|
|
@ -706,14 +706,14 @@ public class BootstrapChecksTests extends AbstractBootstrapCheckTestCase {
|
|||
final List<BootstrapCheck> checks = Collections.singletonList(new BootstrapChecks.DiscoveryConfiguredCheck());
|
||||
|
||||
final BootstrapContext zen2Context = createTestContext(Settings.builder()
|
||||
.put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(), ZEN2_DISCOVERY_TYPE).build(), Metadata.EMPTY_META_DATA);
|
||||
.put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(), ZEN2_DISCOVERY_TYPE).build(), Metadata.EMPTY_METADATA);
|
||||
|
||||
// not always enforced
|
||||
BootstrapChecks.check(zen2Context, false, checks);
|
||||
|
||||
// not enforced for non-zen2 discovery
|
||||
BootstrapChecks.check(createTestContext(Settings.builder().put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(),
|
||||
randomFrom(ZEN_DISCOVERY_TYPE, "single-node", randomAlphaOfLength(5))).build(), Metadata.EMPTY_META_DATA), true, checks);
|
||||
randomFrom(ZEN_DISCOVERY_TYPE, "single-node", randomAlphaOfLength(5))).build(), Metadata.EMPTY_METADATA), true, checks);
|
||||
|
||||
final NodeValidationException e = expectThrows(NodeValidationException.class,
|
||||
() -> BootstrapChecks.check(zen2Context, true, checks));
|
||||
|
@ -723,7 +723,7 @@ public class BootstrapChecksTests extends AbstractBootstrapCheckTestCase {
|
|||
CheckedConsumer<Settings.Builder, NodeValidationException> ensureChecksPass = b ->
|
||||
{
|
||||
final BootstrapContext context = createTestContext(b
|
||||
.put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(), ZEN2_DISCOVERY_TYPE).build(), Metadata.EMPTY_META_DATA);
|
||||
.put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(), ZEN2_DISCOVERY_TYPE).build(), Metadata.EMPTY_METADATA);
|
||||
BootstrapChecks.check(context, true, checks);
|
||||
};
|
||||
|
||||
|
|
|
@ -84,14 +84,14 @@ public class MaxMapCountCheckTests extends AbstractBootstrapCheckTestCase {
|
|||
settingsThatAllowMemoryMap.add(Settings.builder().put("node.store.allow_mmap", true).build());
|
||||
|
||||
for (final Settings settingThatAllowsMemoryMap : settingsThatAllowMemoryMap) {
|
||||
assertFailure(check.check(createTestContext(settingThatAllowsMemoryMap, Metadata.EMPTY_META_DATA)));
|
||||
assertFailure(check.check(createTestContext(settingThatAllowsMemoryMap, Metadata.EMPTY_METADATA)));
|
||||
}
|
||||
}
|
||||
|
||||
public void testMaxMapCountCheckNotEnforcedIfMemoryMapNotAllowed() {
|
||||
// nothing should happen if current vm.max_map_count is under the limit but mmap is not allowed
|
||||
final Settings settings = Settings.builder().put("node.store.allow_mmap", false).build();
|
||||
final BootstrapContext context = createTestContext(settings, Metadata.EMPTY_META_DATA);
|
||||
final BootstrapContext context = createTestContext(settings, Metadata.EMPTY_METADATA);
|
||||
final BootstrapCheck.BootstrapCheckResult result = check.check(context);
|
||||
assertTrue(result.isSuccess());
|
||||
}
|
||||
|
|
|
@ -324,7 +324,7 @@ public class MetadataIndexTemplateServiceTests extends ESSingleNodeTestCase {
|
|||
.build();
|
||||
|
||||
ClusterState state = ClusterState.builder(ClusterState.EMPTY_STATE)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_META_DATA)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_METADATA)
|
||||
.put(v1Template)
|
||||
.build())
|
||||
.build();
|
||||
|
@ -389,7 +389,7 @@ public class MetadataIndexTemplateServiceTests extends ESSingleNodeTestCase {
|
|||
.build();
|
||||
|
||||
ClusterState state = ClusterState.builder(ClusterState.EMPTY_STATE)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_META_DATA)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_METADATA)
|
||||
.put(v1Template)
|
||||
.build())
|
||||
.build();
|
||||
|
@ -428,7 +428,7 @@ public class MetadataIndexTemplateServiceTests extends ESSingleNodeTestCase {
|
|||
.build();
|
||||
|
||||
ClusterState state = ClusterState.builder(ClusterState.EMPTY_STATE)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_META_DATA)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_METADATA)
|
||||
.put(v1Template)
|
||||
.build())
|
||||
.build();
|
||||
|
|
|
@ -446,7 +446,7 @@ public class PublishClusterStateActionTests extends ESTestCase {
|
|||
|
||||
AssertingAckListener[] listeners = new AssertingAckListener[numberOfIterations];
|
||||
DiscoveryNodes discoveryNodes = discoveryNodesBuilder.build();
|
||||
Metadata metadata = Metadata.EMPTY_META_DATA;
|
||||
Metadata metadata = Metadata.EMPTY_METADATA;
|
||||
ClusterState clusterState = ClusterState.builder(CLUSTER_NAME).metadata(metadata).build();
|
||||
ClusterState previousState;
|
||||
for (int i = 0; i < numberOfIterations; i++) {
|
||||
|
@ -539,7 +539,7 @@ public class PublishClusterStateActionTests extends ESTestCase {
|
|||
}
|
||||
discoveryNodesBuilder.localNodeId(master.discoveryNode.getId()).masterNodeId(master.discoveryNode.getId());
|
||||
DiscoveryNodes discoveryNodes = discoveryNodesBuilder.build();
|
||||
Metadata metadata = Metadata.EMPTY_META_DATA;
|
||||
Metadata metadata = Metadata.EMPTY_METADATA;
|
||||
ClusterState clusterState = ClusterState.builder(CLUSTER_NAME).metadata(metadata).nodes(discoveryNodes).build();
|
||||
ClusterState previousState = master.clusterState;
|
||||
try {
|
||||
|
@ -617,7 +617,7 @@ public class PublishClusterStateActionTests extends ESTestCase {
|
|||
|
||||
discoveryNodesBuilder.localNodeId(master.discoveryNode.getId()).masterNodeId(master.discoveryNode.getId());
|
||||
DiscoveryNodes discoveryNodes = discoveryNodesBuilder.build();
|
||||
Metadata metadata = Metadata.EMPTY_META_DATA;
|
||||
Metadata metadata = Metadata.EMPTY_METADATA;
|
||||
ClusterState clusterState = ClusterState.builder(CLUSTER_NAME).metadata(metadata).nodes(discoveryNodes).build();
|
||||
ClusterState previousState = master.clusterState;
|
||||
try {
|
||||
|
|
|
@ -108,7 +108,7 @@ public class GatewayMetaStatePersistedStateTests extends ESTestCase {
|
|||
gateway = newGatewayPersistedState();
|
||||
ClusterState state = gateway.getLastAcceptedState();
|
||||
assertThat(state.getClusterName(), equalTo(clusterName));
|
||||
assertTrue(Metadata.isGlobalStateEquals(state.metadata(), Metadata.EMPTY_META_DATA));
|
||||
assertTrue(Metadata.isGlobalStateEquals(state.metadata(), Metadata.EMPTY_METADATA));
|
||||
assertThat(state.getVersion(), equalTo(Manifest.empty().getClusterStateVersion()));
|
||||
assertThat(state.getNodes().getLocalNode(), equalTo(localNode));
|
||||
|
||||
|
|
|
@ -329,8 +329,8 @@ public class IncrementalClusterStateWriterTests extends ESAllocationTestCase {
|
|||
|
||||
MetaStateServiceWithFailures(int invertedFailRate, NodeEnvironment nodeEnv, NamedXContentRegistry namedXContentRegistry) {
|
||||
super(nodeEnv, namedXContentRegistry);
|
||||
META_DATA_FORMAT = wrap(Metadata.FORMAT);
|
||||
INDEX_META_DATA_FORMAT = wrap(IndexMetadata.FORMAT);
|
||||
METADATA_FORMAT = wrap(Metadata.FORMAT);
|
||||
INDEX_METADATA_FORMAT = wrap(IndexMetadata.FORMAT);
|
||||
MANIFEST_FORMAT = wrap(Manifest.FORMAT);
|
||||
failRandomly = false;
|
||||
this.invertedFailRate = invertedFailRate;
|
||||
|
@ -388,7 +388,7 @@ public class IncrementalClusterStateWriterTests extends ESAllocationTestCase {
|
|||
|
||||
// We only guarantee atomicity of writes, if there is initial Manifest file
|
||||
Manifest manifest = Manifest.empty();
|
||||
Metadata metadata = Metadata.EMPTY_META_DATA;
|
||||
Metadata metadata = Metadata.EMPTY_METADATA;
|
||||
metaStateService.writeManifestAndCleanup("startup", Manifest.empty());
|
||||
long currentTerm = randomNonNegativeLong();
|
||||
long clusterStateVersion = randomNonNegativeLong();
|
||||
|
|
|
@ -124,7 +124,7 @@ public class MetaStateServiceTests extends ESTestCase {
|
|||
assertTrue(manifest.isEmpty());
|
||||
|
||||
Metadata metadata = manifestAndMetadata.v2();
|
||||
assertTrue(Metadata.isGlobalStateEquals(metadata, Metadata.EMPTY_META_DATA));
|
||||
assertTrue(Metadata.isGlobalStateEquals(metadata, Metadata.EMPTY_METADATA));
|
||||
}
|
||||
|
||||
public void testLoadEmptyStateWithManifest() throws IOException {
|
||||
|
@ -134,7 +134,7 @@ public class MetaStateServiceTests extends ESTestCase {
|
|||
Tuple<Manifest, Metadata> manifestAndMetadata = metaStateService.loadFullState();
|
||||
assertTrue(manifestAndMetadata.v1().isEmpty());
|
||||
Metadata metadata = manifestAndMetadata.v2();
|
||||
assertTrue(Metadata.isGlobalStateEquals(metadata, Metadata.EMPTY_META_DATA));
|
||||
assertTrue(Metadata.isGlobalStateEquals(metadata, Metadata.EMPTY_METADATA));
|
||||
}
|
||||
|
||||
public void testLoadFullStateMissingGlobalMetadata() throws IOException {
|
||||
|
@ -150,7 +150,7 @@ public class MetaStateServiceTests extends ESTestCase {
|
|||
Tuple<Manifest, Metadata> manifestAndMetadata = metaStateService.loadFullState();
|
||||
assertThat(manifestAndMetadata.v1(), equalTo(manifest));
|
||||
Metadata loadedMetadata = manifestAndMetadata.v2();
|
||||
assertTrue(Metadata.isGlobalStateEquals(loadedMetadata, Metadata.EMPTY_META_DATA));
|
||||
assertTrue(Metadata.isGlobalStateEquals(loadedMetadata, Metadata.EMPTY_METADATA));
|
||||
assertThat(loadedMetadata.hasIndex("test1"), equalTo(true));
|
||||
assertThat(loadedMetadata.index("test1"), equalTo(index));
|
||||
}
|
||||
|
@ -210,6 +210,6 @@ public class MetaStateServiceTests extends ESTestCase {
|
|||
manifestAndMetadata = metaStateService.loadFullState();
|
||||
assertTrue(manifestAndMetadata.v1().isEmpty());
|
||||
metadata = manifestAndMetadata.v2();
|
||||
assertTrue(Metadata.isGlobalStateEquals(metadata, Metadata.EMPTY_META_DATA));
|
||||
assertTrue(Metadata.isGlobalStateEquals(metadata, Metadata.EMPTY_METADATA));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -357,7 +357,7 @@ public class SliceBuilderTests extends ESTestCase {
|
|||
}
|
||||
ClusterService clusterService = mock(ClusterService.class);
|
||||
ClusterState state = mock(ClusterState.class);
|
||||
when(state.metadata()).thenReturn(Metadata.EMPTY_META_DATA);
|
||||
when(state.metadata()).thenReturn(Metadata.EMPTY_METADATA);
|
||||
when(clusterService.state()).thenReturn(state);
|
||||
OperationRouting routing = mock(OperationRouting.class);
|
||||
GroupShardsIterator<ShardIterator> it = new GroupShardsIterator<>(
|
||||
|
|
|
@ -150,7 +150,7 @@ public class MockEventuallyConsistentRepositoryTests extends ESTestCase {
|
|||
final SnapshotId snapshotId = new SnapshotId("foo", UUIDs.randomBase64UUID());
|
||||
// We try to write another snap- blob for "foo" in the next generation. It fails because the content differs.
|
||||
repository.finalizeSnapshot(snapshotId, ShardGenerations.EMPTY, 1L, null, 5, Collections.emptyList(),
|
||||
-1L, false, Metadata.EMPTY_META_DATA, Collections.emptyMap(), Version.CURRENT, future);
|
||||
-1L, false, Metadata.EMPTY_METADATA, Collections.emptyMap(), Version.CURRENT, future);
|
||||
future.actionGet();
|
||||
|
||||
// We try to write another snap- blob for "foo" in the next generation. It fails because the content differs.
|
||||
|
@ -159,7 +159,7 @@ public class MockEventuallyConsistentRepositoryTests extends ESTestCase {
|
|||
final PlainActionFuture<SnapshotInfo> fut = PlainActionFuture.newFuture();
|
||||
repository.finalizeSnapshot(
|
||||
snapshotId, ShardGenerations.EMPTY, 1L, null, 6, Collections.emptyList(),
|
||||
0, false, Metadata.EMPTY_META_DATA, Collections.emptyMap(), Version.CURRENT, fut);
|
||||
0, false, Metadata.EMPTY_METADATA, Collections.emptyMap(), Version.CURRENT, fut);
|
||||
fut.actionGet();
|
||||
});
|
||||
assertThat(assertionError.getMessage(), equalTo("\nExpected: <6>\n but: was <5>"));
|
||||
|
@ -168,7 +168,7 @@ public class MockEventuallyConsistentRepositoryTests extends ESTestCase {
|
|||
// It passes cleanly because the content of the blob except for the timestamps.
|
||||
final PlainActionFuture<SnapshotInfo> future2 = PlainActionFuture.newFuture();
|
||||
repository.finalizeSnapshot(snapshotId, ShardGenerations.EMPTY, 1L, null, 5, Collections.emptyList(),
|
||||
0, false, Metadata.EMPTY_META_DATA, Collections.emptyMap(),Version.CURRENT, future2);
|
||||
0, false, Metadata.EMPTY_METADATA, Collections.emptyMap(),Version.CURRENT, future2);
|
||||
future2.actionGet();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public abstract class AbstractBootstrapCheckTestCase extends ESTestCase {
|
|||
protected final BootstrapContext emptyContext;
|
||||
|
||||
public AbstractBootstrapCheckTestCase() {
|
||||
emptyContext = createTestContext(Settings.EMPTY, Metadata.EMPTY_META_DATA);
|
||||
emptyContext = createTestContext(Settings.EMPTY, Metadata.EMPTY_METADATA);
|
||||
}
|
||||
|
||||
protected BootstrapContext createTestContext(Settings settings, Metadata metadata) {
|
||||
|
|
|
@ -50,7 +50,7 @@ public class TransportAnalyticsStatsActionTests extends ESTestCase {
|
|||
|
||||
|
||||
ClusterState clusterState = mock(ClusterState.class);
|
||||
when(clusterState.getMetadata()).thenReturn(Metadata.EMPTY_META_DATA);
|
||||
when(clusterState.getMetadata()).thenReturn(Metadata.EMPTY_METADATA);
|
||||
when(clusterService.state()).thenReturn(clusterState);
|
||||
|
||||
return new TransportAnalyticsStatsAction(transportService, clusterService, threadPool,
|
||||
|
|
|
@ -13,12 +13,12 @@ import java.util.List;
|
|||
import java.util.function.Function;
|
||||
|
||||
public final class LdapMetadataResolverSettings {
|
||||
public static final Function<String, Setting.AffixSetting<List<String>>> ADDITIONAL_META_DATA_SETTING = RealmSettings.affixSetting(
|
||||
public static final Function<String, Setting.AffixSetting<List<String>>> ADDITIONAL_METADATA_SETTING = RealmSettings.affixSetting(
|
||||
"metadata", key -> Setting.listSetting(key, Collections.emptyList(), Function.identity(), Setting.Property.NodeScope));
|
||||
|
||||
private LdapMetadataResolverSettings() {}
|
||||
|
||||
public static List<Setting.AffixSetting<?>> getSettings(String type) {
|
||||
return Collections.singletonList(ADDITIONAL_META_DATA_SETTING.apply(type));
|
||||
return Collections.singletonList(ADDITIONAL_METADATA_SETTING.apply(type));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ public class LicenseServiceTests extends ESTestCase {
|
|||
.build();
|
||||
|
||||
final ClusterState clusterState = Mockito.mock(ClusterState.class);
|
||||
Mockito.when(clusterState.metadata()).thenReturn(Metadata.EMPTY_META_DATA);
|
||||
Mockito.when(clusterState.metadata()).thenReturn(Metadata.EMPTY_METADATA);
|
||||
|
||||
final ClusterService clusterService = Mockito.mock(ClusterService.class);
|
||||
Mockito.when(clusterService.state()).thenReturn(clusterState);
|
||||
|
|
|
@ -19,7 +19,7 @@ public class TLSLicenseBootstrapCheckTests extends AbstractBootstrapCheckTestCas
|
|||
public void testBootstrapCheckOnEmptyMetadata() {
|
||||
assertTrue(new TLSLicenseBootstrapCheck().check(emptyContext).isSuccess());
|
||||
assertTrue(new TLSLicenseBootstrapCheck().check(createTestContext(Settings.builder().put("xpack.security.transport.ssl.enabled"
|
||||
, randomBoolean()).build(), Metadata.EMPTY_META_DATA)).isSuccess());
|
||||
, randomBoolean()).build(), Metadata.EMPTY_METADATA)).isSuccess());
|
||||
}
|
||||
|
||||
public void testBootstrapCheckFailureOnPremiumLicense() throws Exception {
|
||||
|
|
|
@ -377,7 +377,7 @@ public class TransportPutLifecycleActionTests extends ESTestCase {
|
|||
LifecyclePolicyMetadata policyMetadata = new LifecyclePolicyMetadata(newPolicy, Collections.emptyMap(), 2L, 2L);
|
||||
|
||||
ClusterState existingState = ClusterState.builder(ClusterState.EMPTY_STATE)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_META_DATA)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_METADATA)
|
||||
.put(meta, false)
|
||||
.build())
|
||||
.build();
|
||||
|
@ -432,7 +432,7 @@ public class TransportPutLifecycleActionTests extends ESTestCase {
|
|||
assertTrue(TransportPutLifecycleAction.isIndexPhaseDefinitionUpdatable(REGISTRY, client, meta, newPolicy));
|
||||
|
||||
ClusterState existingState = ClusterState.builder(ClusterState.EMPTY_STATE)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_META_DATA)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_METADATA)
|
||||
.put(meta, false)
|
||||
.build())
|
||||
.build();
|
||||
|
@ -468,7 +468,7 @@ public class TransportPutLifecycleActionTests extends ESTestCase {
|
|||
.putCustom(ILM_CUSTOM_METADATA_KEY, exState.asMap())
|
||||
.build();
|
||||
existingState = ClusterState.builder(ClusterState.EMPTY_STATE)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_META_DATA)
|
||||
.metadata(Metadata.builder(Metadata.EMPTY_METADATA)
|
||||
.put(meta, false)
|
||||
.build())
|
||||
.build();
|
||||
|
|
|
@ -117,7 +117,7 @@ public class TransportGetTrainedModelsStatsActionTests extends ESTestCase {
|
|||
new HashSet<>(Arrays.asList(InferenceProcessor.MAX_INFERENCE_PROCESSORS,
|
||||
MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING,
|
||||
OperationRouting.USE_ADAPTIVE_REPLICA_SELECTION_SETTING,
|
||||
ClusterService.USER_DEFINED_META_DATA,
|
||||
ClusterService.USER_DEFINED_METADATA,
|
||||
AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING,
|
||||
ClusterApplierService.CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING)));
|
||||
clusterService = new ClusterService(settings, clusterSettings, tp);
|
||||
|
|
|
@ -82,7 +82,7 @@ public class InferenceProcessorFactoryTests extends ESTestCase {
|
|||
new HashSet<>(Arrays.asList(InferenceProcessor.MAX_INFERENCE_PROCESSORS,
|
||||
MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING,
|
||||
OperationRouting.USE_ADAPTIVE_REPLICA_SELECTION_SETTING,
|
||||
ClusterService.USER_DEFINED_META_DATA,
|
||||
ClusterService.USER_DEFINED_METADATA,
|
||||
AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING,
|
||||
ClusterApplierService.CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING)));
|
||||
clusterService = new ClusterService(settings, clusterSettings, tp);
|
||||
|
|
|
@ -136,7 +136,7 @@ public class AutodetectResultProcessorIT extends MlSingleNodeTestCase {
|
|||
MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING,
|
||||
OperationRouting.USE_ADAPTIVE_REPLICA_SELECTION_SETTING,
|
||||
AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING,
|
||||
ClusterService.USER_DEFINED_META_DATA,
|
||||
ClusterService.USER_DEFINED_METADATA,
|
||||
ResultsPersisterService.PERSIST_RESULTS_MAX_RETRIES,
|
||||
ClusterApplierService.CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING)));
|
||||
ClusterService clusterService = new ClusterService(settings, clusterSettings, tp);
|
||||
|
|
|
@ -55,7 +55,7 @@ public class EstablishedMemUsageIT extends BaseMlIntegTestCase {
|
|||
ResultsPersisterService.PERSIST_RESULTS_MAX_RETRIES,
|
||||
AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING,
|
||||
OperationRouting.USE_ADAPTIVE_REPLICA_SELECTION_SETTING,
|
||||
ClusterService.USER_DEFINED_META_DATA,
|
||||
ClusterService.USER_DEFINED_METADATA,
|
||||
ClusterApplierService.CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING)));
|
||||
ClusterService clusterService = new ClusterService(settings, clusterSettings, tp);
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ public class JobResultsProviderIT extends MlSingleNodeTestCase {
|
|||
AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING,
|
||||
OperationRouting.USE_ADAPTIVE_REPLICA_SELECTION_SETTING,
|
||||
ResultsPersisterService.PERSIST_RESULTS_MAX_RETRIES,
|
||||
ClusterService.USER_DEFINED_META_DATA,
|
||||
ClusterService.USER_DEFINED_METADATA,
|
||||
ClusterApplierService.CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING)));
|
||||
ClusterService clusterService = new ClusterService(builder.build(), clusterSettings, tp);
|
||||
|
||||
|
|
|
@ -388,7 +388,7 @@ public class JobResultsPersisterTests extends ESTestCase {
|
|||
OperationRouting.USE_ADAPTIVE_REPLICA_SELECTION_SETTING,
|
||||
ResultsPersisterService.PERSIST_RESULTS_MAX_RETRIES,
|
||||
AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING,
|
||||
ClusterService.USER_DEFINED_META_DATA,
|
||||
ClusterService.USER_DEFINED_METADATA,
|
||||
ClusterApplierService.CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING)));
|
||||
ClusterService clusterService = new ClusterService(Settings.EMPTY, clusterSettings, tp);
|
||||
|
||||
|
|
|
@ -376,7 +376,7 @@ public class ResultsPersisterServiceTests extends ESTestCase {
|
|||
MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING,
|
||||
OperationRouting.USE_ADAPTIVE_REPLICA_SELECTION_SETTING,
|
||||
AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING,
|
||||
ClusterService.USER_DEFINED_META_DATA,
|
||||
ClusterService.USER_DEFINED_METADATA,
|
||||
ResultsPersisterService.PERSIST_RESULTS_MAX_RETRIES,
|
||||
ClusterApplierService.CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING)));
|
||||
ClusterService clusterService = new ClusterService(Settings.EMPTY, clusterSettings, tp);
|
||||
|
|
|
@ -32,7 +32,7 @@ public class LdapMetadataResolver {
|
|||
private final boolean ignoreReferralErrors;
|
||||
|
||||
public LdapMetadataResolver(RealmConfig realmConfig, boolean ignoreReferralErrors) {
|
||||
this(realmConfig.getSetting(LdapMetadataResolverSettings.ADDITIONAL_META_DATA_SETTING), ignoreReferralErrors);
|
||||
this(realmConfig.getSetting(LdapMetadataResolverSettings.ADDITIONAL_METADATA_SETTING), ignoreReferralErrors);
|
||||
}
|
||||
|
||||
LdapMetadataResolver(Collection<String> attributeNames, boolean ignoreReferralErrors) {
|
||||
|
|
|
@ -374,12 +374,12 @@ public class ActiveDirectoryRealmTests extends ESTestCase {
|
|||
/**
|
||||
* This tests template role mappings (see
|
||||
* {@link TemplateRoleName}) with an LDAP realm, using a additional
|
||||
* metadata field (see {@link LdapMetadataResolverSettings#ADDITIONAL_META_DATA_SETTING}).
|
||||
* metadata field (see {@link LdapMetadataResolverSettings#ADDITIONAL_METADATA_SETTING}).
|
||||
*/
|
||||
public void testRealmWithTemplatedRoleMapping() throws Exception {
|
||||
final RealmConfig.RealmIdentifier realmId = realmId("testRealmWithTemplatedRoleMapping");
|
||||
Settings settings = settings(realmId, Settings.builder()
|
||||
.put(getFullSettingKey(realmId, LdapMetadataResolverSettings.ADDITIONAL_META_DATA_SETTING), "departmentNumber")
|
||||
.put(getFullSettingKey(realmId, LdapMetadataResolverSettings.ADDITIONAL_METADATA_SETTING), "departmentNumber")
|
||||
.build());
|
||||
RealmConfig config = setupRealm(realmId, settings);
|
||||
ActiveDirectorySessionFactory sessionFactory = new ActiveDirectorySessionFactory(config, sslService, threadPool);
|
||||
|
|
|
@ -413,7 +413,7 @@ public class LdapRealmTests extends LdapTestCase {
|
|||
/**
|
||||
* This tests template role mappings (see
|
||||
* {@link TemplateRoleName}) with an LDAP realm, using a additional
|
||||
* metadata field (see {@link LdapMetadataResolverSettings#ADDITIONAL_META_DATA_SETTING}).
|
||||
* metadata field (see {@link LdapMetadataResolverSettings#ADDITIONAL_METADATA_SETTING}).
|
||||
*/
|
||||
public void testLdapRealmWithTemplatedRoleMapping() throws Exception {
|
||||
String groupSearchBase = "o=sevenSeas";
|
||||
|
@ -422,7 +422,7 @@ public class LdapRealmTests extends LdapTestCase {
|
|||
.put(defaultGlobalSettings)
|
||||
.put(buildLdapSettings(ldapUrls(), userTemplate, groupSearchBase, LdapSearchScope.SUB_TREE))
|
||||
.put(getFullSettingKey(REALM_IDENTIFIER.getName(),
|
||||
LdapMetadataResolverSettings.ADDITIONAL_META_DATA_SETTING.apply(LdapRealmSettings.LDAP_TYPE)), "uid")
|
||||
LdapMetadataResolverSettings.ADDITIONAL_METADATA_SETTING.apply(LdapRealmSettings.LDAP_TYPE)), "uid")
|
||||
.build();
|
||||
RealmConfig config = getRealmConfig(REALM_IDENTIFIER, settings);
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class LdapMetadataResolverTests extends ESTestCase {
|
|||
final Settings settings = Settings.builder()
|
||||
.put("path.home", createTempDir())
|
||||
.putList(RealmSettings.getFullSettingKey(realmId.getName(),
|
||||
LdapMetadataResolverSettings.ADDITIONAL_META_DATA_SETTING.apply(LdapRealmSettings.LDAP_TYPE)),
|
||||
LdapMetadataResolverSettings.ADDITIONAL_METADATA_SETTING.apply(LdapRealmSettings.LDAP_TYPE)),
|
||||
"cn", "uid")
|
||||
.build();
|
||||
RealmConfig config = new RealmConfig(realmId,
|
||||
|
|
|
@ -1296,7 +1296,7 @@ public class AuthorizationServiceTests extends ESTestCase {
|
|||
private ClusterState mockEmptyMetadata() {
|
||||
ClusterState state = mock(ClusterState.class);
|
||||
when(clusterService.state()).thenReturn(state);
|
||||
when(state.metadata()).thenReturn(Metadata.EMPTY_META_DATA);
|
||||
when(state.metadata()).thenReturn(Metadata.EMPTY_METADATA);
|
||||
return state;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class AuthorizedIndicesTests extends ESTestCase {
|
|||
|
||||
public void testAuthorizedIndicesUserWithoutRoles() {
|
||||
List<String> authorizedIndices =
|
||||
RBACEngine.resolveAuthorizedIndicesFromRole(Role.EMPTY, "", Metadata.EMPTY_META_DATA.getIndicesLookup());
|
||||
RBACEngine.resolveAuthorizedIndicesFromRole(Role.EMPTY, "", Metadata.EMPTY_METADATA.getIndicesLookup());
|
||||
assertTrue(authorizedIndices.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class AuthorizedIndicesTests extends ESTestCase {
|
|||
public void testAuthorizedIndicesUserWithSomeRolesEmptyMetadata() {
|
||||
Role role = Role.builder("role").add(IndexPrivilege.ALL, "*").build();
|
||||
List<String> authorizedIndices =
|
||||
RBACEngine.resolveAuthorizedIndicesFromRole(role, SearchAction.NAME, Metadata.EMPTY_META_DATA.getIndicesLookup());
|
||||
RBACEngine.resolveAuthorizedIndicesFromRole(role, SearchAction.NAME, Metadata.EMPTY_METADATA.getIndicesLookup());
|
||||
assertTrue(authorizedIndices.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class AuthorizedIndicesTests extends ESTestCase {
|
|||
Role role = Role.builder("user_role").add(IndexPrivilege.ALL, "*").cluster(Collections.singleton("all"), Collections.emptySet())
|
||||
.build();
|
||||
List<String> authorizedIndices =
|
||||
RBACEngine.resolveAuthorizedIndicesFromRole(role, SearchAction.NAME, Metadata.EMPTY_META_DATA.getIndicesLookup());
|
||||
RBACEngine.resolveAuthorizedIndicesFromRole(role, SearchAction.NAME, Metadata.EMPTY_METADATA.getIndicesLookup());
|
||||
assertTrue(authorizedIndices.isEmpty());
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class TransportWatcherStatsActionTests extends ESTestCase {
|
|||
when(clusterService.getClusterName()).thenReturn(clusterName);
|
||||
|
||||
ClusterState clusterState = mock(ClusterState.class);
|
||||
when(clusterState.getMetadata()).thenReturn(Metadata.EMPTY_META_DATA);
|
||||
when(clusterState.getMetadata()).thenReturn(Metadata.EMPTY_METADATA);
|
||||
when(clusterService.state()).thenReturn(clusterState);
|
||||
|
||||
WatcherLifeCycleService watcherLifeCycleService = mock(WatcherLifeCycleService.class);
|
||||
|
|
|
@ -228,7 +228,7 @@ public class OpenLdapTests extends ESTestCase {
|
|||
public void testResolveSingleValuedAttributeFromConnection() throws Exception {
|
||||
final RealmConfig.RealmIdentifier realmId = new RealmConfig.RealmIdentifier("ldap", "oldap-test");
|
||||
final Settings settings = Settings.builder()
|
||||
.putList(getFullSettingKey(realmId.getName(), LdapMetadataResolverSettings.ADDITIONAL_META_DATA_SETTING.apply("ldap")),
|
||||
.putList(getFullSettingKey(realmId.getName(), LdapMetadataResolverSettings.ADDITIONAL_METADATA_SETTING.apply("ldap")),
|
||||
"cn", "sn")
|
||||
.build();
|
||||
final RealmConfig config = new RealmConfig(realmId, settings,
|
||||
|
@ -245,7 +245,7 @@ public class OpenLdapTests extends ESTestCase {
|
|||
public void testResolveMultiValuedAttributeFromConnection() throws Exception {
|
||||
final RealmConfig.RealmIdentifier realmId = new RealmConfig.RealmIdentifier("ldap", "oldap-test");
|
||||
final Settings settings = Settings.builder()
|
||||
.putList(getFullSettingKey(realmId.getName(), LdapMetadataResolverSettings.ADDITIONAL_META_DATA_SETTING.apply("ldap")),
|
||||
.putList(getFullSettingKey(realmId.getName(), LdapMetadataResolverSettings.ADDITIONAL_METADATA_SETTING.apply("ldap")),
|
||||
"objectClass")
|
||||
.build();
|
||||
final RealmConfig config = new RealmConfig(realmId, settings,
|
||||
|
@ -262,7 +262,7 @@ public class OpenLdapTests extends ESTestCase {
|
|||
public void testResolveMissingAttributeFromConnection() throws Exception {
|
||||
final RealmConfig.RealmIdentifier realmId = new RealmConfig.RealmIdentifier("ldap", "oldap-test");
|
||||
final Settings settings = Settings.builder()
|
||||
.putList(getFullSettingKey(realmId.getName(), LdapMetadataResolverSettings.ADDITIONAL_META_DATA_SETTING.apply("ldap")),
|
||||
.putList(getFullSettingKey(realmId.getName(), LdapMetadataResolverSettings.ADDITIONAL_METADATA_SETTING.apply("ldap")),
|
||||
"alias")
|
||||
.build();
|
||||
final RealmConfig config = new RealmConfig(realmId, settings,
|
||||
|
|
Loading…
Reference in New Issue