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( getConfigFactory().buildWithReplacements(
ExecutorServiceConfig.class, ImmutableMap.of("base_path", "druid.processing") 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); final ServerManager serverManager = new ServerManager(segmentLoader, conglomerate, emitter, executorService);

View File

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

View File

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