private static byte[] toBytes(PendingRestarts pendingRestarts) {
            Cursor root = new Slime().setObject();
            Cursor generationsArray = root.setArray(GENERATIONS);
            pendingRestarts.generationsForRestarts().forEach((generation, hostnames) -> {
                Cursor generationObject = generationsArray.addObject();
                generationObject.setLong(GENERATION, generation);
                hostnames.forEach(generationObject.setArray(HOSTNAMES)::addString);
            });
            return uncheck(() -> SlimeUtils.toJsonBytes(root));
        }
Sets up a listenable cache with the given listener, over the applications path of this tenant.
configserver/src/main/java/com/yahoo/vespa/config/server/application/ApplicationCuratorDatabase.java