Package com.github.ambry.store
Class MessageInfo
- java.lang.Object
-
- com.github.ambry.store.MessageInfo
-
public class MessageInfo extends java.lang.Object
A message info class that contains basic info about a message
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MessageInfo.Builder
A builder class forMessageInfo
.
-
Field Summary
Fields Modifier and Type Field Description static short
LIFE_VERSION_FROM_FRONTEND
-
Constructor Summary
Constructors Constructor Description MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, boolean undeleted, long expirationTimeInMs, java.lang.Long crc, short accountId, short containerId, long operationTimeMs, short lifeVersion)
Construct an instance of MessageInfo.MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, boolean undeleted, short accountId, short containerId, long operationTimeMs, short lifeVersion)
Construct an instance of MessageInfo.MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, long expirationTimeInMs, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, long expirationTimeInMs, java.lang.Long crc, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.MessageInfo(StoreKey key, long size, long expirationTimeInMs, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.MessageInfo(StoreKey key, long size, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.MessageInfo(StoreKey key, long size, short accountId, short containerId, long operationTimeMs, short lifeVersion)
Construct an instance of MessageInfo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
short
getAccountId()
short
getContainerId()
java.lang.Long
getCrc()
long
getExpirationTimeInMs()
short
getLifeVersion()
long
getOperationTimeMs()
long
getSize()
Get size of message in bytesStoreKey
getStoreKey()
int
hashCode()
boolean
isDeleted()
boolean
isExpired()
boolean
isTtlUpdated()
boolean
isUndeleted()
java.lang.String
toString()
-
-
-
Field Detail
-
LIFE_VERSION_FROM_FRONTEND
public static final short LIFE_VERSION_FROM_FRONTEND
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MessageInfo
public MessageInfo(StoreKey key, long size, long expirationTimeInMs, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.- Parameters:
key
- theStoreKey
associated with this message.size
- the size of this message in bytes.expirationTimeInMs
- the time at which the message will expire. A value of -1 means no expiration.accountId
- accountId of the blobcontainerId
- containerId of the bloboperationTimeMs
- operation time in ms
-
MessageInfo
public MessageInfo(StoreKey key, long size, short accountId, short containerId, long operationTimeMs, short lifeVersion)
Construct an instance of MessageInfo.- Parameters:
key
- theStoreKey
associated with this message.size
- the size of this message in bytes.accountId
- accountId of the blobcontainerId
- containerId of the bloboperationTimeMs
- operation time in mslifeVersion
- update version of update
-
MessageInfo
public MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.- Parameters:
key
- theStoreKey
associated with this message.size
- the size of this message in bytes.deleted
-true
if the message is deleted,false
otherwisettlUpdated
-true
if the message's ttl has been updated,false
otherwiseaccountId
- accountId of the blobcontainerId
- containerId of the bloboperationTimeMs
- operation time in ms
-
MessageInfo
public MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, boolean undeleted, short accountId, short containerId, long operationTimeMs, short lifeVersion)
Construct an instance of MessageInfo.- Parameters:
key
- theStoreKey
associated with this message.size
- the size of this message in bytes.deleted
-true
if the message is deleted,false
otherwisettlUpdated
-true
if the message's ttl has been updated,false
otherwiseundeleted
-true
if the message is undeleted,false
otherwiseaccountId
- accountId of the blobcontainerId
- containerId of the bloboperationTimeMs
- operation time in mslifeVersion
- update version of update
-
MessageInfo
public MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, long expirationTimeInMs, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.- Parameters:
key
- theStoreKey
associated with this message.size
- the size of this message in bytes.deleted
-true
if the message is deleted,false
otherwisettlUpdated
-true
if the message's ttl has been updated,false
otherwiseexpirationTimeInMs
- the time at which the message will expire. A value of -1 means no expiration.accountId
- accountId of the blobcontainerId
- containerId of the bloboperationTimeMs
- operation time in ms
-
MessageInfo
public MessageInfo(StoreKey key, long size, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.- Parameters:
key
- theStoreKey
associated with this message.size
- the size of this message in bytes.accountId
- accountId of the blobcontainerId
- containerId of the bloboperationTimeMs
- operation time in ms
-
MessageInfo
public MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, long expirationTimeInMs, java.lang.Long crc, short accountId, short containerId, long operationTimeMs)
Construct an instance of MessageInfo.- Parameters:
key
- theStoreKey
associated with this message.size
- the size of this message in bytes.deleted
-true
if the message is deleted,false
otherwisettlUpdated
-true
if the message's ttl has been updated,false
otherwiseexpirationTimeInMs
- the time at which the message will expire. A value of -1 means no expiration.crc
- the crc associated with this message. If unavailable, pass in null.accountId
- accountId of the blobcontainerId
- containerId of the bloboperationTimeMs
- operation time in ms
-
MessageInfo
public MessageInfo(StoreKey key, long size, boolean deleted, boolean ttlUpdated, boolean undeleted, long expirationTimeInMs, java.lang.Long crc, short accountId, short containerId, long operationTimeMs, short lifeVersion)
Construct an instance of MessageInfo.- Parameters:
key
- theStoreKey
associated with this message.size
- the size of this message in bytes.deleted
-true
if the message is deleted,false
otherwisettlUpdated
-true
if the message's ttl has been updated,false
otherwiseexpirationTimeInMs
- the time at which the message will expire. A value of -1 means no expiration.crc
- the crc associated with this message. If unavailable, pass in null.accountId
- accountId of the blobcontainerId
- containerId of the bloboperationTimeMs
- operation time in mslifeVersion
- update version of update
-
-
Method Detail
-
getStoreKey
public StoreKey getStoreKey()
-
getSize
public long getSize()
Get size of message in bytes- Returns:
- size in bytes
-
getExpirationTimeInMs
public long getExpirationTimeInMs()
-
isDeleted
public boolean isDeleted()
-
isTtlUpdated
public boolean isTtlUpdated()
- Returns:
true
if the message's ttl has been updated,false
otherwise
-
isUndeleted
public boolean isUndeleted()
-
isExpired
public boolean isExpired()
-
getCrc
public java.lang.Long getCrc()
- Returns:
- the crc associated with this message, if there is one; null otherwise.
-
getAccountId
public short getAccountId()
-
getContainerId
public short getContainerId()
-
getOperationTimeMs
public long getOperationTimeMs()
-
getLifeVersion
public short getLifeVersion()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-