HintedHandOffManager (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.db

## Class HintedHandOffManager

- java.lang.Object
- - org.apache.cassandra.db.HintedHandOffManager

- All Implemented Interfaces:
    HintedHandOffManagerMBean

      public class HintedHandOffManager
      extends java.lang.Object
      implements HintedHandOffManagerMBean

  The hint schema looks like this: CREATE TABLE hints ( target_id uuid, hint_id timeuuid, message_version int, mutation blob, PRIMARY KEY (target_id, hint_id, message_version) ) WITH COMPACT STORAGE; Thus, for each node in the cluster we treat its uuid as the partition key; each hint is a logical row (physical composite column) containing the mutation to replay and associated metadata. When FailureDetector signals that a node that was down is back up, we page through the hinted mutations and send them over one at a time, waiting for hinted_handoff_throttle_delay in between each. deliverHints is also exposed to JMX so it can be run manually if FD ever misses its cue somehow.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static HintedHandOffManager` | `instance`
    `static java.lang.String` | `MBEAN_NAME`
    `HintedHandoffMetrics` | `metrics`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HintedHandOffManager()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `calculateHintTTL(Mutation mutation)`
    `protected void` | `compact()`
    `void` | `deleteHintsForEndpoint(java.net.InetAddress endpoint)`
    `void` | `deleteHintsForEndpoint(java.lang.String ipOrHostname)` Nuke all hints from this node to `ep`.
    `Mutation` | `hintFor(Mutation mutation, long now, int ttl, java.util.UUID targetId)` Returns a mutation representing a Hint to be sent to `targetId` as soon as it becomes available again.
    `java.util.List<java.lang.String>` | `listEndpointsPendingHints()` List all the endpoints that this node has hints for.
    `void` | `pauseHintsDelivery(boolean b)` pause hints delivery process
    `void` | `scheduleHintDelivery(java.net.InetAddress to, boolean precompact)`
    `void` | `scheduleHintDelivery(java.lang.String to)` force hint delivery to an endpoint
    `void` | `start()`
    `void` | `truncateAllHints()` Truncate all the hints

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MBEAN_NAME

          public static final java.lang.String MBEAN_NAME

      See Also:
        Constant Field Values

    - #### instance

          public static final HintedHandOffManager instance

    - #### metrics

          public final HintedHandoffMetrics metrics

  - ### Constructor Detail

    - #### HintedHandOffManager

          public HintedHandOffManager()

  - ### Method Detail

    - #### hintFor

          public Mutation hintFor(Mutation mutation,
                         long now,
                         int ttl,
                         java.util.UUID targetId)

      Returns a mutation representing a Hint to be sent to `targetId` as soon as it becomes available again.

    - #### calculateHintTTL

          public static int calculateHintTTL(Mutation mutation)

    - #### start

          public void start()

    - #### deleteHintsForEndpoint

          public void deleteHintsForEndpoint(java.lang.String ipOrHostname)

      Description copied from interface: `HintedHandOffManagerMBean`
      Nuke all hints from this node to `ep`.
      Specified by:
        `deleteHintsForEndpoint` in interface `HintedHandOffManagerMBean`
      Parameters:
        `ipOrHostname` - String rep. of endpoint address to delete hints for, either ip address ("127.0.0.1") or hostname

    - #### deleteHintsForEndpoint

          public void deleteHintsForEndpoint(java.net.InetAddress endpoint)

    - #### truncateAllHints

          public void truncateAllHints()
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException

      Description copied from interface: `HintedHandOffManagerMBean`
      Truncate all the hints
      Specified by:
        `truncateAllHints` in interface `HintedHandOffManagerMBean`
      Throws:
        `java.util.concurrent.ExecutionException`
        `java.lang.InterruptedException`

    - #### compact

          protected void compact()

    - #### scheduleHintDelivery

          public void scheduleHintDelivery(java.net.InetAddress to,
                                  boolean precompact)

    - #### scheduleHintDelivery

          public void scheduleHintDelivery(java.lang.String to)
                                    throws java.net.UnknownHostException

      Description copied from interface: `HintedHandOffManagerMBean`
      force hint delivery to an endpoint
      Specified by:
        `scheduleHintDelivery` in interface `HintedHandOffManagerMBean`
      Throws:
        `java.net.UnknownHostException`

    - #### pauseHintsDelivery

          public void pauseHintsDelivery(boolean b)

      Description copied from interface: `HintedHandOffManagerMBean`
      pause hints delivery process
      Specified by:
        `pauseHintsDelivery` in interface `HintedHandOffManagerMBean`

    - #### listEndpointsPendingHints

          public java.util.List<java.lang.String> listEndpointsPendingHints()

      Description copied from interface: `HintedHandOffManagerMBean`
      List all the endpoints that this node has hints for.
      Specified by:
        `listEndpointsPendingHints` in interface `HintedHandOffManagerMBean`
      Returns:
        set of endpoints; as Strings

Copyright © 2014 The Apache Software Foundation