
com.yahoo.vespa.hosted.provision.provisioning.ArchiveUris Maven / Gradle / Ivy
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.provision.provisioning;
import com.yahoo.config.provision.TenantName;
import com.yahoo.lang.CachedSupplier;
import com.yahoo.vespa.curator.Lock;
import com.yahoo.vespa.hosted.provision.Node;
import com.yahoo.vespa.hosted.provision.node.Allocation;
import com.yahoo.vespa.hosted.provision.persistence.CuratorDatabaseClient;
import java.time.Duration;
import java.util.Map;
import java.util.Optional;
import java.util.TreeMap;
import java.util.logging.Logger;
import java.util.regex.Pattern;
/**
* Thread safe class to get and set archive URI for given tenants. Archive URIs are stored in ZooKeeper so that
* nodes within the same tenant have the same archive URI from all the config servers.
*
* @author freva
*/
public class ArchiveUris {
private static final Logger log = Logger.getLogger(ArchiveUris.class.getName());
private static final Pattern validUriPattern = Pattern.compile("[a-z0-9]+://(?:(?:[a-z0-9]+(?:[-_][a-z0-9.]+)*)+/)+");
private static final Duration cacheTtl = Duration.ofMinutes(1);
private final CuratorDatabaseClient db;
private final CachedSupplier
© 2015 - 2025 Weber Informatics LLC | Privacy Policy