diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexMerger.java b/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexMerger.java index e662bf0224a..bf454f5077e 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexMerger.java +++ b/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexMerger.java @@ -22,7 +22,6 @@ package com.metamx.druid.index.v1; import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.base.Splitter; -import com.google.common.base.Stopwatch; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; import com.google.common.collect.Lists; diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ByteBufferInputRowParser.java b/indexing-common/src/main/java/com/metamx/druid/indexer/data/ByteBufferInputRowParser.java index bc3721bf719..d0764e72a26 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ByteBufferInputRowParser.java +++ b/indexing-common/src/main/java/com/metamx/druid/indexer/data/ByteBufferInputRowParser.java @@ -1,10 +1,10 @@ package com.metamx.druid.indexer.data; -import java.nio.ByteBuffer; - import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.nio.ByteBuffer; + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = StringInputRowParser.class) @JsonSubTypes(value = { @JsonSubTypes.Type(name = "protobuf", value = ProtoBufInputRowParser.class), diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ProtoBufInputRowParser.java b/indexing-common/src/main/java/com/metamx/druid/indexer/data/ProtoBufInputRowParser.java index b5cb4e2e0c9..3130a86a1b4 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ProtoBufInputRowParser.java +++ b/indexing-common/src/main/java/com/metamx/druid/indexer/data/ProtoBufInputRowParser.java @@ -1,14 +1,5 @@ package com.metamx.druid.indexer.data; -import static com.google.protobuf.DescriptorProtos.FileDescriptorSet; -import static com.google.protobuf.Descriptors.Descriptor; -import static com.google.protobuf.Descriptors.FileDescriptor; - -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.util.List; -import java.util.Map; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Throwables; @@ -20,6 +11,15 @@ import com.google.protobuf.InvalidProtocolBufferException; import com.metamx.common.exception.FormattedException; import com.metamx.druid.input.InputRow; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.List; +import java.util.Map; + +import static com.google.protobuf.DescriptorProtos.FileDescriptorSet; +import static com.google.protobuf.Descriptors.Descriptor; +import static com.google.protobuf.Descriptors.FileDescriptor; + public class ProtoBufInputRowParser implements ByteBufferInputRowParser { diff --git a/indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoBufInputRowParserTest.java b/indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoBufInputRowParserTest.java index 237f89edf14..fd402c56b41 100644 --- a/indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoBufInputRowParserTest.java +++ b/indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoBufInputRowParserTest.java @@ -1,18 +1,16 @@ package com.metamx.druid.indexer.data; -import static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ONE; -import static org.junit.Assert.assertEquals; +import com.metamx.druid.input.InputRow; +import org.joda.time.DateTime; +import org.junit.Test; import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.List; -import com.google.protobuf.ByteString; -import org.joda.time.DateTime; -import org.junit.Test; - -import com.metamx.druid.input.InputRow; +import static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ONE; +import static org.junit.Assert.assertEquals; public class ProtoBufInputRowParserTest { diff --git a/indexing-service/src/main/java/com/metamx/druid/indexing/common/TaskStatus.java b/indexing-service/src/main/java/com/metamx/druid/indexing/common/TaskStatus.java index bb7c6c4a10f..68952a9bc1f 100644 --- a/indexing-service/src/main/java/com/metamx/druid/indexing/common/TaskStatus.java +++ b/indexing-service/src/main/java/com/metamx/druid/indexing/common/TaskStatus.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Objects; import com.google.common.base.Preconditions; -import com.metamx.druid.indexing.common.task.TaskResource; /** * Represents the status of a task from the perspective of the coordinator. The task may be ongoing diff --git a/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/ForkingTaskRunner.java b/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/ForkingTaskRunner.java index dfb9cbc94c4..41abb0a036c 100644 --- a/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/ForkingTaskRunner.java +++ b/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/ForkingTaskRunner.java @@ -62,7 +62,6 @@ import java.util.Properties; import java.util.UUID; import java.util.concurrent.Callable; import java.util.concurrent.Executors; -import java.util.concurrent.ExecutorService; /** * Runs tasks in separate processes using the "internal peon" verb. @@ -146,12 +145,12 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer throw new IllegalStateException("Task has been shut down!"); } - if (taskInfo == null) { + if (taskWorkItem == null) { log.makeAlert("WTF?! TaskInfo disappeared!").addData("task", task.getId()).emit(); throw new ISE("TaskInfo disappeared for task[%s]!", task.getId()); } - if (taskInfo.processHolder != null) { + if (taskWorkItem.processHolder != null) { log.makeAlert("WTF?! TaskInfo already has a processHolder") .addData("task", task.getId()) .emit(); diff --git a/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/RemoteTaskRunner.java b/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/RemoteTaskRunner.java index 3392f471849..66af95d5316 100644 --- a/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/RemoteTaskRunner.java +++ b/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/RemoteTaskRunner.java @@ -20,7 +20,6 @@ package com.metamx.druid.indexing.coordinator; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.api.client.util.Maps; import com.google.common.base.Charsets; import com.google.common.base.Joiner; import com.google.common.base.Optional; @@ -29,6 +28,7 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; import com.google.common.base.Throwables; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.common.io.InputSupplier; import com.google.common.primitives.Ints; @@ -272,7 +272,8 @@ public class RemoteTaskRunner implements TaskRunner, TaskLogStreamer runningTasks.put( task.getId(), new RemoteTaskRunnerWorkItem( - task, SettableFuture.create(), + task, + SettableFuture.create(), worker ) ); @@ -680,7 +681,7 @@ public class RemoteTaskRunner implements TaskRunner, TaskLogStreamer if (zkWorker != null) { try { List tasksToFail = Lists.newArrayList( - cf.getChildren().forPath(JOINER.join(config.getIndexerTaskPath(), worker.getHost())) + cf.getChildren().forPath(JOINER.join(zkPaths.getIndexerTaskPath(), worker.getHost())) ); log.info("[%s]: Found %d tasks assigned", worker.getHost(), tasksToFail.size()); diff --git a/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/ZkWorker.java b/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/ZkWorker.java index c1e33525e23..3ee77c5f820 100644 --- a/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/ZkWorker.java +++ b/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/ZkWorker.java @@ -26,7 +26,6 @@ import com.google.common.base.Throwables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import com.metamx.druid.indexing.common.TaskStatus; import com.metamx.druid.indexing.common.task.Task; import com.metamx.druid.indexing.worker.TaskAnnouncement; import com.metamx.druid.indexing.worker.Worker; diff --git a/indexing-service/src/main/java/com/metamx/druid/indexing/worker/WorkerCuratorCoordinator.java b/indexing-service/src/main/java/com/metamx/druid/indexing/worker/WorkerCuratorCoordinator.java index b62d383a4ae..ae0cde96201 100644 --- a/indexing-service/src/main/java/com/metamx/druid/indexing/worker/WorkerCuratorCoordinator.java +++ b/indexing-service/src/main/java/com/metamx/druid/indexing/worker/WorkerCuratorCoordinator.java @@ -30,7 +30,6 @@ import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.common.logger.Logger; import com.metamx.druid.curator.announcement.Announcer; -import com.metamx.druid.indexing.common.TaskStatus; import com.metamx.druid.indexing.coordinator.config.RemoteTaskRunnerConfig; import com.metamx.druid.initialization.ZkPathsConfig; import org.apache.curator.framework.CuratorFramework; diff --git a/realtime/src/main/java/com/metamx/druid/realtime/firehose/IrcFirehoseFactory.java b/realtime/src/main/java/com/metamx/druid/realtime/firehose/IrcFirehoseFactory.java index 5e3efa7af4e..b67a246fb24 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/firehose/IrcFirehoseFactory.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/firehose/IrcFirehoseFactory.java @@ -35,7 +35,6 @@ import com.metamx.common.logger.Logger; import com.metamx.druid.input.InputRow; import org.joda.time.DateTime; -import java.io.File; import java.io.IOException; import java.util.List; import java.util.concurrent.LinkedBlockingQueue; diff --git a/server/src/main/java/com/metamx/druid/index/ReferenceCountingSequence.java b/server/src/main/java/com/metamx/druid/index/ReferenceCountingSequence.java index 58aeb068f90..ca7066ececb 100644 --- a/server/src/main/java/com/metamx/druid/index/ReferenceCountingSequence.java +++ b/server/src/main/java/com/metamx/druid/index/ReferenceCountingSequence.java @@ -25,8 +25,6 @@ import com.metamx.common.guava.Yielder; import com.metamx.common.guava.YieldingAccumulator; import com.metamx.common.guava.YieldingSequenceBase; -import java.io.Closeable; - /** */ public class ReferenceCountingSequence extends YieldingSequenceBase diff --git a/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java b/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java index 0da949b9a7c..8c31261d5bb 100644 --- a/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java +++ b/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java @@ -19,14 +19,12 @@ package com.metamx.druid.master; -import com.google.common.collect.MinMaxPriorityQueue; import com.metamx.common.Pair; import com.metamx.druid.client.DataSegment; import com.metamx.emitter.EmittingLogger; import org.joda.time.DateTime; import org.joda.time.Interval; -import java.util.Comparator; import java.util.List; public class CostBalancerStrategy implements BalancerStrategy