Class RepositoryMetadata
java.lang.Object
org.elasticsearch.cluster.metadata.RepositoryMetadata
- All Implemented Interfaces:
Writeable
Metadata about registered repository
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRepositoryMetadata(String name, String uuid, String type, Settings settings, long generation, long pendingGeneration)
RepositoryMetadata(String name, String type, Settings settings)
Constructs new repository metadataRepositoryMetadata(RepositoryMetadata metadata, long generation, long pendingGeneration)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Checks if this instance is equal to the other instance in all fields other thangeneration
andpendingGeneration
.long
Returns the safe repository generation.int
hashCode()
name()
Returns repository namelong
Returns the pending repository generation.settings()
Returns repository settingstoString()
type()
Returns repository typeuuid()
Return the repository UUID, if set and known.withSettings(Settings settings)
void
writeTo(StreamOutput out)
Writes repository metadata to stream output
-
Field Details
-
REPO_GEN_IN_CS_VERSION
-
-
Constructor Details
-
RepositoryMetadata
Constructs new repository metadata- Parameters:
name
- repository nametype
- repository typesettings
- repository settings
-
RepositoryMetadata
-
RepositoryMetadata
-
RepositoryMetadata
- Throws:
IOException
-
-
Method Details
-
name
Returns repository name- Returns:
- repository name
-
type
Returns repository type- Returns:
- repository type
-
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 beforeSnapshotsService.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 theRepositoryData
and callingRepositoriesService.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
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 theRepositoryData
at this generation. See package level documentation for the blob store based repositoriesorg.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 generationgeneration
may exist in the repository and should not be reused for writing newRepositoryData
to the repository. See package level documentation for the blob store based repositoriesorg.elasticsearch.repositories.blobstore
for details on how this value is used during snapshots.- Returns:
- highest pending repository generation
-
writeTo
Writes repository metadata to stream output- Specified by:
writeTo
in interfaceWriteable
- Parameters:
out
- stream output- Throws:
IOException
-
equalsIgnoreGenerations
Checks if this instance is equal to the other instance in all fields other thangeneration
andpendingGeneration
.- Parameters:
other
- other repository metadata- Returns:
true
if both instances equal in all fields but the generation fields
-
equals
-
hashCode
public int hashCode() -
toString
-
withUuid
-
withSettings
-