Package io.etcd.jetcd

Interface Maintenance

  • All Superinterfaces:
    java.lang.AutoCloseable, CloseableClient

    public interface Maintenance
    extends CloseableClient
    Interface of maintenance talking to etcd.

    An etcd cluster needs periodic maintenance to remain reliable. Depending on an etcd application's needs, this maintenance can usually be automated and performed without downtime or significantly degraded performance.

    All etcd maintenance manages storage resources consumed by the etcd keyspace. Failure to adequately control the keyspace size is guarded by storage space quotas; if an etcd member runs low on space, a quota will trigger cluster-wide alarms which will put the system into a limited-operation maintenance mode. To avoid running out of space for writes to the keyspace, the etcd keyspace history must be compacted. Storage space itself may be reclaimed by defragmenting etcd members. Finally, periodic snapshot backups of etcd member state makes it possible to recover any unintended logical data loss or corruption caused by operational error.

    • Method Detail

      • listAlarms

        java.util.concurrent.CompletableFuture<AlarmResponse> listAlarms()
        get all active keyspace alarm.
        Returns:
        the response
      • alarmDisarm

        java.util.concurrent.CompletableFuture<AlarmResponse> alarmDisarm​(AlarmMember member)
        disarms a given alarm.
        Parameters:
        member - the alarm
        Returns:
        the response result
      • defragmentMember

        @Deprecated
        java.util.concurrent.CompletableFuture<DefragmentResponse> defragmentMember​(java.net.URI endpoint)
        Deprecated.
        Defragment one member of the cluster by its endpoint.
        Parameters:
        endpoint - the etcd server endpoint.
        Returns:
        the response result
      • defragmentMember

        java.util.concurrent.CompletableFuture<DefragmentResponse> defragmentMember​(java.lang.String target)
        Defragment one member of the cluster by its endpoint.

        After compacting the keyspace, the backend database may exhibit internal fragmentation. Any internal fragmentation is space that is free to use by the backend but still consumes storage space. The process of defragmentation releases this storage space back to the file system. Defragmentation is issued on a per-member so that cluster-wide latency spikes may be avoided.

        Defragment is an expensive operation. User should avoid defragmenting multiple members at the same time. To defragment multiple members in the cluster, user need to call defragment multiple times with different endpoints.

        Parameters:
        target - the etcd server endpoint.
        Returns:
        the response result
      • statusMember

        @Deprecated
        java.util.concurrent.CompletableFuture<StatusResponse> statusMember​(java.net.URI endpoint)
        Deprecated.
        get the status of a member by its endpoint.
        Parameters:
        endpoint - the etcd server endpoint.
        Returns:
        the response result
      • statusMember

        java.util.concurrent.CompletableFuture<StatusResponse> statusMember​(java.lang.String target)
        get the status of a member by its endpoint.
        Parameters:
        target - the etcd server endpoint.
        Returns:
        the response result
      • hashKV

        @Deprecated
        java.util.concurrent.CompletableFuture<HashKVResponse> hashKV​(java.net.URI endpoint,
                                                                      long rev)
        Deprecated.
        returns a hash of the KV state at the time of the RPC.
        Parameters:
        endpoint - the etcd server endpoint.
        rev - the revision
        Returns:
        the response result
      • hashKV

        java.util.concurrent.CompletableFuture<HashKVResponse> hashKV​(java.lang.String target,
                                                                      long rev)
        returns a hash of the KV state at the time of the RPC. If revision is zero, the hash is computed on all keys. If the revision is non-zero, the hash is computed on all keys at or below the given revision.
        Parameters:
        target - the etcd server endpoint.
        rev - the revision
        Returns:
        the response result
      • snapshot

        java.util.concurrent.CompletableFuture<java.lang.Long> snapshot​(java.io.OutputStream output)
        retrieves backend snapshot.
        Parameters:
        output - the output stream to write the snapshot content.
        Returns:
        a Snapshot for retrieving backend snapshot.
      • snapshot

        void snapshot​(io.grpc.stub.StreamObserver<SnapshotResponse> observer)
        retrieves backend snapshot as as stream of chunks.
        Parameters:
        observer - a stream of data chunks
      • moveLeader

        java.util.concurrent.CompletableFuture<MoveLeaderResponse> moveLeader​(long transfereeID)
        moveLeader requests current leader to transfer its leadership to the transferee.
        Parameters:
        transfereeID - the id
        Returns:
        the response result