public final class HintsService extends java.lang.Object implements HintsServiceMBean
Modifier and Type | Field and Description |
---|---|
static HintsService |
instance |
HintedHandoffMetrics |
metrics |
Modifier and Type | Method and Description |
---|---|
void |
deleteAllHints()
Deletes all hints for all destinations.
|
void |
deleteAllHintsForEndpoint(java.net.InetAddress 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.
|
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() |
java.util.concurrent.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.lang.Iterable<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 final HintedHandoffMetrics metrics
public void registerMBean()
public void write(java.lang.Iterable<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 void shutdownBlocking() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
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(java.net.InetAddress target)
target
- inet address of the target nodepublic void excise(java.util.UUID hostId)
hostId
- id of the node being excisedpublic java.util.concurrent.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 boolean isShutDown()
Copyright © 2019 The Apache Software Foundation