Class RepositoryMetadata

java.lang.Object
org.elasticsearch.cluster.metadata.RepositoryMetadata
All Implemented Interfaces:
Writeable

public class RepositoryMetadata
extends java.lang.Object
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​(java.lang.String name, java.lang.String 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​(java.lang.String name, java.lang.String uuid, java.lang.String type, Settings settings, long generation, long pendingGeneration)
    • RepositoryMetadata

      public RepositoryMetadata​(StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
  • Method Details

    • name

      public java.lang.String name()
      Returns repository name
      Returns:
      repository name
    • type

      public java.lang.String type()
      Returns repository type
      Returns:
      repository type
    • uuid

      public java.lang.String 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 java.io.IOException
      Writes repository metadata to stream output
      Specified by:
      writeTo in interface Writeable
      Parameters:
      out - stream output
      Throws:
      java.io.IOException
    • 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​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

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

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • withUuid

      public RepositoryMetadata withUuid​(java.lang.String uuid)