Package com.github.ambry.cloud.azure
Class CosmosUpdateTimeBasedReplicationFeed
- java.lang.Object
-
- com.github.ambry.cloud.azure.CosmosUpdateTimeBasedReplicationFeed
-
- All Implemented Interfaces:
AzureReplicationFeed
,java.io.Closeable
,java.lang.AutoCloseable
public class CosmosUpdateTimeBasedReplicationFeed extends java.lang.Object implements AzureReplicationFeed
The replication feed that provides next list of blobs to replicate from Azure and correspondingFindToken
using Cosmos update time field.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.ambry.cloud.azure.AzureReplicationFeed
AzureReplicationFeed.FeedType
-
-
Constructor Summary
Constructors Constructor Description CosmosUpdateTimeBasedReplicationFeed(CosmosDataAccessor cosmosDataAccessor, AzureMetrics azureMetrics, int queryBatchSize)
Constructor forCosmosUpdateTimeBasedReplicationFeed
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
FindResult
getNextEntriesAndUpdatedToken(com.github.ambry.replication.FindToken curfindToken, long maxTotalSizeOfEntries, java.lang.String partitionPath)
Returns an ordered sequenced list of blobs within the specified partition and updatedFindToken
, such that total size of all blobs in the list are less or equal tomaxTotalSizeOfEntries
.
-
-
-
Constructor Detail
-
CosmosUpdateTimeBasedReplicationFeed
public CosmosUpdateTimeBasedReplicationFeed(CosmosDataAccessor cosmosDataAccessor, AzureMetrics azureMetrics, int queryBatchSize)
Constructor forCosmosUpdateTimeBasedReplicationFeed
object.- Parameters:
cosmosDataAccessor
-CosmosDataAccessor
object to run Cosmos change feed queries.azureMetrics
-AzureMetrics
object.queryBatchSize
- batch size for each find since query.
-
-
Method Detail
-
getNextEntriesAndUpdatedToken
public FindResult getNextEntriesAndUpdatedToken(com.github.ambry.replication.FindToken curfindToken, long maxTotalSizeOfEntries, java.lang.String partitionPath) throws com.microsoft.azure.cosmosdb.DocumentClientException
Description copied from interface:AzureReplicationFeed
Returns an ordered sequenced list of blobs within the specified partition and updatedFindToken
, such that total size of all blobs in the list are less or equal tomaxTotalSizeOfEntries
. This method should return at least one blob, if exists, aftercurfindToken
, irrespective ofmaxTotalSizeOfEntries
requirement.- Specified by:
getNextEntriesAndUpdatedToken
in interfaceAzureReplicationFeed
- Parameters:
curfindToken
- currentFindToken
object that acts as a bookmark to return blobs after.maxTotalSizeOfEntries
- max total size of all theCloudBlobMetadata
objects returned.partitionPath
- partition of the blobs.- Returns:
FindResult
instance that contains updatedFindToken
object which can act as a bookmark for subsequent requests, andList
ofCloudBlobMetadata
entries.- Throws:
com.microsoft.azure.cosmosdb.DocumentClientException
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-