Package org.elasticsearch.repositories
Class ShardGeneration
java.lang.Object
org.elasticsearch.repositories.ShardGeneration
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentFragment
The generation ID of a shard, used to name the shard-level
index-$SHARD_GEN
file that represents a BlobStoreIndexShardSnapshots
instance. Before 7.6 (SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION
) these generations were
numeric, but recent versions use a UUID instead.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionShardGeneration
(long legacyGeneration) Construct a specificShardGeneration
for a repository using the legacy numeric format.ShardGeneration
(String rawGeneration) Construct a specificShardGeneration
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static ShardGeneration
fromXContent
(XContentParser parser) int
hashCode()
static ShardGeneration
static ShardGeneration
newGeneration
(Random random) Convert to aString
for use in naming theindex-$SHARD_GEN
blob containing aBlobStoreIndexShardSnapshots
.toString()
toXContent
(XContentBuilder builder, ToXContent.Params params) void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
ShardGeneration
Construct a specificShardGeneration
. Doing this is generally a mistake, you should either create a new fresh one withnewGeneration()
or else read one from the wire withShardGeneration(StreamInput)
orfromXContent(XContentParser)
. -
ShardGeneration
public ShardGeneration(long legacyGeneration) Construct a specificShardGeneration
for a repository using the legacy numeric format. -
ShardGeneration
- Throws:
IOException
-
-
Method Details
-
newGeneration
- Returns:
- a new (fresh) shard generation.
-
newGeneration
- Returns:
- a new (fresh) shard generation generated using the given
Random
for repeatability in tests.
-
fromXContent
- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
toBlobNamePart
Convert to aString
for use in naming theindex-$SHARD_GEN
blob containing aBlobStoreIndexShardSnapshots
. -
toString
-
equals
-
hashCode
public int hashCode() -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-