All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.palantir.atlasdb.timelock.api.management.DialogueTimeLockManagementEndpoints Maven / Gradle / Ivy

There is a newer version: 0.1152.0
Show newest version
package com.palantir.atlasdb.timelock.api.management;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ListMultimap;
import com.palantir.dialogue.Endpoint;
import com.palantir.dialogue.HttpMethod;
import com.palantir.dialogue.PathTemplate;
import com.palantir.dialogue.UrlBuilder;
import java.lang.Override;
import java.lang.String;
import java.util.Optional;
import java.util.Set;
import javax.annotation.processing.Generated;

@Generated("com.palantir.conjure.java.services.dialogue.DialogueEndpointsGenerator")
enum DialogueTimeLockManagementEndpoints implements Endpoint {
    /**
     * The endpoint loads all persisted namespaces. leaderPaxos is filtered out from the set as it is not a
     * namespace. No transactionality guarantees are given: namespace additions and deletions while the request is
     * running may or may not be reflected in the output.
     */
    getNamespaces {
        private final PathTemplate pathTemplate = PathTemplate.builder()
                .fixed("tl")
                .fixed("management")
                .fixed("getNamespaces")
                .build();

        @Override
        public void renderPath(ListMultimap params, UrlBuilder url) {
            pathTemplate.fill(params, url);
        }

        @Override
        public HttpMethod httpMethod() {
            return HttpMethod.POST;
        }

        @Override
        public String serviceName() {
            return "TimeLockManagementService";
        }

        @Override
        public String endpointName() {
            return "getNamespaces";
        }

        @Override
        public String version() {
            return VERSION;
        }
    },

    /**
     * The endpoint loads all namespaces with new timestamps since the last restart. leaderPaxos is
     * filtered out from the set as it is not a namespace.
     */
    getActiveNamespaces {
        private final PathTemplate pathTemplate = PathTemplate.builder()
                .fixed("tl")
                .fixed("management")
                .fixed("getActiveNamespaces")
                .build();

        @Override
        public void renderPath(ListMultimap params, UrlBuilder url) {
            pathTemplate.fill(params, url);
        }

        @Override
        public HttpMethod httpMethod() {
            return HttpMethod.POST;
        }

        @Override
        public String serviceName() {
            return "TimeLockManagementService";
        }

        @Override
        public String endpointName() {
            return "getActiveNamespaces";
        }

        @Override
        public String version() {
            return VERSION;
        }
    },

    /**
     * The operation of achieving consensus on all namespaces is NOT atomic. In the case of failures, it can be assumed
     * that consensus was achieved on some namespaces.
     */
    achieveConsensus {
        private final PathTemplate pathTemplate = PathTemplate.builder()
                .fixed("tl")
                .fixed("management")
                .fixed("achieveConsensus")
                .build();

        @Override
        public void renderPath(ListMultimap params, UrlBuilder url) {
            pathTemplate.fill(params, url);
        }

        @Override
        public HttpMethod httpMethod() {
            return HttpMethod.POST;
        }

        @Override
        public String serviceName() {
            return "TimeLockManagementService";
        }

        @Override
        public String endpointName() {
            return "achieveConsensus";
        }

        @Override
        public String version() {
            return VERSION;
        }
    },

    /**
     * Invalidates existing resources for a given TimeLock namespace in a persistant way, until re-enabled. Does not
     * actually cause a leader election, and should not interrupt service for other naemspaces. Note that this operation
     * is atomic for each namespace (e.g. users will not see two different lock services servicing the same
     * startTransactions request), but not atomic as a whole. Additionally, if this method throws, it is
     * nondeterministic which, if any, namespaces have been invalidated; some may even be invalidated only on a subset
     * of nodes. This state can be cleared by re-enabling all namespaces.
     */
    invalidateResources {
        private final PathTemplate pathTemplate = PathTemplate.builder()
                .fixed("tl")
                .fixed("management")
                .fixed("invalidateResources")
                .build();

        @Override
        public void renderPath(ListMultimap params, UrlBuilder url) {
            pathTemplate.fill(params, url);
        }

        @Override
        public HttpMethod httpMethod() {
            return HttpMethod.POST;
        }

        @Override
        public String serviceName() {
            return "TimeLockManagementService";
        }

        @Override
        public String endpointName() {
            return "invalidateResources";
        }

        @Override
        public String version() {
            return VERSION;
        }
    },

    /** Gets the randomly generated server id associated with the server's current lifecycle upon start up. */
    getServerLifecycleId {
        private final PathTemplate pathTemplate = PathTemplate.builder()
                .fixed("tl")
                .fixed("management")
                .fixed("getServerLifecycleId")
                .build();

        @Override
        public void renderPath(ListMultimap params, UrlBuilder url) {
            pathTemplate.fill(params, url);
        }

        @Override
        public HttpMethod httpMethod() {
            return HttpMethod.POST;
        }

        @Override
        public String serviceName() {
            return "TimeLockManagementService";
        }

        @Override
        public String endpointName() {
            return "getServerLifecycleId";
        }

        @Override
        public String version() {
            return VERSION;
        }
    },

    /**
     * Kills TimeLock server asynchronously i.e. current server will not be able to talk to peer nodes or serve requests
     * once the task is executed. After hitting this endpoint, the server will require external intervention to start up
     * the service again. The endpoint returns the (randomly generated) server id associated with server upon start up.
     * A client can then make getServerId requests wherein change in server id would imply that the server
     * was bounced.
     */
    forceKillTimeLockServer {
        private final PathTemplate pathTemplate = PathTemplate.builder()
                .fixed("tl")
                .fixed("management")
                .fixed("forceKillTimeLockServer")
                .build();

        @Override
        public void renderPath(ListMultimap params, UrlBuilder url) {
            pathTemplate.fill(params, url);
        }

        @Override
        public HttpMethod httpMethod() {
            return HttpMethod.POST;
        }

        @Override
        public String serviceName() {
            return "TimeLockManagementService";
        }

        @Override
        public String endpointName() {
            return "forceKillTimeLockServer";
        }

        @Override
        public String version() {
            return VERSION;
        }
    },

    /**
     * Updates the timestamp service to the currentTimestamp to ensure that all fresh timestamps issued after this
     * request are greater than the current timestamp. The caller of this is responsible for not using any of the fresh
     * timestamps previously served to it, and must call getFreshTimestamps() to ensure it is using timestamps after the
     * fastforward point.
     */
    fastForwardTimestamp {
        private final PathTemplate pathTemplate = PathTemplate.builder()
                .fixed("tl")
                .fixed("management")
                .fixed("fastForward")
                .build();

        private final ImmutableSet tags = ImmutableSet.of("server-request-context");

        @Override
        public void renderPath(ListMultimap params, UrlBuilder url) {
            pathTemplate.fill(params, url);
        }

        @Override
        public HttpMethod httpMethod() {
            return HttpMethod.POST;
        }

        @Override
        public String serviceName() {
            return "TimeLockManagementService";
        }

        @Override
        public String endpointName() {
            return "fastForwardTimestamp";
        }

        @Override
        public String version() {
            return VERSION;
        }

        @Override
        public Set tags() {
            return tags;
        }
    };

    private static final String VERSION = Optional.ofNullable(
                    DialogueTimeLockManagementEndpoints.class.getPackage().getImplementationVersion())
            .orElse("0.0.0");
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy