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 |
Constructor and Description |
---|
TierObjectMetadata(TierSegmentUploadInitiate uploadInitiate,
boolean includeCompactionFields,
boolean includeFtpsCleanupField) |
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 includeFtpsCleanupField,
long stateChangeTimestamp) |
TierObjectMetadata(TopicIdPartition topicIdPartition,
TierPartitionStateEntry metadata) |
Modifier and Type | Method and Description |
---|---|
long |
baseOffset() |
long |
endOffset() |
boolean |
equals(Object o) |
long |
firstBatchTimestamp() |
void |
forceMutateState(TierObjectMetadata.State newState)
To mutate state without canTransitionTo rules checking.
|
boolean |
hasAbortedTxns() |
boolean |
hasEpochState() |
int |
hashCode() |
boolean |
hasProducerState() |
static int |
initialBufferSize() |
boolean |
isEligibleForCleanup(long maxDeleteTimestampForCleanup,
boolean cleanupFeatureFlag) |
long |
maxTimestamp() |
TierObjectMetadata |
maybeMigrateFormat(long currentTimeMs,
boolean compactFeatureFlag,
boolean cleanupFeatureFlag)
Migrate metadata to backfill stateChangeTimestamp.
|
void |
mutateState(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() |
long |
stateChangeTimestamp() |
int |
tierEpoch() |
TopicIdPartition |
topicIdPartition() |
String |
toString() |
TierUploadType |
uploadType() |
short |
version() |
public static final long DEFAULT_STATE_CHANGE_TIMESTAMP
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 includeFtpsCleanupField, long stateChangeTimestamp)
public TierObjectMetadata(TierSegmentUploadInitiate uploadInitiate, boolean includeCompactionFields, boolean includeFtpsCleanupField)
public static int initialBufferSize()
public TopicIdPartition topicIdPartition()
public ByteBuffer payloadBuffer()
public int payloadSize()
public int tierEpoch()
public long baseOffset()
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 maybeMigrateFormat(long currentTimeMs, boolean compactFeatureFlag, boolean cleanupFeatureFlag)
TierObjectMetadata.State.SEGMENT_DELETE_COMPLETE
.
Metadata in other status will be backfilled with a dummy value DEFAULT_STATE_CHANGE_TIMESTAMP
.
Return the metadata itself if stateChangeTimestamp is already present.public boolean isEligibleForCleanup(long maxDeleteTimestampForCleanup, boolean cleanupFeatureFlag)