Class RepositoriesMetadata

org.elasticsearch.cluster.AbstractNamedDiffable<Metadata.Custom>
org.elasticsearch.cluster.metadata.RepositoriesMetadata
All Implemented Interfaces:
ClusterState.FeatureAware, Diffable<Metadata.Custom>, Metadata.Custom, NamedDiffable<Metadata.Custom>, NamedWriteable, VersionedNamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class RepositoriesMetadata extends AbstractNamedDiffable<Metadata.Custom> implements Metadata.Custom
Contains metadata about registered snapshot repositories
  • Field Details

  • Constructor Details

    • RepositoriesMetadata

      public RepositoriesMetadata(<RepositoryMetadata> repositories)
      Constructs new repository metadata
      Parameters:
      repositories - list of repositories
    • RepositoriesMetadata

      public RepositoriesMetadata(StreamInput in) throws
      Throws:
  • Method Details

    • withUpdatedGeneration

      public  repoName, long safeGeneration, long pendingGeneration)
      Creates a new instance that has the given repository moved to the given safeGeneration and pendingGeneration.
      Parameters:
      repoName - repository name
      safeGeneration - new safe generation
      pendingGeneration - new pending generation
      Returns:
      new instance with updated generations
    • withUuid

      public  repoName,  uuid)
      Creates a new instance that records the UUID of the given repository.
      Parameters:
      repoName - repository name
      uuid - repository uuid
      Returns:
      new instance with updated uuid
    • repositories

      public <RepositoryMetadata> repositories()
      Returns list of currently registered repositories
      Returns:
      list of repositories
    • repository

      public  name)
      Returns a repository with a given name or null if such repository doesn't exist
      Parameters:
      name - name of repository
      Returns:
      repository metadata
    • equals

      public boolean equals( o)
      Overrides:
       in class 
    • equalsIgnoreGenerations

      public boolean equalsIgnoreGenerations(@Nullable RepositoriesMetadata other)
      Checks if this instance and the given instance share the same repositories by checking that this instances' repositories and the repositories in other are equal or only differ in their values of RepositoryMetadata.generation() and RepositoryMetadata.pendingGeneration().
      Parameters:
      other - other repositories metadata
      Returns:
      true iff both instances contain the same repositories apart from differences in generations
    • hashCode

      public int hashCode()
      Overrides:
       in class 
    • getWriteableName

      public  getWriteableName()
      Returns the name of the writeable object
      Specified by:
      getWriteableName in interface NamedWriteable
      Specified by:
      getWriteableName in interface VersionedNamedWriteable
    • getMinimalSupportedVersion

      public Version getMinimalSupportedVersion()
      Description copied from interface: VersionedNamedWriteable
      The minimal version of the recipient this object can be sent to
      Specified by:
      getMinimalSupportedVersion in interface VersionedNamedWriteable
    • readDiffFrom

      public static NamedDiff<Metadata.Custom> readDiffFrom(StreamInput in) throws
      Throws:
    • writeTo

      public void writeTo(StreamOutput out) throws
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
    • fromXContent

      public static RepositoriesMetadata fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws
      Throws:
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
    • context

      public <Metadata.XContentContext> context()
      Specified by:
      context in interface Metadata.Custom
    • toXContent

      public static void toXContent(RepositoryMetadata repository, org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Serializes information about a single repository
      Parameters:
      repository - repository metadata
      builder - XContent builder
      params - serialization parameters
      Throws:
    • toString

      public  toString()
      Overrides:
       in class