Package com.github.ambry.cloud.azure
Class CosmosUpdateTimeFindToken
- java.lang.Object
-
- com.github.ambry.cloud.azure.CosmosUpdateTimeFindToken
-
- All Implemented Interfaces:
com.github.ambry.replication.FindToken
public class CosmosUpdateTimeFindToken extends java.lang.Object implements com.github.ambry.replication.FindToken
FindToken
object to act as bookmark for replication based on Cosmos update time field.
-
-
Constructor Summary
Constructors Constructor Description CosmosUpdateTimeFindToken()
Constructor for start tokenCosmosUpdateTimeFindToken(long lastUpdateTime, long bytesRead, java.util.Set<java.lang.String> lastUpdateTimeReadBlobIds)
Constructor for in-progress tokenCosmosUpdateTimeFindToken(short version, long lastUpdateTime, long bytesRead, java.util.Set<java.lang.String> lastUpdateTimeReadBlobIds)
Constructor for reading token that can have older version
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
long
getBytesRead()
long
getLastUpdateTime()
ReturnlastUpdateTime
.java.util.Set<java.lang.String>
getLastUpdateTimeReadBlobIds()
ReturnlastUpdateTimeReadBlobIds
com.github.ambry.replication.FindTokenType
getType()
static CosmosUpdateTimeFindToken
getUpdatedToken(CosmosUpdateTimeFindToken prevToken, java.util.List<CloudBlobMetadata> queryResults)
Utility to construct a new CloudFindToken from a previous instance and the results of a findEntriesSince query.short
getVersion()
int
hashCode()
byte[]
toBytes()
java.lang.String
toString()
-
-
-
Constructor Detail
-
CosmosUpdateTimeFindToken
public CosmosUpdateTimeFindToken()
Constructor for start token
-
CosmosUpdateTimeFindToken
public CosmosUpdateTimeFindToken(long lastUpdateTime, long bytesRead, java.util.Set<java.lang.String> lastUpdateTimeReadBlobIds)
Constructor for in-progress token
-
CosmosUpdateTimeFindToken
public CosmosUpdateTimeFindToken(short version, long lastUpdateTime, long bytesRead, java.util.Set<java.lang.String> lastUpdateTimeReadBlobIds)
Constructor for reading token that can have older version
-
-
Method Detail
-
getUpdatedToken
public static CosmosUpdateTimeFindToken getUpdatedToken(CosmosUpdateTimeFindToken prevToken, java.util.List<CloudBlobMetadata> queryResults)
Utility to construct a new CloudFindToken from a previous instance and the results of a findEntriesSince query.- Parameters:
prevToken
- previousCosmosUpdateTimeFindToken
.queryResults
- List ofCloudBlobMetadata
objects.- Returns:
- the updated token.
-
toBytes
public byte[] toBytes()
- Specified by:
toBytes
in interfacecom.github.ambry.replication.FindToken
-
getBytesRead
public long getBytesRead()
- Specified by:
getBytesRead
in interfacecom.github.ambry.replication.FindToken
-
getLastUpdateTime
public long getLastUpdateTime()
ReturnlastUpdateTime
.- Returns:
lastUpdateTime
-
getLastUpdateTimeReadBlobIds
public java.util.Set<java.lang.String> getLastUpdateTimeReadBlobIds()
ReturnlastUpdateTimeReadBlobIds
- Returns:
lastUpdateTimeReadBlobIds
-
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
-
getType
public com.github.ambry.replication.FindTokenType getType()
- Specified by:
getType
in interfacecom.github.ambry.replication.FindToken
-
getVersion
public short getVersion()
- Specified by:
getVersion
in interfacecom.github.ambry.replication.FindToken
-
-