public class TierObjectMetadata extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TierObjectMetadata.State |
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_STATE_CHANGE_TIMESTAMP |
static int |
UNKNOWN_VIRTUAL_OFFSET |
Constructor and Description |
---|
TierObjectMetadata(TierSegmentUploadInitiate uploadInitiate,
boolean includeCompactionFields,
boolean includeStateChangeTimestamp) |
TierObjectMetadata(TopicIdPartition topicIdPartition,
int tierEpoch,
UUID objectId,
long baseOffset,
long endOffset,
long maxTimestamp,
long firstBatchTimestamp,
int size,
TierObjectMetadata.State state,
boolean hasEpochState,
boolean hasAbortedTxns,
boolean hasProducerState,
TierUploadType uploadType,
TierObjectStore.OpaqueData opaqueData,
boolean includeCompactionFields,
boolean includeStateChangeTimestamp,
long stateChangeTimestamp) |
TierObjectMetadata(TopicIdPartition topicIdPartition,
int tierEpoch,
UUID objectId,
long baseOffset,
long virtualBaseOffset,
long endOffset,
long maxTimestamp,
long firstBatchTimestamp,
int size,
TierObjectMetadata.State state,
boolean hasEpochState,
boolean hasAbortedTxns,
boolean hasProducerState,
TierUploadType uploadType,
TierObjectStore.OpaqueData opaqueData,
boolean includeCompactionFields,
boolean includeStateChangeTimestamp,
long stateChangeTimestamp,
TierObjectMetadata.State stateBeforeDeletion) |
TierObjectMetadata(TopicIdPartition topicIdPartition,
TierPartitionStateEntry metadata) |
Modifier and Type | Method and Description |
---|---|
long |
baseOffset() |
boolean |
boundOverlappingOffset(long newVirtualBaseOffset) |
long |
endOffset() |
boolean |
equals(Object o) |
boolean |
equalsExcludingStateAndChangeTimestamp(TierObjectMetadata that)
Check that this TierObjectMetadata is equal to the provided TierObjectMetadata, excluding
the mutable state and state change timestamp fields.
|
long |
firstBatchTimestamp() |
void |
forceMutateState(TierObjectMetadata.State newState)
To mutate state without canTransitionTo rules checking.
|
boolean |
hasAbortedTxns() |
boolean |
hasEpochState() |
int |
hashCode() |
boolean |
hasProducerState() |
boolean |
hasStateBeforeDeletion() |
boolean |
hasVirtualOffset() |
static int |
initialBufferSize() |
boolean |
isEligibleForCleanup(long maxDeleteTimestampForCleanup,
boolean cleanupFeatureFlag) |
long |
maxTimestamp() |
TierObjectMetadata |
migrateFormat(long currentTimeMs,
boolean includeCompactionFields,
boolean includeStateChangeTimestamp)
Migrate metadata to latest format and backfill stateChangeTimestamp.
|
void |
mutateState(TierObjectMetadata.State newState) |
boolean |
mutateStateBeforeDeletion(TierObjectMetadata.State newState) |
boolean |
mutateStateChangeTimestamp(long newStateChangeTimestamp) |
UUID |
objectId()
Random ID associated with each TierObjectMetadata entry.
|
String |
objectIdAsBase64() |
TierObjectStore.OpaqueData |
opaqueData() |
ByteBuffer |
payloadBuffer()
Returns the internal Flatbuffers representation backing this TierObjectMetadata.
|
int |
payloadSize() |
int |
size() |
TierObjectMetadata.State |
state() |
TierObjectMetadata.State |
stateBeforeDeletion() |
long |
stateChangeTimestamp() |
int |
tierEpoch() |
TopicIdPartition |
topicIdPartition() |
String |
toString() |
TierUploadType |
uploadType() |
short |
version() |
long |
virtualBaseOffset() |
public static final long DEFAULT_STATE_CHANGE_TIMESTAMP
public static final int UNKNOWN_VIRTUAL_OFFSET
public TierObjectMetadata(TopicIdPartition topicIdPartition, TierPartitionStateEntry metadata)
public TierObjectMetadata(TopicIdPartition topicIdPartition, int tierEpoch, UUID objectId, long baseOffset, long endOffset, long maxTimestamp, long firstBatchTimestamp, int size, TierObjectMetadata.State state, boolean hasEpochState, boolean hasAbortedTxns, boolean hasProducerState, TierUploadType uploadType, TierObjectStore.OpaqueData opaqueData, boolean includeCompactionFields, boolean includeStateChangeTimestamp, long stateChangeTimestamp)
public TierObjectMetadata(TopicIdPartition topicIdPartition, int tierEpoch, UUID objectId, long baseOffset, long virtualBaseOffset, long endOffset, long maxTimestamp, long firstBatchTimestamp, int size, TierObjectMetadata.State state, boolean hasEpochState, boolean hasAbortedTxns, boolean hasProducerState, TierUploadType uploadType, TierObjectStore.OpaqueData opaqueData, boolean includeCompactionFields, boolean includeStateChangeTimestamp, long stateChangeTimestamp, TierObjectMetadata.State stateBeforeDeletion)
public TierObjectMetadata(TierSegmentUploadInitiate uploadInitiate, boolean includeCompactionFields, boolean includeStateChangeTimestamp)
public static int initialBufferSize()
public TopicIdPartition topicIdPartition()
public ByteBuffer payloadBuffer()
public int payloadSize()
public int tierEpoch()
public long baseOffset()
public long virtualBaseOffset()
public boolean hasVirtualOffset()
public boolean boundOverlappingOffset(long newVirtualBaseOffset)
public UUID objectId()
public String objectIdAsBase64()
public long endOffset()
public long maxTimestamp()
public long firstBatchTimestamp()
public int size()
public boolean hasEpochState()
public boolean hasAbortedTxns()
public TierObjectMetadata.State state()
public void mutateState(TierObjectMetadata.State newState)
public void forceMutateState(TierObjectMetadata.State newState)
newState
- the target state to transit topublic boolean hasProducerState()
public TierUploadType uploadType()
public TierObjectStore.OpaqueData opaqueData()
public short version()
public long stateChangeTimestamp()
public boolean mutateStateChangeTimestamp(long newStateChangeTimestamp)
public TierObjectMetadata.State stateBeforeDeletion()
public boolean mutateStateBeforeDeletion(TierObjectMetadata.State newState)
public boolean hasStateBeforeDeletion()
public TierObjectMetadata migrateFormat(long currentTimeMs, boolean includeCompactionFields, boolean includeStateChangeTimestamp)
TierObjectMetadata.State.SEGMENT_DELETE_COMPLETE
. Metadata in other status will be backfilled with a dummy value
DEFAULT_STATE_CHANGE_TIMESTAMP
.public boolean isEligibleForCleanup(long maxDeleteTimestampForCleanup, boolean cleanupFeatureFlag)
public boolean equalsExcludingStateAndChangeTimestamp(TierObjectMetadata that)