why am i so bad at coding

This commit is contained in:
fjy 2014-09-30 11:53:18 -07:00
parent b1b9e0a267
commit 2b2b028e5c
3 changed files with 2 additions and 6 deletions

View File

@ -544,6 +544,7 @@ public class RemoteTaskRunner implements TaskRunner, TaskLogStreamer
announceTask(task, zkWorker, taskRunnerWorkItem);
return true;
} else {
log.debug("Worker nodes %s do not have capacity to run any more tasks!", zkWorkers.values());
return false;
}
}

View File

@ -160,7 +160,7 @@ public class ZkWorker implements Closeable
public ImmutableZkWorker toImmutable()
{
return new ImmutableZkWorker(this);
return new ImmutableZkWorker(worker, getCurrCapacityUsed(), getAvailabilityGroups());
}
@Override

View File

@ -24,10 +24,8 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
import com.google.common.primitives.Ints;
import com.google.inject.Inject;
import com.metamx.emitter.EmittingLogger;
import io.druid.indexing.common.task.Task;
import io.druid.indexing.overlord.ImmutableZkWorker;
import io.druid.indexing.overlord.ZkWorker;
import io.druid.indexing.overlord.config.RemoteTaskRunnerConfig;
import java.util.Comparator;
@ -37,8 +35,6 @@ import java.util.TreeSet;
*/
public class FillCapacityWorkerSelectStrategy implements WorkerSelectStrategy
{
private static final EmittingLogger log = new EmittingLogger(FillCapacityWorkerSelectStrategy.class);
private final RemoteTaskRunnerConfig config;
@Inject
@ -77,7 +73,6 @@ public class FillCapacityWorkerSelectStrategy implements WorkerSelectStrategy
return Optional.of(zkWorker);
}
}
log.debug("Worker nodes %s do not have capacity to run any more tasks!", zkWorkers.values());
return Optional.absent();
}