Class CosmosDataAccessor


  • public class CosmosDataAccessor
    extends java.lang.Object
    • 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 of CloudBlobMetadata objects in specified partitionPath after requestContinationToken, capped by specified maxFeedSize 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 - the Timer 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 the CosmosContainerDeletionEntry for newly deprecated Containers to cosmos table.
        Parameters:
        deprecatedContainers - Set of deleted CosmosContainerDeletionEntrys.
        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 a Set of CosmosContainerDeletionEntry objects from cosmos db that are not marked as deleted.
        Parameters:
        maxEntries - Max number of entries to fetch on one query.
        Returns:
        Set of CosmosContainerDeletionEntry objects.
        Throws:
        com.microsoft.azure.cosmosdb.DocumentClientException - in case of any error.