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

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

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

import com.palantir.conjure.java.lib.internal.ClientEndpoint;
import com.palantir.logsafe.Safe;
import com.palantir.tokens.auth.AuthHeader;
import java.util.Set;
import java.util.UUID;
import javax.annotation.processing.Generated;
import javax.ws.rs.Consumes;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/")
@Generated("com.palantir.conjure.java.services.JerseyServiceGenerator")
public interface TimeLockManagementService {
    /**
     * 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.
     */
    @POST
    @Path("tl/management/getNamespaces")
    @ClientEndpoint(method = "POST", path = "/tl/management/getNamespaces")
    Set getNamespaces(@HeaderParam("Authorization") AuthHeader authHeader);

    /**
     * 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.
     */
    @POST
    @Path("tl/management/getActiveNamespaces")
    @ClientEndpoint(method = "POST", path = "/tl/management/getActiveNamespaces")
    Set getActiveNamespaces(@HeaderParam("Authorization") AuthHeader authHeader);

    /**
     * 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.
     */
    @POST
    @Path("tl/management/achieveConsensus")
    @ClientEndpoint(method = "POST", path = "/tl/management/achieveConsensus")
    void achieveConsensus(@HeaderParam("Authorization") AuthHeader authHeader, @Safe Set namespaces);

    /**
     * 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.
     */
    @POST
    @Path("tl/management/invalidateResources")
    @ClientEndpoint(method = "POST", path = "/tl/management/invalidateResources")
    void invalidateResources(@HeaderParam("Authorization") AuthHeader authHeader, @Safe Set namespaces);

    /** Gets the randomly generated server id associated with the server's current lifecycle upon start up. */
    @POST
    @Path("tl/management/getServerLifecycleId")
    @ClientEndpoint(method = "POST", path = "/tl/management/getServerLifecycleId")
    UUID getServerLifecycleId(@HeaderParam("Authorization") AuthHeader authHeader);

    /**
     * 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.
     */
    @POST
    @Path("tl/management/forceKillTimeLockServer")
    @ClientEndpoint(method = "POST", path = "/tl/management/forceKillTimeLockServer")
    UUID forceKillTimeLockServer(@HeaderParam("Authorization") AuthHeader authHeader);

    /**
     * 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.
     *
     * @param currentTimestamp the largest timestamp issued until the fast-forward call
     */
    @POST
    @Path("tl/management/fastForward")
    @ClientEndpoint(method = "POST", path = "/tl/management/fastForward")
    void fastForwardTimestamp(
            @HeaderParam("Authorization") AuthHeader authHeader,
            @Safe @QueryParam("namespace") String namespace,
            @QueryParam("currentTimestamp") long currentTimestamp);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy