Search in sources :

Example 71 with Version

use of org.opensearch.Version in project OpenSearch by opensearch-project.

the class DiscoveryModuleTests method testLegacyHostsProvider.

public void testLegacyHostsProvider() {
    Settings settings = Settings.builder().put(DiscoveryModule.LEGACY_DISCOVERY_HOSTS_PROVIDER_SETTING.getKey(), "custom").build();
    AtomicBoolean created = new AtomicBoolean(false);
    DummyHostsProviderPlugin plugin = () -> Collections.singletonMap("custom", () -> {
        created.set(true);
        return hostsResolver -> Collections.emptyList();
    });
    newModule(settings, Collections.singletonList(plugin));
    assertTrue(created.get());
    assertWarnings("[discovery.zen.hosts_provider] setting was deprecated in OpenSearch and will be removed in a future release! " + "See the breaking changes documentation for the next major version.");
}
Also used : Arrays(java.util.Arrays) ThreadPool(org.opensearch.threadpool.ThreadPool) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Version(org.opensearch.Version) ThreadContext(org.opensearch.common.util.concurrent.ThreadContext) MockTransportService(org.opensearch.test.transport.MockTransportService) Supplier(java.util.function.Supplier) NamedWriteableRegistry(org.opensearch.common.io.stream.NamedWriteableRegistry) ClusterState(org.opensearch.cluster.ClusterState) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) After(org.junit.After) Map(java.util.Map) RerouteService(org.opensearch.cluster.routing.RerouteService) BiConsumer(java.util.function.BiConsumer) Coordinator(org.opensearch.cluster.coordination.Coordinator) ClusterSettings(org.opensearch.common.settings.ClusterSettings) Before(org.junit.Before) ClusterApplier(org.opensearch.cluster.service.ClusterApplier) MasterService(org.opensearch.cluster.service.MasterService) OpenSearchTestCase(org.opensearch.test.OpenSearchTestCase) Collection(java.util.Collection) Settings(org.opensearch.common.settings.Settings) IOException(java.io.IOException) Mockito.when(org.mockito.Mockito.when) TransportService(org.opensearch.transport.TransportService) DiscoveryPlugin(org.opensearch.plugins.DiscoveryPlugin) IOUtils(org.opensearch.core.internal.io.IOUtils) GatewayMetaState(org.opensearch.gateway.GatewayMetaState) List(java.util.List) NetworkService(org.opensearch.common.network.NetworkService) Collections(java.util.Collections) Mockito.mock(org.mockito.Mockito.mock) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ClusterSettings(org.opensearch.common.settings.ClusterSettings) Settings(org.opensearch.common.settings.Settings)

Example 72 with Version

use of org.opensearch.Version in project OpenSearch by opensearch-project.

the class BlobStoreRepository method doGetRepositoryData.

private void doGetRepositoryData(ActionListener<RepositoryData> listener) {
    // Retry loading RepositoryData in a loop in case we run into concurrent modifications of the repository.
    // Keep track of the most recent generation we failed to load so we can break out of the loop if we fail to load the same
    // generation repeatedly.
    long lastFailedGeneration = RepositoryData.UNKNOWN_REPO_GEN;
    while (true) {
        final long genToLoad;
        if (bestEffortConsistency) {
            // We're only using #latestKnownRepoGen as a hint in this mode and listing repo contents as a secondary way of trying
            // to find a higher generation
            final long generation;
            try {
                generation = latestIndexBlobId();
            } catch (IOException ioe) {
                listener.onFailure(new RepositoryException(metadata.name(), "Could not determine repository generation from root blobs", ioe));
                return;
            }
            genToLoad = latestKnownRepoGen.updateAndGet(known -> Math.max(known, generation));
            if (genToLoad > generation) {
                logger.info("Determined repository generation [" + generation + "] from repository contents but correct generation must be at least [" + genToLoad + "]");
            }
        } else {
            // We only rely on the generation tracked in #latestKnownRepoGen which is exclusively updated from the cluster state
            genToLoad = latestKnownRepoGen.get();
        }
        try {
            final Tuple<Long, BytesReference> cached = latestKnownRepositoryData.get();
            final RepositoryData loaded;
            // Caching is not used with #bestEffortConsistency see docs on #cacheRepositoryData for details
            if (bestEffortConsistency == false && cached != null && cached.v1() == genToLoad) {
                loaded = repositoryDataFromCachedEntry(cached);
            } else {
                loaded = getRepositoryData(genToLoad);
                // We can cache serialized in the most recent version here without regard to the actual repository metadata version
                // since we're only caching the information that we just wrote and thus won't accidentally cache any information that
                // isn't safe
                cacheRepositoryData(BytesReference.bytes(loaded.snapshotsToXContent(XContentFactory.jsonBuilder(), Version.CURRENT)), genToLoad);
            }
            listener.onResponse(loaded);
            return;
        } catch (RepositoryException e) {
            // If the generation to load changed concurrently and we didn't just try loading the same generation before we retry
            if (genToLoad != latestKnownRepoGen.get() && genToLoad != lastFailedGeneration) {
                lastFailedGeneration = genToLoad;
                logger.warn("Failed to load repository data generation [" + genToLoad + "] because a concurrent operation moved the current generation to [" + latestKnownRepoGen.get() + "]", e);
                continue;
            }
            if (bestEffortConsistency == false && ExceptionsHelper.unwrap(e, NoSuchFileException.class) != null) {
                // We did not find the expected index-N even though the cluster state continues to point at the missing value
                // of N so we mark this repository as corrupted.
                markRepoCorrupted(genToLoad, e, ActionListener.wrap(v -> listener.onFailure(corruptedStateException(e)), listener::onFailure));
            } else {
                listener.onFailure(e);
            }
            return;
        } catch (Exception e) {
            listener.onFailure(new RepositoryException(metadata.name(), "Unexpected exception when loading repository data", e));
            return;
        }
    }
}
Also used : Metadata(org.opensearch.cluster.metadata.Metadata) IndexFormatTooNewException(org.apache.lucene.index.IndexFormatTooNewException) AllocationService(org.opensearch.cluster.routing.allocation.AllocationService) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) Version(org.opensearch.Version) Strings(org.opensearch.common.Strings) AbortedSnapshotException(org.opensearch.snapshots.AbortedSnapshotException) GroupedActionListener(org.opensearch.action.support.GroupedActionListener) RecoveryState(org.opensearch.indices.recovery.RecoveryState) Map(java.util.Map) Lucene(org.opensearch.common.lucene.Lucene) ActionListener(org.opensearch.action.ActionListener) IOContext(org.apache.lucene.store.IOContext) Repository(org.opensearch.repositories.Repository) TimeValue(org.opensearch.common.unit.TimeValue) ExceptionsHelper(org.opensearch.ExceptionsHelper) Set(java.util.Set) Settings(org.opensearch.common.settings.Settings) BlobStoreIndexShardSnapshot(org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot) BlockingQueue(java.util.concurrent.BlockingQueue) AbstractLifecycleComponent(org.opensearch.common.component.AbstractLifecycleComponent) Logger(org.apache.logging.log4j.Logger) RepositoryOperation(org.opensearch.repositories.RepositoryOperation) Stream(java.util.stream.Stream) ClusterStateUpdateTask(org.opensearch.cluster.ClusterStateUpdateTask) BytesArray(org.opensearch.common.bytes.BytesArray) BlobStoreIndexShardSnapshots(org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshots) FsBlobContainer(org.opensearch.common.blobstore.fs.FsBlobContainer) StepListener(org.opensearch.action.StepListener) XContentType(org.opensearch.common.xcontent.XContentType) IndexCommit(org.apache.lucene.index.IndexCommit) ThreadPool(org.opensearch.threadpool.ThreadPool) BlobContainer(org.opensearch.common.blobstore.BlobContainer) Releasable(org.opensearch.common.lease.Releasable) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) ClusterState(org.opensearch.cluster.ClusterState) SnapshotMissingException(org.opensearch.snapshots.SnapshotMissingException) Numbers(org.opensearch.common.Numbers) SlicedInputStream(org.opensearch.index.snapshots.blobstore.SlicedInputStream) SnapshotException(org.opensearch.snapshots.SnapshotException) Streams(org.opensearch.common.io.Streams) CompressorFactory(org.opensearch.common.compress.CompressorFactory) RepositoryVerificationException(org.opensearch.repositories.RepositoryVerificationException) RepositoryCleanupInProgress(org.opensearch.cluster.RepositoryCleanupInProgress) InputStreamIndexInput(org.opensearch.common.lucene.store.InputStreamIndexInput) LongStream(java.util.stream.LongStream) IndexInput(org.apache.lucene.store.IndexInput) SetOnce(org.apache.lucene.util.SetOnce) RepositoriesMetadata(org.opensearch.cluster.metadata.RepositoriesMetadata) Executor(java.util.concurrent.Executor) SnapshotInfo(org.opensearch.snapshots.SnapshotInfo) RepositoryMetadata(org.opensearch.cluster.metadata.RepositoryMetadata) IOException(java.io.IOException) IndexShardSnapshotFailedException(org.opensearch.index.snapshots.IndexShardSnapshotFailedException) NotXContentException(org.opensearch.common.compress.NotXContentException) AtomicLong(java.util.concurrent.atomic.AtomicLong) RepositoryCleanupResult(org.opensearch.repositories.RepositoryCleanupResult) BlobPath(org.opensearch.common.blobstore.BlobPath) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) ClusterService(org.opensearch.cluster.service.ClusterService) CounterMetric(org.opensearch.common.metrics.CounterMetric) ShardGenerations(org.opensearch.repositories.ShardGenerations) NoSuchFileException(java.nio.file.NoSuchFileException) AbstractRunnable(org.opensearch.common.util.concurrent.AbstractRunnable) SnapshotCreationException(org.opensearch.snapshots.SnapshotCreationException) ByteSizeUnit(org.opensearch.common.unit.ByteSizeUnit) SnapshotFiles(org.opensearch.index.snapshots.blobstore.SnapshotFiles) SnapshotsService(org.opensearch.snapshots.SnapshotsService) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) ConcurrentCollections(org.opensearch.common.util.concurrent.ConcurrentCollections) XContentParser(org.opensearch.common.xcontent.XContentParser) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) MapperService(org.opensearch.index.mapper.MapperService) IndexId(org.opensearch.repositories.IndexId) XContentFactory(org.opensearch.common.xcontent.XContentFactory) RepositoryStats(org.opensearch.repositories.RepositoryStats) BlobMetadata(org.opensearch.common.blobstore.BlobMetadata) RecoverySettings(org.opensearch.indices.recovery.RecoverySettings) RepositoryException(org.opensearch.repositories.RepositoryException) FileInfo.canonicalName(org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot.FileInfo.canonicalName) BytesRef(org.apache.lucene.util.BytesRef) SnapshotId(org.opensearch.snapshots.SnapshotId) Collection(java.util.Collection) LoggingDeprecationHandler(org.opensearch.common.xcontent.LoggingDeprecationHandler) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Store(org.opensearch.index.store.Store) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Collectors(java.util.stream.Collectors) Nullable(org.opensearch.common.Nullable) Tuple(org.opensearch.common.collect.Tuple) BlobStore(org.opensearch.common.blobstore.BlobStore) List(java.util.List) Optional(java.util.Optional) BytesReference(org.opensearch.common.bytes.BytesReference) RateLimitingInputStream(org.opensearch.index.snapshots.blobstore.RateLimitingInputStream) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ActionRunnable(org.opensearch.action.ActionRunnable) SnapshotsInProgress(org.opensearch.cluster.SnapshotsInProgress) ByteSizeValue(org.opensearch.common.unit.ByteSizeValue) SnapshotDeletionsInProgress(org.opensearch.cluster.SnapshotDeletionsInProgress) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) FilterInputStream(java.io.FilterInputStream) IndexShardSnapshotStatus(org.opensearch.index.snapshots.IndexShardSnapshotStatus) IndexMetaDataGenerations(org.opensearch.repositories.IndexMetaDataGenerations) UUIDs(org.opensearch.common.UUIDs) StoreFileMetadata(org.opensearch.index.store.StoreFileMetadata) IndexOutput(org.apache.lucene.store.IndexOutput) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) RepositoryData(org.opensearch.repositories.RepositoryData) Setting(org.opensearch.common.settings.Setting) RepositoryShardId(org.opensearch.repositories.RepositoryShardId) IndexFormatTooOldException(org.apache.lucene.index.IndexFormatTooOldException) ShardId(org.opensearch.index.shard.ShardId) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) DeleteResult(org.opensearch.common.blobstore.DeleteResult) LogManager(org.apache.logging.log4j.LogManager) Collections(java.util.Collections) RateLimiter(org.apache.lucene.store.RateLimiter) InputStream(java.io.InputStream) BytesReference(org.opensearch.common.bytes.BytesReference) AtomicLong(java.util.concurrent.atomic.AtomicLong) NoSuchFileException(java.nio.file.NoSuchFileException) RepositoryException(org.opensearch.repositories.RepositoryException) IOException(java.io.IOException) IndexFormatTooNewException(org.apache.lucene.index.IndexFormatTooNewException) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) AbortedSnapshotException(org.opensearch.snapshots.AbortedSnapshotException) SnapshotMissingException(org.opensearch.snapshots.SnapshotMissingException) SnapshotException(org.opensearch.snapshots.SnapshotException) RepositoryVerificationException(org.opensearch.repositories.RepositoryVerificationException) IOException(java.io.IOException) IndexShardSnapshotFailedException(org.opensearch.index.snapshots.IndexShardSnapshotFailedException) NotXContentException(org.opensearch.common.compress.NotXContentException) NoSuchFileException(java.nio.file.NoSuchFileException) SnapshotCreationException(org.opensearch.snapshots.SnapshotCreationException) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) RepositoryException(org.opensearch.repositories.RepositoryException) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) IndexFormatTooOldException(org.apache.lucene.index.IndexFormatTooOldException) RepositoryData(org.opensearch.repositories.RepositoryData)

Example 73 with Version

use of org.opensearch.Version in project OpenSearch by opensearch-project.

the class RepositoryData method parseSnapshots.

/**
 * Parses the "snapshots" field and fills maps for the various per snapshot properties. This method must run before
 * {@link #parseIndices} which will rely on the maps of snapshot properties to have been populated already.
 *
 * @param parser           x-content parse
 * @param snapshots        map of snapshot uuid to {@link SnapshotId}
 * @param snapshotStates   map of snapshot uuid to {@link SnapshotState}
 * @param snapshotVersions map of snapshot uuid to {@link Version} that the snapshot was taken in
 * @param indexMetaLookup  map of {@link SnapshotId} to map of index id (as returned by {@link IndexId#getId}) that defines the index
 *                         metadata generations for the snapshot
 */
private static void parseSnapshots(XContentParser parser, Map<String, SnapshotId> snapshots, Map<String, SnapshotState> snapshotStates, Map<String, Version> snapshotVersions, Map<SnapshotId, Map<String, String>> indexMetaLookup) throws IOException {
    XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_ARRAY, parser.nextToken(), parser);
    final Map<String, String> stringDeduplicator = new HashMap<>();
    while (parser.nextToken() != XContentParser.Token.END_ARRAY) {
        String name = null;
        String uuid = null;
        SnapshotState state = null;
        Map<String, String> metaGenerations = null;
        Version version = null;
        while (parser.nextToken() != XContentParser.Token.END_OBJECT) {
            String currentFieldName = parser.currentName();
            parser.nextToken();
            switch(currentFieldName) {
                case NAME:
                    name = parser.text();
                    break;
                case UUID:
                    uuid = parser.text();
                    break;
                case STATE:
                    state = SnapshotState.fromValue((byte) parser.intValue());
                    break;
                case INDEX_METADATA_LOOKUP:
                    metaGenerations = parser.map(HashMap::new, p -> stringDeduplicator.computeIfAbsent(p.text(), Function.identity()));
                    break;
                case VERSION:
                    version = Version.fromString(parser.text());
                    break;
            }
        }
        final SnapshotId snapshotId = new SnapshotId(name, uuid);
        if (state != null) {
            snapshotStates.put(uuid, state);
        }
        if (version != null) {
            snapshotVersions.put(uuid, version);
        }
        snapshots.put(uuid, snapshotId);
        if (metaGenerations != null && metaGenerations.isEmpty() == false) {
            indexMetaLookup.put(snapshotId, metaGenerations);
        }
    }
}
Also used : SnapshotId(org.opensearch.snapshots.SnapshotId) Collection(java.util.Collection) OpenSearchParseException(org.opensearch.OpenSearchParseException) SnapshotState(org.opensearch.snapshots.SnapshotState) Set(java.util.Set) Version(org.opensearch.Version) IOException(java.io.IOException) HashMap(java.util.HashMap) ResourceNotFoundException(org.opensearch.ResourceNotFoundException) SnapshotsService(org.opensearch.snapshots.SnapshotsService) Function(java.util.function.Function) Collectors(java.util.stream.Collectors) Nullable(org.opensearch.common.Nullable) ArrayList(java.util.ArrayList) XContentBuilder(org.opensearch.common.xcontent.XContentBuilder) XContentParser(org.opensearch.common.xcontent.XContentParser) HashSet(java.util.HashSet) Objects(java.util.Objects) List(java.util.List) Map(java.util.Map) XContentParserUtils(org.opensearch.common.xcontent.XContentParserUtils) UUIDs(org.opensearch.common.UUIDs) Collections(java.util.Collections) SnapshotId(org.opensearch.snapshots.SnapshotId) SnapshotState(org.opensearch.snapshots.SnapshotState) HashMap(java.util.HashMap) Version(org.opensearch.Version)

Example 74 with Version

use of org.opensearch.Version in project OpenSearch by opensearch-project.

the class RepositoryData method snapshotsFromXContent.

/**
 * Reads an instance of {@link RepositoryData} from x-content, loading the snapshots and indices metadata.
 *
 * @param fixBrokenShardGens set to {@code true} to filter out broken shard generations read from the {@code parser} via
 *                           {@link ShardGenerations#fixShardGeneration}. Used to disable fixing broken generations when reading
 *                           from cached bytes that we trust to not contain broken generations.
 */
public static RepositoryData snapshotsFromXContent(XContentParser parser, long genId, boolean fixBrokenShardGens) throws IOException {
    XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser);
    final Map<String, SnapshotId> snapshots = new HashMap<>();
    final Map<String, SnapshotState> snapshotStates = new HashMap<>();
    final Map<String, Version> snapshotVersions = new HashMap<>();
    final Map<IndexId, List<SnapshotId>> indexSnapshots = new HashMap<>();
    final Map<String, IndexId> indexLookup = new HashMap<>();
    final ShardGenerations.Builder shardGenerations = ShardGenerations.builder();
    final Map<SnapshotId, Map<String, String>> indexMetaLookup = new HashMap<>();
    Map<String, String> indexMetaIdentifiers = null;
    while (parser.nextToken() == XContentParser.Token.FIELD_NAME) {
        final String field = parser.currentName();
        switch(field) {
            case SNAPSHOTS:
                parseSnapshots(parser, snapshots, snapshotStates, snapshotVersions, indexMetaLookup);
                break;
            case INDICES:
                parseIndices(parser, fixBrokenShardGens, snapshots, indexSnapshots, indexLookup, shardGenerations);
                break;
            case INDEX_METADATA_IDENTIFIERS:
                XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser);
                indexMetaIdentifiers = parser.mapStrings();
                break;
            case MIN_VERSION:
                XContentParserUtils.ensureExpectedToken(XContentParser.Token.VALUE_STRING, parser.nextToken(), parser);
                final Version version = Version.fromString(parser.text());
                assert SnapshotsService.useShardGenerations(version);
                break;
            default:
                XContentParserUtils.throwUnknownField(field, parser.getTokenLocation());
        }
    }
    return new RepositoryData(genId, snapshots, snapshotStates, snapshotVersions, indexSnapshots, shardGenerations.build(), buildIndexMetaGenerations(indexMetaLookup, indexLookup, indexMetaIdentifiers));
}
Also used : HashMap(java.util.HashMap) SnapshotId(org.opensearch.snapshots.SnapshotId) SnapshotState(org.opensearch.snapshots.SnapshotState) Version(org.opensearch.Version) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map)

Example 75 with Version

use of org.opensearch.Version in project OpenSearch by opensearch-project.

the class RepositoryData method snapshotsToXContent.

/**
 * Writes the snapshots metadata and the related indices metadata to x-content.
 */
public XContentBuilder snapshotsToXContent(final XContentBuilder builder, final Version repoMetaVersion) throws IOException {
    builder.startObject();
    // write the snapshots list
    builder.startArray(SNAPSHOTS);
    final boolean shouldWriteIndexGens = SnapshotsService.useIndexGenerations(repoMetaVersion);
    final boolean shouldWriteShardGens = SnapshotsService.useShardGenerations(repoMetaVersion);
    for (final SnapshotId snapshot : getSnapshotIds()) {
        builder.startObject();
        builder.field(NAME, snapshot.getName());
        final String snapshotUUID = snapshot.getUUID();
        builder.field(UUID, snapshotUUID);
        final SnapshotState state = snapshotStates.get(snapshotUUID);
        if (state != null) {
            builder.field(STATE, state.value());
        }
        if (shouldWriteIndexGens) {
            builder.startObject(INDEX_METADATA_LOOKUP);
            for (Map.Entry<IndexId, String> entry : indexMetaDataGenerations.lookup.getOrDefault(snapshot, Collections.emptyMap()).entrySet()) {
                builder.field(entry.getKey().getId(), entry.getValue());
            }
            builder.endObject();
        }
        final Version version = snapshotVersions.get(snapshotUUID);
        if (version != null) {
            builder.field(VERSION, version.toString());
        }
        builder.endObject();
    }
    builder.endArray();
    // write the indices map
    builder.startObject(INDICES);
    for (final IndexId indexId : getIndices().values()) {
        builder.startObject(indexId.getName());
        builder.field(INDEX_ID, indexId.getId());
        builder.startArray(SNAPSHOTS);
        List<SnapshotId> snapshotIds = indexSnapshots.get(indexId);
        assert snapshotIds != null;
        for (final SnapshotId snapshotId : snapshotIds) {
            builder.value(snapshotId.getUUID());
        }
        builder.endArray();
        if (shouldWriteShardGens) {
            builder.startArray(SHARD_GENERATIONS);
            for (String gen : shardGenerations.getGens(indexId)) {
                builder.value(gen);
            }
            builder.endArray();
        }
        builder.endObject();
    }
    builder.endObject();
    if (shouldWriteIndexGens) {
        builder.field(MIN_VERSION, SnapshotsService.INDEX_GEN_IN_REPO_DATA_VERSION.toString());
        builder.field(INDEX_METADATA_IDENTIFIERS, indexMetaDataGenerations.identifiers);
    } else if (shouldWriteShardGens) {
        // Add min version field to make it impossible for older OpenSearch versions to deserialize this object
        builder.field(MIN_VERSION, SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION.toString());
    }
    builder.endObject();
    return builder;
}
Also used : SnapshotId(org.opensearch.snapshots.SnapshotId) SnapshotState(org.opensearch.snapshots.SnapshotState) Version(org.opensearch.Version) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

Version (org.opensearch.Version)242 Settings (org.opensearch.common.settings.Settings)86 LegacyESVersion (org.opensearch.LegacyESVersion)84 ArrayList (java.util.ArrayList)59 IOException (java.io.IOException)54 List (java.util.List)54 Map (java.util.Map)50 DiscoveryNode (org.opensearch.cluster.node.DiscoveryNode)42 Collections (java.util.Collections)39 HashMap (java.util.HashMap)38 ClusterState (org.opensearch.cluster.ClusterState)38 IndexMetadata (org.opensearch.cluster.metadata.IndexMetadata)37 HashSet (java.util.HashSet)36 BytesReference (org.opensearch.common.bytes.BytesReference)36 TimeValue (org.opensearch.common.unit.TimeValue)36 Set (java.util.Set)35 Collectors (java.util.stream.Collectors)34 XContentBuilder (org.opensearch.common.xcontent.XContentBuilder)33 StreamInput (org.opensearch.common.io.stream.StreamInput)32 BytesArray (org.opensearch.common.bytes.BytesArray)30