@InterfaceAudience.Private class ClusterCompactionQueues extends Object
Modifier and Type | Field and Description |
---|---|
private Set<ServerName> |
compactingServers |
private Map<ServerName,List<MajorCompactionRequest>> |
compactionQueues |
private int |
concurrentServers |
private ReadWriteLock |
lock |
Constructor and Description |
---|
ClusterCompactionQueues(int concurrentServers) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addToCompactionQueue(ServerName serverName,
MajorCompactionRequest info) |
(package private) boolean |
atCapacity() |
(package private) int |
getCompactionRequestsLeftToFinish() |
(package private) Optional<ServerName> |
getLargestQueueFromServersNotCompacting() |
(package private) List<MajorCompactionRequest> |
getQueue(ServerName serverName) |
(package private) boolean |
hasWorkItems() |
(package private) void |
releaseCompaction(ServerName serverName) |
(package private) MajorCompactionRequest |
reserveForCompaction(ServerName serverName) |
private final Map<ServerName,List<MajorCompactionRequest>> compactionQueues
private final Set<ServerName> compactingServers
private final ReadWriteLock lock
private final int concurrentServers
ClusterCompactionQueues(int concurrentServers)
void addToCompactionQueue(ServerName serverName, MajorCompactionRequest info)
boolean hasWorkItems()
int getCompactionRequestsLeftToFinish()
List<MajorCompactionRequest> getQueue(ServerName serverName)
MajorCompactionRequest reserveForCompaction(ServerName serverName)
void releaseCompaction(ServerName serverName)
boolean atCapacity()
Optional<ServerName> getLargestQueueFromServersNotCompacting()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.