Class SegmentBlob
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.SegmentBlob
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object object)@Nullable StringgetBlobId()static Iterable<SegmentId>getBulkSegmentIds(Blob blob)StringgetContentIdentity()A unique identifier of the content of this value.@NotNull GCGenerationgetGcGeneration()Get the underlying segment's gc generation.@NotNull InputStreamgetNewStream()Returns a new stream for this blob.RecordIdgetRecordId()Returns the identifier of this record.protected intgetRecordNumber()@Nullable StringgetReference()Returns a secure reference to this blob, ornullif such a reference is not available.protected SegmentgetSegment()Returns the segment that contains this record.inthashCode()booleanisExternal()booleanisInlined()Checks if the external blob is inlined in the id itselflonglength()Returns the length of this blob or -1 if unknown.static @Nullable StringreadBlobId(@NotNull Segment segment, int recordNumber)static @Nullable StringreadBlobId(@NotNull Segment segment, int recordNumber, Map<SegmentId,Segment> recoveredSegments)StringtoString()
-
-
-
Method Detail
-
getNewStream
@NotNull public @NotNull InputStream getNewStream()
Description copied from interface:BlobReturns a new stream for this blob. The streams returned from multiple calls to this method are byte wise equals. That is, subsequent calls toreadreturn the same sequence of bytes as long as neither call throws an exception.- Specified by:
getNewStreamin interfaceBlob- Returns:
- a new stream for this blob
-
length
public long length()
Description copied from interface:BlobReturns the length of this blob or -1 if unknown.
-
getReference
@Nullable public @Nullable String getReference()
Description copied from interface:BlobReturns a secure reference to this blob, ornullif such a reference is not available.- Specified by:
getReferencein interfaceBlob- Returns:
- binary reference, or
null - See Also:
- OAK-834
-
getContentIdentity
public String getContentIdentity()
Description copied from interface:BlobA unique identifier of the content of this value. Usually this is a message digest of the content (a cryptographically secure one-way hash). This allows to avoid processing large binary values multiple times.This method returns null if the identifier is unknown. The identifier may not always be available, for example if the value has not yet been saved or processed. Once an identifier is available, it will never change because values are immutable.
If two values have the same identifier, the content of the value is guaranteed to be the same. However it is not guaranteed that two values with the same content will return the same identifier.
The identifier is opaque, meaning it can have any format and size.
- Specified by:
getContentIdentityin interfaceBlob- Returns:
- the unique identifier or null
-
isInlined
public boolean isInlined()
Description copied from interface:BlobChecks if the external blob is inlined in the id itself
-
isExternal
public boolean isExternal()
-
getBlobId
@Nullable public @Nullable String getBlobId()
-
readBlobId
@Nullable public static @Nullable String readBlobId(@NotNull @NotNull Segment segment, int recordNumber)
-
readBlobId
@Nullable public static @Nullable String readBlobId(@NotNull @NotNull Segment segment, int recordNumber, Map<SegmentId,Segment> recoveredSegments)
-
equals
public boolean equals(Object object)
-
hashCode
public int hashCode()
-
getSegment
protected Segment getSegment()
Returns the segment that contains this record.- Returns:
- segment that contains this record
-
getRecordNumber
protected int getRecordNumber()
-
getRecordId
public RecordId getRecordId()
Returns the identifier of this record.- Returns:
- record identifier
-
getGcGeneration
@NotNull public @NotNull GCGeneration getGcGeneration()
Get the underlying segment's gc generation. Might cause the segment to get loaded if the generation info is missing- Returns:
- the segment's gc generation
-
-