Class BlobStoreIndexShardSnapshot.FileInfo
java.lang.Object
org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot.FileInfo
- All Implemented Interfaces:
Writeable
- Enclosing class:
- BlobStoreIndexShardSnapshot
Information about snapshotted file
-
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
ConstructorDescriptionFileInfo
(String name, StoreFileMetadata metadata, ByteSizeValue partSize) Constructs a new instance of file infoFileInfo
(StreamInput in) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
canonicalName
(String blobName) Returns base file name from part namechecksum()
Returns file md5 checksum provided byStore
fromXContent
(org.elasticsearch.xcontent.XContentParser parser) Parses JSON that represents file infoboolean
isSame
(BlobStoreIndexShardSnapshot.FileInfo fileInfo) Checks if a file in a store is the same fileboolean
Checks if a file in a store is the same filelong
length()
File lengthmetadata()
Returns the StoreFileMetadata for this file info.name()
Returns the base file nameint
Returns number of partslong
partBytes
(int part) Returns the size (in bytes) of a given partpartName
(int part) Returns part name if file is stored as multiple partspartSize()
Returns part sizeReturns original file nametoString()
static void
toXContent
(BlobStoreIndexShardSnapshot.FileInfo file, org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) Serializes file info into JSONvoid
writeTo
(StreamOutput out) Write this into the StreamOutput.
-
Field Details
-
SERIALIZE_WRITER_UUID
- See Also:
-
-
Constructor Details
-
FileInfo
Constructs a new instance of file info- Parameters:
name
- file name as stored in the blob storemetadata
- the files meta datapartSize
- size of the single chunk
-
FileInfo
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
name
Returns the base file name- Returns:
- file name
-
partName
Returns part name if file is stored as multiple parts- Parameters:
part
- part number- Returns:
- part name
-
canonicalName
Returns base file name from part name- Parameters:
blobName
- part name- Returns:
- base file name
-
physicalName
Returns original file name- Returns:
- original file name
-
length
public long length()File length- Returns:
- file length
-
partSize
Returns part size- Returns:
- part size
-
partBytes
public long partBytes(int part) Returns the size (in bytes) of a given part- Returns:
- the size (in bytes) of a given part
-
numberOfParts
public int numberOfParts()Returns number of parts- Returns:
- number of parts
-
checksum
Returns file md5 checksum provided byStore
- Returns:
- file checksum
-
metadata
Returns the StoreFileMetadata for this file info. -
isSame
Checks if a file in a store is the same file- Parameters:
md
- file in a store- Returns:
- true if file in a store this this file have the same checksum and length
-
isSame
Checks if a file in a store is the same file- Parameters:
fileInfo
- file in a store- Returns:
- true if file in a store this this file have the same checksum and length
-
toXContent
public static void toXContent(BlobStoreIndexShardSnapshot.FileInfo file, org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException Serializes file info into JSON- Parameters:
file
- file infobuilder
- XContent builderparams
- parameters- Throws:
IOException
-
fromXContent
public static BlobStoreIndexShardSnapshot.FileInfo fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException Parses JSON that represents file info- Parameters:
parser
- parser- Returns:
- file info
- Throws:
IOException
-
toString
-