Skip to content
Prev Previous commit
Next Next commit
Adding ConsolidatedLocationEndpoints to encapsulate thin proxy locati…
…on endpoint and gateway location endpoint.
  • Loading branch information
jeet1995 committed Feb 1, 2025
commit bf2a3b9ca5d43a4eae636bb0a879b0c9bdf8b813

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ public void openConnectionsAndInitCachesWithContainer(ProactiveConnectionManagem

cosmosAsyncContainer.openConnectionsAndInitCaches(proactiveConnectionRegionCount).block();

UnmodifiableList<LocationCache.ConsolidatedLocationEndpoints> readEndpoints =
UnmodifiableList<LocationCache.ConsolidatedRegionalEndpoint> readEndpoints =
globalEndpointManager.getReadEndpoints();

List<URI> proactiveConnectionEndpoints = readEndpoints.subList(
0,
Math.min(readEndpoints.size(),proactiveContainerInitConfig.getProactiveConnectionRegionsCount()))
.stream().map(LocationCache.ConsolidatedLocationEndpoints::getGatewayLocationEndpoint).collect(Collectors.toList());
.stream().map(LocationCache.ConsolidatedRegionalEndpoint::getGatewayLocationEndpoint).collect(Collectors.toList());

Mono<CosmosAsyncContainer> asyncContainerMono = Mono.just(cosmosAsyncContainer);

Expand Down Expand Up @@ -345,13 +345,13 @@ public void openConnectionsAndInitCachesWithCosmosClient_And_PerContainerConnect
ConcurrentHashMap<String, ?> routingMap = getRoutingMap(rxDocumentClient);
ConcurrentHashMap<String, ?> collectionInfoByNameMap = getCollectionInfoByNameMap(rxDocumentClient);
Set<String> endpoints = ConcurrentHashMap.newKeySet();
UnmodifiableList<LocationCache.ConsolidatedLocationEndpoints> readEndpoints = globalEndpointManager.getReadEndpoints();
UnmodifiableList<LocationCache.ConsolidatedRegionalEndpoint> readEndpoints = globalEndpointManager.getReadEndpoints();

List<URI> proactiveConnectionEndpoints = readEndpoints.subList(
0,
Math.min(readEndpoints.size(), proactiveContainerInitConfig.getProactiveConnectionRegionsCount()))
.stream()
.map(LocationCache.ConsolidatedLocationEndpoints::getGatewayLocationEndpoint)
.map(LocationCache.ConsolidatedRegionalEndpoint::getGatewayLocationEndpoint)
.collect(Collectors.toList());

Flux<CosmosAsyncContainer> asyncContainerFlux = Flux.fromIterable(asyncContainers);
Expand Down Expand Up @@ -495,12 +495,12 @@ public void openConnectionsAndInitCachesWithCosmosClient_And_PerContainerConnect
ConcurrentHashMap<String, ?> routingMap = getRoutingMap(rxDocumentClient);
ConcurrentHashMap<String, ?> collectionInfoByNameMap = getCollectionInfoByNameMap(rxDocumentClient);
Set<String> endpoints = ConcurrentHashMap.newKeySet();
UnmodifiableList<LocationCache.ConsolidatedLocationEndpoints> readEndpoints = globalEndpointManager.getReadEndpoints();
UnmodifiableList<LocationCache.ConsolidatedRegionalEndpoint> readEndpoints = globalEndpointManager.getReadEndpoints();
List<URI> proactiveConnectionEndpoints = readEndpoints.subList(
0,
Math.min(readEndpoints.size(), proactiveContainerInitConfig.getProactiveConnectionRegionsCount()))
.stream()
.map(LocationCache.ConsolidatedLocationEndpoints::getGatewayLocationEndpoint)
.map(LocationCache.ConsolidatedRegionalEndpoint::getGatewayLocationEndpoint)
.collect(Collectors.toList());;

Flux<CosmosAsyncContainer> asyncContainerFlux = Flux.fromIterable(asyncContainers);
Expand Down Expand Up @@ -666,12 +666,12 @@ public void openConnectionsAndInitCachesWithCosmosClient_And_PerContainerConnect
ConcurrentHashMap<String, ?> routingMap = getRoutingMap(rxDocumentClient);
ConcurrentHashMap<String, ?> collectionInfoByNameMap = getCollectionInfoByNameMap(rxDocumentClient);
Set<String> endpoints = ConcurrentHashMap.newKeySet();
UnmodifiableList<LocationCache.ConsolidatedLocationEndpoints> readEndpoints = globalEndpointManager.getReadEndpoints();
UnmodifiableList<LocationCache.ConsolidatedRegionalEndpoint> readEndpoints = globalEndpointManager.getReadEndpoints();
List<URI> proactiveConnectionEndpoints = readEndpoints.subList(
0,
Math.min(readEndpoints.size(), proactiveContainerInitConfig.getProactiveConnectionRegionsCount()))
.stream()
.map(LocationCache.ConsolidatedLocationEndpoints::getGatewayLocationEndpoint)
.map(LocationCache.ConsolidatedRegionalEndpoint::getGatewayLocationEndpoint)
.collect(Collectors.toList());;

Flux<CosmosAsyncContainer> asyncContainerFlux = Flux.fromIterable(asyncContainers);
Expand Down
Loading