Class SnapshotsInProgress

All Implemented Interfaces:
ClusterState.Custom, ClusterState.FeatureAware, Diffable<ClusterState.Custom>, NamedDiffable<ClusterState.Custom>, org.opensearch.core.common.io.stream.NamedWriteable, org.opensearch.core.common.io.stream.VersionedNamedWriteable, org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContent, org.opensearch.core.xcontent.ToXContentFragment

public class SnapshotsInProgress extends AbstractNamedDiffable<ClusterState.Custom> implements ClusterState.Custom
Meta data about snapshots that are currently executing
Opensearch.internal:
  • Field Details

  • Constructor Details

    • SnapshotsInProgress

      public SnapshotsInProgress(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • startedEntry

      public static SnapshotsInProgress.Entry startedEntry(Snapshot snapshot, boolean includeGlobalState, boolean partial, List<IndexId> indices, List<String> dataStreams, long startTime, long repositoryStateId, Map<org.opensearch.core.index.shard.ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, Map<String,Object> userMetadata, org.opensearch.Version version, boolean remoteStoreIndexShallowCopy)
      Creates the initial SnapshotsInProgress.Entry when starting a snapshot, if no shard-level snapshot work is to be done the resulting entry will be in state SnapshotsInProgress.State.SUCCESS right away otherwise it will be in state SnapshotsInProgress.State.STARTED.
    • startClone

      public static SnapshotsInProgress.Entry startClone(Snapshot snapshot, SnapshotId source, List<IndexId> indices, long startTime, long repositoryStateId, org.opensearch.Version version)
      Creates the initial snapshot clone entry
      Parameters:
      snapshot - snapshot to clone into
      source - snapshot to clone from
      indices - indices to clone
      startTime - start time
      repositoryStateId - repository state id that this clone is based on
      version - repository metadata version to write
      Returns:
      snapshot clone entry
    • completed

      public static boolean completed(Collection<SnapshotsInProgress.ShardSnapshotStatus> shards)
      Checks if all shards in the list have completed
      Parameters:
      shards - list of shard statuses
      Returns:
      true if all shards have completed (either successfully or failed), false otherwise
    • of

      public static SnapshotsInProgress of(List<SnapshotsInProgress.Entry> entries)
    • entries

      public List<SnapshotsInProgress.Entry> entries()
    • snapshot

      public SnapshotsInProgress.Entry snapshot(Snapshot snapshot)
    • getWriteableName

      public String getWriteableName()
      Specified by:
      getWriteableName in interface org.opensearch.core.common.io.stream.NamedWriteable
      Specified by:
      getWriteableName in interface org.opensearch.core.common.io.stream.VersionedNamedWriteable
    • getMinimalSupportedVersion

      public org.opensearch.Version getMinimalSupportedVersion()
      Specified by:
      getMinimalSupportedVersion in interface org.opensearch.core.common.io.stream.VersionedNamedWriteable
    • readDiffFrom

      public static NamedDiff<ClusterState.Custom> readDiffFrom(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Specified by:
      writeTo in interface org.opensearch.core.common.io.stream.Writeable
      Throws:
      IOException
    • toXContent

      public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.opensearch.core.xcontent.ToXContent
      Throws:
      IOException