Class RepositoryMetadata

org.elasticsearch.cluster.metadata.RepositoryMetadata
All Implemented Interfaces:
Writeable

public class RepositoryMetadata extends implements Writeable
Metadata about registered repository
  • Field Details

    • REPO_GEN_IN_CS_VERSION

      public static final Version REPO_GEN_IN_CS_VERSION
  • Constructor Details

    • RepositoryMetadata

      public RepositoryMetadata( name,  type, Settings settings)
      Constructs new repository metadata
      Parameters:
      name - repository name
      type - repository type
      settings - repository settings
    • RepositoryMetadata

      public RepositoryMetadata(RepositoryMetadata metadata, long generation, long pendingGeneration)
    • RepositoryMetadata

      public RepositoryMetadata( name,  uuid,  type, Settings settings, long generation, long pendingGeneration)
    • RepositoryMetadata

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

    • name

      public  name()
      Returns repository name
      Returns:
      repository name
    • type

      public  type()
      Returns repository type
      Returns:
      repository type
    • uuid

      public  uuid()
      Return the repository UUID, if set and known. The repository UUID is stored in the repository and typically populated here when the repository is registered or when we write to it. It may not be set if the repository is maintaining support for versions before SnapshotsService.UUIDS_IN_REPO_DATA_VERSION. It may not be known if the repository was registered with ?verify=false and has had no subsequent writes. Consumers may, if desired, try and fill in a missing value themselves by retrieving the RepositoryData and calling RepositoriesService.updateRepositoryUuidInMetadata(org.elasticsearch.cluster.service.ClusterService, java.lang.String, org.elasticsearch.repositories.RepositoryData, org.elasticsearch.action.ActionListener<java.lang.Void>).
      Returns:
      repository UUID, or RepositoryData.MISSING_UUID if the UUID is not set or not known.
    • settings

      public Settings settings()
      Returns repository settings
      Returns:
      repository settings
    • generation

      public long generation()
      Returns the safe repository generation. RepositoryData for this generation is assumed to exist in the repository. All operations on the repository must be based on the RepositoryData at this generation. See package level documentation for the blob store based repositories org.elasticsearch.repositories.blobstore for details on how this value is used during snapshots.
      Returns:
      safe repository generation
    • pendingGeneration

      public long pendingGeneration()
      Returns the pending repository generation. RepositoryData for this generation and all generations down to the safe generation generation may exist in the repository and should not be reused for writing new RepositoryData to the repository. See package level documentation for the blob store based repositories org.elasticsearch.repositories.blobstore for details on how this value is used during snapshots.
      Returns:
      highest pending repository generation
    • writeTo

      public void writeTo(StreamOutput out) throws
      Writes repository metadata to stream output
      Specified by:
      writeTo in interface Writeable
      Parameters:
      out - stream output
      Throws:
    • equalsIgnoreGenerations

      public boolean equalsIgnoreGenerations(RepositoryMetadata other)
      Checks if this instance is equal to the other instance in all fields other than generation and pendingGeneration.
      Parameters:
      other - other repository metadata
      Returns:
      true if both instances equal in all fields but the generation fields
    • equals

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

      public int hashCode()
      Overrides:
       in class 
    • toString

      public  toString()
      Overrides:
       in class 
    • withUuid

      public  uuid)
    • withSettings

      public RepositoryMetadata withSettings(Settings settings)