|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.db.HintedHandOffManager
public class HintedHandOffManager
For each endpoint for which we have hints, there is a row in the system hints CF. The key for this row is ByteBuffer.wrap(string), i.e. "127.0.0.1". SuperColumns in that row are keys for which we have hinted data. Subcolumns names within that supercolumn are keyspace+CF, concatenated with SEPARATOR. Subcolumn values are always empty; instead, we store the row data "normally" in the application table it belongs in. When FailureDetector signals that a node that was down is back up, we read its hints row to see what rows we need to forward data for, then reach each row in its entirety and send it over. deliverHints is also exposed to JMX so it can be run manually if FD ever misses its cue somehow. HHM never deletes the row from Application tables; usually (but not for CL.ANY!) the row belongs on this node, as well. instead, we rely on cleanup compactions to remove data that doesn't belong. (Cleanup compactions may be started manually -- on a per node basis -- with "nodeprobe cleanup.") TODO this avoids our hint rows from growing excessively large by offloading the message data into application tables. But, this means that cleanup compactions will nuke HH data. Probably better would be to store the RowMutation messages in a HHData (non-super) CF, modifying the above to store a UUID value in the HH subcolumn value, which we use as a key to a [standard] HHData system CF that would contain the message bytes.
Field Summary | |
---|---|
static java.lang.String |
HINTS_CF
|
static HintedHandOffManager |
instance
|
Constructor Summary | |
---|---|
HintedHandOffManager()
|
Method Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.Integer> |
countPendingHints()
List all the endpoints that this node has hints for, and count the number of hints for each such endpoint. |
void |
deleteHintsForEndpoint(java.net.InetAddress endpoint)
|
void |
deleteHintsForEndpoint(java.lang.String ipOrHostname)
Nuke all hints from this node to `ep`. |
void |
deliverHints(java.net.InetAddress to)
|
void |
deliverHints(java.lang.String to)
|
java.util.List<java.lang.String> |
listEndpointsPendingHints()
List all the endpoints that this node has hints for. |
static java.nio.ByteBuffer |
makeCombinedName(java.lang.String tableName,
java.lang.String columnFamily)
|
void |
registerMBean()
|
static void |
renameHints(java.lang.String oldTable,
java.lang.String newTable)
called when a keyspace is dropped or rename. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final HintedHandOffManager instance
public static final java.lang.String HINTS_CF
Constructor Detail |
---|
public HintedHandOffManager()
Method Detail |
---|
public void registerMBean()
public void deleteHintsForEndpoint(java.lang.String ipOrHostname)
HintedHandOffManagerMBean
deleteHintsForEndpoint
in interface HintedHandOffManagerMBean
ipOrHostname
- String rep. of endpoint address to delete hints for, either ip address ("127.0.0.1") or hostnamepublic void deleteHintsForEndpoint(java.net.InetAddress endpoint)
public static java.nio.ByteBuffer makeCombinedName(java.lang.String tableName, java.lang.String columnFamily)
public static void renameHints(java.lang.String oldTable, java.lang.String newTable) throws java.io.IOException
java.io.IOException
public void deliverHints(java.net.InetAddress to)
public void deliverHints(java.lang.String to) throws java.net.UnknownHostException
java.net.UnknownHostException
public java.util.List<java.lang.String> listEndpointsPendingHints()
HintedHandOffManagerMBean
listEndpointsPendingHints
in interface HintedHandOffManagerMBean
public java.util.Map<java.lang.String,java.lang.Integer> countPendingHints()
HintedHandOffManagerMBean
countPendingHints
in interface HintedHandOffManagerMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |