[Javadocs] add remaining internal classes and reenable missingJavadoc on server (#3296)
Adds the remaining javadocs to internal classes and reenables the missingJavadoc gradle task on the server module. From here forward if class level javadocs are missing in the server module, gradle check will fail! Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
This commit is contained in:
parent
10bff0c9f5
commit
3aef125d0d
|
@ -178,8 +178,7 @@ configure([
|
|||
|
||||
configure(project(":server")) {
|
||||
project.tasks.withType(MissingJavadocTask) {
|
||||
isExcluded = true
|
||||
// TODO: reenable after fixing missing javadocs
|
||||
// TODO: bump to variable missing level after increasing javadoc coverage
|
||||
javadocMissingLevel = "class"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,11 @@ public interface IndicesRequest {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaceable interface.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
interface Replaceable extends IndicesRequest {
|
||||
/**
|
||||
* Sets the indices that the action relates to.
|
||||
|
|
|
@ -289,6 +289,11 @@ public class ClusterHealthRequest extends MasterNodeReadRequest<ClusterHealthReq
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The level of the health request.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Level {
|
||||
CLUSTER,
|
||||
INDICES,
|
||||
|
|
|
@ -120,6 +120,11 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
|
|||
private static final ParseField REMOVE = new ParseField("remove");
|
||||
private static final ParseField REMOVE_INDEX = new ParseField("remove_index");
|
||||
|
||||
/**
|
||||
* The type of request.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Type {
|
||||
ADD((byte) 0, AliasActions.ADD),
|
||||
REMOVE((byte) 1, AliasActions.REMOVE),
|
||||
|
|
|
@ -46,6 +46,11 @@ import java.io.IOException;
|
|||
* @opensearch.internal
|
||||
*/
|
||||
public class GetIndexRequest extends ClusterInfoRequest<GetIndexRequest> {
|
||||
/**
|
||||
* The features to get.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Feature {
|
||||
ALIASES((byte) 0),
|
||||
MAPPINGS((byte) 1),
|
||||
|
|
|
@ -261,6 +261,11 @@ public class CommonStatsFlags implements Writeable, Cloneable {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The flags.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Flag {
|
||||
Store("store", 0),
|
||||
Indexing("indexing", 1),
|
||||
|
|
|
@ -284,6 +284,11 @@ public class TransportSearchAction extends HandledTransportAction<SearchRequest,
|
|||
executeRequest(task, searchRequest, this::searchAsyncAction, listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* The single phase search action.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface SinglePhaseSearchAction {
|
||||
void executeOnShardTarget(
|
||||
SearchTask searchTask,
|
||||
|
|
|
@ -60,6 +60,11 @@ import static org.opensearch.common.xcontent.support.XContentMapValues.nodeStrin
|
|||
*/
|
||||
public class IndicesOptions implements ToXContentFragment {
|
||||
|
||||
/**
|
||||
* The wildcard states.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum WildcardStates {
|
||||
OPEN,
|
||||
CLOSED,
|
||||
|
@ -120,6 +125,11 @@ public class IndicesOptions implements ToXContentFragment {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The options.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Option {
|
||||
IGNORE_UNAVAILABLE,
|
||||
IGNORE_ALIASES,
|
||||
|
|
|
@ -75,6 +75,11 @@ public interface WriteRequest<R extends WriteRequest<R>> extends Writeable {
|
|||
|
||||
ActionRequestValidationException validate();
|
||||
|
||||
/**
|
||||
* The refresh policy of the request.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
enum RefreshPolicy implements Writeable {
|
||||
/**
|
||||
* Don't refresh after this request. The default.
|
||||
|
|
|
@ -616,6 +616,11 @@ public class ReplicationOperation<
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of the primary.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface PrimaryResult<RequestT extends ReplicationRequest<RequestT>> {
|
||||
|
||||
/**
|
||||
|
|
|
@ -568,6 +568,11 @@ public class TermVectorsRequest extends SingleShardRequest<TermVectorsRequest> i
|
|||
out.writeLong(version);
|
||||
}
|
||||
|
||||
/**
|
||||
* The flags.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Flag {
|
||||
// Do not change the order of these flags we use
|
||||
// the ordinal for encoding! Only append to the end!
|
||||
|
|
|
@ -24,8 +24,15 @@ import java.util.stream.Collectors;
|
|||
/**
|
||||
* Parses the list of JVM versions which should be denied to run Opensearch engine with due to discovered
|
||||
* issues or flaws.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class DenyJvmVersionsParser {
|
||||
/**
|
||||
* Provides the reason for the denial
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface VersionPredicate extends Predicate<Version> {
|
||||
String getReason();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* The OpenSearch Contributors require contributions made to
|
||||
* this file be licensed under the Apache-2.0 license or a
|
||||
* compatible open source license.
|
||||
*/
|
||||
|
||||
/** jvm specific bootstrapping */
|
||||
package org.opensearch.bootstrap.jvm;
|
|
@ -66,6 +66,11 @@ public abstract class AbstractDiffable<T extends Diffable<T>> implements Diffabl
|
|||
return (Diff<T>) EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* A complete diff.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class CompleteDiff<T extends Diffable<T>> implements Diff<T> {
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -62,6 +62,11 @@ public abstract class AbstractNamedDiffable<T extends NamedDiffable<T>> implemen
|
|||
return new CompleteNamedDiff<>(tClass, name, in);
|
||||
}
|
||||
|
||||
/**
|
||||
* A complete named diff.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class CompleteNamedDiff<T extends NamedDiffable<T>> implements NamedDiff<T> {
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -244,6 +244,8 @@ public class ClusterInfo implements ToXContentFragment, Writeable {
|
|||
|
||||
/**
|
||||
* Represents a data path on a node
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class NodeAndPath implements Writeable {
|
||||
public final String nodeId;
|
||||
|
@ -281,6 +283,8 @@ public class ClusterInfo implements ToXContentFragment, Writeable {
|
|||
|
||||
/**
|
||||
* Represents the total amount of "reserved" space on a particular data path, together with the set of shards considered.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class ReservedSpace implements Writeable {
|
||||
|
||||
|
@ -344,6 +348,11 @@ public class ClusterInfo implements ToXContentFragment, Writeable {
|
|||
builder.endArray(); // end "shards"
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for Reserved Space.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
private long total;
|
||||
private ObjectHashSet<ShardId> shardIds = new ObjectHashSet<>();
|
||||
|
|
|
@ -106,6 +106,8 @@ public class ClusterState implements ToXContentFragment, Diffable<ClusterState>
|
|||
|
||||
/**
|
||||
* An interface that implementors use when a class requires a client to maybe have a feature.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface FeatureAware {
|
||||
|
||||
|
@ -135,6 +137,11 @@ public class ClusterState implements ToXContentFragment, Diffable<ClusterState>
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom cluster state.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface Custom extends NamedDiffable<Custom>, ToXContentFragment, FeatureAware {
|
||||
|
||||
/**
|
||||
|
@ -403,6 +410,11 @@ public class ClusterState implements ToXContentFragment, Diffable<ClusterState>
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Metrics for cluster state.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Metric {
|
||||
VERSION("version"),
|
||||
|
||||
|
@ -582,6 +594,11 @@ public class ClusterState implements ToXContentFragment, Diffable<ClusterState>
|
|||
return new Builder(state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for cluster state.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private final ClusterName clusterName;
|
||||
|
@ -778,6 +795,11 @@ public class ClusterState implements ToXContentFragment, Diffable<ClusterState>
|
|||
out.writeVInt(minimumClusterManagerNodesOnPublishingClusterManager);
|
||||
}
|
||||
|
||||
/**
|
||||
* The cluster state diff.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class ClusterStateDiff implements Diff<ClusterState> {
|
||||
|
||||
private final long toVersion;
|
||||
|
|
|
@ -207,6 +207,11 @@ public class ClusterStateObserver {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An observer of the cluster state for changes.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class ObserverClusterStateListener implements TimeoutClusterStateListener {
|
||||
|
||||
@Override
|
||||
|
@ -298,6 +303,8 @@ public class ClusterStateObserver {
|
|||
|
||||
/**
|
||||
* The observer considers two cluster states to be the same if they have the same version and cluster-manager node id (i.e. null or set)
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class StoredState {
|
||||
private final String clusterManagerNodeId;
|
||||
|
@ -317,6 +324,11 @@ public class ClusterStateObserver {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Listener for the observer.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface Listener {
|
||||
|
||||
/** called when a new state is observed */
|
||||
|
@ -328,6 +340,11 @@ public class ClusterStateObserver {
|
|||
void onTimeout(TimeValue timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Context for the observer.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class ObservingContext {
|
||||
public final Listener listener;
|
||||
public final Predicate<ClusterState> statePredicate;
|
||||
|
@ -343,6 +360,11 @@ public class ClusterStateObserver {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A context preserving listener.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static final class ContextPreservingListener implements Listener {
|
||||
private final Listener delegate;
|
||||
private final Supplier<ThreadContext.StoredContext> contextSupplier;
|
||||
|
|
|
@ -85,6 +85,11 @@ public interface ClusterStateTaskConfig {
|
|||
return new Basic(priority, timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic task config.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class Basic implements ClusterStateTaskConfig {
|
||||
final TimeValue timeout;
|
||||
final Priority priority;
|
||||
|
|
|
@ -81,6 +81,8 @@ public interface ClusterStateTaskExecutor<T> {
|
|||
/**
|
||||
* Represents the result of a batched execution of cluster state update tasks
|
||||
* @param <T> the type of the cluster state update task
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class ClusterTasksResult<T> {
|
||||
@Nullable
|
||||
|
@ -101,6 +103,11 @@ public interface ClusterStateTaskExecutor<T> {
|
|||
return new Builder<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for cluster state task.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder<T> {
|
||||
private final Map<T, TaskResult> executionResults = new IdentityHashMap<>();
|
||||
|
||||
|
@ -142,6 +149,11 @@ public interface ClusterStateTaskExecutor<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The task result.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
final class TaskResult {
|
||||
private final Exception failure;
|
||||
|
||||
|
|
|
@ -229,6 +229,8 @@ public final class DiffableUtils {
|
|||
* Represents differences between two Maps of (possibly diffable) objects.
|
||||
*
|
||||
* @param <T> the diffable object
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class JdkMapDiff<K, T> extends MapDiff<K, T, Map<K, T>> {
|
||||
|
||||
|
@ -283,6 +285,8 @@ public final class DiffableUtils {
|
|||
* Represents differences between two ImmutableOpenMap of (possibly diffable) objects
|
||||
*
|
||||
* @param <T> the object type
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class ImmutableOpenMapDiff<K, T> extends MapDiff<K, T, ImmutableOpenMap<K, T>> {
|
||||
|
||||
|
@ -369,6 +373,8 @@ public final class DiffableUtils {
|
|||
* Represents differences between two ImmutableOpenIntMap of (possibly diffable) objects
|
||||
*
|
||||
* @param <T> the object type
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class ImmutableOpenIntMapDiff<T> extends MapDiff<Integer, T, ImmutableOpenIntMap<T>> {
|
||||
|
||||
|
@ -434,6 +440,8 @@ public final class DiffableUtils {
|
|||
* @param <K> the type of map keys
|
||||
* @param <T> the type of map values
|
||||
* @param <M> the map implementation type
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public abstract static class MapDiff<K, T, M> implements Diff<M> {
|
||||
|
||||
|
@ -553,6 +561,8 @@ public final class DiffableUtils {
|
|||
/**
|
||||
* Provides read and write operations to serialize keys of map
|
||||
* @param <K> type of key
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface KeySerializer<K> {
|
||||
void writeKey(K key, StreamOutput out) throws IOException;
|
||||
|
@ -562,6 +572,8 @@ public final class DiffableUtils {
|
|||
|
||||
/**
|
||||
* Serializes String keys of a map
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static final class StringKeySerializer implements KeySerializer<String> {
|
||||
private static final StringKeySerializer INSTANCE = new StringKeySerializer();
|
||||
|
@ -579,6 +591,8 @@ public final class DiffableUtils {
|
|||
|
||||
/**
|
||||
* Serializes Integer keys of a map as an Int
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static final class IntKeySerializer implements KeySerializer<Integer> {
|
||||
public static final IntKeySerializer INSTANCE = new IntKeySerializer();
|
||||
|
@ -596,6 +610,8 @@ public final class DiffableUtils {
|
|||
|
||||
/**
|
||||
* Serializes Integer keys of a map as a VInt. Requires keys to be positive.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static final class VIntKeySerializer implements KeySerializer<Integer> {
|
||||
public static final IntKeySerializer INSTANCE = new IntKeySerializer();
|
||||
|
@ -625,6 +641,8 @@ public final class DiffableUtils {
|
|||
*
|
||||
* @param <K> key type of map
|
||||
* @param <V> value type of map
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface ValueSerializer<K, V> {
|
||||
|
||||
|
@ -679,6 +697,8 @@ public final class DiffableUtils {
|
|||
*
|
||||
* @param <K> type of map keys
|
||||
* @param <V> type of map values
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public abstract static class DiffableValueSerializer<K, V extends Diffable<V>> implements ValueSerializer<K, V> {
|
||||
private static final DiffableValueSerializer WRITE_ONLY_INSTANCE = new DiffableValueSerializer() {
|
||||
|
@ -722,6 +742,8 @@ public final class DiffableUtils {
|
|||
*
|
||||
* @param <K> type of map keys
|
||||
* @param <V> type of map values
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public abstract static class NonDiffableValueSerializer<K, V> implements ValueSerializer<K, V> {
|
||||
@Override
|
||||
|
@ -749,6 +771,8 @@ public final class DiffableUtils {
|
|||
* Implementation of the ValueSerializer that wraps value and diff readers.
|
||||
*
|
||||
* Note: this implementation is ignoring the key.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class DiffableValueReader<K, V extends Diffable<V>> extends DiffableValueSerializer<K, V> {
|
||||
private final Reader<V> reader;
|
||||
|
@ -774,6 +798,8 @@ public final class DiffableUtils {
|
|||
* Implementation of ValueSerializer that serializes immutable sets
|
||||
*
|
||||
* @param <K> type of map key
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class StringSetValueSerializer<K> extends NonDiffableValueSerializer<K, Set<String>> {
|
||||
private static final StringSetValueSerializer INSTANCE = new StringSetValueSerializer();
|
||||
|
|
|
@ -469,6 +469,11 @@ public class InternalClusterInfoService implements ClusterInfoService, ClusterSt
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indices statistics summary.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class IndicesStatsSummary {
|
||||
static final IndicesStatsSummary EMPTY = new IndicesStatsSummary(
|
||||
ImmutableOpenMap.of(),
|
||||
|
@ -493,6 +498,8 @@ public class InternalClusterInfoService implements ClusterInfoService, ClusterSt
|
|||
|
||||
/**
|
||||
* Runs {@link InternalClusterInfoService#refresh()}, logging failures/rejections appropriately.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class RefreshRunnable extends AbstractRunnable {
|
||||
private final String reason;
|
||||
|
@ -526,6 +533,8 @@ public class InternalClusterInfoService implements ClusterInfoService, ClusterSt
|
|||
|
||||
/**
|
||||
* Runs {@link InternalClusterInfoService#refresh()}, logging failures/rejections appropriately, and reschedules itself on completion.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class RefreshAndRescheduleRunnable extends RefreshRunnable {
|
||||
RefreshAndRescheduleRunnable() {
|
||||
|
|
|
@ -229,6 +229,11 @@ public class NodeConnectionsService extends AbstractLifecycleComponent {
|
|||
runnables.forEach(Runnable::run);
|
||||
}
|
||||
|
||||
/**
|
||||
* A connection checker.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class ConnectionChecker extends AbstractRunnable {
|
||||
protected void doRun() {
|
||||
if (connectionChecker == this) {
|
||||
|
@ -311,6 +316,8 @@ public class NodeConnectionsService extends AbstractLifecycleComponent {
|
|||
* Similarly if we are currently disconnecting and then {@link ConnectionTarget#connect(ActionListener)} is called then all
|
||||
* disconnection listeners are immediately removed for failure notification and a connection is started once the disconnection is
|
||||
* complete.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class ConnectionTarget {
|
||||
private final DiscoveryNode discoveryNode;
|
||||
|
|
|
@ -117,6 +117,11 @@ public final class RepositoryCleanupInProgress extends AbstractNamedDiffable<Clu
|
|||
return LegacyESVersion.V_7_4_0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry in the collection.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class Entry implements Writeable, RepositoryOperation {
|
||||
|
||||
private final String repository;
|
||||
|
|
|
@ -112,6 +112,11 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
|
|||
return entries.valuesIt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder of the restore.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class Builder {
|
||||
|
||||
private final ImmutableOpenMap.Builder<String, Entry> entries = ImmutableOpenMap.builder();
|
||||
|
@ -134,6 +139,8 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
|
|||
|
||||
/**
|
||||
* Restore metadata
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Entry {
|
||||
private final String uuid;
|
||||
|
@ -237,6 +244,8 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
|
|||
|
||||
/**
|
||||
* Represents status of a restored shard
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class ShardRestoreStatus implements Writeable {
|
||||
private State state;
|
||||
|
@ -360,6 +369,8 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
|
|||
|
||||
/**
|
||||
* Shard restore process state
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum State {
|
||||
/**
|
||||
|
|
|
@ -219,6 +219,8 @@ public class SnapshotDeletionsInProgress extends AbstractNamedDiffable<Custom> i
|
|||
|
||||
/**
|
||||
* A class representing a snapshot deletion request entry in the cluster state.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class Entry implements Writeable, RepositoryOperation {
|
||||
private final List<SnapshotId> snapshots;
|
||||
|
@ -375,6 +377,11 @@ public class SnapshotDeletionsInProgress extends AbstractNamedDiffable<Custom> i
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the deletions.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum State implements Writeable {
|
||||
|
||||
/**
|
||||
|
|
|
@ -177,6 +177,11 @@ public class SnapshotsInProgress extends AbstractNamedDiffable<Custom> implement
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry in the collection.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Entry implements Writeable, ToXContent, RepositoryOperation {
|
||||
private final State state;
|
||||
private final Snapshot snapshot;
|
||||
|
@ -778,6 +783,11 @@ public class SnapshotsInProgress extends AbstractNamedDiffable<Custom> implement
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of shard snapshots.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class ShardSnapshotStatus implements Writeable {
|
||||
|
||||
/**
|
||||
|
@ -913,6 +923,11 @@ public class SnapshotsInProgress extends AbstractNamedDiffable<Custom> implement
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the snapshots.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum State {
|
||||
INIT((byte) 0, false),
|
||||
STARTED((byte) 1, false),
|
||||
|
@ -1050,6 +1065,11 @@ public class SnapshotsInProgress extends AbstractNamedDiffable<Custom> implement
|
|||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* The shard state.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum ShardState {
|
||||
INIT((byte) 0, false, false),
|
||||
SUCCESS((byte) 2, true, false),
|
||||
|
|
|
@ -171,6 +171,11 @@ public class MappingUpdatedAction {
|
|||
return new UncategorizedExecutionException("Failed execution", root);
|
||||
}
|
||||
|
||||
/**
|
||||
* An adjustable semaphore
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class AdjustableSemaphore extends Semaphore {
|
||||
|
||||
private final Object maxPermitsMutex = new Object();
|
||||
|
|
|
@ -87,6 +87,11 @@ public class NodeMappingRefreshAction {
|
|||
transportService.sendRequest(clusterManagerNode, ACTION_NAME, request, EmptyTransportResponseHandler.INSTANCE_SAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* A handler for a node mapping refresh transport request.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class NodeMappingRefreshTransportHandler implements TransportRequestHandler<NodeMappingRefreshRequest> {
|
||||
|
||||
@Override
|
||||
|
@ -96,6 +101,11 @@ public class NodeMappingRefreshAction {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Request to refresh node mapping.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class NodeMappingRefreshRequest extends TransportRequest implements IndicesRequest {
|
||||
|
||||
private String index;
|
||||
|
|
|
@ -333,6 +333,11 @@ public class ShardStateAction {
|
|||
this.followUpRerouteTaskPriority = followUpRerouteTaskPriority;
|
||||
}
|
||||
|
||||
/**
|
||||
* A transport handler for a shard failed action.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class ShardFailedTransportHandler implements TransportRequestHandler<FailedShardEntry> {
|
||||
private final ClusterService clusterService;
|
||||
private final ShardFailedClusterStateTaskExecutor shardFailedClusterStateTaskExecutor;
|
||||
|
@ -416,6 +421,11 @@ public class ShardStateAction {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executor if shard fails cluster state task.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class ShardFailedClusterStateTaskExecutor implements ClusterStateTaskExecutor<FailedShardEntry> {
|
||||
private final AllocationService allocationService;
|
||||
private final RerouteService rerouteService;
|
||||
|
@ -552,6 +562,11 @@ public class ShardStateAction {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry for a failed shard.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class FailedShardEntry extends TransportRequest {
|
||||
final ShardId shardId;
|
||||
final String allocationId;
|
||||
|
@ -658,6 +673,11 @@ public class ShardStateAction {
|
|||
sendShardAction(SHARD_STARTED_ACTION_NAME, currentState, entry, listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for a shard started action.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class ShardStartedTransportHandler implements TransportRequestHandler<StartedShardEntry> {
|
||||
private final ClusterService clusterService;
|
||||
private final ShardStartedClusterStateTaskExecutor shardStartedClusterStateTaskExecutor;
|
||||
|
@ -687,6 +707,11 @@ public class ShardStateAction {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executor for when shard starts cluster state.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class ShardStartedClusterStateTaskExecutor
|
||||
implements
|
||||
ClusterStateTaskExecutor<StartedShardEntry>,
|
||||
|
@ -812,6 +837,11 @@ public class ShardStateAction {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* try for started shard.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class StartedShardEntry extends TransportRequest {
|
||||
final ShardId shardId;
|
||||
final String allocationId;
|
||||
|
@ -855,6 +885,11 @@ public class ShardStateAction {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Error thrown when a shard is no longer primary.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class NoLongerPrimaryShardException extends OpenSearchException {
|
||||
|
||||
public NoLongerPrimaryShardException(ShardId shardId, String msg) {
|
||||
|
|
|
@ -321,6 +321,11 @@ public class ClusterBlocks extends AbstractDiffable<ClusterBlocks> {
|
|||
return AbstractDiffable.readDiffFrom(ClusterBlocks::readFrom, in);
|
||||
}
|
||||
|
||||
/**
|
||||
* An immutable level holder.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class ImmutableLevelHolder {
|
||||
|
||||
private final Set<ClusterBlock> global;
|
||||
|
@ -344,6 +349,11 @@ public class ClusterBlocks extends AbstractDiffable<ClusterBlocks> {
|
|||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for cluster blocks.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private final Set<ClusterBlock> global = new HashSet<>();
|
||||
|
|
|
@ -107,6 +107,11 @@ public class ClusterFormationFailureHelper {
|
|||
warningScheduler = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* A warning scheduler.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class WarningScheduler {
|
||||
|
||||
private boolean isActive() {
|
||||
|
@ -143,6 +148,11 @@ public class ClusterFormationFailureHelper {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the cluster formation.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class ClusterFormationState {
|
||||
private final Settings settings;
|
||||
private final ClusterState clusterState;
|
||||
|
|
|
@ -56,6 +56,11 @@ public interface ClusterStatePublisher {
|
|||
*/
|
||||
void publish(ClusterChangedEvent clusterChangedEvent, ActionListener<Void> publishListener, AckListener ackListener);
|
||||
|
||||
/**
|
||||
* An acknowledgement listener.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
interface AckListener {
|
||||
/**
|
||||
* Should be called when the cluster coordination layer has committed the cluster state (i.e. even if this publication fails,
|
||||
|
|
|
@ -211,6 +211,11 @@ public class CoordinationMetadata implements Writeable, ToXContentFragment {
|
|||
+ '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for coordination metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
private long term = 0;
|
||||
private VotingConfiguration lastCommittedConfiguration = VotingConfiguration.EMPTY_CONFIG;
|
||||
|
@ -258,6 +263,11 @@ public class CoordinationMetadata implements Writeable, ToXContentFragment {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Excluded nodes from voting config.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class VotingConfigExclusion implements Writeable, ToXContentFragment {
|
||||
public static final String MISSING_VALUE_MARKER = "_absent_";
|
||||
private final String nodeId;
|
||||
|
@ -351,6 +361,8 @@ public class CoordinationMetadata implements Writeable, ToXContentFragment {
|
|||
|
||||
/**
|
||||
* A collection of persistent node ids, denoting the voting configuration for cluster state changes.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class VotingConfiguration implements Writeable, ToXContentFragment {
|
||||
|
||||
|
|
|
@ -569,6 +569,8 @@ public class CoordinationState {
|
|||
|
||||
/**
|
||||
* Pluggable persistence layer for {@link CoordinationState}.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface PersistedState extends Closeable {
|
||||
|
||||
|
@ -641,6 +643,8 @@ public class CoordinationState {
|
|||
|
||||
/**
|
||||
* A collection of votes, used to calculate quorums. Optionally records the Joins as well.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class VoteCollection {
|
||||
|
||||
|
|
|
@ -1351,12 +1351,22 @@ public class Coordinator extends AbstractLifecycleComponent implements Discovery
|
|||
return onJoinValidators;
|
||||
}
|
||||
|
||||
/**
|
||||
* The mode of the coordinator.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Mode {
|
||||
CANDIDATE,
|
||||
LEADER,
|
||||
FOLLOWER
|
||||
}
|
||||
|
||||
/**
|
||||
* The coordinator peer finder.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class CoordinatorPeerFinder extends PeerFinder {
|
||||
|
||||
CoordinatorPeerFinder(
|
||||
|
@ -1480,6 +1490,11 @@ public class Coordinator extends AbstractLifecycleComponent implements Discovery
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The coordinator publication.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class CoordinatorPublication extends Publication {
|
||||
|
||||
private final PublishRequest publishRequest;
|
||||
|
|
|
@ -183,6 +183,11 @@ public class ElectionSchedulerFactory {
|
|||
+ '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* The Election scheduler.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class ElectionScheduler implements Releasable {
|
||||
private final AtomicBoolean isClosed = new AtomicBoolean();
|
||||
private final AtomicLong attempt = new AtomicLong();
|
||||
|
|
|
@ -294,6 +294,11 @@ public class FollowersChecker {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A fast response state.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class FastResponseState {
|
||||
final long term;
|
||||
final Mode mode;
|
||||
|
@ -311,6 +316,8 @@ public class FollowersChecker {
|
|||
|
||||
/**
|
||||
* A checker for an individual follower.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class FollowerChecker {
|
||||
private final DiscoveryNode discoveryNode;
|
||||
|
@ -449,6 +456,11 @@ public class FollowersChecker {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Request to check follower.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class FollowerCheckRequest extends TransportRequest {
|
||||
|
||||
private final long term;
|
||||
|
|
|
@ -253,6 +253,11 @@ public class JoinHelper {
|
|||
sendJoinRequest(destination, term, optionalJoin, () -> {});
|
||||
}
|
||||
|
||||
/**
|
||||
* A failed join attempt.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
// package-private for testing
|
||||
static class FailedJoinAttempt {
|
||||
private final DiscoveryNode destination;
|
||||
|
@ -392,12 +397,22 @@ public class JoinHelper {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The callback interface.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface JoinCallback {
|
||||
void onSuccess();
|
||||
|
||||
void onFailure(Exception e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listener for the join task
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class JoinTaskListener implements ClusterStateTaskListener {
|
||||
private final JoinTaskExecutor.Task task;
|
||||
private final JoinCallback joinCallback;
|
||||
|
@ -429,6 +444,11 @@ public class JoinHelper {
|
|||
default void close(Mode newMode) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* A leader join accumulator.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class LeaderJoinAccumulator implements JoinAccumulator {
|
||||
@Override
|
||||
public void handleJoinRequest(DiscoveryNode sender, JoinCallback joinCallback) {
|
||||
|
@ -449,6 +469,11 @@ public class JoinHelper {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An initial join accumulator.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class InitialJoinAccumulator implements JoinAccumulator {
|
||||
@Override
|
||||
public void handleJoinRequest(DiscoveryNode sender, JoinCallback joinCallback) {
|
||||
|
@ -462,6 +487,11 @@ public class JoinHelper {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A follower join accumulator.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class FollowerJoinAccumulator implements JoinAccumulator {
|
||||
@Override
|
||||
public void handleJoinRequest(DiscoveryNode sender, JoinCallback joinCallback) {
|
||||
|
@ -474,6 +504,11 @@ public class JoinHelper {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A candidate join accumulator.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class CandidateJoinAccumulator implements JoinAccumulator {
|
||||
|
||||
private final Map<DiscoveryNode, JoinCallback> joinRequestAccumulator = new HashMap<>();
|
||||
|
|
|
@ -75,6 +75,11 @@ public class JoinTaskExecutor implements ClusterStateTaskExecutor<JoinTaskExecut
|
|||
private final RerouteService rerouteService;
|
||||
private final TransportService transportService;
|
||||
|
||||
/**
|
||||
* Task for the join task executor.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Task {
|
||||
|
||||
private final DiscoveryNode node;
|
||||
|
|
|
@ -151,6 +151,11 @@ public class LagDetector {
|
|||
return Collections.unmodifiableSet(appliedStateTrackersByNode.keySet());
|
||||
}
|
||||
|
||||
/**
|
||||
* A tracker that the node applied state.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class NodeAppliedStateTracker {
|
||||
private final DiscoveryNode discoveryNode;
|
||||
private final AtomicLong appliedVersion = new AtomicLong();
|
||||
|
|
|
@ -233,6 +233,11 @@ public class LeaderChecker {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A check scheduler.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class CheckScheduler implements Releasable {
|
||||
|
||||
private final AtomicBoolean isClosed = new AtomicBoolean();
|
||||
|
@ -380,6 +385,11 @@ public class LeaderChecker {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A leader check request.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class LeaderCheckRequest extends TransportRequest {
|
||||
|
||||
private final DiscoveryNode sender;
|
||||
|
|
|
@ -56,6 +56,11 @@ public class NodeRemovalClusterStateTaskExecutor
|
|||
private final AllocationService allocationService;
|
||||
private final Logger logger;
|
||||
|
||||
/**
|
||||
* Task for the executor.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Task {
|
||||
|
||||
private final DiscoveryNode node;
|
||||
|
|
|
@ -230,6 +230,11 @@ public abstract class OpenSearchNodeCommand extends EnvironmentAwareCommand {
|
|||
return parser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom unknown metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class UnknownMetadataCustom implements Metadata.Custom {
|
||||
|
||||
private final String name;
|
||||
|
@ -274,6 +279,11 @@ public abstract class OpenSearchNodeCommand extends EnvironmentAwareCommand {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An unknown condition.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class UnknownCondition extends Condition<Object> {
|
||||
|
||||
public UnknownCondition(String name, Object value) {
|
||||
|
|
|
@ -92,6 +92,11 @@ public class PendingClusterStateStats implements Writeable, ToXContentFragment {
|
|||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fields for parsing and toXContent
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static final class Fields {
|
||||
static final String QUEUE = "cluster_state_queue";
|
||||
static final String TOTAL = "total";
|
||||
|
|
|
@ -167,6 +167,11 @@ public class PreVoteCollector {
|
|||
return "PreVoteCollector{" + "state=" + state + '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* The pre vote round.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class PreVotingRound implements Releasable {
|
||||
private final Map<DiscoveryNode, PreVoteResponse> preVotesReceived = newConcurrentMap();
|
||||
private final AtomicBoolean electionStarted = new AtomicBoolean();
|
||||
|
|
|
@ -252,6 +252,11 @@ public abstract class Publication {
|
|||
APPLIED_COMMIT,
|
||||
}
|
||||
|
||||
/**
|
||||
* A publication target.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class PublicationTarget {
|
||||
private final DiscoveryNode discoveryNode;
|
||||
private boolean ackIsPending = true;
|
||||
|
@ -363,6 +368,11 @@ public abstract class Publication {
|
|||
return state == PublicationTargetState.FAILED;
|
||||
}
|
||||
|
||||
/**
|
||||
* A handler for a publish response.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class PublishResponseHandler implements ActionListener<PublishWithJoinResponse> {
|
||||
|
||||
@Override
|
||||
|
@ -404,6 +414,11 @@ public abstract class Publication {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* An apply commit response handler.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private class ApplyCommitResponseHandler implements ActionListener<TransportResponse.Empty> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -284,6 +284,8 @@ public class PublicationTransportHandler {
|
|||
* Publishing a cluster state typically involves sending the same cluster state (or diff) to every node, so the work of diffing,
|
||||
* serializing, and compressing the state can be done once and the results shared across publish requests. The
|
||||
* {@code PublicationContext} implements this sharing.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class PublicationContext {
|
||||
|
||||
|
|
|
@ -170,6 +170,11 @@ public class Reconfigurator {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A node to handle voting configs.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class VotingConfigNode implements Comparable<VotingConfigNode> {
|
||||
final String id;
|
||||
final boolean live;
|
||||
|
|
|
@ -76,6 +76,8 @@ public abstract class AliasAction {
|
|||
|
||||
/**
|
||||
* Validate a new alias.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface NewAliasValidator {
|
||||
|
@ -84,6 +86,8 @@ public abstract class AliasAction {
|
|||
|
||||
/**
|
||||
* Operation to add an alias to an index.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Add extends AliasAction {
|
||||
private final String alias;
|
||||
|
@ -174,6 +178,8 @@ public abstract class AliasAction {
|
|||
|
||||
/**
|
||||
* Operation to remove an alias from an index.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Remove extends AliasAction {
|
||||
private final String alias;
|
||||
|
@ -220,6 +226,8 @@ public abstract class AliasAction {
|
|||
/**
|
||||
* Operation to remove an index. This is an "alias action" because it allows us to remove an index at the same time as we remove add an
|
||||
* alias to replace it.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class RemoveIndex extends AliasAction {
|
||||
public RemoveIndex(String index) {
|
||||
|
|
|
@ -276,6 +276,11 @@ public class AliasMetadata extends AbstractDiffable<AliasMetadata> implements To
|
|||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder of alias metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private final String alias;
|
||||
|
|
|
@ -68,6 +68,11 @@ public final class ClusterNameExpressionResolver {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A wildcard expression resolver.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class WildcardExpressionResolver {
|
||||
|
||||
private List<String> resolve(Set<String> remoteClusters, String clusterExpression) {
|
||||
|
|
|
@ -156,6 +156,11 @@ public class ComponentTemplateMetadata implements Metadata.Custom {
|
|||
return Strings.toString(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* A diff between component template metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class ComponentTemplateMetadataDiff implements NamedDiff<Metadata.Custom> {
|
||||
|
||||
final Diff<Map<String, ComponentTemplate>> componentTemplateDiff;
|
||||
|
|
|
@ -289,6 +289,11 @@ public class ComposableIndexTemplate extends AbstractDiffable<ComposableIndexTem
|
|||
return Strings.toString(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Template for data stream.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class DataStreamTemplate implements Writeable, ToXContentObject {
|
||||
|
||||
private static final ParseField TIMESTAMP_FIELD_FIELD = new ParseField("timestamp_field");
|
||||
|
|
|
@ -157,6 +157,11 @@ public class ComposableIndexTemplateMetadata implements Metadata.Custom {
|
|||
return Strings.toString(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* A diff between composable metadata templates.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class ComposableIndexTemplateMetadataDiff implements NamedDiff<Metadata.Custom> {
|
||||
|
||||
final Diff<Map<String, ComposableIndexTemplate>> indexTemplateDiff;
|
||||
|
|
|
@ -232,6 +232,11 @@ public final class DataStream extends AbstractDiffable<DataStream> implements To
|
|||
return Objects.hash(name, timeStampField, indices, generation);
|
||||
}
|
||||
|
||||
/**
|
||||
* A timestamp field.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class TimestampField implements Writeable, ToXContentObject {
|
||||
|
||||
static ParseField NAME_FIELD = new ParseField("name");
|
||||
|
|
|
@ -161,6 +161,11 @@ public class DataStreamMetadata implements Metadata.Custom {
|
|||
return Strings.toString(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder of data stream metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private final Map<String, DataStream> dataStreams = new HashMap<>();
|
||||
|
@ -175,6 +180,11 @@ public class DataStreamMetadata implements Metadata.Custom {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A diff between data stream metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static class DataStreamMetadataDiff implements NamedDiff<Metadata.Custom> {
|
||||
|
||||
final Diff<Map<String, DataStream>> dataStreamDiff;
|
||||
|
|
|
@ -90,6 +90,8 @@ public class DiffableStringMap extends AbstractMap<String, String> implements Di
|
|||
|
||||
/**
|
||||
* Represents differences between two DiffableStringMaps.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class DiffableStringMapDiff implements Diff<DiffableStringMap> {
|
||||
|
||||
|
|
|
@ -139,6 +139,8 @@ public interface IndexAbstraction {
|
|||
|
||||
/**
|
||||
* Represents an concrete index and encapsulates its {@link IndexMetadata}
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class Index implements IndexAbstraction {
|
||||
|
||||
|
@ -192,6 +194,8 @@ public interface IndexAbstraction {
|
|||
|
||||
/**
|
||||
* Represents an alias and groups all {@link IndexMetadata} instances sharing the same alias name together.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class Alias implements IndexAbstraction {
|
||||
|
||||
|
@ -329,6 +333,11 @@ public interface IndexAbstraction {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A data stream.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class DataStream implements IndexAbstraction {
|
||||
|
||||
private final org.opensearch.cluster.metadata.DataStream dataStream;
|
||||
|
|
|
@ -190,6 +190,8 @@ public final class IndexGraveyard implements Metadata.Custom {
|
|||
|
||||
/**
|
||||
* A class to build an IndexGraveyard.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class Builder {
|
||||
private List<Tombstone> tombstones;
|
||||
|
@ -275,6 +277,8 @@ public final class IndexGraveyard implements Metadata.Custom {
|
|||
|
||||
/**
|
||||
* A class representing a diff of two IndexGraveyard objects.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class IndexGraveyardDiff implements NamedDiff<Metadata.Custom> {
|
||||
|
||||
|
@ -362,6 +366,8 @@ public final class IndexGraveyard implements Metadata.Custom {
|
|||
|
||||
/**
|
||||
* An individual tombstone entry for representing a deleted index.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class Tombstone implements ToXContentObject, Writeable {
|
||||
|
||||
|
@ -460,6 +466,8 @@ public final class IndexGraveyard implements Metadata.Custom {
|
|||
|
||||
/**
|
||||
* A builder for building tombstone entries.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static final class Builder {
|
||||
private Index index;
|
||||
|
|
|
@ -149,6 +149,11 @@ public class IndexMetadata implements Diffable<IndexMetadata>, ToXContentFragmen
|
|||
EnumSet.of(ClusterBlockLevel.METADATA_WRITE, ClusterBlockLevel.WRITE)
|
||||
);
|
||||
|
||||
/**
|
||||
* The state of the index.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum State {
|
||||
OPEN((byte) 0),
|
||||
CLOSE((byte) 1);
|
||||
|
@ -281,6 +286,11 @@ public class IndexMetadata implements Diffable<IndexMetadata>, ToXContentFragmen
|
|||
public static final String SETTING_AUTO_EXPAND_REPLICAS = "index.auto_expand_replicas";
|
||||
public static final Setting<AutoExpandReplicas> INDEX_AUTO_EXPAND_REPLICAS_SETTING = AutoExpandReplicas.SETTING;
|
||||
|
||||
/**
|
||||
* Blocks the API.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum APIBlock implements Writeable {
|
||||
READ_ONLY("read_only", INDEX_READ_ONLY_BLOCK),
|
||||
READ("read", INDEX_READ_BLOCK),
|
||||
|
@ -832,6 +842,11 @@ public class IndexMetadata implements Diffable<IndexMetadata>, ToXContentFragmen
|
|||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* A diff of index metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class IndexMetadataDiff implements Diff<IndexMetadata> {
|
||||
|
||||
private final String index;
|
||||
|
@ -1058,6 +1073,11 @@ public class IndexMetadata implements Diffable<IndexMetadata>, ToXContentFragmen
|
|||
return new Builder(indexMetadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder of index metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private String index;
|
||||
|
|
|
@ -773,6 +773,11 @@ public class IndexNameExpressionResolver {
|
|||
return Booleans.parseBoolean(threadContext.getHeader(SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Context for the resolver.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Context {
|
||||
|
||||
private final ClusterState state;
|
||||
|
@ -912,6 +917,8 @@ public class IndexNameExpressionResolver {
|
|||
|
||||
/**
|
||||
* Resolves alias/index name expressions with wildcards into the corresponding concrete indices/aliases
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static final class WildcardExpressionResolver implements ExpressionResolver {
|
||||
|
||||
|
@ -1192,6 +1199,11 @@ public class IndexNameExpressionResolver {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A date math expression resolver.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class DateMathExpressionResolver implements ExpressionResolver {
|
||||
|
||||
private static final DateFormatter DEFAULT_DATE_FORMATTER = DateFormatter.forPattern("uuuu.MM.dd");
|
||||
|
|
|
@ -270,6 +270,11 @@ public class IndexTemplateMetadata extends AbstractDiffable<IndexTemplateMetadat
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder of index template metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private static final Set<String> VALID_FIELDS = Sets.newHashSet(
|
||||
|
|
|
@ -233,6 +233,11 @@ public class Manifest implements ToXContentFragment {
|
|||
return globalGeneration == MISSING_GLOBAL_GENERATION;
|
||||
}
|
||||
|
||||
/**
|
||||
* An index entry.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static final class IndexEntry implements ToXContentFragment {
|
||||
private static final ParseField INDEX_GENERATION_PARSE_FIELD = new ParseField("generation");
|
||||
private static final ParseField INDEX_PARSE_FIELD = new ParseField("index");
|
||||
|
|
|
@ -112,6 +112,11 @@ public class Metadata implements Iterable<IndexMetadata>, Diffable<Metadata>, To
|
|||
public static final String UNKNOWN_CLUSTER_UUID = "_na_";
|
||||
public static final Pattern NUMBER_PATTERN = Pattern.compile("[0-9]+$");
|
||||
|
||||
/**
|
||||
* Context of the XContent.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum XContentContext {
|
||||
/* Custom metadata should be returns as part of API call */
|
||||
API,
|
||||
|
@ -146,6 +151,11 @@ public class Metadata implements Iterable<IndexMetadata>, Diffable<Metadata>, To
|
|||
*/
|
||||
public static EnumSet<XContentContext> ALL_CONTEXTS = EnumSet.allOf(XContentContext.class);
|
||||
|
||||
/**
|
||||
* Custom metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface Custom extends NamedDiffable<Custom>, ToXContentFragment, ClusterState.FeatureAware {
|
||||
|
||||
EnumSet<XContentContext> context();
|
||||
|
@ -920,6 +930,11 @@ public class Metadata implements Iterable<IndexMetadata>, Diffable<Metadata>, To
|
|||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* A diff of metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static class MetadataDiff implements Diff<Metadata> {
|
||||
|
||||
private final long version;
|
||||
|
@ -1088,6 +1103,11 @@ public class Metadata implements Iterable<IndexMetadata>, Diffable<Metadata>, To
|
|||
return new Builder(metadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder of metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private String clusterUUID;
|
||||
|
|
|
@ -125,6 +125,11 @@ public class MetadataCreateDataStreamService {
|
|||
return createDataStream(metadataCreateIndexService, current, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* A request to create a data stream cluster state update
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class CreateDataStreamClusterStateUpdateRequest extends ClusterStateUpdateRequest {
|
||||
|
||||
private final String name;
|
||||
|
|
|
@ -583,6 +583,8 @@ public class MetadataIndexStateService {
|
|||
* This step iterates over the indices previously blocked and sends a {@link TransportVerifyShardBeforeCloseAction} to each shard. If
|
||||
* this action succeed then the shard is considered to be ready for closing. When all shards of a given index are ready for closing,
|
||||
* the index is considered ready to be closed.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class WaitForClosedBlocksApplied extends ActionRunnable<Map<Index, IndexResult>> {
|
||||
|
||||
|
@ -715,6 +717,8 @@ public class MetadataIndexStateService {
|
|||
/**
|
||||
* Helper class that coordinates with shards to ensure that blocks have been properly applied to all shards using
|
||||
* {@link TransportVerifyShardIndexBlockAction}.
|
||||
*
|
||||
* @opensearch.metadata
|
||||
*/
|
||||
class WaitForBlocksApplied extends ActionRunnable<Map<Index, AddBlockResult>> {
|
||||
|
||||
|
|
|
@ -1498,6 +1498,11 @@ public class MetadataIndexTemplateService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Listener for putting metadata in the template
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface PutListener {
|
||||
|
||||
void onResponse(PutResponse response);
|
||||
|
@ -1505,6 +1510,11 @@ public class MetadataIndexTemplateService {
|
|||
void onFailure(Exception e);
|
||||
}
|
||||
|
||||
/**
|
||||
* A PUT request.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class PutRequest {
|
||||
final String name;
|
||||
final String cause;
|
||||
|
@ -1564,6 +1574,11 @@ public class MetadataIndexTemplateService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The PUT response.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class PutResponse {
|
||||
private final boolean acknowledged;
|
||||
|
||||
|
@ -1576,6 +1591,11 @@ public class MetadataIndexTemplateService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A remove Request.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class RemoveRequest {
|
||||
final String name;
|
||||
TimeValue masterTimeout = MasterNodeRequest.DEFAULT_MASTER_NODE_TIMEOUT;
|
||||
|
@ -1590,6 +1610,11 @@ public class MetadataIndexTemplateService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A remove Response.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class RemoveResponse {
|
||||
private final boolean acknowledged;
|
||||
|
||||
|
@ -1602,6 +1627,11 @@ public class MetadataIndexTemplateService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A remove listener.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface RemoveListener {
|
||||
|
||||
void onResponse(RemoveResponse response);
|
||||
|
|
|
@ -94,6 +94,11 @@ public class SystemIndexMetadataUpgradeService implements ClusterStateListener {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Task to update system index metadata.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class SystemIndexMetadataUpdateTask extends ClusterStateUpdateTask {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -52,6 +52,11 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public class DiscoveryNodeFilters {
|
||||
|
||||
/**
|
||||
* Operation type.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum OpType {
|
||||
AND,
|
||||
OR
|
||||
|
|
|
@ -515,6 +515,11 @@ public class DiscoveryNodes extends AbstractDiffable<DiscoveryNodes> implements
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delta between nodes.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Delta {
|
||||
|
||||
private final String localNodeId;
|
||||
|
@ -658,6 +663,11 @@ public class DiscoveryNodes extends AbstractDiffable<DiscoveryNodes> implements
|
|||
return new Builder(nodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder of a map of discovery nodes.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private final ImmutableOpenMap.Builder<String, DiscoveryNode> nodes;
|
||||
|
|
|
@ -365,6 +365,11 @@ public class IndexRoutingTable extends AbstractDiffable<IndexRoutingTable> imple
|
|||
return new Builder(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder of a routing table.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private final Index index;
|
||||
|
|
|
@ -698,6 +698,11 @@ public class IndexShardRoutingTable implements Iterable<ShardRouting> {
|
|||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder of an index shard routing table.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
private ShardId shardId;
|
||||
|
|
|
@ -106,6 +106,11 @@ public abstract class RecoverySource implements Writeable, ToXContentObject {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of recovery.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Type {
|
||||
EMPTY_STORE,
|
||||
EXISTING_STORE,
|
||||
|
@ -141,6 +146,8 @@ public abstract class RecoverySource implements Writeable, ToXContentObject {
|
|||
|
||||
/**
|
||||
* Recovery from a fresh copy
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class EmptyStoreRecoverySource extends RecoverySource {
|
||||
public static final EmptyStoreRecoverySource INSTANCE = new EmptyStoreRecoverySource();
|
||||
|
@ -158,6 +165,8 @@ public abstract class RecoverySource implements Writeable, ToXContentObject {
|
|||
|
||||
/**
|
||||
* Recovery from an existing on-disk store
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class ExistingStoreRecoverySource extends RecoverySource {
|
||||
/**
|
||||
|
@ -211,6 +220,8 @@ public abstract class RecoverySource implements Writeable, ToXContentObject {
|
|||
|
||||
/**
|
||||
* recovery from other shards on same node (shrink index action)
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class LocalShardsRecoverySource extends RecoverySource {
|
||||
|
||||
|
@ -232,6 +243,8 @@ public abstract class RecoverySource implements Writeable, ToXContentObject {
|
|||
|
||||
/**
|
||||
* recovery from a snapshot
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class SnapshotRecoverySource extends RecoverySource {
|
||||
|
||||
|
@ -338,6 +351,8 @@ public abstract class RecoverySource implements Writeable, ToXContentObject {
|
|||
|
||||
/**
|
||||
* peer recovery from a primary shard
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class PeerRecoverySource extends RecoverySource {
|
||||
|
||||
|
|
|
@ -137,6 +137,11 @@ public interface RoutingChangesObserver {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Observer of routing changes.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
class DelegatingRoutingChangesObserver implements RoutingChangesObserver {
|
||||
|
||||
private final RoutingChangesObserver[] routingChangesObservers;
|
||||
|
|
|
@ -893,6 +893,11 @@ public class RoutingNodes implements Iterable<RoutingNode> {
|
|||
return nodesToShards.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Unassigned shard list.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class UnassignedShards implements Iterable<ShardRouting> {
|
||||
|
||||
private final RoutingNodes nodes;
|
||||
|
@ -989,6 +994,11 @@ public class RoutingNodes implements Iterable<RoutingNode> {
|
|||
ignored.add(shard);
|
||||
}
|
||||
|
||||
/**
|
||||
* An unassigned iterator.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class UnassignedIterator implements Iterator<ShardRouting>, ExistingShardsAllocator.UnassignedAllocationHandler {
|
||||
|
||||
private final ListIterator<ShardRouting> iterator;
|
||||
|
@ -1369,6 +1379,11 @@ public class RoutingNodes implements Iterable<RoutingNode> {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A collection of recoveries.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
private static final class Recoveries {
|
||||
private static final Recoveries EMPTY = new Recoveries();
|
||||
private int incoming = 0;
|
||||
|
|
|
@ -424,6 +424,8 @@ public class RoutingTable implements Iterable<IndexRoutingTable>, Diffable<Routi
|
|||
|
||||
/**
|
||||
* Builder for the routing table. Note that build can only be called one time.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
|
|
|
@ -81,6 +81,8 @@ public final class UnassignedInfo implements ToXContentFragment, Writeable {
|
|||
* <p>
|
||||
* Note, ordering of the enum is important, make sure to add new values
|
||||
* at the end and handle version serialization properly.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Reason {
|
||||
/**
|
||||
|
@ -155,6 +157,8 @@ public final class UnassignedInfo implements ToXContentFragment, Writeable {
|
|||
*
|
||||
* Note, ordering of the enum is important, make sure to add new values
|
||||
* at the end and handle version serialization properly.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum AllocationStatus implements Writeable {
|
||||
/**
|
||||
|
|
|
@ -742,6 +742,8 @@ public class AllocationService {
|
|||
/**
|
||||
* this class is used to describe results of applying a set of
|
||||
* {@link org.opensearch.cluster.routing.allocation.command.AllocationCommand}
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class CommandsResult {
|
||||
|
||||
|
|
|
@ -142,6 +142,11 @@ public class DiskThresholdSettings {
|
|||
clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING, this::setEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates a low disk watermark.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static final class LowDiskWatermarkValidator implements Setting.Validator<String> {
|
||||
|
||||
@Override
|
||||
|
@ -167,6 +172,11 @@ public class DiskThresholdSettings {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates a high disk watermark.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static final class HighDiskWatermarkValidator implements Setting.Validator<String> {
|
||||
|
||||
@Override
|
||||
|
@ -192,6 +202,11 @@ public class DiskThresholdSettings {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the flood stage.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static final class FloodStageValidator implements Setting.Validator<String> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -188,7 +188,11 @@ public class NodeAllocationResult implements ToXContentObject, Writeable, Compar
|
|||
return nodeResultComparator.compare(this, other);
|
||||
}
|
||||
|
||||
/** A class that captures metadata about a shard store on a node. */
|
||||
/**
|
||||
* A class that captures metadata about a shard store on a node.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class ShardStoreInfo implements ToXContentFragment, Writeable {
|
||||
private final boolean inSync;
|
||||
@Nullable
|
||||
|
|
|
@ -315,6 +315,11 @@ public class RoutingAllocation {
|
|||
this.hasPendingAsyncFetch = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Debug mode.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum DebugMode {
|
||||
/**
|
||||
* debug mode is off
|
||||
|
|
|
@ -291,6 +291,8 @@ public class BalancedShardsAllocator implements ShardsAllocator {
|
|||
|
||||
/**
|
||||
* A {@link Balancer}
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Balancer {
|
||||
private final Logger logger;
|
||||
|
@ -1192,6 +1194,11 @@ public class BalancedShardsAllocator implements ShardsAllocator {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* A model node.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class ModelNode implements Iterable<ModelIndex> {
|
||||
private final Map<String, ModelIndex> indices = new HashMap<>();
|
||||
private int numShards = 0;
|
||||
|
@ -1270,6 +1277,11 @@ public class BalancedShardsAllocator implements ShardsAllocator {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* A model index.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static final class ModelIndex implements Iterable<ShardRouting> {
|
||||
private final String id;
|
||||
private final Set<ShardRouting> shards = new HashSet<>(4); // expect few shards of same index to be allocated on same node
|
||||
|
@ -1322,6 +1334,11 @@ public class BalancedShardsAllocator implements ShardsAllocator {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A node sorter.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
static final class NodeSorter extends IntroSorter {
|
||||
|
||||
final ModelNode[] modelNodes;
|
||||
|
|
|
@ -98,6 +98,11 @@ public class AllocateEmptyPrimaryAllocationCommand extends BasePrimaryAllocation
|
|||
return new Builder().parse(parser).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for an empty primary allocation.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder extends BasePrimaryAllocationCommand.Builder<AllocateEmptyPrimaryAllocationCommand> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -88,6 +88,11 @@ public class AllocateReplicaAllocationCommand extends AbstractAllocateAllocation
|
|||
return new Builder().parse(parser).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder for the command.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
protected static class Builder extends AbstractAllocateAllocationCommand.Builder<AllocateReplicaAllocationCommand> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -95,6 +95,11 @@ public class AllocateStalePrimaryAllocationCommand extends BasePrimaryAllocation
|
|||
return new Builder().parse(parser).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for a stale primary allocation
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Builder extends BasePrimaryAllocationCommand.Builder<AllocateStalePrimaryAllocationCommand> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -85,6 +85,11 @@ public abstract class BasePrimaryAllocationCommand extends AbstractAllocateAlloc
|
|||
return acceptDataLoss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base builder class for the primary allocation command.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
protected abstract static class Builder<T extends BasePrimaryAllocationCommand> extends AbstractAllocateAllocationCommand.Builder<T> {
|
||||
protected boolean acceptDataLoss;
|
||||
|
||||
|
|
|
@ -78,6 +78,8 @@ public class ClusterRebalanceAllocationDecider extends AllocationDecider {
|
|||
|
||||
/**
|
||||
* An enum representation for the configured re-balance type.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum ClusterRebalanceType {
|
||||
/**
|
||||
|
|
|
@ -97,6 +97,8 @@ public abstract class Decision implements ToXContent, Writeable {
|
|||
/**
|
||||
* This enumeration defines the
|
||||
* possible types of decisions
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Type implements Writeable {
|
||||
YES(1),
|
||||
|
@ -170,6 +172,8 @@ public abstract class Decision implements ToXContent, Writeable {
|
|||
|
||||
/**
|
||||
* Simple class representing a single decision
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Single extends Decision implements ToXContentObject {
|
||||
private Type type;
|
||||
|
@ -287,6 +291,8 @@ public abstract class Decision implements ToXContent, Writeable {
|
|||
|
||||
/**
|
||||
* Simple class representing a list of decisions
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static class Multi extends Decision implements ToXContentFragment {
|
||||
|
||||
|
|
|
@ -282,6 +282,8 @@ public class EnableAllocationDecider extends AllocationDecider {
|
|||
* {@link EnableAllocationDecider#CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING} /
|
||||
* {@link EnableAllocationDecider#INDEX_ROUTING_ALLOCATION_ENABLE_SETTING}
|
||||
* via cluster / index settings.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Allocation {
|
||||
|
||||
|
@ -314,6 +316,8 @@ public class EnableAllocationDecider extends AllocationDecider {
|
|||
* {@link EnableAllocationDecider#CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING} /
|
||||
* {@link EnableAllocationDecider#INDEX_ROUTING_REBALANCE_ENABLE_SETTING}
|
||||
* via cluster / index settings.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Rebalance {
|
||||
|
||||
|
|
|
@ -148,6 +148,11 @@ public abstract class LocalTimeOffset {
|
|||
*/
|
||||
public abstract long localToUtc(long localMillis, Strategy strat);
|
||||
|
||||
/**
|
||||
* Strategy for a local time
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface Strategy {
|
||||
/**
|
||||
* Handle a local time that never actually happened because a "gap"
|
||||
|
|
|
@ -81,6 +81,11 @@ import java.util.concurrent.TimeUnit;
|
|||
public abstract class Rounding implements Writeable {
|
||||
private static final Logger logger = LogManager.getLogger(Rounding.class);
|
||||
|
||||
/**
|
||||
* A Date Time Unit
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum DateTimeUnit {
|
||||
WEEK_OF_WEEKYEAR((byte) 1, "week", IsoFields.WEEK_OF_WEEK_BASED_YEAR, true, TimeUnit.DAYS.toMillis(7)) {
|
||||
private final long extraLocalOffsetLookup = TimeUnit.DAYS.toMillis(7);
|
||||
|
@ -262,6 +267,8 @@ public abstract class Rounding implements Writeable {
|
|||
|
||||
/**
|
||||
* A strategy for rounding milliseconds since epoch.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface Prepared {
|
||||
/**
|
||||
|
|
|
@ -69,6 +69,11 @@ public interface CircuitBreaker {
|
|||
*/
|
||||
String IN_FLIGHT_REQUESTS = "in_flight_requests";
|
||||
|
||||
/**
|
||||
* The type of breaker
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
enum Type {
|
||||
// A regular or ChildMemoryCircuitBreaker
|
||||
MEMORY,
|
||||
|
@ -91,6 +96,11 @@ public interface CircuitBreaker {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The breaker durability
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
enum Durability {
|
||||
// The condition that tripped the circuit breaker fixes itself eventually.
|
||||
TRANSIENT,
|
||||
|
|
|
@ -38,6 +38,11 @@ package org.opensearch.common.cache;
|
|||
* @opensearch.internal
|
||||
*/
|
||||
public class RemovalNotification<K, V> {
|
||||
/**
|
||||
* Reason for notification removal
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum RemovalReason {
|
||||
REPLACED,
|
||||
INVALIDATED,
|
||||
|
|
|
@ -147,7 +147,17 @@ public final class HppcMaps {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Object for the map
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class Object {
|
||||
/**
|
||||
* Integer type for the map
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public static final class Integer {
|
||||
public static <V> ObjectIntHashMap<V> ensureNoNullKeys(int capacity, float loadFactor) {
|
||||
return new ObjectIntHashMap<V>(capacity, loadFactor) {
|
||||
|
|
|
@ -35,6 +35,11 @@ package org.opensearch.common.collect;
|
|||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/**
|
||||
* Iterators utility class.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class Iterators {
|
||||
public static <T> Iterator<T> concat(Iterator<? extends T>... iterators) {
|
||||
if (iterators == null) {
|
||||
|
|
|
@ -77,6 +77,11 @@ package org.opensearch.common.component;
|
|||
*/
|
||||
public class Lifecycle {
|
||||
|
||||
/**
|
||||
* State in the lifecycle
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum State {
|
||||
INITIALIZED,
|
||||
STOPPED,
|
||||
|
|
|
@ -421,6 +421,8 @@ public class GeoUtils {
|
|||
|
||||
/**
|
||||
* Represents the point of the geohash cell that should be used as the value of geohash
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum EffectivePoint {
|
||||
TOP_LEFT,
|
||||
|
|
|
@ -420,6 +420,11 @@ public abstract class ShapeBuilder<T extends Shape, G extends org.opensearch.geo
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The orientation of the vertices
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum Orientation {
|
||||
LEFT,
|
||||
RIGHT;
|
||||
|
|
|
@ -314,6 +314,11 @@ class BindingProcessor extends AbstractProcessor {
|
|||
);
|
||||
// TODO(jessewilson): fix BuiltInModule, then add Stage
|
||||
|
||||
/**
|
||||
* A listener for a process creation
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
interface CreationListener {
|
||||
void notify(Errors errors);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue