private CollectionRoutingMap getCollectionRoutingMap()

in bulkimport/src/main/java/com/microsoft/azure/documentdb/bulkimport/DocumentBulkImporter.java [558:573]


    private CollectionRoutingMap getCollectionRoutingMap(DocumentClient client) {
        List<ImmutablePair<PartitionKeyRange, Boolean>> ranges = new ArrayList<>();

        for (PartitionKeyRange range : client.readPartitionKeyRanges(this.collectionLink, (FeedOptions) null).getQueryIterable().toList()) {
            ranges.add(new ImmutablePair<>(range, true));
        }

        CollectionRoutingMap routingMap = InMemoryCollectionRoutingMap.tryCreateCompleteRoutingMap(ranges,
                StringUtils.EMPTY);

        if (routingMap == null) {
            throw new IllegalStateException("Cannot create complete routing map");
        }

        return routingMap;
    }