1) Some whitespace changes

2) Fix up the alerting to actually include the segment and server for when the MasterBalancer has something stuck in the queue
This commit is contained in:
Eric Tschetter 2013-02-01 16:19:17 -06:00
parent da914b835e
commit 7de5c7806e
3 changed files with 21 additions and 26 deletions

View File

@ -126,7 +126,9 @@ public class ComputeNode extends BaseServerNode<ComputeNode>
getConfigFactory().buildWithReplacements(
ExecutorServiceConfig.class, ImmutableMap.of("base_path", "druid.processing")
)
), emitter, new ServiceMetricEvent.Builder()
),
emitter,
new ServiceMetricEvent.Builder()
);
final ServerManager serverManager = new ServerManager(segmentLoader, conglomerate, emitter, executorService);

View File

@ -594,21 +594,20 @@ public class DruidMaster
public DruidMasterRuntimeParams run(DruidMasterRuntimeParams params)
{
// Display info about all historical servers
Iterable<DruidServer> servers =
FunctionalIterable.create(serverInventoryManager.getInventory())
.filter(
new Predicate<DruidServer>()
{
@Override
public boolean apply(
@Nullable DruidServer input
)
{
return input.getType()
.equalsIgnoreCase("historical");
}
}
);
Iterable<DruidServer> servers =FunctionalIterable
.create(serverInventoryManager.getInventory())
.filter(
new Predicate<DruidServer>()
{
@Override
public boolean apply(
@Nullable DruidServer input
)
{
return input.getType().equalsIgnoreCase("historical");
}
}
);
if (log.isDebugEnabled()) {
log.debug("Servers");
for (DruidServer druidServer : servers) {

View File

@ -19,8 +19,6 @@
package com.metamx.druid.master;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.MinMaxPriorityQueue;
import com.google.common.collect.Sets;
@ -30,7 +28,6 @@ import com.metamx.druid.client.DruidServer;
import com.metamx.emitter.EmittingLogger;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@ -71,13 +68,10 @@ public class DruidMasterBalancer implements DruidMasterHelper
for (BalancerSegmentHolder holder : currentlyMovingSegments.get(tier).values()) {
holder.reduceLifetime();
if (holder.getLifetime() <= 0) {
log.makeAlert(
"[%s]: Balancer move segments queue has a segment stuck",
tier,
ImmutableMap.<String, Object>builder()
.put("segment", holder.getSegment().getIdentifier())
.build()
).emit();
log.makeAlert("[%s]: Balancer move segments queue has a segment stuck", tier)
.addData("segment", holder.getSegment().getIdentifier())
.addData("server", holder.getServer())
.emit();
}
}
}