Package com.yahoo.vespa.filedistribution
Class FileReferenceData
- java.lang.Object
-
- com.yahoo.vespa.filedistribution.FileReferenceData
-
- Direct Known Subclasses:
EmptyFileReferenceData
,LazyFileReferenceData
public abstract class FileReferenceData extends Object
Utility class for a file reference with data and metadata- Author:
- hmusum
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileReferenceData.Type
-
Constructor Summary
Constructors Constructor Description FileReferenceData(com.yahoo.config.FileReference fileReference, String filename, FileReferenceData.Type type)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
close()
Close underlying filesByteBuffer
content()
String
filename()
com.yahoo.config.FileReference
fileReference()
abstract int
nextContent(ByteBuffer bb)
Will provide the next part of the content.abstract long
size()
The size of the content in bytesFileReferenceData.Type
type()
abstract long
xxhash()
Only guaranteed to be valid after all content has been consumed.
-
-
-
Constructor Detail
-
FileReferenceData
public FileReferenceData(com.yahoo.config.FileReference fileReference, String filename, FileReferenceData.Type type)
-
-
Method Detail
-
fileReference
public com.yahoo.config.FileReference fileReference()
-
filename
public String filename()
-
type
public FileReferenceData.Type type()
-
content
public ByteBuffer content()
-
nextContent
public abstract int nextContent(ByteBuffer bb)
Will provide the next part of the content.- Parameters:
bb
- with some available space- Returns:
- Number of bytes transferred.
-
xxhash
public abstract long xxhash()
Only guaranteed to be valid after all content has been consumed.- Returns:
- xx64hash of content
-
size
public abstract long size()
The size of the content in bytes- Returns:
- number of bytes
-
close
public abstract void close()
Close underlying files
-
-