private CacheEntry update(RoutingContext ctx) {
        String key = getCacheKey(ctx);
        CacheEntry entry = cache.get(key);
        if (entry == null) {
            entry = new CacheEntry();
            cache.put(key, entry);
        }

        int upd = ctx.getMirror().updates();
        if (entry.generation != upd) {
            entry.generation = upd;
            entry.recipients.clear();

            List<Mirror.Entry> arr = ctx.getMirror().lookup(ctx.getHopPrefix() + "*" + ctx.getHopSuffix());
            int pos = ctx.getMessageBus().getConnectionSpec().hashCode();
            for (int i = 0; i < subsetSize && i < arr.size(); ++i) {
                entry.recipients.add(Hop.parse(arr.get(((pos + i) & Integer.MAX_VALUE) % arr.size()).getName()));
            }
        }
        return entry;
    }
Updates and returns the cache entry for the given routing context. This method assumes that synchronization is
handled outside of it.

@param ctx The routing context.
@return The updated cache entry.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/SubsetServicePolicy.java