public final class HintsService extends java.lang.Object implements HintsServiceMBean
Modifier and Type | Field and Description |
---|---|
static HintsService |
instance |
static java.lang.String |
MBEAN_NAME |
HintedHandoffMetrics |
metrics |
Modifier and Type | Method and Description |
---|---|
void |
deleteAllHints()
Deletes all hints for all destinations.
|
void |
deleteAllHintsForEndpoint(InetAddressAndPort target)
Deletes all hints for the provided destination.
|
void |
deleteAllHintsForEndpoint(java.lang.String address)
Deletes all hints for the provided destination.
|
void |
excise(java.util.UUID hostId)
Cleans up hints-related state after a node with id = hostId left.
|
void |
flushAndFsyncBlockingly(java.lang.Iterable<java.util.UUID> hostIds)
Flush the buffer pool for the selected target nodes, then fsync their writers.
|
long |
getEarliestHintForHost(java.util.UUID hostId)
Get the earliest hint written for a particular node,
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getPendingHints()
Returns all pending hints that this node has.
|
java.util.List<PendingHintsInfo> |
getPendingHintsInfo()
Returns all pending hints that this node has.
|
long |
getTotalHintsSize(java.util.UUID hostId)
Get the total size in bytes of all the hints files associating with the host on disk.
|
boolean |
isDispatchPaused() |
boolean |
isShutDown()
Returns true in case service is shut down.
|
void |
pauseDispatch()
Pause dispatch of all hints.
|
void |
registerMBean() |
void |
resumeDispatch()
Resume dispatch of all hints.
|
void |
shutdownBlocking()
Gracefully and blockingly shut down the service.
|
void |
startDispatch() |
Future |
transferHints(java.util.function.Supplier<java.util.UUID> hostIdSupplier)
Transfer all local hints to the hostId supplied by hostIdSupplier
Flushes the buffer to make sure all hints are on disk and closes the hint writers
so we don't leave any hint files around.
|
void |
write(java.util.Collection<java.util.UUID> hostIds,
Hint hint)
Write a hint for a iterable of nodes.
|
void |
write(java.util.UUID hostId,
Hint hint)
Write a hint for a single node.
|
public static HintsService instance
public static final java.lang.String MBEAN_NAME
public final HintedHandoffMetrics metrics
public void registerMBean()
public void write(java.util.Collection<java.util.UUID> hostIds, Hint hint)
hostIds
- host ids of the hint's target nodeshint
- the hint to storepublic void write(java.util.UUID hostId, Hint hint)
hostId
- host id of the hint's target nodehint
- the hint to storepublic void flushAndFsyncBlockingly(java.lang.Iterable<java.util.UUID> hostIds)
hostIds
- host ids of the nodes to flush and fsync hints forpublic void startDispatch()
public void pauseDispatch()
HintsServiceMBean
pauseDispatch
in interface HintsServiceMBean
public void resumeDispatch()
HintsServiceMBean
resumeDispatch
in interface HintsServiceMBean
public long getTotalHintsSize(java.util.UUID hostId)
hostId,
- belonging hostpublic void shutdownBlocking() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public java.util.List<PendingHintsInfo> getPendingHintsInfo()
PendingHintsInfo
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getPendingHints()
getPendingHints
in interface HintsServiceMBean
public void deleteAllHints()
deleteAllHints
in interface HintsServiceMBean
public void deleteAllHintsForEndpoint(java.lang.String address)
deleteAllHintsForEndpoint
in interface HintsServiceMBean
address
- inet address of the target node - encoded as a string for easier JMX consumptionpublic void deleteAllHintsForEndpoint(InetAddressAndPort target)
target
- inet address of the target nodepublic void excise(java.util.UUID hostId)
hostId
- id of the node being excisedpublic Future transferHints(java.util.function.Supplier<java.util.UUID> hostIdSupplier)
hostIdSupplier
- supplier of stream target host ids. This is generally
the closest one according to the DynamicSnitchpublic long getEarliestHintForHost(java.util.UUID hostId)
hostId
- UUID of the node to check it's hints.public boolean isShutDown()
public boolean isDispatchPaused()
Copyright © 2009- The Apache Software Foundation