Package com.github.ambry.cloud.azure
Class CosmosDataAccessor
- java.lang.Object
-
- com.github.ambry.cloud.azure.CosmosDataAccessor
-
public class CosmosDataAccessor extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COSMOS_LAST_UPDATED_COLUMN
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
deprecateContainers(java.util.Set<CosmosContainerDeletionEntry> deprecatedContainers)
Add theCosmosContainerDeletionEntry
for newly deprecatedContainer
s to cosmos table.java.util.Set<CosmosContainerDeletionEntry>
getDeprecatedContainers(int maxEntries)
Fetch aSet
ofCosmosContainerDeletionEntry
objects from cosmos db that are not marked as deleted.java.lang.String
queryChangeFeed(java.lang.String requestContinuationToken, int maxFeedSize, java.util.List<CloudBlobMetadata> changeFeed, java.lang.String partitionPath, com.codahale.metrics.Timer timer)
Query Cosmos change feed to get the next set ofCloudBlobMetadata
objects in specifiedpartitionPath
afterrequestContinationToken
, capped by specifiedmaxFeedSize
representing the max number of items to be queried from the change feed.
-
-
-
Field Detail
-
COSMOS_LAST_UPDATED_COLUMN
public static final java.lang.String COSMOS_LAST_UPDATED_COLUMN
- See Also:
- Constant Field Values
-
-
Method Detail
-
queryChangeFeed
public java.lang.String queryChangeFeed(java.lang.String requestContinuationToken, int maxFeedSize, java.util.List<CloudBlobMetadata> changeFeed, java.lang.String partitionPath, com.codahale.metrics.Timer timer) throws com.microsoft.azure.cosmosdb.DocumentClientException
Query Cosmos change feed to get the next set ofCloudBlobMetadata
objects in specifiedpartitionPath
afterrequestContinationToken
, capped by specifiedmaxFeedSize
representing the max number of items to be queried from the change feed.- Parameters:
requestContinuationToken
- Continuation token after which change feed is requested.maxFeedSize
- max item count to be requested in the feed query.changeFeed
-CloudBlobMetadata
List
to be populated with the next set of entries returned by change feed query.partitionPath
- partition for which the change feed is requested.timer
- theTimer
to use to record query time (excluding waiting).- Returns:
- next continuation token.
- Throws:
com.microsoft.azure.cosmosdb.DocumentClientException
-
deprecateContainers
public long deprecateContainers(java.util.Set<CosmosContainerDeletionEntry> deprecatedContainers) throws com.microsoft.azure.cosmosdb.DocumentClientException
Add theCosmosContainerDeletionEntry
for newly deprecatedContainer
s to cosmos table.- Parameters:
deprecatedContainers
-Set
of deletedCosmosContainerDeletionEntry
s.- Returns:
- the max deletion trigger time of all the added containers to serve as checkpoint for future update.
- Throws:
com.microsoft.azure.cosmosdb.DocumentClientException
-
getDeprecatedContainers
public java.util.Set<CosmosContainerDeletionEntry> getDeprecatedContainers(int maxEntries) throws com.microsoft.azure.cosmosdb.DocumentClientException
Fetch aSet
ofCosmosContainerDeletionEntry
objects from cosmos db that are not marked as deleted.- Parameters:
maxEntries
- Max number of entries to fetch on one query.- Returns:
Set
ofCosmosContainerDeletionEntry
objects.- Throws:
com.microsoft.azure.cosmosdb.DocumentClientException
- in case of any error.
-
-