From 0d24df76282cf6b105d0395f1b6c9146006c9f22 Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Tue, 30 Oct 2012 22:22:46 -0700 Subject: [PATCH] Removed unused imports. --- .../main/java/com/metamx/druid/BaseQuery.java | 13 +-- .../main/java/com/metamx/druid/Druids.java | 11 +-- .../src/main/java/com/metamx/druid/Query.java | 15 ++-- .../ResultGranularTimestampComparator.java | 4 +- .../java/com/metamx/druid/SearchBinaryFn.java | 5 +- .../druid/client/CachingClusteredClient.java | 25 +++--- .../druid/client/ClientInventoryManager.java | 8 +- .../druid/client/ClientSideServerView.java | 16 ++-- .../com/metamx/druid/client/DataSegment.java | 33 ++++---- .../druid/client/DirectDruidClient.java | 39 ++++----- .../metamx/druid/client/DruidDataSource.java | 7 +- .../com/metamx/druid/client/DruidServer.java | 11 +-- .../client/InventoryManagementStrategy.java | 4 +- .../metamx/druid/client/InventoryManager.java | 12 +-- .../OnlyNewSegmentWatcherServerView.java | 10 +-- .../druid/client/SegmentInventoryManager.java | 4 +- .../druid/client/ServerInventoryManager.java | 6 +- .../com/metamx/druid/client/ServerView.java | 4 +- .../com/metamx/druid/client/ZKPhoneBook.java | 29 +++---- .../client/cache/ByteCountingLRUMap.java | 4 +- .../druid/client/cache/MapCacheBroker.java | 8 +- .../druid/client/selector/ServerSelector.java | 6 +- .../com/metamx/druid/http/BrokerMain.java | 21 ++--- .../metamx/druid/http/ClientInfoResource.java | 22 ++--- .../druid/http/ClientQuerySegmentWalker.java | 7 +- .../druid/http/ClientServletModule.java | 9 +- .../metamx/druid/http/FileRequestLogger.java | 19 +++-- .../com/metamx/druid/http/QueryServlet.java | 26 +++--- .../com/metamx/druid/http/RequestLogLine.java | 7 +- .../com/metamx/druid/http/StatusServlet.java | 9 +- .../druid/initialization/Initialization.java | 29 +++---- .../metamx/druid/merge/ClientAppendQuery.java | 5 +- .../druid/merge/ClientDefaultMergeQuery.java | 7 +- .../metamx/druid/merge/ClientMergeQuery.java | 5 +- .../druid/query/BySegmentQueryRunner.java | 7 +- .../query/ChainedExecutionQueryRunner.java | 16 ++-- .../query/FinalizeResultsQueryRunner.java | 4 +- .../query/IntervalChunkingQueryRunner.java | 16 ++-- .../query/MetricsEmittingQueryRunner.java | 4 +- .../metamx/druid/query/QueryCacheHelper.java | 6 +- .../metamx/druid/query/QueryToolChest.java | 3 +- .../druid/query/ReflectionLoaderThingy.java | 6 +- .../query/dimension/DefaultDimensionSpec.java | 5 +- .../druid/query/dimension/DimensionSpec.java | 3 +- .../dimension/ExtractionDimensionSpec.java | 5 +- .../query/dimension/LegacyDimensionSpec.java | 5 +- .../extraction/PartialDimExtractionFn.java | 6 +- .../extraction/RegexDimExtractionFn.java | 6 +- .../SearchQuerySpecDimExtractionFn.java | 5 +- .../query/extraction/TimeDimExtractionFn.java | 9 +- .../druid/query/filter/AndDimFilter.java | 5 +- .../query/filter/ExtractionDimFilter.java | 5 +- .../druid/query/filter/NotDimFilter.java | 4 +- .../druid/query/filter/OrDimFilter.java | 5 +- .../druid/query/filter/RegexDimFilter.java | 5 +- .../druid/query/filter/SelectorDimFilter.java | 4 +- .../druid/query/group/GroupByQuery.java | 11 +-- .../group/GroupByQueryQueryToolChest.java | 16 ++-- .../query/search/FragmentSearchQuerySpec.java | 9 +- .../InsensitiveContainsSearchQuerySpec.java | 4 +- .../search/LexicographicSearchSortSpec.java | 5 +- .../metamx/druid/query/search/SearchHit.java | 4 +- .../druid/query/search/SearchQuery.java | 14 ++-- .../search/SearchQueryQueryToolChest.java | 26 +++--- .../druid/query/search/SearchQuerySpec.java | 3 - .../druid/query/search/SearchSortSpec.java | 4 +- .../query/search/StrlenSearchSortSpec.java | 1 - .../query/segment/LegacySegmentSpec.java | 13 +-- .../segment/MultipleIntervalSegmentSpec.java | 11 +-- .../segment/MultipleSpecificSegmentSpec.java | 11 +-- .../druid/query/segment/QuerySegmentSpec.java | 7 +- .../query/segment/QuerySegmentWalker.java | 3 +- .../segment/SpecificSegmentQueryRunner.java | 6 +- .../query/segment/SpecificSegmentSpec.java | 9 +- .../query/timeboundary/TimeBoundaryQuery.java | 19 +++-- .../TimeBoundaryQueryQueryToolChest.java | 14 ++-- .../result/BySegmentResultValueClass.java | 4 +- .../result/BySegmentSearchResultValue.java | 5 +- .../java/com/metamx/druid/result/Result.java | 1 - .../druid/result/SearchResultValue.java | 7 +- .../druid/result/TimeBoundaryResultValue.java | 7 +- .../com/metamx/druid/shard/NoneShardSpec.java | 5 +- .../com/metamx/druid/shard/ShardSpec.java | 7 +- .../druid/shard/SingleDimensionShardSpec.java | 10 +-- .../metamx/druid/zk/StringZkSerializer.java | 5 +- .../com/metamx/phonebook/BasePhoneBook.java | 6 +- .../phonebook/ConsistentHashLookup.java | 4 +- .../metamx/phonebook/StoppedPhoneBook.java | 12 +-- .../metamx/druid/CombiningIterableTest.java | 13 +-- ...ResultGranularTimestampComparatorTest.java | 3 +- .../com/metamx/druid/SearchBinaryFnTest.java | 12 +-- .../java/com/metamx/druid/TestHelper.java | 7 +- .../metamx/druid/client/DataSegmentTest.java | 25 +++--- .../client/cache/ByteCountingLRUMapTest.java | 4 +- .../client/cache/MapCacheBrokerTest.java | 3 +- .../druid/query/QuerySegmentSpecTest.java | 13 +-- .../PartialDimExtractionFnTest.java | 9 +- .../extraction/RegexDimExtractionFnTest.java | 5 +- .../SearchQuerySpecDimExtractionFnTest.java | 13 +-- .../extraction/TimeDimExtractionFnTest.java | 5 +- .../shard/SingleDimensionShardSpecTest.java | 14 ++-- .../metamx/druid/BaseQueryGranularity.java | 6 +- .../com/metamx/druid/CombiningIterable.java | 6 +- .../com/metamx/druid/CombiningIterator.java | 8 +- .../com/metamx/druid/DurationGranularity.java | 5 +- .../com/metamx/druid/QueryGranularity.java | 3 +- .../metamx/druid/TimelineObjectHolder.java | 3 +- .../druid/VersionedIntervalTimeline.java | 19 +++-- .../metamx/druid/aggregation/Aggregator.java | 1 - .../druid/aggregation/AggregatorFactory.java | 7 +- .../aggregation/CountAggregatorFactory.java | 11 +-- .../aggregation/DoubleSumAggregator.java | 4 +- .../DoubleSumAggregatorFactory.java | 11 +-- .../DoubleSumBufferAggregator.java | 4 +- .../metamx/druid/aggregation/Histogram.java | 9 +- .../aggregation/HistogramAggregator.java | 4 +- .../HistogramAggregatorFactory.java | 17 ++-- .../HistogramBufferAggregator.java | 6 +- .../druid/aggregation/HistogramVisual.java | 5 +- .../aggregation/JavaScriptAggregator.java | 4 +- .../JavaScriptAggregatorFactory.java | 26 +++--- .../JavaScriptBufferAggregator.java | 6 +- .../druid/aggregation/LongSumAggregator.java | 4 +- .../aggregation/LongSumAggregatorFactory.java | 11 +-- .../aggregation/LongSumBufferAggregator.java | 4 +- .../druid/aggregation/MaxAggregator.java | 4 +- .../aggregation/MaxAggregatorFactory.java | 11 +-- .../aggregation/MaxBufferAggregator.java | 4 +- .../druid/aggregation/MinAggregator.java | 4 +- .../aggregation/MinAggregatorFactory.java | 11 +-- .../aggregation/MinBufferAggregator.java | 4 +- .../ToLowerCaseAggregatorFactory.java | 4 +- .../post/ArithmeticPostAggregator.java | 11 +-- .../post/ConstantPostAggregator.java | 6 +- .../post/FieldAccessPostAggregator.java | 6 +- .../aggregation/post/PostAggregator.java | 6 +- .../com/metamx/druid/collect/CountingMap.java | 6 +- .../druid/collect/OrderedMergeIterator.java | 13 +-- .../druid/collect/OrderedMergeSequence.java | 9 +- .../com/metamx/druid/collect/StupidPool.java | 6 +- .../java/com/metamx/druid/db/DbConnector.java | 10 ++- .../metamx/druid/guava/CombiningSequence.java | 6 +- .../druid/guava/FileOutputSupplier.java | 4 +- .../com/metamx/druid/guava/GuavaUtils.java | 15 ++-- .../metamx/druid/input/MapBasedInputRow.java | 4 +- .../com/metamx/druid/input/MapBasedRow.java | 18 ++-- .../main/java/com/metamx/druid/input/Row.java | 4 +- .../jackson/CommaListJoinDeserializer.java | 8 +- .../jackson/CommaListJoinSerializer.java | 7 +- .../druid/jackson/DefaultObjectMapper.java | 13 +-- .../com/metamx/druid/jackson/JodaStuff.java | 7 +- .../metamx/druid/log/LogLevelAdjuster.java | 11 +-- .../partition/IntegerPartitionChunk.java | 4 +- .../druid/partition/PartitionHolder.java | 8 +- .../druid/partition/StringPartitionChunk.java | 4 +- .../processing/MetricSelectorFactory.java | 1 - .../com/metamx/druid/utils/JodaUtils.java | 13 +-- .../com/metamx/druid/utils/PropUtils.java | 4 +- .../metamx/druid/utils/SerializerUtils.java | 10 +-- .../metamx/druid/QueryGranularityTest.java | 11 +-- .../druid/VersionedIntervalTimelineTest.java | 23 ++--- .../aggregation/CountAggregatorTest.java | 4 +- .../aggregation/DoubleSumAggregatorTest.java | 4 +- .../aggregation/HistogramAggregatorTest.java | 7 +- .../aggregation/JavaScriptAggregatorTest.java | 10 +-- .../aggregation/LongSumAggregatorTest.java | 4 +- .../post/ArithmeticPostAggregatorTest.java | 11 +-- .../post/ConstantPostAggregatorTest.java | 4 +- .../post/FieldAccessPostAggregatorTest.java | 7 +- .../collect/OrderedMergeIteratorTest.java | 12 +-- .../collect/OrderedMergeSequenceTest.java | 19 +++-- .../druid/guava/CombiningSequenceTest.java | 16 ++-- .../metamx/druid/histogram/HistogramTest.java | 11 +-- .../partition/IntegerPartitionChunkTest.java | 4 +- .../partition/StringPartitionChunkTest.java | 4 +- .../com/metamx/druid/utils/JodaUtilsTest.java | 8 +- .../examples/RealtimeStandaloneMain.java | 10 ++- .../TwitterSpritzerFirehoseFactory.java | 30 ++++--- .../com/metamx/druid/common/s3/S3Utils.java | 15 ++-- .../CompressedFloatBufferObjectStrategy.java | 6 +- .../v1/CompressedFloatsIndexedSupplier.java | 15 ++-- .../CompressedFloatsSupplierSerializer.java | 10 +-- .../CompressedLongBufferObjectStrategy.java | 6 +- .../v1/CompressedLongsIndexedSupplier.java | 15 ++-- .../v1/CompressedLongsSupplierSerializer.java | 10 +-- .../index/v1/CompressedObjectStrategy.java | 10 +-- .../druid/index/v1/CompressedPools.java | 8 +- .../index/v1/InMemoryCompressedFloats.java | 14 ++-- .../index/v1/InMemoryCompressedLongs.java | 14 ++-- .../druid/index/v1/IncrementalIndex.java | 28 ++++--- .../java/com/metamx/druid/index/v1/Index.java | 6 +- .../com/metamx/druid/index/v1/IndexIO.java | 24 +++--- .../metamx/druid/index/v1/MMappedIndex.java | 17 ++-- .../metamx/druid/index/v1/MetricHolder.java | 15 ++-- .../druid/index/v1/serde/ComplexMetrics.java | 4 +- .../druid/indexer/data/CSVDataSpec.java | 12 +-- .../metamx/druid/indexer/data/DataSpec.java | 5 +- .../druid/indexer/data/DelimitedDataSpec.java | 12 +-- .../druid/indexer/data/JSONDataSpec.java | 10 ++- .../indexer/data/StringInputRowParser.java | 15 ++-- .../druid/indexer/data/TimestampSpec.java | 7 +- .../kv/ConciseCompressedIndexedInts.java | 6 +- .../com/metamx/druid/kv/EmptyIndexedInts.java | 5 +- .../metamx/druid/kv/FlattenedArrayWriter.java | 12 +-- .../com/metamx/druid/kv/GenericIndexed.java | 12 +-- .../metamx/druid/kv/IntBufferIndexedInts.java | 8 +- .../com/metamx/druid/kv/TmpFileIOPeon.java | 4 +- .../com/metamx/druid/kv/VSizeIndexed.java | 8 +- .../com/metamx/druid/kv/VSizeIndexedInts.java | 6 +- .../metamx/druid/kv/VSizeIndexedWriter.java | 14 ++-- .../CompressedFloatsIndexedSupplierTest.java | 17 ++-- ...ompressedFloatsSupplierSerializerTest.java | 22 ++--- .../CompressedLongsIndexedSupplierTest.java | 17 ++-- ...CompressedLongsSupplierSerializerTest.java | 15 ++-- .../druid/index/v1/IOPeonForTesting.java | 6 +- .../v1/InMemoryCompressedFloatsTest.java | 5 +- .../index/v1/InMemoryCompressedLongsTest.java | 5 +- .../metamx/druid/kv/GenericIndexedTest.java | 9 +- .../com/metamx/druid/kv/IndexedIntsTest.java | 8 +- .../com/metamx/druid/kv/VSizeIndexedTest.java | 11 +-- .../java/com/metamx/druid/indexer/Bucket.java | 5 +- .../metamx/druid/indexer/DbUpdaterJob.java | 19 +++-- .../druid/indexer/DeterminePartitionsJob.java | 59 ++++++------- .../druid/indexer/HadoopDruidIndexer.java | 15 ++-- .../indexer/HadoopDruidIndexerAzkWrapper.java | 20 ++--- .../indexer/HadoopDruidIndexerConfig.java | 33 ++++---- .../druid/indexer/HadoopDruidIndexerJob.java | 21 ++--- .../metamx/druid/indexer/HadoopIOPeon.java | 9 +- .../druid/indexer/HadoopyShardSpec.java | 3 +- .../druid/indexer/IndexGeneratorJob.java | 84 +++++++++---------- .../metamx/druid/indexer/SortableBytes.java | 7 +- .../druid/indexer/StringIntervalFunction.java | 3 +- .../java/com/metamx/druid/indexer/Utils.java | 21 ++--- .../metamx/druid/indexer/ZkUpdaterJob.java | 11 +-- .../granularity/ArbitraryGranularitySpec.java | 17 ++-- .../indexer/granularity/GranularitySpec.java | 5 +- .../granularity/UniformGranularitySpec.java | 15 ++-- .../indexer/hadoop/FSSpideringIterator.java | 8 +- .../path/GranularUnprocessedPathSpec.java | 28 +++---- .../indexer/path/GranularityPathSpec.java | 19 +++-- .../metamx/druid/indexer/path/PathSpec.java | 5 +- .../druid/indexer/path/StaticPathSpec.java | 7 +- .../druid/indexer/rollup/DataRollupSpec.java | 8 +- .../indexer/updater/DbUpdaterJobSpec.java | 3 +- .../druid/indexer/updater/UpdaterJobSpec.java | 2 - .../druid/merger/common/TaskHolder.java | 5 +- .../druid/merger/common/TaskStatus.java | 11 +-- .../druid/merger/common/TaskToolbox.java | 11 +-- .../common/index/StaticS3FirehoseFactory.java | 37 ++++---- .../common/index/YeOldePlumberSchool.java | 19 +++-- .../merger/common/task/AbstractTask.java | 7 +- .../druid/merger/common/task/AppendTask.java | 18 ++-- .../merger/common/task/DefaultMergeTask.java | 16 ++-- .../druid/merger/common/task/DeleteTask.java | 17 ++-- .../task/IndexDeterminePartitionsTask.java | 17 ++-- .../common/task/IndexGeneratorTask.java | 22 ++--- .../druid/merger/common/task/IndexTask.java | 13 +-- .../druid/merger/common/task/MergeTask.java | 26 +++--- .../metamx/druid/merger/common/task/Task.java | 11 +-- .../merger/coordinator/DbTaskStorage.java | 17 ++-- .../merger/coordinator/LocalTaskRunner.java | 9 +- .../merger/coordinator/LocalTaskStorage.java | 9 +- .../coordinator/MergerDBCoordinator.java | 26 +++--- .../merger/coordinator/RemoteTaskRunner.java | 20 ++--- .../druid/merger/coordinator/RetryPolicy.java | 4 +- .../druid/merger/coordinator/TaskContext.java | 5 +- .../druid/merger/coordinator/TaskGroup.java | 9 +- .../coordinator/TaskInventoryManager.java | 4 +- .../druid/merger/coordinator/TaskMaster.java | 6 +- .../druid/merger/coordinator/TaskQueue.java | 27 +++--- .../druid/merger/coordinator/TaskStorage.java | 4 +- .../config/IndexerCoordinatorConfig.java | 11 +-- .../config/IndexerDbConnectorConfig.java | 3 +- .../merger/coordinator/exec/TaskConsumer.java | 3 - .../http/IndexerCoordinatorNode.java | 39 ++++----- .../http/IndexerCoordinatorResource.java | 16 ++-- .../http/IndexerCoordinatorServletModule.java | 9 +- .../druid/merger/worker/TaskMonitor.java | 11 +-- .../metamx/druid/merger/worker/Worker.java | 11 +-- .../worker/WorkerCuratorCoordinator.java | 11 +-- .../druid/merger/worker/http/WorkerNode.java | 35 ++++---- .../metamx/druid/realtime/FireDepartment.java | 4 +- .../druid/realtime/FireDepartmentConfig.java | 3 +- .../com/metamx/druid/realtime/Firehose.java | 4 +- .../druid/realtime/FirehoseFactory.java | 4 +- .../druid/realtime/KafkaFirehoseFactory.java | 30 +++---- .../druid/realtime/MetadataUpdater.java | 21 ++--- .../druid/realtime/RealtimeManager.java | 17 ++-- .../realtime/RealtimeMetricsMonitor.java | 6 +- .../metamx/druid/realtime/RealtimeNode.java | 47 ++++++----- .../druid/realtime/RealtimePlumberSchool.java | 41 ++++----- .../druid/realtime/S3SegmentPusher.java | 29 +++---- .../com/metamx/druid/realtime/Schema.java | 14 ++-- .../metamx/druid/realtime/SegmentPusher.java | 4 +- .../java/com/metamx/druid/realtime/Sink.java | 16 ++-- .../src/main/java/com/metamx/TsvToJson.java | 15 ++-- .../com/metamx/druid/BaseStorageAdapter.java | 9 +- .../com/metamx/druid/GroupByQueryEngine.java | 20 +++-- .../com/metamx/druid/SearchResultBuilder.java | 3 +- .../java/com/metamx/druid/StorageAdapter.java | 5 +- .../DataSegmentChangeRequest.java | 3 +- .../druid/coordination/DruidClusterInfo.java | 6 +- .../SegmentChangeRequestDrop.java | 3 +- .../SegmentChangeRequestLoad.java | 3 +- .../druid/coordination/ServerManager.java | 16 ++-- .../druid/coordination/ZkCoordinator.java | 19 +++-- .../coordination/ZkCoordinatorConfig.java | 4 +- .../coordination/legacy/S3SizeLookup.java | 6 +- .../coordination/legacy/TheSizeAdjuster.java | 11 +-- .../druid/db/DatabaseSegmentManager.java | 42 +++++----- .../com/metamx/druid/http/InfoResource.java | 35 ++++---- .../com/metamx/druid/http/MasterMain.java | 33 ++++---- .../com/metamx/druid/http/MasterResource.java | 10 +-- .../druid/http/MasterServletModule.java | 9 +- .../com/metamx/druid/http/RedirectFilter.java | 15 ++-- .../metamx/druid/http/RedirectServlet.java | 10 ++- .../com/metamx/druid/http/ServerMain.java | 33 ++++---- .../metamx/druid/index/brita/AndFilter.java | 3 +- .../index/brita/DimensionPredicateFilter.java | 7 +- .../druid/index/brita/ExtractionFilter.java | 7 +- .../com/metamx/druid/index/brita/Filters.java | 7 +- .../index/brita/InvertedIndexSelector.java | 3 +- .../metamx/druid/index/brita/OrFilter.java | 3 +- .../metamx/druid/index/brita/RegexFilter.java | 5 +- .../v1/ComplexMetricColumnSerializer.java | 8 +- .../metamx/druid/index/v1/ConciseOffset.java | 3 +- .../index/v1/FloatMetricColumnSerializer.java | 6 +- .../index/v1/IncrementalIndexAdapter.java | 19 +++-- .../v1/IncrementalIndexStorageAdapter.java | 22 ++--- .../druid/index/v1/IndexGranularity.java | 3 +- .../metamx/druid/index/v1/IndexMerger.java | 45 +++++----- .../druid/index/v1/IndexStorageAdapter.java | 18 ++-- .../druid/index/v1/IndexableAdapter.java | 3 +- .../druid/index/v1/MMappedIndexAdapter.java | 11 +-- .../index/v1/MMappedIndexStorageAdapter.java | 16 ++-- .../index/v1/MetricColumnSerializer.java | 2 - .../com/metamx/druid/index/v1/Rowboat.java | 11 +-- .../v1/RowboatFilteringIndexAdapter.java | 3 +- .../v1/SegmentIdAttachedStorageAdapter.java | 5 +- .../druid/index/v1/processing/Cursor.java | 3 +- .../index/v1/processing/CursorFactory.java | 3 +- .../druid/initialization/ServerInit.java | 13 +-- .../ConvertingBaseQueryableFactory.java | 9 +- .../DelegatingStorageAdapterLoader.java | 7 +- .../loading/MMappedStorageAdapterFactory.java | 6 +- .../druid/loading/RealtimeSegmentGetter.java | 6 +- .../metamx/druid/loading/S3SegmentGetter.java | 21 ++--- .../druid/loading/S3SegmentGetterConfig.java | 4 +- .../druid/loading/S3ZippedSegmentGetter.java | 25 +++--- .../loading/SingleStorageAdapterLoader.java | 4 +- .../druid/loading/StorageAdapterFactory.java | 4 +- .../druid/loading/StorageAdapterLoader.java | 4 +- .../metamx/druid/master/BalancerAnalyzer.java | 8 +- .../com/metamx/druid/master/DruidMaster.java | 25 +++--- .../druid/master/DruidMasterAssigner.java | 8 +- .../druid/master/DruidMasterBalancer.java | 10 +-- .../druid/master/DruidMasterDropper.java | 8 +- .../druid/master/DruidMasterLogger.java | 6 +- .../druid/master/DruidMasterReplicator.java | 14 ++-- .../master/DruidMasterRuntimeParams.java | 12 +-- .../master/DruidMasterSegmentInfoLoader.java | 4 +- .../master/DruidMasterSegmentMerger.java | 13 +-- .../metamx/druid/master/HttpMergerClient.java | 9 +- .../metamx/druid/master/LoadQueuePeon.java | 24 +++--- .../com/metamx/druid/master/MergerClient.java | 4 +- .../metamx/druid/metrics/ServerMonitor.java | 4 +- ...DefaultQueryRunnerFactoryConglomerate.java | 4 +- .../druid/query/QueryRunnerFactory.java | 4 +- .../group/GroupByQueryRunnerFactory.java | 10 +-- .../search/SearchQueryRunnerFactory.java | 6 +- .../TimeBoundaryQueryRunnerFactory.java | 8 +- .../druid/utils/ExposeS3DataSource.java | 31 +++---- .../java/com/metamx/druid/utils/ZkSetup.java | 5 +- .../SegmentChangeRequestDropTest.java | 13 +-- .../SegmentChangeRequestLoadTest.java | 13 +-- .../druid/coordination/ServerManagerTest.java | 27 +++--- .../druid/coordination/ZkCoordinatorTest.java | 25 +++--- .../druid/db/DatabaseSegmentManagerTest.java | 16 ++-- .../druid/index/v1/ConciseOffsetTest.java | 4 +- .../metamx/druid/index/v1/EmptyIndexTest.java | 13 +-- .../v1/processing/IntersectingOffsetTest.java | 5 +- .../v1/processing/UnioningOffsetTest.java | 5 +- .../loading/NoopStorageAdapterLoader.java | 9 +- .../druid/master/BalancerAnalyzerTest.java | 12 +-- .../druid/master/DruidMasterBalancerTest.java | 14 ++-- .../master/DruidMasterReplicatorTest.java | 15 ++-- .../master/DruidMasterSegmentMergerTest.java | 14 ++-- .../metamx/druid/master/DruidMasterTest.java | 15 ++-- 388 files changed, 2266 insertions(+), 2036 deletions(-) diff --git a/client/src/main/java/com/metamx/druid/BaseQuery.java b/client/src/main/java/com/metamx/druid/BaseQuery.java index 4538467c167..8213d67a553 100644 --- a/client/src/main/java/com/metamx/druid/BaseQuery.java +++ b/client/src/main/java/com/metamx/druid/BaseQuery.java @@ -19,17 +19,18 @@ package com.metamx.druid; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.Duration; +import org.joda.time.Interval; + import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.metamx.common.guava.Sequence; import com.metamx.druid.query.segment.QuerySegmentSpec; import com.metamx.druid.query.segment.QuerySegmentWalker; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.Duration; -import org.joda.time.Interval; - -import java.util.List; -import java.util.Map; /** */ diff --git a/client/src/main/java/com/metamx/druid/Druids.java b/client/src/main/java/com/metamx/druid/Druids.java index b9c2fbaca74..618d1adc15c 100644 --- a/client/src/main/java/com/metamx/druid/Druids.java +++ b/client/src/main/java/com/metamx/druid/Druids.java @@ -19,6 +19,12 @@ package com.metamx.druid; +import java.util.List; +import java.util.Map; + +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.collect.Lists; import com.metamx.druid.query.filter.AndDimFilter; import com.metamx.druid.query.filter.DimFilter; @@ -35,11 +41,6 @@ import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; import com.metamx.druid.result.Result; import com.metamx.druid.result.SearchResultValue; import com.metamx.druid.result.TimeBoundaryResultValue; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.util.List; -import java.util.Map; /** */ diff --git a/client/src/main/java/com/metamx/druid/Query.java b/client/src/main/java/com/metamx/druid/Query.java index f7450f86534..cb77ca3ed4e 100644 --- a/client/src/main/java/com/metamx/druid/Query.java +++ b/client/src/main/java/com/metamx/druid/Query.java @@ -19,19 +19,20 @@ package com.metamx.druid; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.annotate.JsonSubTypes; +import org.codehaus.jackson.annotate.JsonTypeInfo; +import org.joda.time.Duration; +import org.joda.time.Interval; + import com.metamx.common.guava.Sequence; import com.metamx.druid.query.group.GroupByQuery; import com.metamx.druid.query.search.SearchQuery; import com.metamx.druid.query.segment.QuerySegmentSpec; import com.metamx.druid.query.segment.QuerySegmentWalker; import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; -import org.codehaus.jackson.annotate.JsonSubTypes; -import org.codehaus.jackson.annotate.JsonTypeInfo; -import org.joda.time.Duration; -import org.joda.time.Interval; - -import java.util.List; -import java.util.Map; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "queryType") @JsonSubTypes(value = { diff --git a/client/src/main/java/com/metamx/druid/ResultGranularTimestampComparator.java b/client/src/main/java/com/metamx/druid/ResultGranularTimestampComparator.java index 972d98b3214..01568bc27b0 100644 --- a/client/src/main/java/com/metamx/druid/ResultGranularTimestampComparator.java +++ b/client/src/main/java/com/metamx/druid/ResultGranularTimestampComparator.java @@ -19,11 +19,11 @@ package com.metamx.druid; +import java.util.Comparator; + import com.google.common.primitives.Longs; import com.metamx.druid.result.Result; -import java.util.Comparator; - /** */ public class ResultGranularTimestampComparator implements Comparator> diff --git a/client/src/main/java/com/metamx/druid/SearchBinaryFn.java b/client/src/main/java/com/metamx/druid/SearchBinaryFn.java index bf87f20bbb3..9403b55a9f2 100644 --- a/client/src/main/java/com/metamx/druid/SearchBinaryFn.java +++ b/client/src/main/java/com/metamx/druid/SearchBinaryFn.java @@ -19,6 +19,8 @@ package com.metamx.druid; +import java.util.TreeSet; + import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.metamx.common.guava.nary.BinaryFn; @@ -26,9 +28,6 @@ import com.metamx.druid.query.search.SearchHit; import com.metamx.druid.query.search.SearchSortSpec; import com.metamx.druid.result.Result; import com.metamx.druid.result.SearchResultValue; -import org.joda.time.DateTime; - -import java.util.TreeSet; /** */ diff --git a/client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java b/client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java index 6c7e588a6b7..d933fe31ef2 100644 --- a/client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java +++ b/client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java @@ -19,6 +19,19 @@ package com.metamx.druid.client; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executors; + +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.base.Supplier; import com.google.common.base.Throwables; @@ -52,18 +65,6 @@ import com.metamx.druid.query.segment.MultipleSpecificSegmentSpec; import com.metamx.druid.query.segment.SegmentDescriptor; import com.metamx.druid.result.BySegmentResultValueClass; import com.metamx.druid.result.Result; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Executors; /** */ diff --git a/client/src/main/java/com/metamx/druid/client/ClientInventoryManager.java b/client/src/main/java/com/metamx/druid/client/ClientInventoryManager.java index 5ec8cf47d36..9fdab41abe4 100644 --- a/client/src/main/java/com/metamx/druid/client/ClientInventoryManager.java +++ b/client/src/main/java/com/metamx/druid/client/ClientInventoryManager.java @@ -19,16 +19,16 @@ package com.metamx.druid.client; +import java.util.Map; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; + import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.metamx.common.Pair; import com.metamx.common.logger.Logger; import com.metamx.phonebook.PhoneBook; import com.metamx.phonebook.PhoneBookPeon; -import java.util.Map; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; - /** */ public class ClientInventoryManager extends InventoryManager diff --git a/client/src/main/java/com/metamx/druid/client/ClientSideServerView.java b/client/src/main/java/com/metamx/druid/client/ClientSideServerView.java index 3b0de0d870f..aa5aba6fc62 100644 --- a/client/src/main/java/com/metamx/druid/client/ClientSideServerView.java +++ b/client/src/main/java/com/metamx/druid/client/ClientSideServerView.java @@ -19,6 +19,15 @@ package com.metamx.druid.client; +import java.util.Iterator; +import java.util.Map; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.Executor; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.map.ObjectMapper; + import com.google.common.base.Function; import com.google.common.collect.Maps; import com.google.common.collect.Ordering; @@ -28,13 +37,6 @@ import com.metamx.druid.client.selector.ServerSelector; import com.metamx.druid.query.QueryRunner; import com.metamx.druid.query.QueryToolChestWarehouse; import com.metamx.http.client.HttpClient; -import org.codehaus.jackson.map.ObjectMapper; - -import javax.annotation.Nullable; -import java.util.Iterator; -import java.util.Map; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.Executor; /** */ diff --git a/client/src/main/java/com/metamx/druid/client/DataSegment.java b/client/src/main/java/com/metamx/druid/client/DataSegment.java index 1f7fcc42d19..1e3feede7d3 100644 --- a/client/src/main/java/com/metamx/druid/client/DataSegment.java +++ b/client/src/main/java/com/metamx/druid/client/DataSegment.java @@ -19,18 +19,12 @@ package com.metamx.druid.client; -import com.google.common.base.Preconditions; -import com.google.common.base.Predicate; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.metamx.common.Granularity; -import com.metamx.druid.jackson.CommaListJoinDeserializer; -import com.metamx.druid.jackson.CommaListJoinSerializer; -import com.metamx.druid.query.segment.SegmentDescriptor; -import com.metamx.druid.shard.NoneShardSpec; -import com.metamx.druid.shard.ShardSpec; +import java.util.Comparator; +import java.util.List; +import java.util.Map; + +import javax.annotation.Nullable; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonDeserialize; @@ -38,10 +32,17 @@ import org.codehaus.jackson.map.annotate.JsonSerialize; import org.joda.time.DateTime; import org.joda.time.Interval; -import javax.annotation.Nullable; -import java.util.Comparator; -import java.util.List; -import java.util.Map; +import com.google.common.base.Preconditions; +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterables; +import com.metamx.common.Granularity; +import com.metamx.druid.jackson.CommaListJoinDeserializer; +import com.metamx.druid.jackson.CommaListJoinSerializer; +import com.metamx.druid.query.segment.SegmentDescriptor; +import com.metamx.druid.shard.NoneShardSpec; +import com.metamx.druid.shard.ShardSpec; /** */ diff --git a/client/src/main/java/com/metamx/druid/client/DirectDruidClient.java b/client/src/main/java/com/metamx/druid/client/DirectDruidClient.java index 62782a41892..1f4ae372062 100644 --- a/client/src/main/java/com/metamx/druid/client/DirectDruidClient.java +++ b/client/src/main/java/com/metamx/druid/client/DirectDruidClient.java @@ -19,6 +19,26 @@ package com.metamx.druid.client; +import java.io.Closeable; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Iterator; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + +import org.codehaus.jackson.JsonParser; +import org.codehaus.jackson.JsonToken; +import org.codehaus.jackson.ObjectCodec; +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.map.type.TypeFactory; +import org.codehaus.jackson.smile.SmileFactory; +import org.codehaus.jackson.type.JavaType; +import org.jboss.netty.handler.codec.http.HttpChunk; +import org.jboss.netty.handler.codec.http.HttpHeaders; +import org.jboss.netty.handler.codec.http.HttpResponse; + import com.google.common.base.Throwables; import com.google.common.collect.Maps; import com.google.common.io.Closeables; @@ -40,25 +60,6 @@ import com.metamx.http.client.HttpClient; import com.metamx.http.client.io.AppendableByteArrayInputStream; import com.metamx.http.client.response.ClientResponse; import com.metamx.http.client.response.InputStreamResponseHandler; -import org.codehaus.jackson.JsonParser; -import org.codehaus.jackson.JsonToken; -import org.codehaus.jackson.ObjectCodec; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.type.TypeFactory; -import org.codehaus.jackson.smile.SmileFactory; -import org.codehaus.jackson.type.JavaType; -import org.jboss.netty.handler.codec.http.HttpChunk; -import org.jboss.netty.handler.codec.http.HttpHeaders; -import org.jboss.netty.handler.codec.http.HttpResponse; - -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.Iterator; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; /** */ diff --git a/client/src/main/java/com/metamx/druid/client/DruidDataSource.java b/client/src/main/java/com/metamx/druid/client/DruidDataSource.java index 6f96e8e8672..611ad81f1a0 100644 --- a/client/src/main/java/com/metamx/druid/client/DruidDataSource.java +++ b/client/src/main/java/com/metamx/druid/client/DruidDataSource.java @@ -19,14 +19,15 @@ package com.metamx.druid.client; -import com.google.common.collect.Maps; -import org.codehaus.jackson.annotate.JsonProperty; - import java.util.Collections; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentSkipListSet; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.google.common.collect.Maps; + /** */ public class DruidDataSource diff --git a/client/src/main/java/com/metamx/druid/client/DruidServer.java b/client/src/main/java/com/metamx/druid/client/DruidServer.java index d8f4cda8fa7..751e2d7e46c 100644 --- a/client/src/main/java/com/metamx/druid/client/DruidServer.java +++ b/client/src/main/java/com/metamx/druid/client/DruidServer.java @@ -19,16 +19,17 @@ package com.metamx.druid.client; -import com.google.common.collect.ImmutableMap; -import com.metamx.common.logger.Logger; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.google.common.collect.ImmutableMap; +import com.metamx.common.logger.Logger; + /** */ public class DruidServer implements Comparable diff --git a/client/src/main/java/com/metamx/druid/client/InventoryManagementStrategy.java b/client/src/main/java/com/metamx/druid/client/InventoryManagementStrategy.java index a47f057fa43..9b14c56c6f0 100644 --- a/client/src/main/java/com/metamx/druid/client/InventoryManagementStrategy.java +++ b/client/src/main/java/com/metamx/druid/client/InventoryManagementStrategy.java @@ -19,11 +19,11 @@ package com.metamx.druid.client; +import java.util.Map; + import com.metamx.common.Pair; import com.metamx.phonebook.PhoneBookPeon; -import java.util.Map; - /** */ public interface InventoryManagementStrategy diff --git a/client/src/main/java/com/metamx/druid/client/InventoryManager.java b/client/src/main/java/com/metamx/druid/client/InventoryManager.java index 13f6b6aae5f..8135df4042d 100644 --- a/client/src/main/java/com/metamx/druid/client/InventoryManager.java +++ b/client/src/main/java/com/metamx/druid/client/InventoryManager.java @@ -19,6 +19,12 @@ package com.metamx.druid.client; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import com.metamx.common.ISE; import com.metamx.common.Pair; import com.metamx.common.lifecycle.LifecycleStart; @@ -27,12 +33,6 @@ import com.metamx.common.logger.Logger; import com.metamx.phonebook.PhoneBook; import com.metamx.phonebook.PhoneBookPeon; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - /** */ public abstract class InventoryManager diff --git a/client/src/main/java/com/metamx/druid/client/OnlyNewSegmentWatcherServerView.java b/client/src/main/java/com/metamx/druid/client/OnlyNewSegmentWatcherServerView.java index 3448667f106..dea8065a447 100644 --- a/client/src/main/java/com/metamx/druid/client/OnlyNewSegmentWatcherServerView.java +++ b/client/src/main/java/com/metamx/druid/client/OnlyNewSegmentWatcherServerView.java @@ -19,17 +19,17 @@ package com.metamx.druid.client; +import java.util.Iterator; +import java.util.Map; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.Executor; + import com.google.common.collect.Maps; import com.metamx.common.logger.Logger; import com.metamx.druid.VersionedIntervalTimeline; import com.metamx.druid.client.selector.ServerSelector; import com.metamx.druid.query.QueryRunner; -import java.util.Iterator; -import java.util.Map; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.Executor; - /** */ public class OnlyNewSegmentWatcherServerView implements MutableServerView diff --git a/client/src/main/java/com/metamx/druid/client/SegmentInventoryManager.java b/client/src/main/java/com/metamx/druid/client/SegmentInventoryManager.java index 5bc8633dd9b..0b3b075be78 100644 --- a/client/src/main/java/com/metamx/druid/client/SegmentInventoryManager.java +++ b/client/src/main/java/com/metamx/druid/client/SegmentInventoryManager.java @@ -19,13 +19,13 @@ package com.metamx.druid.client; +import java.util.Map; + import com.metamx.common.Pair; import com.metamx.common.logger.Logger; import com.metamx.phonebook.PhoneBook; import com.metamx.phonebook.PhoneBookPeon; -import java.util.Map; - /** */ public class SegmentInventoryManager extends InventoryManager diff --git a/client/src/main/java/com/metamx/druid/client/ServerInventoryManager.java b/client/src/main/java/com/metamx/druid/client/ServerInventoryManager.java index bd32a62791d..27f2aca0e63 100644 --- a/client/src/main/java/com/metamx/druid/client/ServerInventoryManager.java +++ b/client/src/main/java/com/metamx/druid/client/ServerInventoryManager.java @@ -19,15 +19,15 @@ package com.metamx.druid.client; +import java.util.Iterator; +import java.util.Map; + import com.google.common.collect.Maps; import com.metamx.common.Pair; import com.metamx.common.logger.Logger; import com.metamx.phonebook.PhoneBook; import com.metamx.phonebook.PhoneBookPeon; -import java.util.Iterator; -import java.util.Map; - /** */ public class ServerInventoryManager extends InventoryManager diff --git a/client/src/main/java/com/metamx/druid/client/ServerView.java b/client/src/main/java/com/metamx/druid/client/ServerView.java index 4b707549387..c5fcb30370d 100644 --- a/client/src/main/java/com/metamx/druid/client/ServerView.java +++ b/client/src/main/java/com/metamx/druid/client/ServerView.java @@ -19,12 +19,12 @@ package com.metamx.druid.client; +import java.util.concurrent.Executor; + import com.metamx.druid.VersionedIntervalTimeline; import com.metamx.druid.client.selector.ServerSelector; import com.metamx.druid.query.QueryRunner; -import java.util.concurrent.Executor; - /** */ public interface ServerView diff --git a/client/src/main/java/com/metamx/druid/client/ZKPhoneBook.java b/client/src/main/java/com/metamx/druid/client/ZKPhoneBook.java index af9d552d009..cecf7cf5118 100644 --- a/client/src/main/java/com/metamx/druid/client/ZKPhoneBook.java +++ b/client/src/main/java/com/metamx/druid/client/ZKPhoneBook.java @@ -19,6 +19,21 @@ package com.metamx.druid.client; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.Executor; + +import org.I0Itec.zkclient.DataUpdater; +import org.I0Itec.zkclient.IZkChildListener; +import org.I0Itec.zkclient.ZkClient; +import org.I0Itec.zkclient.exception.ZkNoNodeException; +import org.I0Itec.zkclient.exception.ZkNodeExistsException; +import org.codehaus.jackson.map.ObjectMapper; + import com.google.common.base.Joiner; import com.google.common.collect.HashBasedTable; import com.google.common.collect.Maps; @@ -28,20 +43,6 @@ import com.metamx.common.logger.Logger; import com.metamx.phonebook.BasePhoneBook; import com.metamx.phonebook.PhoneBook; import com.metamx.phonebook.PhoneBookPeon; -import org.I0Itec.zkclient.DataUpdater; -import org.I0Itec.zkclient.IZkChildListener; -import org.I0Itec.zkclient.ZkClient; -import org.I0Itec.zkclient.exception.ZkNoNodeException; -import org.I0Itec.zkclient.exception.ZkNodeExistsException; -import org.codehaus.jackson.map.ObjectMapper; - -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.Executor; /** */ diff --git a/client/src/main/java/com/metamx/druid/client/cache/ByteCountingLRUMap.java b/client/src/main/java/com/metamx/druid/client/cache/ByteCountingLRUMap.java index 59a60f060e5..395fba01909 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/ByteCountingLRUMap.java +++ b/client/src/main/java/com/metamx/druid/client/cache/ByteCountingLRUMap.java @@ -19,12 +19,12 @@ package com.metamx.druid.client.cache; -import com.metamx.common.logger.Logger; - import java.nio.ByteBuffer; import java.util.LinkedHashMap; import java.util.Map; +import com.metamx.common.logger.Logger; + /** */ class ByteCountingLRUMap extends LinkedHashMap diff --git a/client/src/main/java/com/metamx/druid/client/cache/MapCacheBroker.java b/client/src/main/java/com/metamx/druid/client/cache/MapCacheBroker.java index 943c5aae154..decc68464af 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/MapCacheBroker.java +++ b/client/src/main/java/com/metamx/druid/client/cache/MapCacheBroker.java @@ -19,10 +19,6 @@ package com.metamx.druid.client.cache; -import com.google.common.collect.Maps; -import com.google.common.primitives.Ints; -import com.metamx.common.ISE; - import java.nio.ByteBuffer; import java.util.Collections; import java.util.Iterator; @@ -30,6 +26,10 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import com.google.common.collect.Maps; +import com.google.common.primitives.Ints; +import com.metamx.common.ISE; + /** */ public class MapCacheBroker implements CacheBroker diff --git a/client/src/main/java/com/metamx/druid/client/selector/ServerSelector.java b/client/src/main/java/com/metamx/druid/client/selector/ServerSelector.java index 22d56e46f69..69f6f0813af 100644 --- a/client/src/main/java/com/metamx/druid/client/selector/ServerSelector.java +++ b/client/src/main/java/com/metamx/druid/client/selector/ServerSelector.java @@ -19,14 +19,14 @@ package com.metamx.druid.client.selector; +import java.util.LinkedHashSet; +import java.util.Random; + import com.google.common.collect.Iterables; import com.google.common.collect.Sets; import com.metamx.druid.client.DataSegment; import com.metamx.druid.client.DruidServer; -import java.util.LinkedHashSet; -import java.util.Random; - /** */ public class ServerSelector diff --git a/client/src/main/java/com/metamx/druid/http/BrokerMain.java b/client/src/main/java/com/metamx/druid/http/BrokerMain.java index 0386685c94a..e583393891f 100644 --- a/client/src/main/java/com/metamx/druid/http/BrokerMain.java +++ b/client/src/main/java/com/metamx/druid/http/BrokerMain.java @@ -19,6 +19,17 @@ package com.metamx.druid.http; +import java.util.Properties; +import java.util.concurrent.ScheduledExecutorService; + +import org.I0Itec.zkclient.ZkClient; +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.smile.SmileFactory; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.ServletHolder; +import org.skife.config.ConfigurationObjectFactory; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.inject.Guice; @@ -58,16 +69,6 @@ import com.metamx.metrics.SysMonitor; import com.metamx.phonebook.PhoneBook; import com.netflix.curator.framework.CuratorFramework; import com.netflix.curator.x.discovery.ServiceDiscovery; -import org.I0Itec.zkclient.ZkClient; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.smile.SmileFactory; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.servlet.Context; -import org.mortbay.jetty.servlet.ServletHolder; -import org.skife.config.ConfigurationObjectFactory; - -import java.util.Properties; -import java.util.concurrent.ScheduledExecutorService; /** */ diff --git a/client/src/main/java/com/metamx/druid/http/ClientInfoResource.java b/client/src/main/java/com/metamx/druid/http/ClientInfoResource.java index 50a0475de4b..99e788970a4 100644 --- a/client/src/main/java/com/metamx/druid/http/ClientInfoResource.java +++ b/client/src/main/java/com/metamx/druid/http/ClientInfoResource.java @@ -19,6 +19,18 @@ package com.metamx.druid.http; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; + +import org.joda.time.Interval; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -29,16 +41,6 @@ import com.metamx.druid.client.ClientInventoryManager; import com.metamx.druid.client.DataSegment; import com.metamx.druid.client.DruidDataSource; import com.metamx.druid.client.DruidServer; -import org.joda.time.Interval; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; /** */ diff --git a/client/src/main/java/com/metamx/druid/http/ClientQuerySegmentWalker.java b/client/src/main/java/com/metamx/druid/http/ClientQuerySegmentWalker.java index d316e8fcab5..3a5492d9490 100644 --- a/client/src/main/java/com/metamx/druid/http/ClientQuerySegmentWalker.java +++ b/client/src/main/java/com/metamx/druid/http/ClientQuerySegmentWalker.java @@ -19,6 +19,10 @@ package com.metamx.druid.http; +import javax.annotation.Nullable; + +import org.joda.time.Interval; + import com.google.common.base.Function; import com.metamx.druid.Query; import com.metamx.druid.client.CachingClusteredClient; @@ -31,9 +35,6 @@ import com.metamx.druid.query.segment.QuerySegmentWalker; import com.metamx.druid.query.segment.SegmentDescriptor; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; -import org.joda.time.Interval; - -import javax.annotation.Nullable; /** */ diff --git a/client/src/main/java/com/metamx/druid/http/ClientServletModule.java b/client/src/main/java/com/metamx/druid/http/ClientServletModule.java index 7ecc5d7ad81..52e1b4ff7aa 100644 --- a/client/src/main/java/com/metamx/druid/http/ClientServletModule.java +++ b/client/src/main/java/com/metamx/druid/http/ClientServletModule.java @@ -19,15 +19,16 @@ package com.metamx.druid.http; +import javax.inject.Singleton; + +import org.codehaus.jackson.jaxrs.JacksonJsonProvider; +import org.codehaus.jackson.map.ObjectMapper; + import com.google.inject.Provides; import com.metamx.druid.client.ClientInventoryManager; import com.metamx.druid.query.segment.QuerySegmentWalker; import com.sun.jersey.guice.JerseyServletModule; import com.sun.jersey.guice.spi.container.servlet.GuiceContainer; -import org.codehaus.jackson.jaxrs.JacksonJsonProvider; -import org.codehaus.jackson.map.ObjectMapper; - -import javax.inject.Singleton; /** */ diff --git a/client/src/main/java/com/metamx/druid/http/FileRequestLogger.java b/client/src/main/java/com/metamx/druid/http/FileRequestLogger.java index 20425f9eb37..8a3d2f3e1d4 100644 --- a/client/src/main/java/com/metamx/druid/http/FileRequestLogger.java +++ b/client/src/main/java/com/metamx/druid/http/FileRequestLogger.java @@ -19,21 +19,22 @@ package com.metamx.druid.http; -import com.google.common.base.Throwables; -import com.google.common.io.Closeables; -import com.metamx.common.concurrent.ScheduledExecutors; -import com.metamx.common.lifecycle.LifecycleStart; -import com.metamx.common.lifecycle.LifecycleStop; -import org.joda.time.DateTime; -import org.joda.time.Duration; -import org.joda.time.MutableDateTime; - import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.concurrent.Callable; import java.util.concurrent.ScheduledExecutorService; +import org.joda.time.DateTime; +import org.joda.time.Duration; +import org.joda.time.MutableDateTime; + +import com.google.common.base.Throwables; +import com.google.common.io.Closeables; +import com.metamx.common.concurrent.ScheduledExecutors; +import com.metamx.common.lifecycle.LifecycleStart; +import com.metamx.common.lifecycle.LifecycleStop; + /** */ public class FileRequestLogger implements RequestLogger diff --git a/client/src/main/java/com/metamx/druid/http/QueryServlet.java b/client/src/main/java/com/metamx/druid/http/QueryServlet.java index f68efbc1e89..5bea2c6da4a 100644 --- a/client/src/main/java/com/metamx/druid/http/QueryServlet.java +++ b/client/src/main/java/com/metamx/druid/http/QueryServlet.java @@ -19,6 +19,20 @@ package com.metamx.druid.http; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.Charset; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.map.ObjectWriter; +import org.joda.time.DateTime; +import org.mortbay.jetty.Request; + import com.google.common.base.Charsets; import com.google.common.collect.ImmutableMap; import com.google.common.io.ByteStreams; @@ -31,18 +45,6 @@ import com.metamx.druid.query.segment.QuerySegmentWalker; import com.metamx.emitter.service.AlertEvent; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.ObjectWriter; -import org.joda.time.DateTime; -import org.mortbay.jetty.Request; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.charset.Charset; /** */ diff --git a/client/src/main/java/com/metamx/druid/http/RequestLogLine.java b/client/src/main/java/com/metamx/druid/http/RequestLogLine.java index e42be46fff6..474de4ef92d 100644 --- a/client/src/main/java/com/metamx/druid/http/RequestLogLine.java +++ b/client/src/main/java/com/metamx/druid/http/RequestLogLine.java @@ -19,11 +19,12 @@ package com.metamx.druid.http; -import com.google.common.base.Joiner; -import com.metamx.druid.Query; +import java.util.Arrays; + import org.joda.time.DateTime; -import java.util.Arrays; +import com.google.common.base.Joiner; +import com.metamx.druid.Query; public class RequestLogLine { diff --git a/client/src/main/java/com/metamx/druid/http/StatusServlet.java b/client/src/main/java/com/metamx/druid/http/StatusServlet.java index 95a40c543b8..2d6ce4c9247 100644 --- a/client/src/main/java/com/metamx/druid/http/StatusServlet.java +++ b/client/src/main/java/com/metamx/druid/http/StatusServlet.java @@ -19,15 +19,16 @@ package com.metamx.druid.http; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + /** */ public class StatusServlet extends HttpServlet diff --git a/client/src/main/java/com/metamx/druid/initialization/Initialization.java b/client/src/main/java/com/metamx/druid/initialization/Initialization.java index f14cfecebf8..301070d9093 100644 --- a/client/src/main/java/com/metamx/druid/initialization/Initialization.java +++ b/client/src/main/java/com/metamx/druid/initialization/Initialization.java @@ -19,6 +19,21 @@ package com.metamx.druid.initialization; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +import org.I0Itec.zkclient.ZkClient; +import org.I0Itec.zkclient.ZkConnection; +import org.codehaus.jackson.map.ObjectMapper; +import org.mortbay.jetty.Connector; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.nio.SelectChannelConnector; +import org.mortbay.thread.QueuedThreadPool; + import com.google.common.base.Throwables; import com.google.common.io.Closeables; import com.google.common.util.concurrent.ThreadFactoryBuilder; @@ -36,20 +51,6 @@ import com.netflix.curator.x.discovery.ServiceDiscovery; import com.netflix.curator.x.discovery.ServiceDiscoveryBuilder; import com.netflix.curator.x.discovery.ServiceInstance; import com.netflix.curator.x.discovery.ServiceProvider; -import org.I0Itec.zkclient.ZkClient; -import org.I0Itec.zkclient.ZkConnection; -import org.codehaus.jackson.map.ObjectMapper; -import org.mortbay.jetty.Connector; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.nio.SelectChannelConnector; -import org.mortbay.thread.QueuedThreadPool; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; /** */ diff --git a/client/src/main/java/com/metamx/druid/merge/ClientAppendQuery.java b/client/src/main/java/com/metamx/druid/merge/ClientAppendQuery.java index 441adcffc3b..4d0a5cf8f99 100644 --- a/client/src/main/java/com/metamx/druid/merge/ClientAppendQuery.java +++ b/client/src/main/java/com/metamx/druid/merge/ClientAppendQuery.java @@ -19,11 +19,12 @@ package com.metamx.druid.merge; -import com.metamx.druid.client.DataSegment; +import java.util.List; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.util.List; +import com.metamx.druid.client.DataSegment; /** */ diff --git a/client/src/main/java/com/metamx/druid/merge/ClientDefaultMergeQuery.java b/client/src/main/java/com/metamx/druid/merge/ClientDefaultMergeQuery.java index c5cc8045492..c94814bdbe9 100644 --- a/client/src/main/java/com/metamx/druid/merge/ClientDefaultMergeQuery.java +++ b/client/src/main/java/com/metamx/druid/merge/ClientDefaultMergeQuery.java @@ -19,12 +19,13 @@ package com.metamx.druid.merge; -import com.metamx.druid.aggregation.AggregatorFactory; -import com.metamx.druid.client.DataSegment; +import java.util.List; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.util.List; +import com.metamx.druid.aggregation.AggregatorFactory; +import com.metamx.druid.client.DataSegment; /** */ diff --git a/client/src/main/java/com/metamx/druid/merge/ClientMergeQuery.java b/client/src/main/java/com/metamx/druid/merge/ClientMergeQuery.java index 83f269d0db3..06f237f7219 100644 --- a/client/src/main/java/com/metamx/druid/merge/ClientMergeQuery.java +++ b/client/src/main/java/com/metamx/druid/merge/ClientMergeQuery.java @@ -19,11 +19,12 @@ package com.metamx.druid.merge; -import com.metamx.druid.client.DataSegment; +import java.util.List; + import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import java.util.List; +import com.metamx.druid.client.DataSegment; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/BySegmentQueryRunner.java b/client/src/main/java/com/metamx/druid/query/BySegmentQueryRunner.java index 1ecea33117f..5e0c5b5362c 100644 --- a/client/src/main/java/com/metamx/druid/query/BySegmentQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/BySegmentQueryRunner.java @@ -19,6 +19,10 @@ package com.metamx.druid.query; +import java.util.List; + +import org.joda.time.DateTime; + import com.google.common.collect.Lists; import com.metamx.common.guava.Accumulator; import com.metamx.common.guava.Sequence; @@ -29,9 +33,6 @@ import com.metamx.common.guava.YieldingAccumulator; import com.metamx.druid.Query; import com.metamx.druid.result.BySegmentResultValueClass; import com.metamx.druid.result.Result; -import org.joda.time.DateTime; - -import java.util.List; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java b/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java index b86d3128d08..1254dd96b53 100644 --- a/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java @@ -19,6 +19,14 @@ package com.metamx.druid.query; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; + import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; @@ -29,14 +37,6 @@ import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.druid.Query; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; - /** * A QueryRunner that combines a list of other QueryRunners and executes them in parallel on an executor. *

diff --git a/client/src/main/java/com/metamx/druid/query/FinalizeResultsQueryRunner.java b/client/src/main/java/com/metamx/druid/query/FinalizeResultsQueryRunner.java index 22f11bb07a8..f67a959b4dc 100644 --- a/client/src/main/java/com/metamx/druid/query/FinalizeResultsQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/FinalizeResultsQueryRunner.java @@ -19,6 +19,8 @@ package com.metamx.druid.query; +import javax.annotation.Nullable; + import com.google.common.base.Function; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; @@ -29,8 +31,6 @@ import com.metamx.druid.aggregation.AggregatorFactory; import com.metamx.druid.result.BySegmentResultValueClass; import com.metamx.druid.result.Result; -import javax.annotation.Nullable; - /** */ public class FinalizeResultsQueryRunner implements QueryRunner diff --git a/client/src/main/java/com/metamx/druid/query/IntervalChunkingQueryRunner.java b/client/src/main/java/com/metamx/druid/query/IntervalChunkingQueryRunner.java index 9c0a32eac3f..b05f6bdb465 100644 --- a/client/src/main/java/com/metamx/druid/query/IntervalChunkingQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/IntervalChunkingQueryRunner.java @@ -19,6 +19,15 @@ package com.metamx.druid.query; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import javax.annotation.Nullable; + +import org.joda.time.Interval; +import org.joda.time.Period; + import com.google.common.base.Function; import com.google.common.collect.Lists; import com.metamx.common.guava.FunctionalIterable; @@ -27,13 +36,6 @@ import com.metamx.common.guava.Sequences; import com.metamx.druid.PeriodGranularity; import com.metamx.druid.Query; import com.metamx.druid.query.segment.MultipleIntervalSegmentSpec; -import org.joda.time.Interval; -import org.joda.time.Period; - -import javax.annotation.Nullable; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/MetricsEmittingQueryRunner.java b/client/src/main/java/com/metamx/druid/query/MetricsEmittingQueryRunner.java index 44db0ac3893..3a29192c70c 100644 --- a/client/src/main/java/com/metamx/druid/query/MetricsEmittingQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/MetricsEmittingQueryRunner.java @@ -19,6 +19,8 @@ package com.metamx.druid.query; +import java.io.IOException; + import com.google.common.base.Function; import com.metamx.common.guava.Accumulator; import com.metamx.common.guava.Sequence; @@ -28,8 +30,6 @@ import com.metamx.druid.Query; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; -import java.io.IOException; - /** */ public class MetricsEmittingQueryRunner implements QueryRunner diff --git a/client/src/main/java/com/metamx/druid/query/QueryCacheHelper.java b/client/src/main/java/com/metamx/druid/query/QueryCacheHelper.java index dd293fbdf5c..7a6e3e8d53b 100644 --- a/client/src/main/java/com/metamx/druid/query/QueryCacheHelper.java +++ b/client/src/main/java/com/metamx/druid/query/QueryCacheHelper.java @@ -19,12 +19,12 @@ package com.metamx.druid.query; -import com.google.common.collect.Lists; -import com.metamx.druid.aggregation.AggregatorFactory; - import java.nio.ByteBuffer; import java.util.List; +import com.google.common.collect.Lists; +import com.metamx.druid.aggregation.AggregatorFactory; + /** */ public class QueryCacheHelper diff --git a/client/src/main/java/com/metamx/druid/query/QueryToolChest.java b/client/src/main/java/com/metamx/druid/query/QueryToolChest.java index ebf77f64af4..4f97449e0e5 100644 --- a/client/src/main/java/com/metamx/druid/query/QueryToolChest.java +++ b/client/src/main/java/com/metamx/druid/query/QueryToolChest.java @@ -19,11 +19,12 @@ package com.metamx.druid.query; +import org.codehaus.jackson.type.TypeReference; + import com.google.common.base.Function; import com.metamx.common.guava.Sequence; import com.metamx.druid.Query; import com.metamx.emitter.service.ServiceMetricEvent; -import org.codehaus.jackson.type.TypeReference; /** * The broker-side (also used by server in some cases) API for a specific Query type. This API is still undergoing diff --git a/client/src/main/java/com/metamx/druid/query/ReflectionLoaderThingy.java b/client/src/main/java/com/metamx/druid/query/ReflectionLoaderThingy.java index cd9eba24f25..2be8346f5f0 100644 --- a/client/src/main/java/com/metamx/druid/query/ReflectionLoaderThingy.java +++ b/client/src/main/java/com/metamx/druid/query/ReflectionLoaderThingy.java @@ -19,12 +19,12 @@ package com.metamx.druid.query; -import com.google.common.collect.Maps; -import com.metamx.common.logger.Logger; - import java.util.Map; import java.util.concurrent.atomic.AtomicReference; +import com.google.common.collect.Maps; +import com.metamx.common.logger.Logger; + /** */ public class ReflectionLoaderThingy diff --git a/client/src/main/java/com/metamx/druid/query/dimension/DefaultDimensionSpec.java b/client/src/main/java/com/metamx/druid/query/dimension/DefaultDimensionSpec.java index 4895378cc1b..99af7eb936d 100644 --- a/client/src/main/java/com/metamx/druid/query/dimension/DefaultDimensionSpec.java +++ b/client/src/main/java/com/metamx/druid/query/dimension/DefaultDimensionSpec.java @@ -19,11 +19,12 @@ package com.metamx.druid.query.dimension; -import com.metamx.druid.query.extraction.DimExtractionFn; +import java.nio.ByteBuffer; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.nio.ByteBuffer; +import com.metamx.druid.query.extraction.DimExtractionFn; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/dimension/DimensionSpec.java b/client/src/main/java/com/metamx/druid/query/dimension/DimensionSpec.java index 34310ef4c09..48f53d8a8ce 100644 --- a/client/src/main/java/com/metamx/druid/query/dimension/DimensionSpec.java +++ b/client/src/main/java/com/metamx/druid/query/dimension/DimensionSpec.java @@ -19,10 +19,11 @@ package com.metamx.druid.query.dimension; -import com.metamx.druid.query.extraction.DimExtractionFn; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; +import com.metamx.druid.query.extraction.DimExtractionFn; + /** */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = LegacyDimensionSpec.class) diff --git a/client/src/main/java/com/metamx/druid/query/dimension/ExtractionDimensionSpec.java b/client/src/main/java/com/metamx/druid/query/dimension/ExtractionDimensionSpec.java index ed85b840d0d..1ad755e7ce2 100644 --- a/client/src/main/java/com/metamx/druid/query/dimension/ExtractionDimensionSpec.java +++ b/client/src/main/java/com/metamx/druid/query/dimension/ExtractionDimensionSpec.java @@ -19,11 +19,12 @@ package com.metamx.druid.query.dimension; -import com.metamx.druid.query.extraction.DimExtractionFn; +import java.nio.ByteBuffer; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.nio.ByteBuffer; +import com.metamx.druid.query.extraction.DimExtractionFn; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/dimension/LegacyDimensionSpec.java b/client/src/main/java/com/metamx/druid/query/dimension/LegacyDimensionSpec.java index 9a4e11a9a5f..b3b3dfa65ca 100644 --- a/client/src/main/java/com/metamx/druid/query/dimension/LegacyDimensionSpec.java +++ b/client/src/main/java/com/metamx/druid/query/dimension/LegacyDimensionSpec.java @@ -19,10 +19,11 @@ package com.metamx.druid.query.dimension; -import com.metamx.common.IAE; +import java.util.Map; + import org.codehaus.jackson.annotate.JsonCreator; -import java.util.Map; +import com.metamx.common.IAE; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/extraction/PartialDimExtractionFn.java b/client/src/main/java/com/metamx/druid/query/extraction/PartialDimExtractionFn.java index 28ea1ebc37b..2dbbf85c9f6 100644 --- a/client/src/main/java/com/metamx/druid/query/extraction/PartialDimExtractionFn.java +++ b/client/src/main/java/com/metamx/druid/query/extraction/PartialDimExtractionFn.java @@ -19,13 +19,13 @@ package com.metamx.druid.query.extraction; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.nio.ByteBuffer; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + /** */ public class PartialDimExtractionFn implements DimExtractionFn diff --git a/client/src/main/java/com/metamx/druid/query/extraction/RegexDimExtractionFn.java b/client/src/main/java/com/metamx/druid/query/extraction/RegexDimExtractionFn.java index da3a878aa2f..02189bb37e3 100644 --- a/client/src/main/java/com/metamx/druid/query/extraction/RegexDimExtractionFn.java +++ b/client/src/main/java/com/metamx/druid/query/extraction/RegexDimExtractionFn.java @@ -19,13 +19,13 @@ package com.metamx.druid.query.extraction; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.nio.ByteBuffer; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + /** */ public class RegexDimExtractionFn implements DimExtractionFn diff --git a/client/src/main/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFn.java b/client/src/main/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFn.java index 57e3bfde16b..f3d9c33bb35 100644 --- a/client/src/main/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFn.java +++ b/client/src/main/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFn.java @@ -19,11 +19,12 @@ package com.metamx.druid.query.extraction; -import com.metamx.druid.query.search.SearchQuerySpec; +import java.nio.ByteBuffer; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.nio.ByteBuffer; +import com.metamx.druid.query.search.SearchQuerySpec; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/extraction/TimeDimExtractionFn.java b/client/src/main/java/com/metamx/druid/query/extraction/TimeDimExtractionFn.java index dc2c2eb36cf..e9fb0179adc 100644 --- a/client/src/main/java/com/metamx/druid/query/extraction/TimeDimExtractionFn.java +++ b/client/src/main/java/com/metamx/druid/query/extraction/TimeDimExtractionFn.java @@ -19,14 +19,15 @@ package com.metamx.druid.query.extraction; -import com.ibm.icu.text.SimpleDateFormat; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.nio.ByteBuffer; import java.text.ParseException; import java.util.Date; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.ibm.icu.text.SimpleDateFormat; + /** */ public class TimeDimExtractionFn implements DimExtractionFn diff --git a/client/src/main/java/com/metamx/druid/query/filter/AndDimFilter.java b/client/src/main/java/com/metamx/druid/query/filter/AndDimFilter.java index b0bbb581030..b6362928dac 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/AndDimFilter.java +++ b/client/src/main/java/com/metamx/druid/query/filter/AndDimFilter.java @@ -19,11 +19,12 @@ package com.metamx.druid.query.filter; -import com.google.common.base.Joiner; +import java.util.List; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.util.List; +import com.google.common.base.Joiner; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/filter/ExtractionDimFilter.java b/client/src/main/java/com/metamx/druid/query/filter/ExtractionDimFilter.java index dd5e7ad6ddd..8ce682174bf 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/ExtractionDimFilter.java +++ b/client/src/main/java/com/metamx/druid/query/filter/ExtractionDimFilter.java @@ -19,11 +19,12 @@ package com.metamx.druid.query.filter; -import com.metamx.druid.query.extraction.DimExtractionFn; +import java.nio.ByteBuffer; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.nio.ByteBuffer; +import com.metamx.druid.query.extraction.DimExtractionFn; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/filter/NotDimFilter.java b/client/src/main/java/com/metamx/druid/query/filter/NotDimFilter.java index 391ac29bfde..aae09b3fbc8 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/NotDimFilter.java +++ b/client/src/main/java/com/metamx/druid/query/filter/NotDimFilter.java @@ -19,11 +19,11 @@ package com.metamx.druid.query.filter; +import java.nio.ByteBuffer; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.nio.ByteBuffer; - /** */ public class NotDimFilter implements DimFilter diff --git a/client/src/main/java/com/metamx/druid/query/filter/OrDimFilter.java b/client/src/main/java/com/metamx/druid/query/filter/OrDimFilter.java index 4ebdcb8471e..4cddd3e5943 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/OrDimFilter.java +++ b/client/src/main/java/com/metamx/druid/query/filter/OrDimFilter.java @@ -19,11 +19,12 @@ package com.metamx.druid.query.filter; -import com.google.common.base.Joiner; +import java.util.List; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.util.List; +import com.google.common.base.Joiner; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/filter/RegexDimFilter.java b/client/src/main/java/com/metamx/druid/query/filter/RegexDimFilter.java index 584916c9bf4..a582b3d2b4c 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/RegexDimFilter.java +++ b/client/src/main/java/com/metamx/druid/query/filter/RegexDimFilter.java @@ -19,11 +19,12 @@ package com.metamx.druid.query.filter; -import com.google.common.base.Charsets; +import java.nio.ByteBuffer; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.nio.ByteBuffer; +import com.google.common.base.Charsets; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/filter/SelectorDimFilter.java b/client/src/main/java/com/metamx/druid/query/filter/SelectorDimFilter.java index 73097ec0cd1..2f6d5371232 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/SelectorDimFilter.java +++ b/client/src/main/java/com/metamx/druid/query/filter/SelectorDimFilter.java @@ -19,11 +19,11 @@ package com.metamx.druid.query.filter; +import java.nio.ByteBuffer; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.nio.ByteBuffer; - /** */ public class SelectorDimFilter implements DimFilter diff --git a/client/src/main/java/com/metamx/druid/query/group/GroupByQuery.java b/client/src/main/java/com/metamx/druid/query/group/GroupByQuery.java index d30af309473..9be360d2f7e 100644 --- a/client/src/main/java/com/metamx/druid/query/group/GroupByQuery.java +++ b/client/src/main/java/com/metamx/druid/query/group/GroupByQuery.java @@ -19,6 +19,12 @@ package com.metamx.druid.query.group; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -33,11 +39,6 @@ import com.metamx.druid.query.dimension.DimensionSpec; import com.metamx.druid.query.filter.DimFilter; import com.metamx.druid.query.segment.LegacySegmentSpec; import com.metamx.druid.query.segment.QuerySegmentSpec; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - -import java.util.List; -import java.util.Map; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/group/GroupByQueryQueryToolChest.java b/client/src/main/java/com/metamx/druid/query/group/GroupByQueryQueryToolChest.java index d66f27f4d36..4ab2e9973e3 100644 --- a/client/src/main/java/com/metamx/druid/query/group/GroupByQueryQueryToolChest.java +++ b/client/src/main/java/com/metamx/druid/query/group/GroupByQueryQueryToolChest.java @@ -19,6 +19,15 @@ package com.metamx.druid.query.group; +import java.util.List; +import java.util.Properties; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.type.TypeReference; +import org.joda.time.Interval; +import org.joda.time.Minutes; + import com.google.common.base.Function; import com.google.common.base.Functions; import com.google.common.base.Joiner; @@ -41,13 +50,6 @@ import com.metamx.druid.query.QueryToolChest; import com.metamx.druid.query.dimension.DimensionSpec; import com.metamx.druid.utils.PropUtils; import com.metamx.emitter.service.ServiceMetricEvent; -import org.codehaus.jackson.type.TypeReference; -import org.joda.time.Interval; -import org.joda.time.Minutes; - -import javax.annotation.Nullable; -import java.util.List; -import java.util.Properties; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/search/FragmentSearchQuerySpec.java b/client/src/main/java/com/metamx/druid/query/search/FragmentSearchQuerySpec.java index e0a73b4bc3c..3c83a229095 100644 --- a/client/src/main/java/com/metamx/druid/query/search/FragmentSearchQuerySpec.java +++ b/client/src/main/java/com/metamx/druid/query/search/FragmentSearchQuerySpec.java @@ -19,13 +19,14 @@ package com.metamx.druid.query.search; -import com.google.common.base.Function; -import com.google.common.collect.Lists; +import java.nio.ByteBuffer; +import java.util.List; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.nio.ByteBuffer; -import java.util.List; +import com.google.common.base.Function; +import com.google.common.collect.Lists; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/search/InsensitiveContainsSearchQuerySpec.java b/client/src/main/java/com/metamx/druid/query/search/InsensitiveContainsSearchQuerySpec.java index 87a6246a5b2..bad823c6e24 100644 --- a/client/src/main/java/com/metamx/druid/query/search/InsensitiveContainsSearchQuerySpec.java +++ b/client/src/main/java/com/metamx/druid/query/search/InsensitiveContainsSearchQuerySpec.java @@ -19,11 +19,11 @@ package com.metamx.druid.query.search; +import java.nio.ByteBuffer; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.nio.ByteBuffer; - /** */ public class InsensitiveContainsSearchQuerySpec implements SearchQuerySpec diff --git a/client/src/main/java/com/metamx/druid/query/search/LexicographicSearchSortSpec.java b/client/src/main/java/com/metamx/druid/query/search/LexicographicSearchSortSpec.java index b7dfddef413..c5d0ca990df 100644 --- a/client/src/main/java/com/metamx/druid/query/search/LexicographicSearchSortSpec.java +++ b/client/src/main/java/com/metamx/druid/query/search/LexicographicSearchSortSpec.java @@ -19,10 +19,9 @@ package com.metamx.druid.query.search; -import org.codehaus.jackson.annotate.JsonCreator; - import java.util.Comparator; -import java.util.Map; + +import org.codehaus.jackson.annotate.JsonCreator; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchHit.java b/client/src/main/java/com/metamx/druid/query/search/SearchHit.java index c1c0727067a..3064ec1ccf4 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchHit.java +++ b/client/src/main/java/com/metamx/druid/query/search/SearchHit.java @@ -19,11 +19,11 @@ package com.metamx.druid.query.search; +import static com.google.common.base.Preconditions.checkNotNull; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import static com.google.common.base.Preconditions.checkNotNull; - /** */ public class SearchHit implements Comparable diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchQuery.java b/client/src/main/java/com/metamx/druid/query/search/SearchQuery.java index 2a721431b89..7ef40272d9a 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchQuery.java +++ b/client/src/main/java/com/metamx/druid/query/search/SearchQuery.java @@ -19,6 +19,14 @@ package com.metamx.druid.query.search; +import java.util.List; +import java.util.Map; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; @@ -29,12 +37,6 @@ import com.metamx.druid.query.filter.DimFilter; import com.metamx.druid.query.segment.QuerySegmentSpec; import com.metamx.druid.result.Result; import com.metamx.druid.result.SearchResultValue; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - -import javax.annotation.Nullable; -import java.util.List; -import java.util.Map; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchQueryQueryToolChest.java b/client/src/main/java/com/metamx/druid/query/search/SearchQueryQueryToolChest.java index 1b6a5e1345e..85b768f2b99 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchQueryQueryToolChest.java +++ b/client/src/main/java/com/metamx/druid/query/search/SearchQueryQueryToolChest.java @@ -19,6 +19,20 @@ package com.metamx.druid.query.search; +import java.nio.ByteBuffer; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.type.TypeReference; +import org.joda.time.DateTime; +import org.joda.time.Interval; +import org.joda.time.Minutes; +import org.joda.time.Period; + import com.google.common.base.Function; import com.google.common.base.Functions; import com.google.common.base.Joiner; @@ -49,18 +63,6 @@ import com.metamx.druid.result.Result; import com.metamx.druid.result.SearchResultValue; import com.metamx.druid.utils.PropUtils; import com.metamx.emitter.service.ServiceMetricEvent; -import org.codehaus.jackson.type.TypeReference; -import org.joda.time.DateTime; -import org.joda.time.Interval; -import org.joda.time.Minutes; -import org.joda.time.Period; - -import javax.annotation.Nullable; -import java.nio.ByteBuffer; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchQuerySpec.java b/client/src/main/java/com/metamx/druid/query/search/SearchQuerySpec.java index faa1cca17a7..6c19bd3b3bc 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchQuerySpec.java +++ b/client/src/main/java/com/metamx/druid/query/search/SearchQuerySpec.java @@ -19,12 +19,9 @@ package com.metamx.druid.query.search; -import com.google.common.base.Predicate; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import java.util.List; - /** */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchSortSpec.java b/client/src/main/java/com/metamx/druid/query/search/SearchSortSpec.java index b68f074e2ce..07c1b42416c 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchSortSpec.java +++ b/client/src/main/java/com/metamx/druid/query/search/SearchSortSpec.java @@ -19,11 +19,11 @@ package com.metamx.druid.query.search; +import java.util.Comparator; + import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import java.util.Comparator; - /** */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = LexicographicSearchSortSpec.class) diff --git a/client/src/main/java/com/metamx/druid/query/search/StrlenSearchSortSpec.java b/client/src/main/java/com/metamx/druid/query/search/StrlenSearchSortSpec.java index bef5de85726..8fd79701c1d 100644 --- a/client/src/main/java/com/metamx/druid/query/search/StrlenSearchSortSpec.java +++ b/client/src/main/java/com/metamx/druid/query/search/StrlenSearchSortSpec.java @@ -20,7 +20,6 @@ package com.metamx.druid.query.search; import java.util.Comparator; -import java.util.Map; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/segment/LegacySegmentSpec.java b/client/src/main/java/com/metamx/druid/query/segment/LegacySegmentSpec.java index 6d25c152ab4..4bd18029e77 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/LegacySegmentSpec.java +++ b/client/src/main/java/com/metamx/druid/query/segment/LegacySegmentSpec.java @@ -19,16 +19,17 @@ package com.metamx.druid.query.segment; -import com.google.common.base.Function; -import com.google.common.collect.Lists; -import com.metamx.common.IAE; -import org.codehaus.jackson.annotate.JsonCreator; -import org.joda.time.Interval; - import java.util.Arrays; import java.util.List; import java.util.Map; +import org.codehaus.jackson.annotate.JsonCreator; +import org.joda.time.Interval; + +import com.google.common.base.Function; +import com.google.common.collect.Lists; +import com.metamx.common.IAE; + /** */ public class LegacySegmentSpec extends MultipleIntervalSegmentSpec diff --git a/client/src/main/java/com/metamx/druid/query/segment/MultipleIntervalSegmentSpec.java b/client/src/main/java/com/metamx/druid/query/segment/MultipleIntervalSegmentSpec.java index f81126857bc..823f2c3a659 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/MultipleIntervalSegmentSpec.java +++ b/client/src/main/java/com/metamx/druid/query/segment/MultipleIntervalSegmentSpec.java @@ -19,15 +19,16 @@ package com.metamx.druid.query.segment; -import com.metamx.druid.Query; -import com.metamx.druid.query.QueryRunner; -import com.metamx.druid.utils.JodaUtils; +import java.util.Collections; +import java.util.List; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.joda.time.Interval; -import java.util.Collections; -import java.util.List; +import com.metamx.druid.Query; +import com.metamx.druid.query.QueryRunner; +import com.metamx.druid.utils.JodaUtils; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/segment/MultipleSpecificSegmentSpec.java b/client/src/main/java/com/metamx/druid/query/segment/MultipleSpecificSegmentSpec.java index 4193934fbc0..c28f8406ca5 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/MultipleSpecificSegmentSpec.java +++ b/client/src/main/java/com/metamx/druid/query/segment/MultipleSpecificSegmentSpec.java @@ -19,16 +19,17 @@ package com.metamx.druid.query.segment; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.metamx.druid.Query; import com.metamx.druid.query.QueryRunner; import com.metamx.druid.utils.JodaUtils; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.Interval; - -import java.util.List; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentSpec.java b/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentSpec.java index ca42ce8bc8a..ab0ce80b2c8 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentSpec.java +++ b/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentSpec.java @@ -19,13 +19,14 @@ package com.metamx.druid.query.segment; -import com.metamx.druid.Query; -import com.metamx.druid.query.QueryRunner; +import java.util.List; + import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; import org.joda.time.Interval; -import java.util.List; +import com.metamx.druid.Query; +import com.metamx.druid.query.QueryRunner; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentWalker.java b/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentWalker.java index efb7667a370..526bb448b20 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentWalker.java +++ b/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentWalker.java @@ -19,9 +19,10 @@ package com.metamx.druid.query.segment; +import org.joda.time.Interval; + import com.metamx.druid.Query; import com.metamx.druid.query.QueryRunner; -import org.joda.time.Interval; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentQueryRunner.java b/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentQueryRunner.java index f5289185646..62f2f43cec7 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentQueryRunner.java @@ -19,6 +19,9 @@ package com.metamx.druid.query.segment; +import java.io.IOException; +import java.util.concurrent.Callable; + import com.google.common.base.Throwables; import com.metamx.common.guava.Accumulator; import com.metamx.common.guava.Sequence; @@ -27,9 +30,6 @@ import com.metamx.common.guava.YieldingAccumulator; import com.metamx.druid.Query; import com.metamx.druid.query.QueryRunner; -import java.io.IOException; -import java.util.concurrent.Callable; - /** */ public class SpecificSegmentQueryRunner implements QueryRunner diff --git a/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentSpec.java b/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentSpec.java index c85ef86aa2a..ca1953669d5 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentSpec.java +++ b/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentSpec.java @@ -19,13 +19,14 @@ package com.metamx.druid.query.segment; -import com.metamx.druid.Query; -import com.metamx.druid.query.QueryRunner; -import org.joda.time.Interval; - import java.util.Arrays; import java.util.List; +import org.joda.time.Interval; + +import com.metamx.druid.Query; +import com.metamx.druid.query.QueryRunner; + /** */ public class SpecificSegmentSpec implements QuerySegmentSpec diff --git a/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQuery.java b/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQuery.java index b68d97813ca..be30df421f8 100644 --- a/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQuery.java +++ b/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQuery.java @@ -19,6 +19,16 @@ package com.metamx.druid.query.timeboundary; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -28,15 +38,6 @@ import com.metamx.druid.query.segment.MultipleIntervalSegmentSpec; import com.metamx.druid.query.segment.QuerySegmentSpec; import com.metamx.druid.result.Result; import com.metamx.druid.result.TimeBoundaryResultValue; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.List; -import java.util.Map; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java b/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java index 9d65ab9b47c..73471f8fe63 100644 --- a/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java +++ b/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java @@ -19,6 +19,14 @@ package com.metamx.druid.query.timeboundary; +import java.nio.ByteBuffer; +import java.util.List; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.type.TypeReference; +import org.joda.time.DateTime; + import com.google.common.base.Function; import com.google.common.base.Functions; import com.google.common.collect.Lists; @@ -36,12 +44,6 @@ import com.metamx.druid.query.QueryToolChest; import com.metamx.druid.result.Result; import com.metamx.druid.result.TimeBoundaryResultValue; import com.metamx.emitter.service.ServiceMetricEvent; -import org.codehaus.jackson.type.TypeReference; -import org.joda.time.DateTime; - -import javax.annotation.Nullable; -import java.nio.ByteBuffer; -import java.util.List; /** */ diff --git a/client/src/main/java/com/metamx/druid/result/BySegmentResultValueClass.java b/client/src/main/java/com/metamx/druid/result/BySegmentResultValueClass.java index 24d9637ae84..eddd10ad687 100644 --- a/client/src/main/java/com/metamx/druid/result/BySegmentResultValueClass.java +++ b/client/src/main/java/com/metamx/druid/result/BySegmentResultValueClass.java @@ -19,10 +19,10 @@ package com.metamx.druid.result; -import org.codehaus.jackson.annotate.JsonProperty; - import java.util.List; +import org.codehaus.jackson.annotate.JsonProperty; + /** */ public class BySegmentResultValueClass diff --git a/client/src/main/java/com/metamx/druid/result/BySegmentSearchResultValue.java b/client/src/main/java/com/metamx/druid/result/BySegmentSearchResultValue.java index b324ccbab37..4517429039a 100644 --- a/client/src/main/java/com/metamx/druid/result/BySegmentSearchResultValue.java +++ b/client/src/main/java/com/metamx/druid/result/BySegmentSearchResultValue.java @@ -19,11 +19,12 @@ package com.metamx.druid.result; -import com.metamx.druid.query.search.SearchHit; +import java.util.List; + import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.annotate.JsonValue; -import java.util.List; +import com.metamx.druid.query.search.SearchHit; /** */ diff --git a/client/src/main/java/com/metamx/druid/result/Result.java b/client/src/main/java/com/metamx/druid/result/Result.java index 9fc5aebf347..49cc332aa1e 100644 --- a/client/src/main/java/com/metamx/druid/result/Result.java +++ b/client/src/main/java/com/metamx/druid/result/Result.java @@ -21,7 +21,6 @@ package com.metamx.druid.result; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.annotate.JsonUnwrapped; import org.joda.time.DateTime; /** diff --git a/client/src/main/java/com/metamx/druid/result/SearchResultValue.java b/client/src/main/java/com/metamx/druid/result/SearchResultValue.java index 40f10ed85ec..3131b9eeeee 100644 --- a/client/src/main/java/com/metamx/druid/result/SearchResultValue.java +++ b/client/src/main/java/com/metamx/druid/result/SearchResultValue.java @@ -19,12 +19,13 @@ package com.metamx.druid.result; -import com.metamx.druid.query.search.SearchHit; +import java.util.Iterator; +import java.util.List; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonValue; -import java.util.Iterator; -import java.util.List; +import com.metamx.druid.query.search.SearchHit; /** */ diff --git a/client/src/main/java/com/metamx/druid/result/TimeBoundaryResultValue.java b/client/src/main/java/com/metamx/druid/result/TimeBoundaryResultValue.java index 74daa14f376..ce85ed692c7 100644 --- a/client/src/main/java/com/metamx/druid/result/TimeBoundaryResultValue.java +++ b/client/src/main/java/com/metamx/druid/result/TimeBoundaryResultValue.java @@ -19,13 +19,14 @@ package com.metamx.druid.result; -import com.metamx.common.IAE; -import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; +import java.util.Map; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonValue; import org.joda.time.DateTime; -import java.util.Map; +import com.metamx.common.IAE; +import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; /** */ diff --git a/client/src/main/java/com/metamx/druid/shard/NoneShardSpec.java b/client/src/main/java/com/metamx/druid/shard/NoneShardSpec.java index 4ed756e1daf..cf3dd974094 100644 --- a/client/src/main/java/com/metamx/druid/shard/NoneShardSpec.java +++ b/client/src/main/java/com/metamx/druid/shard/NoneShardSpec.java @@ -19,12 +19,11 @@ package com.metamx.druid.shard; +import java.util.Map; + import com.metamx.druid.input.InputRow; import com.metamx.druid.partition.PartitionChunk; import com.metamx.druid.partition.SingleElementPartitionChunk; -import org.codehaus.jackson.annotate.JsonTypeName; - -import java.util.Map; /** */ diff --git a/client/src/main/java/com/metamx/druid/shard/ShardSpec.java b/client/src/main/java/com/metamx/druid/shard/ShardSpec.java index c0127b055e9..03a11a4b47d 100644 --- a/client/src/main/java/com/metamx/druid/shard/ShardSpec.java +++ b/client/src/main/java/com/metamx/druid/shard/ShardSpec.java @@ -19,12 +19,13 @@ package com.metamx.druid.shard; -import com.metamx.druid.input.InputRow; -import com.metamx.druid.partition.PartitionChunk; +import java.util.Map; + import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import java.util.Map; +import com.metamx.druid.input.InputRow; +import com.metamx.druid.partition.PartitionChunk; /** * A Marker interface that exists to combine ShardSpec objects together for Jackson diff --git a/client/src/main/java/com/metamx/druid/shard/SingleDimensionShardSpec.java b/client/src/main/java/com/metamx/druid/shard/SingleDimensionShardSpec.java index 7580673b071..c4b67073b1e 100644 --- a/client/src/main/java/com/metamx/druid/shard/SingleDimensionShardSpec.java +++ b/client/src/main/java/com/metamx/druid/shard/SingleDimensionShardSpec.java @@ -19,14 +19,14 @@ package com.metamx.druid.shard; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.annotate.JsonProperty; + import com.metamx.druid.input.InputRow; import com.metamx.druid.partition.PartitionChunk; import com.metamx.druid.partition.StringPartitionChunk; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.annotate.JsonTypeName; - -import java.util.List; -import java.util.Map; /** * Class uses getters/setters to work around http://jira.codehaus.org/browse/MSHADE-92 diff --git a/client/src/main/java/com/metamx/druid/zk/StringZkSerializer.java b/client/src/main/java/com/metamx/druid/zk/StringZkSerializer.java index 40ccf68da17..b6b08e78eac 100644 --- a/client/src/main/java/com/metamx/druid/zk/StringZkSerializer.java +++ b/client/src/main/java/com/metamx/druid/zk/StringZkSerializer.java @@ -19,11 +19,12 @@ package com.metamx.druid.zk; -import com.metamx.common.IAE; +import java.nio.charset.Charset; + import org.I0Itec.zkclient.exception.ZkMarshallingError; import org.I0Itec.zkclient.serialize.ZkSerializer; -import java.nio.charset.Charset; +import com.metamx.common.IAE; /** */ diff --git a/client/src/main/java/com/metamx/phonebook/BasePhoneBook.java b/client/src/main/java/com/metamx/phonebook/BasePhoneBook.java index f604f341412..dc2cad6a459 100644 --- a/client/src/main/java/com/metamx/phonebook/BasePhoneBook.java +++ b/client/src/main/java/com/metamx/phonebook/BasePhoneBook.java @@ -19,13 +19,13 @@ package com.metamx.phonebook; +import java.util.List; +import java.util.Map; + import com.metamx.common.ISE; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; -import java.util.List; -import java.util.Map; - /** */ public class BasePhoneBook implements PhoneBook diff --git a/client/src/main/java/com/metamx/phonebook/ConsistentHashLookup.java b/client/src/main/java/com/metamx/phonebook/ConsistentHashLookup.java index ff2dd74a63b..30dc22218fb 100644 --- a/client/src/main/java/com/metamx/phonebook/ConsistentHashLookup.java +++ b/client/src/main/java/com/metamx/phonebook/ConsistentHashLookup.java @@ -19,12 +19,12 @@ package com.metamx.phonebook; -import org.apache.commons.codec.digest.DigestUtils; - import java.math.BigInteger; import java.util.Map; import java.util.TreeMap; +import org.apache.commons.codec.digest.DigestUtils; + /** */ public class ConsistentHashLookup implements ServiceLookup diff --git a/client/src/main/java/com/metamx/phonebook/StoppedPhoneBook.java b/client/src/main/java/com/metamx/phonebook/StoppedPhoneBook.java index 907ee186b06..ac00c1a9777 100644 --- a/client/src/main/java/com/metamx/phonebook/StoppedPhoneBook.java +++ b/client/src/main/java/com/metamx/phonebook/StoppedPhoneBook.java @@ -19,6 +19,12 @@ package com.metamx.phonebook; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import com.google.common.base.Supplier; import com.google.common.collect.Constraint; import com.google.common.collect.Constraints; @@ -29,12 +35,6 @@ import com.google.common.collect.Sets; import com.metamx.common.IAE; import com.metamx.common.logger.Logger; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - /** * A class that collects announcements for you. Can be used to simplify start/stop logic * diff --git a/client/src/test/java/com/metamx/druid/CombiningIterableTest.java b/client/src/test/java/com/metamx/druid/CombiningIterableTest.java index 94650467656..845ff5accf0 100644 --- a/client/src/test/java/com/metamx/druid/CombiningIterableTest.java +++ b/client/src/test/java/com/metamx/druid/CombiningIterableTest.java @@ -19,17 +19,18 @@ package com.metamx.druid; -import com.metamx.common.guava.nary.BinaryFn; -import com.metamx.druid.result.Result; -import org.joda.time.DateTime; -import org.junit.Assert; -import org.junit.Test; - import java.util.Arrays; import java.util.Comparator; import java.util.Iterator; import java.util.List; +import org.joda.time.DateTime; +import org.junit.Assert; +import org.junit.Test; + +import com.metamx.common.guava.nary.BinaryFn; +import com.metamx.druid.result.Result; + /** */ public class CombiningIterableTest diff --git a/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java b/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java index 13f99f601ac..f8e86563b3d 100644 --- a/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java +++ b/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java @@ -19,11 +19,12 @@ package com.metamx.druid; -import com.metamx.druid.result.Result; import org.joda.time.DateTime; import org.junit.Assert; import org.junit.Test; +import com.metamx.druid.result.Result; + /** */ public class ResultGranularTimestampComparatorTest diff --git a/client/src/test/java/com/metamx/druid/SearchBinaryFnTest.java b/client/src/test/java/com/metamx/druid/SearchBinaryFnTest.java index 4b6b4181d26..796bf5a25bc 100644 --- a/client/src/test/java/com/metamx/druid/SearchBinaryFnTest.java +++ b/client/src/test/java/com/metamx/druid/SearchBinaryFnTest.java @@ -19,17 +19,19 @@ package com.metamx.druid; +import java.util.Iterator; + +import junit.framework.Assert; + +import org.joda.time.DateTime; +import org.junit.Test; + import com.google.common.collect.ImmutableList; import com.metamx.druid.query.search.LexicographicSearchSortSpec; import com.metamx.druid.query.search.SearchHit; import com.metamx.druid.query.search.StrlenSearchSortSpec; import com.metamx.druid.result.Result; import com.metamx.druid.result.SearchResultValue; -import junit.framework.Assert; -import org.joda.time.DateTime; -import org.junit.Test; - -import java.util.Iterator; /** */ diff --git a/client/src/test/java/com/metamx/druid/TestHelper.java b/client/src/test/java/com/metamx/druid/TestHelper.java index 342b3b4111c..16dc90695a4 100644 --- a/client/src/test/java/com/metamx/druid/TestHelper.java +++ b/client/src/test/java/com/metamx/druid/TestHelper.java @@ -19,13 +19,14 @@ package com.metamx.druid; +import java.util.Iterator; + +import org.junit.Assert; + import com.google.common.collect.Lists; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.druid.result.Result; -import org.junit.Assert; - -import java.util.Iterator; /** */ diff --git a/client/src/test/java/com/metamx/druid/client/DataSegmentTest.java b/client/src/test/java/com/metamx/druid/client/DataSegmentTest.java index c29d10781e2..25a767fe56b 100644 --- a/client/src/test/java/com/metamx/druid/client/DataSegmentTest.java +++ b/client/src/test/java/com/metamx/druid/client/DataSegmentTest.java @@ -19,13 +19,12 @@ package com.metamx.druid.client; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.shard.NoneShardSpec; -import com.metamx.druid.shard.SingleDimensionShardSpec; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; import org.joda.time.DateTime; @@ -33,11 +32,13 @@ import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.metamx.druid.jackson.DefaultObjectMapper; +import com.metamx.druid.shard.NoneShardSpec; +import com.metamx.druid.shard.SingleDimensionShardSpec; /** */ diff --git a/client/src/test/java/com/metamx/druid/client/cache/ByteCountingLRUMapTest.java b/client/src/test/java/com/metamx/druid/client/cache/ByteCountingLRUMapTest.java index fac858d2192..b3d273b2bf8 100644 --- a/client/src/test/java/com/metamx/druid/client/cache/ByteCountingLRUMapTest.java +++ b/client/src/test/java/com/metamx/druid/client/cache/ByteCountingLRUMapTest.java @@ -19,12 +19,12 @@ package com.metamx.druid.client.cache; +import java.nio.ByteBuffer; + import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.nio.ByteBuffer; - /** */ public class ByteCountingLRUMapTest diff --git a/client/src/test/java/com/metamx/druid/client/cache/MapCacheBrokerTest.java b/client/src/test/java/com/metamx/druid/client/cache/MapCacheBrokerTest.java index 4338a23a10d..343fe1e6301 100644 --- a/client/src/test/java/com/metamx/druid/client/cache/MapCacheBrokerTest.java +++ b/client/src/test/java/com/metamx/druid/client/cache/MapCacheBrokerTest.java @@ -19,11 +19,12 @@ package com.metamx.druid.client.cache; -import com.google.common.primitives.Ints; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import com.google.common.primitives.Ints; + /** */ public class MapCacheBrokerTest diff --git a/client/src/test/java/com/metamx/druid/query/QuerySegmentSpecTest.java b/client/src/test/java/com/metamx/druid/query/QuerySegmentSpecTest.java index a05973af729..4c12fc7e443 100644 --- a/client/src/test/java/com/metamx/druid/query/QuerySegmentSpecTest.java +++ b/client/src/test/java/com/metamx/druid/query/QuerySegmentSpecTest.java @@ -19,6 +19,13 @@ package com.metamx.druid.query; +import java.util.Map; + +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.Interval; +import org.junit.Assert; +import org.junit.Test; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.metamx.druid.jackson.DefaultObjectMapper; @@ -27,12 +34,6 @@ import com.metamx.druid.query.segment.MultipleIntervalSegmentSpec; import com.metamx.druid.query.segment.MultipleSpecificSegmentSpec; import com.metamx.druid.query.segment.QuerySegmentSpec; import com.metamx.druid.query.segment.SegmentDescriptor; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.Interval; -import org.junit.Assert; -import org.junit.Test; - -import java.util.Map; /** */ diff --git a/client/src/test/java/com/metamx/druid/query/extraction/PartialDimExtractionFnTest.java b/client/src/test/java/com/metamx/druid/query/extraction/PartialDimExtractionFnTest.java index 061f8122f2e..ed0407ff8a1 100644 --- a/client/src/test/java/com/metamx/druid/query/extraction/PartialDimExtractionFnTest.java +++ b/client/src/test/java/com/metamx/druid/query/extraction/PartialDimExtractionFnTest.java @@ -19,14 +19,15 @@ package com.metamx.druid.query.extraction; -import com.google.common.collect.Sets; -import org.junit.Assert; -import org.junit.Test; - import java.util.Arrays; import java.util.List; import java.util.Set; +import org.junit.Assert; +import org.junit.Test; + +import com.google.common.collect.Sets; + /** */ public class PartialDimExtractionFnTest diff --git a/client/src/test/java/com/metamx/druid/query/extraction/RegexDimExtractionFnTest.java b/client/src/test/java/com/metamx/druid/query/extraction/RegexDimExtractionFnTest.java index 2ec3f3db239..2e06a80125e 100644 --- a/client/src/test/java/com/metamx/druid/query/extraction/RegexDimExtractionFnTest.java +++ b/client/src/test/java/com/metamx/druid/query/extraction/RegexDimExtractionFnTest.java @@ -19,11 +19,12 @@ package com.metamx.druid.query.extraction; -import com.google.common.collect.Sets; +import java.util.Set; + import org.junit.Assert; import org.junit.Test; -import java.util.Set; +import com.google.common.collect.Sets; /** */ diff --git a/client/src/test/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFnTest.java b/client/src/test/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFnTest.java index 808c3603b6b..5fe1517fe8e 100644 --- a/client/src/test/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFnTest.java +++ b/client/src/test/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFnTest.java @@ -19,16 +19,17 @@ package com.metamx.druid.query.extraction; +import java.util.Arrays; +import java.util.List; +import java.util.Set; + +import org.junit.Assert; +import org.junit.Test; + import com.google.common.collect.Sets; import com.metamx.druid.query.search.FragmentSearchQuerySpec; import com.metamx.druid.query.search.LexicographicSearchSortSpec; import com.metamx.druid.query.search.SearchQuerySpec; -import org.junit.Assert; -import org.junit.Test; - -import java.util.Arrays; -import java.util.List; -import java.util.Set; /** */ diff --git a/client/src/test/java/com/metamx/druid/query/extraction/TimeDimExtractionFnTest.java b/client/src/test/java/com/metamx/druid/query/extraction/TimeDimExtractionFnTest.java index 7f5b6eabe1c..cfba9e650a6 100644 --- a/client/src/test/java/com/metamx/druid/query/extraction/TimeDimExtractionFnTest.java +++ b/client/src/test/java/com/metamx/druid/query/extraction/TimeDimExtractionFnTest.java @@ -19,11 +19,12 @@ package com.metamx.druid.query.extraction; -import com.google.common.collect.Sets; +import java.util.Set; + import org.junit.Assert; import org.junit.Test; -import java.util.Set; +import com.google.common.collect.Sets; /** */ diff --git a/client/src/test/java/com/metamx/druid/shard/SingleDimensionShardSpecTest.java b/client/src/test/java/com/metamx/druid/shard/SingleDimensionShardSpecTest.java index d92f927767f..8a11b067742 100644 --- a/client/src/test/java/com/metamx/druid/shard/SingleDimensionShardSpecTest.java +++ b/client/src/test/java/com/metamx/druid/shard/SingleDimensionShardSpecTest.java @@ -19,6 +19,13 @@ package com.metamx.druid.shard; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; + import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -28,13 +35,6 @@ import com.google.common.collect.Maps; import com.metamx.common.Pair; import com.metamx.druid.input.InputRow; import com.metamx.druid.input.MapBasedInputRow; -import org.junit.Assert; -import org.junit.Test; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; /** */ diff --git a/common/src/main/java/com/metamx/druid/BaseQueryGranularity.java b/common/src/main/java/com/metamx/druid/BaseQueryGranularity.java index bf9b8ce1f21..7fcc77ea33e 100644 --- a/common/src/main/java/com/metamx/druid/BaseQueryGranularity.java +++ b/common/src/main/java/com/metamx/druid/BaseQueryGranularity.java @@ -19,12 +19,12 @@ package com.metamx.druid; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; - import java.util.Iterator; import java.util.NoSuchElementException; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; + public abstract class BaseQueryGranularity extends QueryGranularity { public abstract long next(long offset); diff --git a/common/src/main/java/com/metamx/druid/CombiningIterable.java b/common/src/main/java/com/metamx/druid/CombiningIterable.java index 7100656207b..6f00ff6d93f 100644 --- a/common/src/main/java/com/metamx/druid/CombiningIterable.java +++ b/common/src/main/java/com/metamx/druid/CombiningIterable.java @@ -19,12 +19,12 @@ package com.metamx.druid; -import com.metamx.common.guava.MergeIterable; -import com.metamx.common.guava.nary.BinaryFn; - import java.util.Comparator; import java.util.Iterator; +import com.metamx.common.guava.MergeIterable; +import com.metamx.common.guava.nary.BinaryFn; + /** */ public class CombiningIterable implements Iterable diff --git a/common/src/main/java/com/metamx/druid/CombiningIterator.java b/common/src/main/java/com/metamx/druid/CombiningIterator.java index e8a27af0868..b31e49fc1af 100644 --- a/common/src/main/java/com/metamx/druid/CombiningIterator.java +++ b/common/src/main/java/com/metamx/druid/CombiningIterator.java @@ -19,14 +19,14 @@ package com.metamx.druid; -import com.google.common.collect.Iterators; -import com.google.common.collect.PeekingIterator; -import com.metamx.common.guava.nary.BinaryFn; - import java.util.Comparator; import java.util.Iterator; import java.util.NoSuchElementException; +import com.google.common.collect.Iterators; +import com.google.common.collect.PeekingIterator; +import com.metamx.common.guava.nary.BinaryFn; + /** */ public class CombiningIterator implements Iterator diff --git a/common/src/main/java/com/metamx/druid/DurationGranularity.java b/common/src/main/java/com/metamx/druid/DurationGranularity.java index da485b62e97..9d20c3f4b17 100644 --- a/common/src/main/java/com/metamx/druid/DurationGranularity.java +++ b/common/src/main/java/com/metamx/druid/DurationGranularity.java @@ -19,12 +19,13 @@ package com.metamx.druid; -import com.google.common.primitives.Longs; +import java.nio.ByteBuffer; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.joda.time.DateTime; -import java.nio.ByteBuffer; +import com.google.common.primitives.Longs; public class DurationGranularity extends BaseQueryGranularity { diff --git a/common/src/main/java/com/metamx/druid/QueryGranularity.java b/common/src/main/java/com/metamx/druid/QueryGranularity.java index 36a4dd01714..d7ab0e486b3 100644 --- a/common/src/main/java/com/metamx/druid/QueryGranularity.java +++ b/common/src/main/java/com/metamx/druid/QueryGranularity.java @@ -19,13 +19,14 @@ package com.metamx.druid; -import com.metamx.common.IAE; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; import org.joda.time.DateTime; import org.joda.time.ReadableDuration; +import com.metamx.common.IAE; + @JsonTypeInfo(use=JsonTypeInfo.Id.NAME, property = "type", defaultImpl = QueryGranularity.class) @JsonSubTypes(value = { @JsonSubTypes.Type(name = "period", value = PeriodGranularity.class), diff --git a/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java b/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java index 403fe8bb2cb..c515066d089 100644 --- a/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java +++ b/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java @@ -19,9 +19,10 @@ package com.metamx.druid; -import com.metamx.druid.partition.PartitionHolder; import org.joda.time.Interval; +import com.metamx.druid.partition.PartitionHolder; + /** */ public class TimelineObjectHolder diff --git a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java index a45821c7dba..4572787ba7a 100644 --- a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java +++ b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java @@ -19,15 +19,6 @@ package com.metamx.druid; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.metamx.common.guava.Comparators; -import com.metamx.common.logger.Logger; -import com.metamx.druid.partition.ImmutablePartitionHolder; -import com.metamx.druid.partition.PartitionChunk; -import com.metamx.druid.partition.PartitionHolder; -import org.joda.time.Interval; - import java.util.ArrayList; import java.util.Comparator; import java.util.Iterator; @@ -37,6 +28,16 @@ import java.util.NavigableMap; import java.util.TreeMap; import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.joda.time.Interval; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.metamx.common.guava.Comparators; +import com.metamx.common.logger.Logger; +import com.metamx.druid.partition.ImmutablePartitionHolder; +import com.metamx.druid.partition.PartitionChunk; +import com.metamx.druid.partition.PartitionHolder; + /** * VersionedIntervalTimeline is a data structure that manages objects on a specific timeline. *

diff --git a/common/src/main/java/com/metamx/druid/aggregation/Aggregator.java b/common/src/main/java/com/metamx/druid/aggregation/Aggregator.java index 4acbd162f5a..f311b09c34d 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/Aggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/Aggregator.java @@ -19,7 +19,6 @@ package com.metamx.druid.aggregation; -import java.util.Comparator; /** * An Aggregator is an object that can aggregate metrics. Its aggregation-related methods (namely, aggregate() and get()) diff --git a/common/src/main/java/com/metamx/druid/aggregation/AggregatorFactory.java b/common/src/main/java/com/metamx/druid/aggregation/AggregatorFactory.java index 00722fcf5eb..34c503f5459 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/AggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/AggregatorFactory.java @@ -19,12 +19,13 @@ package com.metamx.druid.aggregation; -import com.metamx.druid.processing.MetricSelectorFactory; +import java.util.Comparator; +import java.util.List; + import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import java.util.Comparator; -import java.util.List; +import com.metamx.druid.processing.MetricSelectorFactory; /** * Processing related interface diff --git a/common/src/main/java/com/metamx/druid/aggregation/CountAggregatorFactory.java b/common/src/main/java/com/metamx/druid/aggregation/CountAggregatorFactory.java index 61dcde40449..1c15ec67054 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/CountAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/CountAggregatorFactory.java @@ -19,14 +19,15 @@ package com.metamx.druid.aggregation; -import com.google.common.collect.ImmutableList; -import com.google.common.primitives.Longs; -import com.metamx.druid.processing.MetricSelectorFactory; +import java.util.Comparator; +import java.util.List; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.util.Comparator; -import java.util.List; +import com.google.common.collect.ImmutableList; +import com.google.common.primitives.Longs; +import com.metamx.druid.processing.MetricSelectorFactory; /** */ diff --git a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregator.java index 21cb4691227..507753fa1b1 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregator.java @@ -19,10 +19,10 @@ package com.metamx.druid.aggregation; -import com.metamx.druid.processing.FloatMetricSelector; - import java.util.Comparator; +import com.metamx.druid.processing.FloatMetricSelector; + /** */ public class DoubleSumAggregator implements Aggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregatorFactory.java b/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregatorFactory.java index d8166f841e7..f18ae23a63f 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregatorFactory.java @@ -19,16 +19,17 @@ package com.metamx.druid.aggregation; -import com.google.common.primitives.Doubles; -import com.metamx.druid.processing.MetricSelectorFactory; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.google.common.primitives.Doubles; +import com.metamx.druid.processing.MetricSelectorFactory; + /** */ public class DoubleSumAggregatorFactory implements AggregatorFactory diff --git a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumBufferAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/DoubleSumBufferAggregator.java index 3e85d489db2..add78ac8ca0 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumBufferAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/DoubleSumBufferAggregator.java @@ -19,10 +19,10 @@ package com.metamx.druid.aggregation; -import com.metamx.druid.processing.FloatMetricSelector; - import java.nio.ByteBuffer; +import com.metamx.druid.processing.FloatMetricSelector; + /** */ public class DoubleSumBufferAggregator implements BufferAggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/Histogram.java b/common/src/main/java/com/metamx/druid/aggregation/Histogram.java index 8f081ca7ade..79f7ee3c211 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/Histogram.java +++ b/common/src/main/java/com/metamx/druid/aggregation/Histogram.java @@ -19,14 +19,15 @@ package com.metamx.druid.aggregation; +import java.nio.ByteBuffer; +import java.util.Arrays; + +import org.codehaus.jackson.annotate.JsonValue; + import com.google.common.base.Preconditions; import com.google.common.primitives.Floats; import com.google.common.primitives.Ints; import com.google.common.primitives.Longs; -import org.codehaus.jackson.annotate.JsonValue; - -import java.nio.ByteBuffer; -import java.util.Arrays; public class Histogram { diff --git a/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregator.java index c2d9d674732..d5a73e1ce28 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregator.java @@ -19,11 +19,11 @@ package com.metamx.druid.aggregation; +import java.util.Comparator; + import com.google.common.primitives.Longs; import com.metamx.druid.processing.FloatMetricSelector; -import java.util.Comparator; - public class HistogramAggregator implements Aggregator { static final Comparator COMPARATOR = new Comparator() diff --git a/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregatorFactory.java b/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregatorFactory.java index 8902ae56bef..f2b20840557 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregatorFactory.java @@ -19,19 +19,20 @@ package com.metamx.druid.aggregation; -import com.google.common.base.Charsets; -import com.google.common.primitives.Floats; -import com.google.common.primitives.Longs; -import com.metamx.druid.processing.MetricSelectorFactory; -import org.apache.commons.codec.binary.Base64; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import org.apache.commons.codec.binary.Base64; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.google.common.base.Charsets; +import com.google.common.primitives.Floats; +import com.google.common.primitives.Longs; +import com.metamx.druid.processing.MetricSelectorFactory; + public class HistogramAggregatorFactory implements AggregatorFactory { private static final byte CACHE_TYPE_ID = 0x7; diff --git a/common/src/main/java/com/metamx/druid/aggregation/HistogramBufferAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/HistogramBufferAggregator.java index fe4f366631c..cd25549ec05 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/HistogramBufferAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/HistogramBufferAggregator.java @@ -20,13 +20,13 @@ package com.metamx.druid.aggregation; +import java.nio.ByteBuffer; +import java.util.Arrays; + import com.google.common.primitives.Floats; import com.google.common.primitives.Longs; import com.metamx.druid.processing.FloatMetricSelector; -import java.nio.ByteBuffer; -import java.util.Arrays; - public class HistogramBufferAggregator implements BufferAggregator { private final FloatMetricSelector selector; diff --git a/common/src/main/java/com/metamx/druid/aggregation/HistogramVisual.java b/common/src/main/java/com/metamx/druid/aggregation/HistogramVisual.java index 5ce5217e1b2..a72c1612255 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/HistogramVisual.java +++ b/common/src/main/java/com/metamx/druid/aggregation/HistogramVisual.java @@ -19,11 +19,12 @@ package com.metamx.druid.aggregation; -import com.google.common.base.Preconditions; +import java.util.Arrays; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.util.Arrays; +import com.google.common.base.Preconditions; public class HistogramVisual { diff --git a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregator.java index 80daa045d82..8a66cd2e597 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregator.java @@ -19,11 +19,11 @@ package com.metamx.druid.aggregation; +import java.util.List; + import com.google.common.collect.Lists; import com.metamx.druid.processing.FloatMetricSelector; -import java.util.List; - public class JavaScriptAggregator implements Aggregator { static interface ScriptAggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregatorFactory.java b/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregatorFactory.java index f2dd1604af4..c8333ab34de 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregatorFactory.java @@ -19,12 +19,14 @@ package com.metamx.druid.aggregation; -import com.google.common.base.Joiner; -import com.google.common.collect.Lists; -import com.google.common.primitives.Doubles; -import com.metamx.common.IAE; -import com.metamx.druid.processing.FloatMetricSelector; -import com.metamx.druid.processing.MetricSelectorFactory; +import java.nio.ByteBuffer; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Comparator; +import java.util.List; + +import javax.annotation.Nullable; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.mozilla.javascript.Context; @@ -32,12 +34,12 @@ import org.mozilla.javascript.Function; import org.mozilla.javascript.Script; import org.mozilla.javascript.ScriptableObject; -import javax.annotation.Nullable; -import java.nio.ByteBuffer; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Comparator; -import java.util.List; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.primitives.Doubles; +import com.metamx.common.IAE; +import com.metamx.druid.processing.FloatMetricSelector; +import com.metamx.druid.processing.MetricSelectorFactory; public class JavaScriptAggregatorFactory implements AggregatorFactory { diff --git a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptBufferAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/JavaScriptBufferAggregator.java index 02fe27abda4..6713666e932 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptBufferAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/JavaScriptBufferAggregator.java @@ -19,12 +19,12 @@ package com.metamx.druid.aggregation; -import com.google.common.collect.Lists; -import com.metamx.druid.processing.FloatMetricSelector; - import java.nio.ByteBuffer; import java.util.List; +import com.google.common.collect.Lists; +import com.metamx.druid.processing.FloatMetricSelector; + public class JavaScriptBufferAggregator implements BufferAggregator { private final FloatMetricSelector[] selectorList; diff --git a/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregator.java index 32a81ef719f..8377e01253b 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregator.java @@ -19,11 +19,11 @@ package com.metamx.druid.aggregation; +import java.util.Comparator; + import com.google.common.primitives.Longs; import com.metamx.druid.processing.FloatMetricSelector; -import java.util.Comparator; - /** */ public class LongSumAggregator implements Aggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregatorFactory.java b/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregatorFactory.java index a32887c2b68..952cf8f4849 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregatorFactory.java @@ -19,16 +19,17 @@ package com.metamx.druid.aggregation; -import com.google.common.primitives.Longs; -import com.metamx.druid.processing.MetricSelectorFactory; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.google.common.primitives.Longs; +import com.metamx.druid.processing.MetricSelectorFactory; + /** */ public class LongSumAggregatorFactory implements AggregatorFactory diff --git a/common/src/main/java/com/metamx/druid/aggregation/LongSumBufferAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/LongSumBufferAggregator.java index 533f6782d5d..d6c6f9bcc15 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/LongSumBufferAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/LongSumBufferAggregator.java @@ -19,10 +19,10 @@ package com.metamx.druid.aggregation; -import com.metamx.druid.processing.FloatMetricSelector; - import java.nio.ByteBuffer; +import com.metamx.druid.processing.FloatMetricSelector; + /** */ public class LongSumBufferAggregator implements BufferAggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/MaxAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/MaxAggregator.java index 0bd0ed6f29a..1b435b70a18 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MaxAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/MaxAggregator.java @@ -19,10 +19,10 @@ package com.metamx.druid.aggregation; -import com.metamx.druid.processing.FloatMetricSelector; - import java.util.Comparator; +import com.metamx.druid.processing.FloatMetricSelector; + /** */ public class MaxAggregator implements Aggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/MaxAggregatorFactory.java b/common/src/main/java/com/metamx/druid/aggregation/MaxAggregatorFactory.java index cd5aaf336db..111f0b55f2c 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MaxAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/MaxAggregatorFactory.java @@ -19,16 +19,17 @@ package com.metamx.druid.aggregation; -import com.google.common.primitives.Doubles; -import com.metamx.druid.processing.MetricSelectorFactory; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.google.common.primitives.Doubles; +import com.metamx.druid.processing.MetricSelectorFactory; + /** */ public class MaxAggregatorFactory implements AggregatorFactory diff --git a/common/src/main/java/com/metamx/druid/aggregation/MaxBufferAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/MaxBufferAggregator.java index 8a497a1ddfb..4c2469902e9 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MaxBufferAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/MaxBufferAggregator.java @@ -19,10 +19,10 @@ package com.metamx.druid.aggregation; -import com.metamx.druid.processing.FloatMetricSelector; - import java.nio.ByteBuffer; +import com.metamx.druid.processing.FloatMetricSelector; + /** */ public class MaxBufferAggregator implements BufferAggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/MinAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/MinAggregator.java index 1ff56fa837d..aeb0081e24b 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MinAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/MinAggregator.java @@ -19,10 +19,10 @@ package com.metamx.druid.aggregation; -import com.metamx.druid.processing.FloatMetricSelector; - import java.util.Comparator; +import com.metamx.druid.processing.FloatMetricSelector; + /** */ public class MinAggregator implements Aggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/MinAggregatorFactory.java b/common/src/main/java/com/metamx/druid/aggregation/MinAggregatorFactory.java index ee6e4d25a01..e62e4f156be 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MinAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/MinAggregatorFactory.java @@ -19,16 +19,17 @@ package com.metamx.druid.aggregation; -import com.google.common.primitives.Doubles; -import com.metamx.druid.processing.MetricSelectorFactory; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.google.common.primitives.Doubles; +import com.metamx.druid.processing.MetricSelectorFactory; + /** */ public class MinAggregatorFactory implements AggregatorFactory diff --git a/common/src/main/java/com/metamx/druid/aggregation/MinBufferAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/MinBufferAggregator.java index 68e34675e36..9dc8a7f6d10 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MinBufferAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/MinBufferAggregator.java @@ -19,10 +19,10 @@ package com.metamx.druid.aggregation; -import com.metamx.druid.processing.FloatMetricSelector; - import java.nio.ByteBuffer; +import com.metamx.druid.processing.FloatMetricSelector; + /** */ public class MinBufferAggregator implements BufferAggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/ToLowerCaseAggregatorFactory.java b/common/src/main/java/com/metamx/druid/aggregation/ToLowerCaseAggregatorFactory.java index 6d16b10be06..b7cc2f717a8 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/ToLowerCaseAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/ToLowerCaseAggregatorFactory.java @@ -19,11 +19,11 @@ package com.metamx.druid.aggregation; -import com.metamx.druid.processing.MetricSelectorFactory; - import java.util.Comparator; import java.util.List; +import com.metamx.druid.processing.MetricSelectorFactory; + /** */ public class ToLowerCaseAggregatorFactory implements AggregatorFactory diff --git a/common/src/main/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregator.java index 90a5e09afbd..8fd3dd905d9 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregator.java @@ -19,17 +19,18 @@ package com.metamx.druid.aggregation.post; -import com.google.common.collect.Maps; -import com.metamx.common.IAE; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.google.common.collect.Maps; +import com.metamx.common.IAE; + /** */ public class ArithmeticPostAggregator implements PostAggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/post/ConstantPostAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/post/ConstantPostAggregator.java index eef818db49f..e9ac3bedd6c 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/post/ConstantPostAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/post/ConstantPostAggregator.java @@ -19,12 +19,12 @@ package com.metamx.druid.aggregation.post; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.util.Comparator; import java.util.Map; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + /** */ public class ConstantPostAggregator implements PostAggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregator.java index 1c3f328fa87..bf075fc4bd1 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregator.java @@ -19,12 +19,12 @@ package com.metamx.druid.aggregation.post; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.util.Comparator; import java.util.Map; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + /** */ public class FieldAccessPostAggregator implements PostAggregator diff --git a/common/src/main/java/com/metamx/druid/aggregation/post/PostAggregator.java b/common/src/main/java/com/metamx/druid/aggregation/post/PostAggregator.java index 5e679d64868..dc2b0568a12 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/post/PostAggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/post/PostAggregator.java @@ -19,12 +19,12 @@ package com.metamx.druid.aggregation.post; -import org.codehaus.jackson.annotate.JsonSubTypes; -import org.codehaus.jackson.annotate.JsonTypeInfo; - import java.util.Comparator; import java.util.Map; +import org.codehaus.jackson.annotate.JsonSubTypes; +import org.codehaus.jackson.annotate.JsonTypeInfo; + /** * Functionally similar to an Aggregator. See the Aggregator interface for more comments. */ diff --git a/common/src/main/java/com/metamx/druid/collect/CountingMap.java b/common/src/main/java/com/metamx/druid/collect/CountingMap.java index 9f9c2eeef88..56c06aadaa3 100644 --- a/common/src/main/java/com/metamx/druid/collect/CountingMap.java +++ b/common/src/main/java/com/metamx/druid/collect/CountingMap.java @@ -19,13 +19,13 @@ package com.metamx.druid.collect; +import java.util.Map; +import java.util.concurrent.atomic.AtomicLong; + import com.google.common.base.Supplier; import com.google.common.collect.ImmutableMap; import com.metamx.common.guava.DefaultingHashMap; -import java.util.Map; -import java.util.concurrent.atomic.AtomicLong; - /** */ public class CountingMap extends DefaultingHashMap diff --git a/common/src/main/java/com/metamx/druid/collect/OrderedMergeIterator.java b/common/src/main/java/com/metamx/druid/collect/OrderedMergeIterator.java index f9268aa7e1a..6f8adf78ab6 100644 --- a/common/src/main/java/com/metamx/druid/collect/OrderedMergeIterator.java +++ b/common/src/main/java/com/metamx/druid/collect/OrderedMergeIterator.java @@ -19,18 +19,19 @@ package com.metamx.druid.collect; +import java.util.Comparator; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.PriorityQueue; + +import javax.annotation.Nullable; + import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.collect.Iterators; import com.google.common.collect.PeekingIterator; import com.metamx.common.guava.FunctionalIterator; -import javax.annotation.Nullable; -import java.util.Comparator; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.PriorityQueue; - /** * An OrderedMergeIterator is an iterator that merges together multiple sorted iterators. It is written assuming * that the input Iterators are provided in order. That is, it places an extra restriction in the input iterators. diff --git a/common/src/main/java/com/metamx/druid/collect/OrderedMergeSequence.java b/common/src/main/java/com/metamx/druid/collect/OrderedMergeSequence.java index 60772e4f474..5fc713acabc 100644 --- a/common/src/main/java/com/metamx/druid/collect/OrderedMergeSequence.java +++ b/common/src/main/java/com/metamx/druid/collect/OrderedMergeSequence.java @@ -19,6 +19,11 @@ package com.metamx.druid.collect; +import java.io.IOException; +import java.util.PriorityQueue; + +import javax.annotation.Nullable; + import com.google.common.base.Function; import com.google.common.base.Throwables; import com.google.common.collect.Ordering; @@ -30,10 +35,6 @@ import com.metamx.common.guava.Yielders; import com.metamx.common.guava.YieldingAccumulator; import com.metamx.common.guava.YieldingAccumulators; -import javax.annotation.Nullable; -import java.io.IOException; -import java.util.PriorityQueue; - /** * An OrderedMergeIterator is an iterator that merges together multiple sorted iterators. It is written assuming * that the input Iterators are provided in order. That is, it places an extra restriction in the input iterators. diff --git a/common/src/main/java/com/metamx/druid/collect/StupidPool.java b/common/src/main/java/com/metamx/druid/collect/StupidPool.java index 8d5c3f26590..15eefaf240b 100644 --- a/common/src/main/java/com/metamx/druid/collect/StupidPool.java +++ b/common/src/main/java/com/metamx/druid/collect/StupidPool.java @@ -19,14 +19,14 @@ package com.metamx.druid.collect; +import java.io.IOException; +import java.util.LinkedList; + import com.google.common.base.Supplier; import com.google.common.collect.Lists; import com.metamx.common.ISE; import com.metamx.common.logger.Logger; -import java.io.IOException; -import java.util.LinkedList; - /** */ public class StupidPool diff --git a/common/src/main/java/com/metamx/druid/db/DbConnector.java b/common/src/main/java/com/metamx/druid/db/DbConnector.java index bda9fb1221d..bbc16c4c488 100644 --- a/common/src/main/java/com/metamx/druid/db/DbConnector.java +++ b/common/src/main/java/com/metamx/druid/db/DbConnector.java @@ -19,15 +19,17 @@ package com.metamx.druid.db; -import com.metamx.common.logger.Logger; +import java.util.List; +import java.util.Map; + +import javax.sql.DataSource; + import org.apache.commons.dbcp.BasicDataSource; import org.skife.jdbi.v2.DBI; import org.skife.jdbi.v2.Handle; import org.skife.jdbi.v2.tweak.HandleCallback; -import javax.sql.DataSource; -import java.util.List; -import java.util.Map; +import com.metamx.common.logger.Logger; /** */ diff --git a/common/src/main/java/com/metamx/druid/guava/CombiningSequence.java b/common/src/main/java/com/metamx/druid/guava/CombiningSequence.java index 8a1c9a660d5..b4c184f0c8f 100644 --- a/common/src/main/java/com/metamx/druid/guava/CombiningSequence.java +++ b/common/src/main/java/com/metamx/druid/guava/CombiningSequence.java @@ -19,6 +19,9 @@ package com.metamx.druid.guava; +import java.io.IOException; +import java.util.concurrent.atomic.AtomicReference; + import com.google.common.collect.Ordering; import com.metamx.common.guava.Accumulator; import com.metamx.common.guava.Sequence; @@ -27,9 +30,6 @@ import com.metamx.common.guava.Yielders; import com.metamx.common.guava.YieldingAccumulator; import com.metamx.common.guava.nary.BinaryFn; -import java.io.IOException; -import java.util.concurrent.atomic.AtomicReference; - /** */ public class CombiningSequence implements Sequence diff --git a/common/src/main/java/com/metamx/druid/guava/FileOutputSupplier.java b/common/src/main/java/com/metamx/druid/guava/FileOutputSupplier.java index f9d713dd1b1..0c6b6103615 100644 --- a/common/src/main/java/com/metamx/druid/guava/FileOutputSupplier.java +++ b/common/src/main/java/com/metamx/druid/guava/FileOutputSupplier.java @@ -19,13 +19,13 @@ package com.metamx.druid.guava; -import com.google.common.io.OutputSupplier; - import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import com.google.common.io.OutputSupplier; + /** */ public class FileOutputSupplier implements OutputSupplier diff --git a/common/src/main/java/com/metamx/druid/guava/GuavaUtils.java b/common/src/main/java/com/metamx/druid/guava/GuavaUtils.java index 784bd06192c..7384d141c32 100644 --- a/common/src/main/java/com/metamx/druid/guava/GuavaUtils.java +++ b/common/src/main/java/com/metamx/druid/guava/GuavaUtils.java @@ -19,13 +19,6 @@ package com.metamx.druid.guava; -import com.google.common.base.Charsets; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import com.google.common.io.CharStreams; -import com.google.common.io.InputSupplier; - -import javax.annotation.Nullable; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -36,6 +29,14 @@ import java.util.Arrays; import java.util.List; import java.util.zip.GZIPInputStream; +import javax.annotation.Nullable; + +import com.google.common.base.Charsets; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import com.google.common.io.CharStreams; +import com.google.common.io.InputSupplier; + /** */ public class GuavaUtils diff --git a/common/src/main/java/com/metamx/druid/input/MapBasedInputRow.java b/common/src/main/java/com/metamx/druid/input/MapBasedInputRow.java index 2177bcde776..f0839436661 100644 --- a/common/src/main/java/com/metamx/druid/input/MapBasedInputRow.java +++ b/common/src/main/java/com/metamx/druid/input/MapBasedInputRow.java @@ -19,11 +19,11 @@ package com.metamx.druid.input; -import org.joda.time.DateTime; - import java.util.List; import java.util.Map; +import org.joda.time.DateTime; + /** */ public class MapBasedInputRow extends MapBasedRow implements InputRow diff --git a/common/src/main/java/com/metamx/druid/input/MapBasedRow.java b/common/src/main/java/com/metamx/druid/input/MapBasedRow.java index 03c56e2f66d..01d3c1b38d4 100644 --- a/common/src/main/java/com/metamx/druid/input/MapBasedRow.java +++ b/common/src/main/java/com/metamx/druid/input/MapBasedRow.java @@ -19,19 +19,21 @@ package com.metamx.druid.input; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.DateTime; + import com.google.common.base.Function; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.metamx.common.IAE; import com.metamx.common.exception.FormattedException; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.DateTime; - -import javax.annotation.Nullable; -import java.util.Arrays; -import java.util.List; -import java.util.Map; /** */ diff --git a/common/src/main/java/com/metamx/druid/input/Row.java b/common/src/main/java/com/metamx/druid/input/Row.java index 6f6f3f2c17c..95012f25189 100644 --- a/common/src/main/java/com/metamx/druid/input/Row.java +++ b/common/src/main/java/com/metamx/druid/input/Row.java @@ -19,11 +19,11 @@ package com.metamx.druid.input; +import java.util.List; + import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import java.util.List; - /** */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "version") diff --git a/common/src/main/java/com/metamx/druid/jackson/CommaListJoinDeserializer.java b/common/src/main/java/com/metamx/druid/jackson/CommaListJoinDeserializer.java index 1932746b3d0..ca919198050 100644 --- a/common/src/main/java/com/metamx/druid/jackson/CommaListJoinDeserializer.java +++ b/common/src/main/java/com/metamx/druid/jackson/CommaListJoinDeserializer.java @@ -19,15 +19,15 @@ package com.metamx.druid.jackson; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + import org.codehaus.jackson.JsonParser; import org.codehaus.jackson.JsonProcessingException; import org.codehaus.jackson.map.DeserializationContext; import org.codehaus.jackson.map.deser.std.StdScalarDeserializer; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; - /** */ public class CommaListJoinDeserializer extends StdScalarDeserializer> diff --git a/common/src/main/java/com/metamx/druid/jackson/CommaListJoinSerializer.java b/common/src/main/java/com/metamx/druid/jackson/CommaListJoinSerializer.java index 3b270ad4aa1..f0dd0f4056a 100644 --- a/common/src/main/java/com/metamx/druid/jackson/CommaListJoinSerializer.java +++ b/common/src/main/java/com/metamx/druid/jackson/CommaListJoinSerializer.java @@ -19,14 +19,15 @@ package com.metamx.druid.jackson; -import com.google.common.base.Joiner; +import java.io.IOException; +import java.util.List; + import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.JsonGenerator; import org.codehaus.jackson.map.SerializerProvider; import org.codehaus.jackson.map.ser.std.ScalarSerializerBase; -import java.io.IOException; -import java.util.List; +import com.google.common.base.Joiner; /** */ diff --git a/common/src/main/java/com/metamx/druid/jackson/DefaultObjectMapper.java b/common/src/main/java/com/metamx/druid/jackson/DefaultObjectMapper.java index 7c96a8a3b2b..61be638a666 100644 --- a/common/src/main/java/com/metamx/druid/jackson/DefaultObjectMapper.java +++ b/common/src/main/java/com/metamx/druid/jackson/DefaultObjectMapper.java @@ -19,10 +19,9 @@ package com.metamx.druid.jackson; -import com.google.common.base.Throwables; -import com.metamx.common.Granularity; -import com.metamx.common.guava.Accumulator; -import com.metamx.common.guava.Sequence; +import java.io.IOException; +import java.util.TimeZone; + import org.codehaus.jackson.JsonFactory; import org.codehaus.jackson.JsonGenerator; import org.codehaus.jackson.JsonParser; @@ -38,8 +37,10 @@ import org.codehaus.jackson.map.SerializerProvider; import org.codehaus.jackson.map.module.SimpleModule; import org.joda.time.DateTimeZone; -import java.io.IOException; -import java.util.TimeZone; +import com.google.common.base.Throwables; +import com.metamx.common.Granularity; +import com.metamx.common.guava.Accumulator; +import com.metamx.common.guava.Sequence; /** */ diff --git a/common/src/main/java/com/metamx/druid/jackson/JodaStuff.java b/common/src/main/java/com/metamx/druid/jackson/JodaStuff.java index 69ff973d815..3b907cdb5c9 100644 --- a/common/src/main/java/com/metamx/druid/jackson/JodaStuff.java +++ b/common/src/main/java/com/metamx/druid/jackson/JodaStuff.java @@ -19,23 +19,20 @@ package com.metamx.druid.jackson; +import java.io.IOException; + import org.codehaus.jackson.JsonParser; import org.codehaus.jackson.JsonProcessingException; import org.codehaus.jackson.JsonToken; import org.codehaus.jackson.map.DeserializationContext; import org.codehaus.jackson.map.KeyDeserializer; import org.codehaus.jackson.map.deser.std.StdDeserializer; -import org.codehaus.jackson.map.ext.JodaDeserializers; import org.codehaus.jackson.map.module.SimpleModule; import org.codehaus.jackson.map.ser.std.ToStringSerializer; import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import org.joda.time.Interval; -import org.joda.time.ReadableInstant; import org.joda.time.format.ISODateTimeFormat; -import java.io.IOException; - /** */ public class JodaStuff diff --git a/common/src/main/java/com/metamx/druid/log/LogLevelAdjuster.java b/common/src/main/java/com/metamx/druid/log/LogLevelAdjuster.java index e77f9f75441..691d11de143 100644 --- a/common/src/main/java/com/metamx/druid/log/LogLevelAdjuster.java +++ b/common/src/main/java/com/metamx/druid/log/LogLevelAdjuster.java @@ -19,16 +19,13 @@ package com.metamx.druid.log; +import java.lang.management.ManagementFactory; + +import javax.management.ObjectName; + import org.apache.log4j.Level; import org.apache.log4j.Logger; -import javax.management.InstanceAlreadyExistsException; -import javax.management.MBeanRegistrationException; -import javax.management.MalformedObjectNameException; -import javax.management.NotCompliantMBeanException; -import javax.management.ObjectName; -import java.lang.management.ManagementFactory; - /** */ diff --git a/common/src/main/java/com/metamx/druid/partition/IntegerPartitionChunk.java b/common/src/main/java/com/metamx/druid/partition/IntegerPartitionChunk.java index a49313711ec..70a20479dbe 100644 --- a/common/src/main/java/com/metamx/druid/partition/IntegerPartitionChunk.java +++ b/common/src/main/java/com/metamx/druid/partition/IntegerPartitionChunk.java @@ -19,10 +19,10 @@ package com.metamx.druid.partition; -import com.google.common.collect.Ordering; - import java.util.Comparator; +import com.google.common.collect.Ordering; + /** */ public class IntegerPartitionChunk implements PartitionChunk diff --git a/common/src/main/java/com/metamx/druid/partition/PartitionHolder.java b/common/src/main/java/com/metamx/druid/partition/PartitionHolder.java index 00dc3e18a43..e41c6f6bbd0 100644 --- a/common/src/main/java/com/metamx/druid/partition/PartitionHolder.java +++ b/common/src/main/java/com/metamx/druid/partition/PartitionHolder.java @@ -19,16 +19,16 @@ package com.metamx.druid.partition; +import java.util.Iterator; +import java.util.List; +import java.util.TreeSet; + import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; import com.google.common.collect.Sets; -import java.util.Iterator; -import java.util.List; -import java.util.TreeSet; - /** * An object that clumps together multiple other objects which each represent a shard of some space. */ diff --git a/common/src/main/java/com/metamx/druid/partition/StringPartitionChunk.java b/common/src/main/java/com/metamx/druid/partition/StringPartitionChunk.java index 2b27b4d3451..7722099d10c 100644 --- a/common/src/main/java/com/metamx/druid/partition/StringPartitionChunk.java +++ b/common/src/main/java/com/metamx/druid/partition/StringPartitionChunk.java @@ -19,10 +19,10 @@ package com.metamx.druid.partition; -import com.google.common.collect.Ordering; - import java.util.Comparator; +import com.google.common.collect.Ordering; + /** */ public class StringPartitionChunk implements PartitionChunk diff --git a/common/src/main/java/com/metamx/druid/processing/MetricSelectorFactory.java b/common/src/main/java/com/metamx/druid/processing/MetricSelectorFactory.java index 8c023c322f4..28fd5193652 100644 --- a/common/src/main/java/com/metamx/druid/processing/MetricSelectorFactory.java +++ b/common/src/main/java/com/metamx/druid/processing/MetricSelectorFactory.java @@ -19,7 +19,6 @@ package com.metamx.druid.processing; -import java.io.Closeable; /** * Factory class for MetricSelectors diff --git a/common/src/main/java/com/metamx/druid/utils/JodaUtils.java b/common/src/main/java/com/metamx/druid/utils/JodaUtils.java index 53b14618001..08fa7f421bf 100644 --- a/common/src/main/java/com/metamx/druid/utils/JodaUtils.java +++ b/common/src/main/java/com/metamx/druid/utils/JodaUtils.java @@ -19,16 +19,17 @@ package com.metamx.druid.utils; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.metamx.common.guava.Comparators; -import org.joda.time.DateTime; -import org.joda.time.Interval; - import java.util.ArrayList; import java.util.Iterator; import java.util.TreeSet; +import org.joda.time.DateTime; +import org.joda.time.Interval; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.metamx.common.guava.Comparators; + /** */ public class JodaUtils diff --git a/common/src/main/java/com/metamx/druid/utils/PropUtils.java b/common/src/main/java/com/metamx/druid/utils/PropUtils.java index 48909c02efe..273bd653f97 100644 --- a/common/src/main/java/com/metamx/druid/utils/PropUtils.java +++ b/common/src/main/java/com/metamx/druid/utils/PropUtils.java @@ -19,10 +19,10 @@ package com.metamx.druid.utils; -import com.metamx.common.ISE; - import java.util.Properties; +import com.metamx.common.ISE; + /** */ public class PropUtils diff --git a/common/src/main/java/com/metamx/druid/utils/SerializerUtils.java b/common/src/main/java/com/metamx/druid/utils/SerializerUtils.java index 0a1b58d0383..a3e7ad9cbb4 100644 --- a/common/src/main/java/com/metamx/druid/utils/SerializerUtils.java +++ b/common/src/main/java/com/metamx/druid/utils/SerializerUtils.java @@ -19,11 +19,6 @@ package com.metamx.druid.utils; -import com.google.common.io.ByteStreams; -import com.google.common.io.Closeables; -import com.google.common.io.OutputSupplier; -import com.metamx.druid.IntList; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -33,6 +28,11 @@ import java.nio.charset.Charset; import java.util.Arrays; import java.util.List; +import com.google.common.io.ByteStreams; +import com.google.common.io.Closeables; +import com.google.common.io.OutputSupplier; +import com.metamx.druid.IntList; + public class SerializerUtils { private static final Charset UTF8 = Charset.forName("UTF-8"); diff --git a/common/src/test/java/com/metamx/druid/QueryGranularityTest.java b/common/src/test/java/com/metamx/druid/QueryGranularityTest.java index 18f39ef3a1b..b044cf339bb 100644 --- a/common/src/test/java/com/metamx/druid/QueryGranularityTest.java +++ b/common/src/test/java/com/metamx/druid/QueryGranularityTest.java @@ -19,9 +19,9 @@ package com.metamx.druid; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.metamx.druid.jackson.DefaultObjectMapper; +import java.util.Iterator; +import java.util.List; + import org.codehaus.jackson.map.ObjectMapper; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -34,8 +34,9 @@ import org.joda.time.Weeks; import org.junit.Assert; import org.junit.Test; -import java.util.Iterator; -import java.util.List; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.metamx.druid.jackson.DefaultObjectMapper; /** */ diff --git a/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java b/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java index 96d0fa01ce1..61d61d2f68e 100644 --- a/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java +++ b/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java @@ -19,14 +19,10 @@ package com.metamx.druid; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Ordering; -import com.metamx.common.Pair; -import com.metamx.druid.partition.ImmutablePartitionHolder; -import com.metamx.druid.partition.IntegerPartitionChunk; -import com.metamx.druid.partition.PartitionChunk; -import com.metamx.druid.partition.PartitionHolder; -import com.metamx.druid.partition.SingleElementPartitionChunk; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + import org.joda.time.DateTime; import org.joda.time.Days; import org.joda.time.Hours; @@ -35,9 +31,14 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Ordering; +import com.metamx.common.Pair; +import com.metamx.druid.partition.ImmutablePartitionHolder; +import com.metamx.druid.partition.IntegerPartitionChunk; +import com.metamx.druid.partition.PartitionChunk; +import com.metamx.druid.partition.PartitionHolder; +import com.metamx.druid.partition.SingleElementPartitionChunk; /** */ diff --git a/common/src/test/java/com/metamx/druid/aggregation/CountAggregatorTest.java b/common/src/test/java/com/metamx/druid/aggregation/CountAggregatorTest.java index 8a780146504..f26e59659af 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/CountAggregatorTest.java +++ b/common/src/test/java/com/metamx/druid/aggregation/CountAggregatorTest.java @@ -19,11 +19,11 @@ package com.metamx.druid.aggregation; +import java.util.Comparator; + import org.junit.Assert; import org.junit.Test; -import java.util.Comparator; - /** */ public class CountAggregatorTest diff --git a/common/src/test/java/com/metamx/druid/aggregation/DoubleSumAggregatorTest.java b/common/src/test/java/com/metamx/druid/aggregation/DoubleSumAggregatorTest.java index d1a87ac9c2d..645a6a23a37 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/DoubleSumAggregatorTest.java +++ b/common/src/test/java/com/metamx/druid/aggregation/DoubleSumAggregatorTest.java @@ -19,11 +19,11 @@ package com.metamx.druid.aggregation; +import java.util.Comparator; + import org.junit.Assert; import org.junit.Test; -import java.util.Comparator; - /** */ public class DoubleSumAggregatorTest diff --git a/common/src/test/java/com/metamx/druid/aggregation/HistogramAggregatorTest.java b/common/src/test/java/com/metamx/druid/aggregation/HistogramAggregatorTest.java index d72ca031efc..e2910863773 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/HistogramAggregatorTest.java +++ b/common/src/test/java/com/metamx/druid/aggregation/HistogramAggregatorTest.java @@ -19,12 +19,13 @@ package com.metamx.druid.aggregation; -import com.google.common.collect.Lists; +import java.nio.ByteBuffer; +import java.util.ArrayList; + import org.junit.Assert; import org.junit.Test; -import java.nio.ByteBuffer; -import java.util.ArrayList; +import com.google.common.collect.Lists; public class HistogramAggregatorTest { diff --git a/common/src/test/java/com/metamx/druid/aggregation/JavaScriptAggregatorTest.java b/common/src/test/java/com/metamx/druid/aggregation/JavaScriptAggregatorTest.java index 96c2606c2c2..6629140c8ff 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/JavaScriptAggregatorTest.java +++ b/common/src/test/java/com/metamx/druid/aggregation/JavaScriptAggregatorTest.java @@ -20,14 +20,14 @@ package com.metamx.druid.aggregation; -import com.google.common.collect.Lists; -import com.google.common.primitives.Doubles; -import com.metamx.druid.processing.FloatMetricSelector; +import java.nio.ByteBuffer; +import java.util.Arrays; + import org.junit.Assert; import org.junit.Test; -import java.nio.ByteBuffer; -import java.util.Arrays; +import com.google.common.collect.Lists; +import com.metamx.druid.processing.FloatMetricSelector; public class JavaScriptAggregatorTest { diff --git a/common/src/test/java/com/metamx/druid/aggregation/LongSumAggregatorTest.java b/common/src/test/java/com/metamx/druid/aggregation/LongSumAggregatorTest.java index 8db1a4a4755..aba5a4b1d92 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/LongSumAggregatorTest.java +++ b/common/src/test/java/com/metamx/druid/aggregation/LongSumAggregatorTest.java @@ -19,11 +19,11 @@ package com.metamx.druid.aggregation; +import java.util.Comparator; + import org.junit.Assert; import org.junit.Test; -import java.util.Comparator; - /** */ public class LongSumAggregatorTest diff --git a/common/src/test/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregatorTest.java b/common/src/test/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregatorTest.java index c8365de19b6..fbb9da1e7bb 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregatorTest.java +++ b/common/src/test/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregatorTest.java @@ -19,16 +19,17 @@ package com.metamx.druid.aggregation.post; -import com.google.common.collect.Lists; -import com.metamx.druid.aggregation.CountAggregator; -import org.junit.Assert; -import org.junit.Test; - import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.junit.Assert; +import org.junit.Test; + +import com.google.common.collect.Lists; +import com.metamx.druid.aggregation.CountAggregator; + /** */ public class ArithmeticPostAggregatorTest diff --git a/common/src/test/java/com/metamx/druid/aggregation/post/ConstantPostAggregatorTest.java b/common/src/test/java/com/metamx/druid/aggregation/post/ConstantPostAggregatorTest.java index 0de6e2c62e7..6495308cb35 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/post/ConstantPostAggregatorTest.java +++ b/common/src/test/java/com/metamx/druid/aggregation/post/ConstantPostAggregatorTest.java @@ -19,11 +19,11 @@ package com.metamx.druid.aggregation.post; +import java.util.Comparator; + import org.junit.Assert; import org.junit.Test; -import java.util.Comparator; - /** */ public class ConstantPostAggregatorTest diff --git a/common/src/test/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregatorTest.java b/common/src/test/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregatorTest.java index e413504b1ad..a0ffa56795e 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregatorTest.java +++ b/common/src/test/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregatorTest.java @@ -19,12 +19,13 @@ package com.metamx.druid.aggregation.post; -import com.metamx.druid.aggregation.CountAggregator; +import java.util.HashMap; +import java.util.Map; + import org.junit.Assert; import org.junit.Test; -import java.util.HashMap; -import java.util.Map; +import com.metamx.druid.aggregation.CountAggregator; /** */ diff --git a/common/src/test/java/com/metamx/druid/collect/OrderedMergeIteratorTest.java b/common/src/test/java/com/metamx/druid/collect/OrderedMergeIteratorTest.java index f06b337e348..2ba2ab03ee6 100644 --- a/common/src/test/java/com/metamx/druid/collect/OrderedMergeIteratorTest.java +++ b/common/src/test/java/com/metamx/druid/collect/OrderedMergeIteratorTest.java @@ -19,15 +19,17 @@ package com.metamx.druid.collect; -import com.google.common.collect.Lists; -import com.google.common.collect.Ordering; -import junit.framework.Assert; -import org.junit.Test; - import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; +import junit.framework.Assert; + +import org.junit.Test; + +import com.google.common.collect.Lists; +import com.google.common.collect.Ordering; + /** */ public class OrderedMergeIteratorTest diff --git a/common/src/test/java/com/metamx/druid/collect/OrderedMergeSequenceTest.java b/common/src/test/java/com/metamx/druid/collect/OrderedMergeSequenceTest.java index 7080a50c73c..3b35ee1218f 100644 --- a/common/src/test/java/com/metamx/druid/collect/OrderedMergeSequenceTest.java +++ b/common/src/test/java/com/metamx/druid/collect/OrderedMergeSequenceTest.java @@ -19,6 +19,17 @@ package com.metamx.druid.collect; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import javax.annotation.Nullable; + +import junit.framework.Assert; + +import org.junit.Test; + import com.google.common.base.Function; import com.google.common.collect.Lists; import com.google.common.collect.Ordering; @@ -27,14 +38,6 @@ import com.metamx.common.guava.Sequence; import com.metamx.common.guava.SequenceTestHelper; import com.metamx.common.guava.Sequences; import com.metamx.common.guava.TestSequence; -import junit.framework.Assert; -import org.junit.Test; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; /** */ diff --git a/common/src/test/java/com/metamx/druid/guava/CombiningSequenceTest.java b/common/src/test/java/com/metamx/druid/guava/CombiningSequenceTest.java index 388b7def6a8..5d058758732 100644 --- a/common/src/test/java/com/metamx/druid/guava/CombiningSequenceTest.java +++ b/common/src/test/java/com/metamx/druid/guava/CombiningSequenceTest.java @@ -19,6 +19,15 @@ package com.metamx.druid.guava; +import java.io.IOException; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import junit.framework.Assert; + +import org.junit.Test; + import com.google.common.collect.Lists; import com.google.common.collect.Ordering; import com.metamx.common.Pair; @@ -27,13 +36,6 @@ import com.metamx.common.guava.Sequences; import com.metamx.common.guava.Yielder; import com.metamx.common.guava.YieldingAccumulator; import com.metamx.common.guava.nary.BinaryFn; -import junit.framework.Assert; -import org.junit.Test; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; /** */ diff --git a/common/src/test/java/com/metamx/druid/histogram/HistogramTest.java b/common/src/test/java/com/metamx/druid/histogram/HistogramTest.java index e40cecaa203..e4866234b45 100644 --- a/common/src/test/java/com/metamx/druid/histogram/HistogramTest.java +++ b/common/src/test/java/com/metamx/druid/histogram/HistogramTest.java @@ -19,15 +19,16 @@ package com.metamx.druid.histogram; -import com.google.common.collect.Maps; -import com.metamx.druid.aggregation.Histogram; -import com.metamx.druid.jackson.DefaultObjectMapper; +import java.util.Arrays; +import java.util.Map; + import org.codehaus.jackson.map.ObjectMapper; import org.junit.Assert; import org.junit.Test; -import java.util.Arrays; -import java.util.Map; +import com.google.common.collect.Maps; +import com.metamx.druid.aggregation.Histogram; +import com.metamx.druid.jackson.DefaultObjectMapper; public class HistogramTest { diff --git a/common/src/test/java/com/metamx/druid/partition/IntegerPartitionChunkTest.java b/common/src/test/java/com/metamx/druid/partition/IntegerPartitionChunkTest.java index 0acb92911f5..1b00420558a 100644 --- a/common/src/test/java/com/metamx/druid/partition/IntegerPartitionChunkTest.java +++ b/common/src/test/java/com/metamx/druid/partition/IntegerPartitionChunkTest.java @@ -19,11 +19,11 @@ package com.metamx.druid.partition; +import static com.metamx.druid.partition.IntegerPartitionChunk.make; + import org.junit.Assert; import org.junit.Test; -import static com.metamx.druid.partition.IntegerPartitionChunk.make; - /** */ public class IntegerPartitionChunkTest diff --git a/common/src/test/java/com/metamx/druid/partition/StringPartitionChunkTest.java b/common/src/test/java/com/metamx/druid/partition/StringPartitionChunkTest.java index c6a7cdfd005..572c2ae70c1 100644 --- a/common/src/test/java/com/metamx/druid/partition/StringPartitionChunkTest.java +++ b/common/src/test/java/com/metamx/druid/partition/StringPartitionChunkTest.java @@ -19,11 +19,11 @@ package com.metamx.druid.partition; +import static com.metamx.druid.partition.StringPartitionChunk.make; + import org.junit.Assert; import org.junit.Test; -import static com.metamx.druid.partition.StringPartitionChunk.make; - /** */ public class StringPartitionChunkTest diff --git a/common/src/test/java/com/metamx/druid/utils/JodaUtilsTest.java b/common/src/test/java/com/metamx/druid/utils/JodaUtilsTest.java index 6abaf485b68..9b53504d2af 100644 --- a/common/src/test/java/com/metamx/druid/utils/JodaUtilsTest.java +++ b/common/src/test/java/com/metamx/druid/utils/JodaUtilsTest.java @@ -19,14 +19,14 @@ package com.metamx.druid.utils; -import org.joda.time.Interval; -import org.junit.Assert; -import org.junit.Test; - import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.joda.time.Interval; +import org.junit.Assert; +import org.junit.Test; + /** */ public class JodaUtilsTest diff --git a/examples/twitter/src/main/java/druid/examples/RealtimeStandaloneMain.java b/examples/twitter/src/main/java/druid/examples/RealtimeStandaloneMain.java index 6fabdf04452..be0f8ea93f9 100644 --- a/examples/twitter/src/main/java/druid/examples/RealtimeStandaloneMain.java +++ b/examples/twitter/src/main/java/druid/examples/RealtimeStandaloneMain.java @@ -1,5 +1,10 @@ package druid.examples; +import java.io.File; +import java.io.IOException; + +import org.codehaus.jackson.map.jsontype.NamedType; + import com.metamx.common.config.Config; import com.metamx.common.lifecycle.Lifecycle; import com.metamx.common.logger.Logger; @@ -13,11 +18,8 @@ import com.metamx.druid.realtime.MetadataUpdaterConfig; import com.metamx.druid.realtime.RealtimeNode; import com.metamx.druid.realtime.SegmentPusher; import com.metamx.phonebook.PhoneBook; -import druid.examples.twitter.TwitterSpritzerFirehoseFactory; -import org.codehaus.jackson.map.jsontype.NamedType; -import java.io.File; -import java.io.IOException; +import druid.examples.twitter.TwitterSpritzerFirehoseFactory; /** Standalone Demo Realtime process. * Created: 20121009T2050 diff --git a/examples/twitter/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java b/examples/twitter/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java index 249ea12e3b1..57b20029a38 100644 --- a/examples/twitter/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java +++ b/examples/twitter/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java @@ -1,15 +1,6 @@ package druid.examples.twitter; -import com.metamx.common.logger.Logger; -import com.metamx.druid.input.InputRow; -import com.metamx.druid.input.MapBasedInputRow; -import com.metamx.druid.realtime.Firehose; -import com.metamx.druid.realtime.FirehoseFactory; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonTypeName; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.ObjectMapper; -import twitter4j.*; +import static java.lang.Thread.sleep; import java.io.IOException; import java.util.HashMap; @@ -19,7 +10,24 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; -import static java.lang.Thread.*; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.annotate.JsonTypeName; + +import twitter4j.ConnectionLifeCycleListener; +import twitter4j.HashtagEntity; +import twitter4j.Status; +import twitter4j.StatusDeletionNotice; +import twitter4j.StatusListener; +import twitter4j.TwitterStream; +import twitter4j.TwitterStreamFactory; +import twitter4j.User; + +import com.metamx.common.logger.Logger; +import com.metamx.druid.input.InputRow; +import com.metamx.druid.input.MapBasedInputRow; +import com.metamx.druid.realtime.Firehose; +import com.metamx.druid.realtime.FirehoseFactory; /** diff --git a/index-common/src/main/java/com/metamx/druid/common/s3/S3Utils.java b/index-common/src/main/java/com/metamx/druid/common/s3/S3Utils.java index c68a3e54398..6284c2ee96a 100644 --- a/index-common/src/main/java/com/metamx/druid/common/s3/S3Utils.java +++ b/index-common/src/main/java/com/metamx/druid/common/s3/S3Utils.java @@ -19,19 +19,20 @@ package com.metamx.druid.common.s3; -import com.google.common.io.CharStreams; -import com.metamx.common.logger.Logger; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Pattern; + import org.jets3t.service.S3ServiceException; import org.jets3t.service.ServiceException; import org.jets3t.service.impl.rest.httpclient.RestS3Service; import org.jets3t.service.model.S3Bucket; import org.jets3t.service.model.S3Object; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.security.NoSuchAlgorithmException; -import java.util.regex.Pattern; +import com.google.common.io.CharStreams; +import com.metamx.common.logger.Logger; /** * diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatBufferObjectStrategy.java b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatBufferObjectStrategy.java index 6aa2355dc15..a42c5ba9405 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatBufferObjectStrategy.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatBufferObjectStrategy.java @@ -19,13 +19,13 @@ package com.metamx.druid.index.v1; -import com.google.common.collect.Ordering; -import com.google.common.primitives.Floats; - import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; +import com.google.common.collect.Ordering; +import com.google.common.primitives.Floats; + /** */ public class CompressedFloatBufferObjectStrategy extends CompressedObjectStrategy diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplier.java b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplier.java index 12751ebebe8..726cbf92e3f 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplier.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplier.java @@ -19,6 +19,13 @@ package com.metamx.druid.index.v1; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.channels.WritableByteChannel; +import java.util.Iterator; + import com.google.common.base.Preconditions; import com.google.common.base.Supplier; import com.google.common.io.Closeables; @@ -29,14 +36,6 @@ import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidResourceHolder; import com.metamx.druid.kv.GenericIndexed; import com.metamx.druid.kv.IndexedFloats; -import com.metamx.druid.kv.IndexedIterable; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.FloatBuffer; -import java.nio.channels.WritableByteChannel; -import java.util.Iterator; /** */ diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializer.java b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializer.java index 090ab7b0c7a..8fef71c287f 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializer.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializer.java @@ -19,6 +19,11 @@ package com.metamx.druid.index.v1; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; + import com.google.common.io.ByteStreams; import com.google.common.io.Closeables; import com.google.common.io.OutputSupplier; @@ -28,11 +33,6 @@ import com.metamx.druid.collect.StupidResourceHolder; import com.metamx.druid.kv.FlattenedArrayWriter; import com.metamx.druid.kv.IOPeon; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.ByteOrder; -import java.nio.FloatBuffer; - /** */ public class CompressedFloatsSupplierSerializer diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongBufferObjectStrategy.java b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongBufferObjectStrategy.java index 27dd331a52f..c81e23ce235 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongBufferObjectStrategy.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongBufferObjectStrategy.java @@ -19,13 +19,13 @@ package com.metamx.druid.index.v1; -import com.google.common.collect.Ordering; -import com.google.common.primitives.Longs; - import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.LongBuffer; +import com.google.common.collect.Ordering; +import com.google.common.primitives.Longs; + /** */ public class CompressedLongBufferObjectStrategy extends CompressedObjectStrategy diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplier.java b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplier.java index b76a21176e1..17cf06d5d7e 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplier.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplier.java @@ -19,6 +19,13 @@ package com.metamx.druid.index.v1; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.LongBuffer; +import java.nio.channels.WritableByteChannel; +import java.util.Iterator; + import com.google.common.base.Preconditions; import com.google.common.base.Supplier; import com.google.common.io.Closeables; @@ -28,16 +35,8 @@ import com.metamx.common.IAE; import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidResourceHolder; import com.metamx.druid.kv.GenericIndexed; -import com.metamx.druid.kv.IndexedIterable; import com.metamx.druid.kv.IndexedLongs; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.LongBuffer; -import java.nio.channels.WritableByteChannel; -import java.util.Iterator; - /** */ public class CompressedLongsIndexedSupplier implements Supplier diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializer.java b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializer.java index 57d326da04b..62891f69e9a 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializer.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializer.java @@ -19,6 +19,11 @@ package com.metamx.druid.index.v1; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.ByteOrder; +import java.nio.LongBuffer; + import com.google.common.io.ByteStreams; import com.google.common.io.Closeables; import com.google.common.io.OutputSupplier; @@ -29,11 +34,6 @@ import com.metamx.druid.collect.StupidResourceHolder; import com.metamx.druid.kv.FlattenedArrayWriter; import com.metamx.druid.kv.IOPeon; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.ByteOrder; -import java.nio.LongBuffer; - /** */ public class CompressedLongsSupplierSerializer diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedObjectStrategy.java b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedObjectStrategy.java index 7733ec7fb2f..f5bc7df2279 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedObjectStrategy.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedObjectStrategy.java @@ -19,6 +19,11 @@ package com.metamx.druid.index.v1; +import java.io.IOException; +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + import com.google.common.base.Throwables; import com.google.common.io.Closeables; import com.metamx.druid.collect.ResourceHolder; @@ -27,11 +32,6 @@ import com.ning.compress.lzf.ChunkEncoder; import com.ning.compress.lzf.LZFChunk; import com.ning.compress.lzf.LZFDecoder; -import java.io.IOException; -import java.nio.Buffer; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - /** */ public class CompressedObjectStrategy implements ObjectStrategy> diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedPools.java b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedPools.java index a3061b67030..b2d0f0beb1e 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/CompressedPools.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/CompressedPools.java @@ -19,16 +19,16 @@ package com.metamx.druid.index.v1; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.concurrent.atomic.AtomicLong; + import com.google.common.base.Supplier; import com.metamx.common.logger.Logger; import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidPool; import com.ning.compress.lzf.ChunkEncoder; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.concurrent.atomic.AtomicLong; - /** */ public class CompressedPools diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedFloats.java b/index-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedFloats.java index a46b990a2ba..c5056e80661 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedFloats.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedFloats.java @@ -19,6 +19,13 @@ package com.metamx.druid.index.v1; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.util.Arrays; +import java.util.List; + import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; @@ -28,13 +35,6 @@ import com.metamx.druid.collect.StupidResourceHolder; import com.metamx.druid.kv.GenericIndexed; import com.metamx.druid.kv.IndexedFloats; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.FloatBuffer; -import java.util.Arrays; -import java.util.List; - /** */ public class InMemoryCompressedFloats implements IndexedFloats diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedLongs.java b/index-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedLongs.java index 9a408b46a4c..aed0ec523cd 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedLongs.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedLongs.java @@ -19,6 +19,13 @@ package com.metamx.druid.index.v1; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.LongBuffer; +import java.util.Arrays; +import java.util.List; + import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; @@ -28,13 +35,6 @@ import com.metamx.druid.collect.StupidResourceHolder; import com.metamx.druid.kv.GenericIndexed; import com.metamx.druid.kv.IndexedLongs; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.LongBuffer; -import java.util.Arrays; -import java.util.List; - /** */ public class InMemoryCompressedLongs implements IndexedLongs diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java b/index-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java index 3b05c022cfb..d40419015f3 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java @@ -19,6 +19,21 @@ package com.metamx.druid.index.v1; +import java.util.Arrays; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentNavigableMap; +import java.util.concurrent.ConcurrentSkipListMap; +import java.util.concurrent.CopyOnWriteArrayList; + +import javax.annotation.Nullable; + +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -43,19 +58,6 @@ import com.metamx.druid.input.Row; import com.metamx.druid.processing.ComplexMetricSelector; import com.metamx.druid.processing.FloatMetricSelector; import com.metamx.druid.processing.MetricSelectorFactory; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.util.Arrays; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentNavigableMap; -import java.util.concurrent.ConcurrentSkipListMap; -import java.util.concurrent.CopyOnWriteArrayList; /** */ diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/Index.java b/index-common/src/main/java/com/metamx/druid/index/v1/Index.java index 883fc38474c..8f6c2efe665 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/Index.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/Index.java @@ -19,13 +19,15 @@ package com.metamx.druid.index.v1; -import com.metamx.common.logger.Logger; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; -import org.joda.time.Interval; import java.util.HashMap; import java.util.Map; +import org.joda.time.Interval; + +import com.metamx.common.logger.Logger; + /** * In-memory representation of a segment */ diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/IndexIO.java b/index-common/src/main/java/com/metamx/druid/index/v1/IndexIO.java index ced22ba67b4..2961ca4276b 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/IndexIO.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/IndexIO.java @@ -19,6 +19,18 @@ package com.metamx.druid.index.v1; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.Map; + +import org.joda.time.Interval; + import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.google.common.io.Closeables; @@ -31,18 +43,6 @@ import com.metamx.druid.kv.GenericIndexed; import com.metamx.druid.kv.IndexedIterable; import com.metamx.druid.kv.VSizeIndexed; import com.metamx.druid.utils.SerializerUtils; -import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; -import org.joda.time.Interval; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.channels.FileChannel; -import java.util.Map; /** * This should be changed to use DI instead of a static reference... diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/MMappedIndex.java b/index-common/src/main/java/com/metamx/druid/index/v1/MMappedIndex.java index f23e2b7d061..60a0908f96c 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/MMappedIndex.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/MMappedIndex.java @@ -19,6 +19,15 @@ package com.metamx.druid.index.v1; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +import java.nio.ByteOrder; +import java.nio.LongBuffer; +import java.util.Arrays; +import java.util.Map; + +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.collect.Maps; @@ -27,18 +36,10 @@ import com.metamx.common.logger.Logger; import com.metamx.druid.kv.ConciseCompressedIndexedInts; import com.metamx.druid.kv.GenericIndexed; import com.metamx.druid.kv.Indexed; -import com.metamx.druid.kv.IndexedInts; import com.metamx.druid.kv.IndexedList; import com.metamx.druid.kv.IndexedLongs; import com.metamx.druid.kv.VSizeIndexed; import com.metamx.druid.kv.VSizeIndexedInts; -import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; -import org.joda.time.Interval; - -import java.nio.ByteOrder; -import java.nio.LongBuffer; -import java.util.Arrays; -import java.util.Map; /** */ diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/MetricHolder.java b/index-common/src/main/java/com/metamx/druid/index/v1/MetricHolder.java index 91cbf4f6818..6a010f03cc8 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/MetricHolder.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/MetricHolder.java @@ -19,6 +19,13 @@ package com.metamx.druid.index.v1; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.WritableByteChannel; + import com.google.common.io.ByteStreams; import com.google.common.io.Closeables; import com.google.common.io.InputSupplier; @@ -34,14 +41,6 @@ import com.metamx.druid.kv.IndexedFloats; import com.metamx.druid.kv.ObjectStrategy; import com.metamx.druid.utils.SerializerUtils; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.channels.Channels; -import java.nio.channels.WritableByteChannel; - /** */ public class MetricHolder diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetrics.java b/index-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetrics.java index 33093f8f825..415b46cb1a4 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetrics.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetrics.java @@ -19,11 +19,11 @@ package com.metamx.druid.index.v1.serde; +import java.util.Map; + import com.google.common.collect.Maps; import com.metamx.common.ISE; -import java.util.Map; - /** */ public class ComplexMetrics diff --git a/index-common/src/main/java/com/metamx/druid/indexer/data/CSVDataSpec.java b/index-common/src/main/java/com/metamx/druid/indexer/data/CSVDataSpec.java index 72a683095b9..96552e794a8 100644 --- a/index-common/src/main/java/com/metamx/druid/indexer/data/CSVDataSpec.java +++ b/index-common/src/main/java/com/metamx/druid/indexer/data/CSVDataSpec.java @@ -19,6 +19,13 @@ package com.metamx.druid.indexer.data; +import java.util.List; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; @@ -26,11 +33,6 @@ import com.google.common.collect.Lists; import com.metamx.common.parsers.CSVParser; import com.metamx.common.parsers.Parser; import com.metamx.common.parsers.ToLowerCaseParser; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - -import javax.annotation.Nullable; -import java.util.List; /** */ diff --git a/index-common/src/main/java/com/metamx/druid/indexer/data/DataSpec.java b/index-common/src/main/java/com/metamx/druid/indexer/data/DataSpec.java index 668dbc00fff..ee408366314 100644 --- a/index-common/src/main/java/com/metamx/druid/indexer/data/DataSpec.java +++ b/index-common/src/main/java/com/metamx/druid/indexer/data/DataSpec.java @@ -19,11 +19,12 @@ package com.metamx.druid.indexer.data; -import com.metamx.common.parsers.Parser; +import java.util.List; + import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import java.util.List; +import com.metamx.common.parsers.Parser; /** */ diff --git a/index-common/src/main/java/com/metamx/druid/indexer/data/DelimitedDataSpec.java b/index-common/src/main/java/com/metamx/druid/indexer/data/DelimitedDataSpec.java index 0cad130da33..d5df7af3c16 100644 --- a/index-common/src/main/java/com/metamx/druid/indexer/data/DelimitedDataSpec.java +++ b/index-common/src/main/java/com/metamx/druid/indexer/data/DelimitedDataSpec.java @@ -19,6 +19,13 @@ package com.metamx.druid.indexer.data; +import java.util.List; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; @@ -26,11 +33,6 @@ import com.google.common.collect.Lists; import com.metamx.common.parsers.DelimitedParser; import com.metamx.common.parsers.Parser; import com.metamx.common.parsers.ToLowerCaseParser; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - -import javax.annotation.Nullable; -import java.util.List; /** */ diff --git a/index-common/src/main/java/com/metamx/druid/indexer/data/JSONDataSpec.java b/index-common/src/main/java/com/metamx/druid/indexer/data/JSONDataSpec.java index 4c5f3d45444..1874cc86407 100644 --- a/index-common/src/main/java/com/metamx/druid/indexer/data/JSONDataSpec.java +++ b/index-common/src/main/java/com/metamx/druid/indexer/data/JSONDataSpec.java @@ -19,15 +19,17 @@ package com.metamx.druid.indexer.data; +import java.util.List; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.annotate.JsonProperty; + import com.google.common.base.Function; import com.google.common.collect.Lists; import com.metamx.common.parsers.JSONParser; import com.metamx.common.parsers.Parser; import com.metamx.common.parsers.ToLowerCaseParser; -import org.codehaus.jackson.annotate.JsonProperty; - -import javax.annotation.Nullable; -import java.util.List; /** */ diff --git a/index-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java b/index-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java index 29d12c202d0..20fc0f51796 100644 --- a/index-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java +++ b/index-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java @@ -19,19 +19,20 @@ package com.metamx.druid.indexer.data; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.DateTime; + import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.metamx.common.exception.FormattedException; import com.metamx.common.parsers.Parser; import com.metamx.druid.input.InputRow; import com.metamx.druid.input.MapBasedInputRow; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.DateTime; - -import java.util.List; -import java.util.Map; -import java.util.Set; /** */ diff --git a/index-common/src/main/java/com/metamx/druid/indexer/data/TimestampSpec.java b/index-common/src/main/java/com/metamx/druid/indexer/data/TimestampSpec.java index 4905f268ed4..59d1ca1ed28 100644 --- a/index-common/src/main/java/com/metamx/druid/indexer/data/TimestampSpec.java +++ b/index-common/src/main/java/com/metamx/druid/indexer/data/TimestampSpec.java @@ -19,13 +19,14 @@ package com.metamx.druid.indexer.data; -import com.google.common.base.Function; -import com.metamx.common.parsers.ParserUtils; +import java.util.Map; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.joda.time.DateTime; -import java.util.Map; +import com.google.common.base.Function; +import com.metamx.common.parsers.ParserUtils; /** */ diff --git a/index-common/src/main/java/com/metamx/druid/kv/ConciseCompressedIndexedInts.java b/index-common/src/main/java/com/metamx/druid/kv/ConciseCompressedIndexedInts.java index c35d53328f2..dcbeab56b2f 100644 --- a/index-common/src/main/java/com/metamx/druid/kv/ConciseCompressedIndexedInts.java +++ b/index-common/src/main/java/com/metamx/druid/kv/ConciseCompressedIndexedInts.java @@ -20,14 +20,16 @@ package com.metamx.druid.kv; -import com.google.common.collect.Ordering; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import it.uniroma3.mat.extendedset.intset.IntSet; -import javax.annotation.Nullable; import java.nio.ByteBuffer; import java.util.Iterator; +import javax.annotation.Nullable; + +import com.google.common.collect.Ordering; + /** */ public class ConciseCompressedIndexedInts implements IndexedInts, Comparable diff --git a/index-common/src/main/java/com/metamx/druid/kv/EmptyIndexedInts.java b/index-common/src/main/java/com/metamx/druid/kv/EmptyIndexedInts.java index aaf4d8bffef..20850c2b672 100644 --- a/index-common/src/main/java/com/metamx/druid/kv/EmptyIndexedInts.java +++ b/index-common/src/main/java/com/metamx/druid/kv/EmptyIndexedInts.java @@ -19,11 +19,10 @@ package com.metamx.druid.kv; -import com.google.common.collect.ImmutableList; - -import java.util.Collections; import java.util.Iterator; +import com.google.common.collect.ImmutableList; + /** */ public class EmptyIndexedInts implements IndexedInts diff --git a/index-common/src/main/java/com/metamx/druid/kv/FlattenedArrayWriter.java b/index-common/src/main/java/com/metamx/druid/kv/FlattenedArrayWriter.java index 4c5696a3b8f..cf1a80ce0f7 100644 --- a/index-common/src/main/java/com/metamx/druid/kv/FlattenedArrayWriter.java +++ b/index-common/src/main/java/com/metamx/druid/kv/FlattenedArrayWriter.java @@ -19,6 +19,12 @@ package com.metamx.druid.kv; +import java.io.Closeable; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Arrays; + import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; @@ -27,12 +33,6 @@ import com.google.common.io.CountingOutputStream; import com.google.common.io.InputSupplier; import com.google.common.primitives.Ints; -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Arrays; - /** * Streams arrays of objects out in the binary format described by GenericIndexed */ diff --git a/index-common/src/main/java/com/metamx/druid/kv/GenericIndexed.java b/index-common/src/main/java/com/metamx/druid/kv/GenericIndexed.java index b168c4a790d..ea855d8c7a3 100644 --- a/index-common/src/main/java/com/metamx/druid/kv/GenericIndexed.java +++ b/index-common/src/main/java/com/metamx/druid/kv/GenericIndexed.java @@ -19,12 +19,6 @@ package com.metamx.druid.kv; -import com.google.common.base.Charsets; -import com.google.common.collect.Ordering; -import com.google.common.io.Closeables; -import com.google.common.primitives.Ints; -import com.metamx.common.IAE; - import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.IOException; @@ -33,6 +27,12 @@ import java.nio.channels.WritableByteChannel; import java.util.Arrays; import java.util.Iterator; +import com.google.common.base.Charsets; +import com.google.common.collect.Ordering; +import com.google.common.io.Closeables; +import com.google.common.primitives.Ints; +import com.metamx.common.IAE; + /** * A generic, flat storage mechanism. Use static methods fromArray() or fromIterable() to construct. If input * is sorted, supports binary search index lookups. If input is not sorted, only supports array-like index lookups. diff --git a/index-common/src/main/java/com/metamx/druid/kv/IntBufferIndexedInts.java b/index-common/src/main/java/com/metamx/druid/kv/IntBufferIndexedInts.java index a6c7e42b049..1a196e24742 100644 --- a/index-common/src/main/java/com/metamx/druid/kv/IntBufferIndexedInts.java +++ b/index-common/src/main/java/com/metamx/druid/kv/IntBufferIndexedInts.java @@ -19,14 +19,14 @@ package com.metamx.druid.kv; -import com.google.common.collect.Ordering; -import com.google.common.primitives.Ints; -import com.metamx.druid.IntList; - import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.util.Iterator; +import com.google.common.collect.Ordering; +import com.google.common.primitives.Ints; +import com.metamx.druid.IntList; + /** */ public class IntBufferIndexedInts implements IndexedInts, Comparable diff --git a/index-common/src/main/java/com/metamx/druid/kv/TmpFileIOPeon.java b/index-common/src/main/java/com/metamx/druid/kv/TmpFileIOPeon.java index 9af7e0b0337..48a4879ef92 100644 --- a/index-common/src/main/java/com/metamx/druid/kv/TmpFileIOPeon.java +++ b/index-common/src/main/java/com/metamx/druid/kv/TmpFileIOPeon.java @@ -19,8 +19,6 @@ package com.metamx.druid.kv; -import com.google.common.collect.Maps; - import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; @@ -30,6 +28,8 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.Map; +import com.google.common.collect.Maps; + /** */ public class TmpFileIOPeon implements IOPeon diff --git a/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexed.java b/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexed.java index b77ab3ba4db..d5da8a9dd16 100644 --- a/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexed.java +++ b/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexed.java @@ -19,10 +19,6 @@ package com.metamx.druid.kv; -import com.google.common.primitives.Ints; -import com.metamx.common.IAE; -import com.metamx.common.ISE; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.ByteBuffer; @@ -30,6 +26,10 @@ import java.nio.channels.WritableByteChannel; import java.util.Arrays; import java.util.Iterator; +import com.google.common.primitives.Ints; +import com.metamx.common.IAE; +import com.metamx.common.ISE; + /** */ public class VSizeIndexed implements Indexed diff --git a/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexedInts.java b/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexedInts.java index c4bd1adad2f..449253acfd9 100644 --- a/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexedInts.java +++ b/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexedInts.java @@ -19,13 +19,13 @@ package com.metamx.druid.kv; -import com.google.common.primitives.Ints; -import com.metamx.common.IAE; - import java.nio.ByteBuffer; import java.util.Iterator; import java.util.List; +import com.google.common.primitives.Ints; +import com.metamx.common.IAE; + /** */ public class VSizeIndexedInts implements IndexedInts, Comparable diff --git a/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexedWriter.java b/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexedWriter.java index c50ea15ad53..5911192d6f7 100644 --- a/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexedWriter.java +++ b/index-common/src/main/java/com/metamx/druid/kv/VSizeIndexedWriter.java @@ -19,6 +19,13 @@ package com.metamx.druid.kv; +import java.io.Closeable; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Arrays; +import java.util.List; + import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; @@ -28,13 +35,6 @@ import com.google.common.io.CountingOutputStream; import com.google.common.io.InputSupplier; import com.google.common.primitives.Ints; -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Arrays; -import java.util.List; - /** * Streams arrays of objects out in the binary format described by VSizeIndexed */ diff --git a/index-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplierTest.java b/index-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplierTest.java index 850217c1f0d..9deeb9ce1fc 100644 --- a/index-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplierTest.java +++ b/index-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplierTest.java @@ -19,20 +19,21 @@ package com.metamx.druid.index.v1; -import com.google.common.io.Closeables; -import com.google.common.primitives.Floats; -import com.metamx.druid.kv.IndexedFloats; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import com.google.common.io.Closeables; +import com.google.common.primitives.Floats; +import com.metamx.druid.kv.IndexedFloats; + /** */ public class CompressedFloatsIndexedSupplierTest diff --git a/index-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializerTest.java b/index-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializerTest.java index df300cf7f23..bbc9cd0053c 100644 --- a/index-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializerTest.java +++ b/index-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializerTest.java @@ -19,26 +19,20 @@ package com.metamx.druid.index.v1; -import com.google.common.collect.Maps; -import com.google.common.io.OutputSupplier; -import com.metamx.druid.collect.ResourceHolder; -import com.metamx.druid.kv.FlattenedArrayWriter; -import com.metamx.druid.kv.IOPeon; -import com.metamx.druid.kv.IndexedFloats; -import org.junit.Assert; -import org.junit.Test; - -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; -import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; + +import com.google.common.io.OutputSupplier; +import com.metamx.druid.collect.ResourceHolder; +import com.metamx.druid.kv.FlattenedArrayWriter; +import com.metamx.druid.kv.IndexedFloats; /** */ diff --git a/index-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplierTest.java b/index-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplierTest.java index f14fcd29f86..b299e11b903 100644 --- a/index-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplierTest.java +++ b/index-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplierTest.java @@ -19,20 +19,21 @@ package com.metamx.druid.index.v1; -import com.google.common.io.Closeables; -import com.google.common.primitives.Longs; -import com.metamx.druid.kv.IndexedLongs; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - import java.nio.ByteOrder; import java.nio.LongBuffer; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import com.google.common.io.Closeables; +import com.google.common.primitives.Longs; +import com.metamx.druid.kv.IndexedLongs; + /** */ public class CompressedLongsIndexedSupplierTest diff --git a/index-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializerTest.java b/index-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializerTest.java index 1746c2c2331..e0221154e5e 100644 --- a/index-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializerTest.java +++ b/index-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializerTest.java @@ -19,13 +19,6 @@ package com.metamx.druid.index.v1; -import com.google.common.io.OutputSupplier; -import com.metamx.druid.collect.ResourceHolder; -import com.metamx.druid.kv.FlattenedArrayWriter; -import com.metamx.druid.kv.IndexedLongs; -import org.junit.Assert; -import org.junit.Test; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; @@ -33,6 +26,14 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.LongBuffer; +import org.junit.Assert; +import org.junit.Test; + +import com.google.common.io.OutputSupplier; +import com.metamx.druid.collect.ResourceHolder; +import com.metamx.druid.kv.FlattenedArrayWriter; +import com.metamx.druid.kv.IndexedLongs; + /** */ public class CompressedLongsSupplierSerializerTest diff --git a/index-common/src/test/java/com/metamx/druid/index/v1/IOPeonForTesting.java b/index-common/src/test/java/com/metamx/druid/index/v1/IOPeonForTesting.java index 6229d222e83..632aaffc9ab 100644 --- a/index-common/src/test/java/com/metamx/druid/index/v1/IOPeonForTesting.java +++ b/index-common/src/test/java/com/metamx/druid/index/v1/IOPeonForTesting.java @@ -19,9 +19,6 @@ package com.metamx.druid.index.v1; -import com.google.common.collect.Maps; -import com.metamx.druid.kv.IOPeon; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; @@ -30,6 +27,9 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.Map; +import com.google.common.collect.Maps; +import com.metamx.druid.kv.IOPeon; + /** */ class IOPeonForTesting implements IOPeon diff --git a/index-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedFloatsTest.java b/index-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedFloatsTest.java index bb52785b910..3aa08cf70da 100644 --- a/index-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedFloatsTest.java +++ b/index-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedFloatsTest.java @@ -19,12 +19,13 @@ package com.metamx.druid.index.v1; -import com.metamx.druid.kv.IndexedFloats; +import java.nio.ByteOrder; + import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.nio.ByteOrder; +import com.metamx.druid.kv.IndexedFloats; /** */ diff --git a/index-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedLongsTest.java b/index-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedLongsTest.java index 00c01ac52be..7df50eae7e1 100644 --- a/index-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedLongsTest.java +++ b/index-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedLongsTest.java @@ -19,12 +19,13 @@ package com.metamx.druid.index.v1; -import com.metamx.druid.kv.IndexedLongs; +import java.nio.ByteOrder; + import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.nio.ByteOrder; +import com.metamx.druid.kv.IndexedLongs; /** */ diff --git a/index-common/src/test/java/com/metamx/druid/kv/GenericIndexedTest.java b/index-common/src/test/java/com/metamx/druid/kv/GenericIndexedTest.java index 41e6a65ebde..50c1f4963e3 100644 --- a/index-common/src/test/java/com/metamx/druid/kv/GenericIndexedTest.java +++ b/index-common/src/test/java/com/metamx/druid/kv/GenericIndexedTest.java @@ -19,10 +19,6 @@ package com.metamx.druid.kv; -import com.google.common.collect.Maps; -import org.junit.Assert; -import org.junit.Test; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.ByteBuffer; @@ -31,6 +27,11 @@ import java.nio.channels.WritableByteChannel; import java.util.HashMap; import java.util.Map; +import org.junit.Assert; +import org.junit.Test; + +import com.google.common.collect.Maps; + /** */ public class GenericIndexedTest diff --git a/index-common/src/test/java/com/metamx/druid/kv/IndexedIntsTest.java b/index-common/src/test/java/com/metamx/druid/kv/IndexedIntsTest.java index d7341cb5c28..a58ffcbabad 100644 --- a/index-common/src/test/java/com/metamx/druid/kv/IndexedIntsTest.java +++ b/index-common/src/test/java/com/metamx/druid/kv/IndexedIntsTest.java @@ -19,15 +19,15 @@ package com.metamx.druid.kv; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; - /** */ @RunWith(Parameterized.class) diff --git a/index-common/src/test/java/com/metamx/druid/kv/VSizeIndexedTest.java b/index-common/src/test/java/com/metamx/druid/kv/VSizeIndexedTest.java index 39ce52a5133..44b4f8f53f0 100644 --- a/index-common/src/test/java/com/metamx/druid/kv/VSizeIndexedTest.java +++ b/index-common/src/test/java/com/metamx/druid/kv/VSizeIndexedTest.java @@ -19,11 +19,6 @@ package com.metamx.druid.kv; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import org.junit.Assert; -import org.junit.Test; - import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import java.nio.channels.Channels; @@ -31,6 +26,12 @@ import java.nio.channels.WritableByteChannel; import java.util.Arrays; import java.util.List; +import org.junit.Assert; +import org.junit.Test; + +import com.google.common.base.Function; +import com.google.common.collect.Iterables; + /** */ public class VSizeIndexedTest diff --git a/indexer/src/main/java/com/metamx/druid/indexer/Bucket.java b/indexer/src/main/java/com/metamx/druid/indexer/Bucket.java index 6904522a463..1559996a5f3 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/Bucket.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/Bucket.java @@ -19,10 +19,11 @@ package com.metamx.druid.indexer; -import com.metamx.common.Pair; +import java.nio.ByteBuffer; + import org.joda.time.DateTime; -import java.nio.ByteBuffer; +import com.metamx.common.Pair; public class Bucket { diff --git a/indexer/src/main/java/com/metamx/druid/indexer/DbUpdaterJob.java b/indexer/src/main/java/com/metamx/druid/indexer/DbUpdaterJob.java index d1925629bd2..b2005e296b8 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/DbUpdaterJob.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/DbUpdaterJob.java @@ -19,11 +19,11 @@ package com.metamx.druid.indexer; -import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.db.DbConnector; -import com.metamx.druid.indexer.updater.DbUpdaterJobSpec; -import com.metamx.druid.jackson.DefaultObjectMapper; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.codehaus.jackson.map.ObjectMapper; @@ -32,10 +32,11 @@ import org.skife.jdbi.v2.DBI; import org.skife.jdbi.v2.Handle; import org.skife.jdbi.v2.tweak.HandleCallback; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; +import com.metamx.common.logger.Logger; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.db.DbConnector; +import com.metamx.druid.indexer.updater.DbUpdaterJobSpec; +import com.metamx.druid.jackson.DefaultObjectMapper; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/DeterminePartitionsJob.java b/indexer/src/main/java/com/metamx/druid/indexer/DeterminePartitionsJob.java index a40642ebec5..409eca0dd92 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/DeterminePartitionsJob.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/DeterminePartitionsJob.java @@ -19,6 +19,36 @@ package com.metamx.druid.indexer; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.io.BytesWritable; +import org.apache.hadoop.io.LongWritable; +import org.apache.hadoop.io.Text; +import org.apache.hadoop.io.Writable; +import org.apache.hadoop.mapred.InvalidJobConfException; +import org.apache.hadoop.mapreduce.Job; +import org.apache.hadoop.mapreduce.JobContext; +import org.apache.hadoop.mapreduce.Mapper; +import org.apache.hadoop.mapreduce.RecordWriter; +import org.apache.hadoop.mapreduce.Reducer; +import org.apache.hadoop.mapreduce.TaskAttemptContext; +import org.apache.hadoop.mapreduce.TaskInputOutputContext; +import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; +import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; +import org.codehaus.jackson.type.TypeReference; +import org.joda.time.DateTime; +import org.joda.time.DateTimeComparator; +import org.joda.time.Interval; + import com.google.common.base.Charsets; import com.google.common.base.Function; import com.google.common.base.Joiner; @@ -41,35 +71,6 @@ import com.metamx.druid.CombiningIterable; import com.metamx.druid.shard.NoneShardSpec; import com.metamx.druid.shard.ShardSpec; import com.metamx.druid.shard.SingleDimensionShardSpec; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.io.BytesWritable; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.io.Writable; -import org.apache.hadoop.mapred.InvalidJobConfException; -import org.apache.hadoop.mapreduce.Job; -import org.apache.hadoop.mapreduce.JobContext; -import org.apache.hadoop.mapreduce.Mapper; -import org.apache.hadoop.mapreduce.RecordWriter; -import org.apache.hadoop.mapreduce.Reducer; -import org.apache.hadoop.mapreduce.TaskAttemptContext; -import org.apache.hadoop.mapreduce.TaskInputOutputContext; -import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; -import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; -import org.codehaus.jackson.type.TypeReference; -import org.joda.time.DateTime; -import org.joda.time.DateTimeComparator; -import org.joda.time.Interval; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; -import java.util.Map; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexer.java b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexer.java index d8abc55cf31..3bc89a56c06 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexer.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexer.java @@ -19,17 +19,18 @@ package com.metamx.druid.indexer; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import com.metamx.common.Pair; -import com.metamx.druid.jackson.DefaultObjectMapper; +import java.io.File; +import java.util.Arrays; +import java.util.List; + import org.codehaus.jackson.map.ObjectMapper; import org.joda.time.DateTime; import org.joda.time.Interval; -import java.io.File; -import java.util.Arrays; -import java.util.List; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.metamx.common.Pair; +import com.metamx.druid.jackson.DefaultObjectMapper; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerAzkWrapper.java b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerAzkWrapper.java index 8d073dd7297..ef099c9564c 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerAzkWrapper.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerAzkWrapper.java @@ -19,21 +19,19 @@ package com.metamx.druid.indexer; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.metamx.common.Granularity; -import com.metamx.common.MapUtils; -import com.metamx.common.logger.Logger; -import com.metamx.druid.indexer.path.GranularityPathSpec; -import com.metamx.druid.jackson.DefaultObjectMapper; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Properties; +import org.joda.time.DateTime; +import org.joda.time.Interval; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.metamx.common.MapUtils; +import com.metamx.common.logger.Logger; +import com.metamx.druid.jackson.DefaultObjectMapper; + /** */ public class HadoopDruidIndexerAzkWrapper diff --git a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerConfig.java b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerConfig.java index bcc393829b5..bd8ebf4fbc8 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerConfig.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerConfig.java @@ -19,6 +19,23 @@ package com.metamx.druid.indexer; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.mapreduce.Job; +import org.codehaus.jackson.JsonGenerator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; +import org.joda.time.Interval; +import org.joda.time.format.ISODateTimeFormat; + import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.base.Optional; @@ -40,22 +57,6 @@ import com.metamx.druid.indexer.updater.UpdaterJobSpec; import com.metamx.druid.jackson.DefaultObjectMapper; import com.metamx.druid.shard.ShardSpec; import com.metamx.druid.utils.JodaUtils; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.mapreduce.Job; -import org.codehaus.jackson.JsonGenerator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.DateTime; -import org.joda.time.Interval; -import org.joda.time.format.ISODateTimeFormat; - -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerJob.java b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerJob.java index eae1bfa885d..9c1d80edd75 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerJob.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerJob.java @@ -19,6 +19,17 @@ package com.metamx.druid.indexer; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.mapreduce.Job; +import org.joda.time.DateTime; +import org.joda.time.DateTimeComparator; +import org.joda.time.Interval; + import com.google.common.base.Preconditions; import com.google.common.base.Throwables; import com.google.common.collect.Lists; @@ -27,16 +38,6 @@ import com.metamx.common.ISE; import com.metamx.common.logger.Logger; import com.metamx.druid.client.DataSegment; import com.metamx.druid.shard.NoneShardSpec; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.mapreduce.Job; -import org.joda.time.DateTime; -import org.joda.time.DateTimeComparator; -import org.joda.time.Interval; - -import java.io.IOException; -import java.util.List; -import java.util.Map; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/HadoopIOPeon.java b/indexer/src/main/java/com/metamx/druid/indexer/HadoopIOPeon.java index 21f816f4aba..2af3b200b56 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopIOPeon.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopIOPeon.java @@ -19,14 +19,15 @@ package com.metamx.druid.indexer; -import com.metamx.druid.kv.IOPeon; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.mapreduce.JobContext; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.mapreduce.JobContext; + +import com.metamx.druid.kv.IOPeon; + /** */ class HadoopIOPeon implements IOPeon diff --git a/indexer/src/main/java/com/metamx/druid/indexer/HadoopyShardSpec.java b/indexer/src/main/java/com/metamx/druid/indexer/HadoopyShardSpec.java index d7f40087ba8..59c2591fb3a 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopyShardSpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopyShardSpec.java @@ -19,10 +19,11 @@ package com.metamx.druid.indexer; -import com.metamx.druid.shard.ShardSpec; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; +import com.metamx.druid.shard.ShardSpec; + /** * ShardSpec + a shard ID that is unique across this run. The shard ID is used for grouping and partitioning. * There is one HadoopyShardSpec per Bucket, and our shardNum matches the Bucket shardNum. diff --git a/indexer/src/main/java/com/metamx/druid/indexer/IndexGeneratorJob.java b/indexer/src/main/java/com/metamx/druid/indexer/IndexGeneratorJob.java index c1c4578acef..af0cb283c3f 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/IndexGeneratorJob.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/IndexGeneratorJob.java @@ -19,34 +19,22 @@ package com.metamx.druid.indexer; -import com.google.common.base.Function; -import com.google.common.base.Optional; -import com.google.common.base.Predicate; -import com.google.common.base.Throwables; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; -import com.google.common.hash.Hashing; -import com.google.common.io.Closeables; -import com.google.common.primitives.Longs; -import com.metamx.common.ISE; -import com.metamx.common.RE; -import com.metamx.common.guava.FunctionalIterable; -import com.metamx.common.logger.Logger; -import com.metamx.common.parsers.Parser; -import com.metamx.common.parsers.ParserUtils; -import com.metamx.druid.aggregation.AggregatorFactory; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.v1.IncrementalIndex; -import com.metamx.druid.index.v1.IndexIO; -import com.metamx.druid.index.v1.IndexMerger; -import com.metamx.druid.index.v1.MMappedIndex; -import com.metamx.druid.index.v1.serde.ComplexMetrics; -import com.metamx.druid.input.MapBasedInputRow; -import com.metamx.druid.indexer.rollup.DataRollupSpec; -import com.metamx.druid.jackson.DefaultObjectMapper; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import javax.annotation.Nullable; + import org.apache.commons.io.FileUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; @@ -71,20 +59,32 @@ import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; import org.joda.time.DateTime; import org.joda.time.Interval; -import javax.annotation.Nullable; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; +import com.google.common.base.Function; +import com.google.common.base.Optional; +import com.google.common.base.Predicate; +import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.common.io.Closeables; +import com.google.common.primitives.Longs; +import com.metamx.common.ISE; +import com.metamx.common.RE; +import com.metamx.common.guava.FunctionalIterable; +import com.metamx.common.logger.Logger; +import com.metamx.common.parsers.Parser; +import com.metamx.common.parsers.ParserUtils; +import com.metamx.druid.aggregation.AggregatorFactory; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.index.v1.IncrementalIndex; +import com.metamx.druid.index.v1.IndexIO; +import com.metamx.druid.index.v1.IndexMerger; +import com.metamx.druid.index.v1.MMappedIndex; +import com.metamx.druid.indexer.rollup.DataRollupSpec; +import com.metamx.druid.input.MapBasedInputRow; +import com.metamx.druid.jackson.DefaultObjectMapper; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/SortableBytes.java b/indexer/src/main/java/com/metamx/druid/indexer/SortableBytes.java index 3abaa7951b8..c5e58c7b452 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/SortableBytes.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/SortableBytes.java @@ -19,14 +19,15 @@ package com.metamx.druid.indexer; -import com.google.common.base.Charsets; +import java.nio.ByteBuffer; +import java.util.Arrays; + import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.io.WritableComparator; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Partitioner; -import java.nio.ByteBuffer; -import java.util.Arrays; +import com.google.common.base.Charsets; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/StringIntervalFunction.java b/indexer/src/main/java/com/metamx/druid/indexer/StringIntervalFunction.java index f47075863ae..c5afc4a0928 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/StringIntervalFunction.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/StringIntervalFunction.java @@ -19,9 +19,10 @@ package com.metamx.druid.indexer; -import com.google.common.base.Function; import org.joda.time.Interval; +import com.google.common.base.Function; + /** */ class StringIntervalFunction implements Function diff --git a/indexer/src/main/java/com/metamx/druid/indexer/Utils.java b/indexer/src/main/java/com/metamx/druid/indexer/Utils.java index aa1c3ed2f4b..38a3d42c28e 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/Utils.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/Utils.java @@ -19,10 +19,13 @@ package com.metamx.druid.indexer; -import com.google.common.base.Preconditions; -import com.google.common.collect.Iterators; -import com.metamx.common.ISE; -import com.metamx.druid.jackson.DefaultObjectMapper; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.compress.CompressionCodec; @@ -33,12 +36,10 @@ import org.apache.hadoop.util.ReflectionUtils; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; +import com.google.common.base.Preconditions; +import com.google.common.collect.Iterators; +import com.metamx.common.ISE; +import com.metamx.druid.jackson.DefaultObjectMapper; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/ZkUpdaterJob.java b/indexer/src/main/java/com/metamx/druid/indexer/ZkUpdaterJob.java index cd2ed44bd59..27c3792e9d3 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/ZkUpdaterJob.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/ZkUpdaterJob.java @@ -19,6 +19,12 @@ package com.metamx.druid.indexer; +import org.I0Itec.zkclient.ZkClient; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.Path; +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; + import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; import com.metamx.common.lifecycle.Lifecycle; @@ -28,11 +34,6 @@ import com.metamx.druid.indexer.updater.ZkUpdaterJobSpec; import com.metamx.druid.initialization.Initialization; import com.metamx.druid.initialization.ZkClientConfig; import com.metamx.druid.jackson.DefaultObjectMapper; -import org.I0Itec.zkclient.ZkClient; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.Path; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.DateTime; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/granularity/ArbitraryGranularitySpec.java b/indexer/src/main/java/com/metamx/druid/indexer/granularity/ArbitraryGranularitySpec.java index 151055271ec..7b798e661eb 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/granularity/ArbitraryGranularitySpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/granularity/ArbitraryGranularitySpec.java @@ -19,19 +19,20 @@ package com.metamx.druid.indexer.granularity; -import com.google.common.base.Optional; -import com.google.common.collect.Iterators; -import com.google.common.collect.PeekingIterator; -import com.google.common.collect.Sets; -import com.metamx.common.guava.Comparators; +import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.joda.time.DateTime; import org.joda.time.Interval; -import java.util.List; -import java.util.SortedSet; -import java.util.TreeSet; +import com.google.common.base.Optional; +import com.google.common.collect.Iterators; +import com.google.common.collect.PeekingIterator; +import com.google.common.collect.Sets; +import com.metamx.common.guava.Comparators; public class ArbitraryGranularitySpec implements GranularitySpec { diff --git a/indexer/src/main/java/com/metamx/druid/indexer/granularity/GranularitySpec.java b/indexer/src/main/java/com/metamx/druid/indexer/granularity/GranularitySpec.java index 30ce2df1171..8357b5150cf 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/granularity/GranularitySpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/granularity/GranularitySpec.java @@ -19,13 +19,14 @@ package com.metamx.druid.indexer.granularity; -import com.google.common.base.Optional; +import java.util.SortedSet; + import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; import org.joda.time.DateTime; import org.joda.time.Interval; -import java.util.SortedSet; +import com.google.common.base.Optional; /** * Tells the indexer how to group events based on timestamp. The events may then be further partitioned based diff --git a/indexer/src/main/java/com/metamx/druid/indexer/granularity/UniformGranularitySpec.java b/indexer/src/main/java/com/metamx/druid/indexer/granularity/UniformGranularitySpec.java index a1039caba1c..538d2bdd2bc 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/granularity/UniformGranularitySpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/granularity/UniformGranularitySpec.java @@ -19,18 +19,19 @@ package com.metamx.druid.indexer.granularity; -import com.google.common.base.Optional; -import com.google.common.collect.Sets; -import com.metamx.common.Granularity; -import com.metamx.common.guava.Comparators; +import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.joda.time.DateTime; import org.joda.time.Interval; -import java.util.List; -import java.util.SortedSet; -import java.util.TreeSet; +import com.google.common.base.Optional; +import com.google.common.collect.Sets; +import com.metamx.common.Granularity; +import com.metamx.common.guava.Comparators; public class UniformGranularitySpec implements GranularitySpec { diff --git a/indexer/src/main/java/com/metamx/druid/indexer/hadoop/FSSpideringIterator.java b/indexer/src/main/java/com/metamx/druid/indexer/hadoop/FSSpideringIterator.java index a67e03c749c..b105bef9f43 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/hadoop/FSSpideringIterator.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/hadoop/FSSpideringIterator.java @@ -19,14 +19,14 @@ package com.metamx.druid.indexer.hadoop; -import org.apache.hadoop.fs.FileStatus; -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.fs.Path; - import java.io.IOException; import java.util.Iterator; import java.util.NoSuchElementException; +import org.apache.hadoop.fs.FileStatus; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; + /** */ public class FSSpideringIterator implements Iterator diff --git a/indexer/src/main/java/com/metamx/druid/indexer/path/GranularUnprocessedPathSpec.java b/indexer/src/main/java/com/metamx/druid/indexer/path/GranularUnprocessedPathSpec.java index 47e1676f848..9c30b0ad031 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/path/GranularUnprocessedPathSpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/path/GranularUnprocessedPathSpec.java @@ -19,29 +19,27 @@ package com.metamx.druid.indexer.path; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.metamx.common.Granularity; -import com.metamx.common.guava.Comparators; -import com.metamx.druid.common.s3.S3Utils; -import com.metamx.druid.indexer.HadoopDruidIndexerConfig; -import com.metamx.druid.indexer.granularity.UniformGranularitySpec; -import com.metamx.druid.indexer.hadoop.FSSpideringIterator; +import java.io.IOException; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.mapreduce.Job; import org.codehaus.jackson.annotate.JsonProperty; -import org.jets3t.service.model.S3Object; import org.joda.time.DateTime; import org.joda.time.Interval; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.metamx.common.Granularity; +import com.metamx.common.guava.Comparators; +import com.metamx.druid.indexer.HadoopDruidIndexerConfig; +import com.metamx.druid.indexer.granularity.UniformGranularitySpec; +import com.metamx.druid.indexer.hadoop.FSSpideringIterator; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/path/GranularityPathSpec.java b/indexer/src/main/java/com/metamx/druid/indexer/path/GranularityPathSpec.java index aeca725bd1c..2359b4ec8d5 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/path/GranularityPathSpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/path/GranularityPathSpec.java @@ -19,12 +19,10 @@ package com.metamx.druid.indexer.path; -import com.google.common.collect.Sets; -import com.metamx.common.Granularity; -import com.metamx.common.guava.Comparators; -import com.metamx.common.logger.Logger; -import com.metamx.druid.indexer.HadoopDruidIndexerConfig; -import com.metamx.druid.indexer.hadoop.FSSpideringIterator; +import java.io.IOException; +import java.util.Set; +import java.util.regex.Pattern; + import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -36,9 +34,12 @@ import org.joda.time.Interval; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; -import java.io.IOException; -import java.util.Set; -import java.util.regex.Pattern; +import com.google.common.collect.Sets; +import com.metamx.common.Granularity; +import com.metamx.common.guava.Comparators; +import com.metamx.common.logger.Logger; +import com.metamx.druid.indexer.HadoopDruidIndexerConfig; +import com.metamx.druid.indexer.hadoop.FSSpideringIterator; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/path/PathSpec.java b/indexer/src/main/java/com/metamx/druid/indexer/path/PathSpec.java index 776f51c99bd..4c991624129 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/path/PathSpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/path/PathSpec.java @@ -19,12 +19,13 @@ package com.metamx.druid.indexer.path; -import com.metamx.druid.indexer.HadoopDruidIndexerConfig; +import java.io.IOException; + import org.apache.hadoop.mapreduce.Job; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import java.io.IOException; +import com.metamx.druid.indexer.HadoopDruidIndexerConfig; /** */ diff --git a/indexer/src/main/java/com/metamx/druid/indexer/path/StaticPathSpec.java b/indexer/src/main/java/com/metamx/druid/indexer/path/StaticPathSpec.java index f46135c32cc..6630fd84159 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/path/StaticPathSpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/path/StaticPathSpec.java @@ -19,13 +19,14 @@ package com.metamx.druid.indexer.path; -import com.metamx.common.logger.Logger; -import com.metamx.druid.indexer.HadoopDruidIndexerConfig; +import java.io.IOException; + import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.codehaus.jackson.annotate.JsonProperty; -import java.io.IOException; +import com.metamx.common.logger.Logger; +import com.metamx.druid.indexer.HadoopDruidIndexerConfig; /** * Class uses public fields to work around http://jira.codehaus.org/browse/MSHADE-92 diff --git a/indexer/src/main/java/com/metamx/druid/indexer/rollup/DataRollupSpec.java b/indexer/src/main/java/com/metamx/druid/indexer/rollup/DataRollupSpec.java index e2e1f9ce032..46710512422 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/rollup/DataRollupSpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/rollup/DataRollupSpec.java @@ -19,12 +19,12 @@ package com.metamx.druid.indexer.rollup; -import com.metamx.common.Granularity; -import com.metamx.druid.QueryGranularity; -import com.metamx.druid.aggregation.AggregatorFactory; +import java.util.List; + import org.codehaus.jackson.annotate.JsonProperty; -import java.util.List; +import com.metamx.druid.QueryGranularity; +import com.metamx.druid.aggregation.AggregatorFactory; /** * Class uses public fields to work around http://jira.codehaus.org/browse/MSHADE-92 diff --git a/indexer/src/main/java/com/metamx/druid/indexer/updater/DbUpdaterJobSpec.java b/indexer/src/main/java/com/metamx/druid/indexer/updater/DbUpdaterJobSpec.java index 489a8e94931..60b82069b53 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/updater/DbUpdaterJobSpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/updater/DbUpdaterJobSpec.java @@ -19,9 +19,10 @@ package com.metamx.druid.indexer.updater; -import com.metamx.druid.db.DbConnectorConfig; import org.codehaus.jackson.annotate.JsonProperty; +import com.metamx.druid.db.DbConnectorConfig; + /** */ public class DbUpdaterJobSpec extends DbConnectorConfig implements UpdaterJobSpec diff --git a/indexer/src/main/java/com/metamx/druid/indexer/updater/UpdaterJobSpec.java b/indexer/src/main/java/com/metamx/druid/indexer/updater/UpdaterJobSpec.java index 4818e4c99a9..3523a198ba6 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/updater/UpdaterJobSpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/updater/UpdaterJobSpec.java @@ -19,8 +19,6 @@ package com.metamx.druid.indexer.updater; -import com.metamx.druid.indexer.DbUpdaterJob; -import com.metamx.druid.indexer.ZkUpdaterJob; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; diff --git a/merger/src/main/java/com/metamx/druid/merger/common/TaskHolder.java b/merger/src/main/java/com/metamx/druid/merger/common/TaskHolder.java index d9479a7dbbf..02928bb4a92 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/TaskHolder.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/TaskHolder.java @@ -19,11 +19,12 @@ package com.metamx.druid.merger.common; -import com.metamx.druid.merger.common.task.Task; -import com.metamx.druid.merger.coordinator.TaskContext; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; +import com.metamx.druid.merger.common.task.Task; +import com.metamx.druid.merger.coordinator.TaskContext; + /** */ public class TaskHolder diff --git a/merger/src/main/java/com/metamx/druid/merger/common/TaskStatus.java b/merger/src/main/java/com/metamx/druid/merger/common/TaskStatus.java index 39b38a18a93..78ed44ec860 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/TaskStatus.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/TaskStatus.java @@ -19,16 +19,17 @@ package com.metamx.druid.merger.common; +import java.util.Collections; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.metamx.druid.client.DataSegment; import com.metamx.druid.merger.common.task.Task; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - -import java.util.Collections; -import java.util.List; public class TaskStatus { diff --git a/merger/src/main/java/com/metamx/druid/merger/common/TaskToolbox.java b/merger/src/main/java/com/metamx/druid/merger/common/TaskToolbox.java index e631db0eea2..9a5df0926d6 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/TaskToolbox.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/TaskToolbox.java @@ -19,6 +19,12 @@ package com.metamx.druid.merger.common; +import java.io.File; +import java.util.Map; + +import org.codehaus.jackson.map.ObjectMapper; +import org.jets3t.service.impl.rest.httpclient.RestS3Service; + import com.google.common.collect.ImmutableMap; import com.metamx.druid.loading.S3SegmentGetter; import com.metamx.druid.loading.S3SegmentGetterConfig; @@ -28,11 +34,6 @@ import com.metamx.druid.merger.common.task.Task; import com.metamx.druid.merger.coordinator.config.IndexerCoordinatorConfig; import com.metamx.druid.realtime.SegmentPusher; import com.metamx.emitter.service.ServiceEmitter; -import org.codehaus.jackson.map.ObjectMapper; -import org.jets3t.service.impl.rest.httpclient.RestS3Service; - -import java.io.File; -import java.util.Map; /** * Stuff that may be needed by a Task in order to conduct its business. diff --git a/merger/src/main/java/com/metamx/druid/merger/common/index/StaticS3FirehoseFactory.java b/merger/src/main/java/com/metamx/druid/merger/common/index/StaticS3FirehoseFactory.java index 28b78f78ad6..3e1a068a88b 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/index/StaticS3FirehoseFactory.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/index/StaticS3FirehoseFactory.java @@ -19,6 +19,25 @@ package com.metamx.druid.merger.common.index; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URI; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Queue; +import java.util.zip.GZIPInputStream; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.LineIterator; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.annotate.JsonTypeName; +import org.codehaus.jackson.map.annotate.JacksonInject; +import org.jets3t.service.S3Service; +import org.jets3t.service.model.S3Object; + import com.google.common.base.Charsets; import com.google.common.base.Preconditions; import com.google.common.base.Throwables; @@ -29,24 +48,6 @@ import com.metamx.druid.indexer.data.StringInputRowParser; import com.metamx.druid.input.InputRow; import com.metamx.druid.realtime.Firehose; import com.metamx.druid.realtime.FirehoseFactory; -import org.apache.commons.io.IOUtils; -import org.apache.commons.io.LineIterator; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.annotate.JsonTypeName; -import org.codehaus.jackson.map.annotate.JacksonInject; -import org.jets3t.service.S3Service; -import org.jets3t.service.model.S3Object; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URI; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Queue; -import java.util.zip.GZIPInputStream; /** * Builds firehoses that read from a predefined list of S3 objects and then dry up. diff --git a/merger/src/main/java/com/metamx/druid/merger/common/index/YeOldePlumberSchool.java b/merger/src/main/java/com/metamx/druid/merger/common/index/YeOldePlumberSchool.java index 4ece129f49b..28624444984 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/index/YeOldePlumberSchool.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/index/YeOldePlumberSchool.java @@ -19,6 +19,16 @@ package com.metamx.druid.merger.common.index; +import java.io.File; +import java.util.List; +import java.util.Set; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.annotate.JsonTypeName; +import org.codehaus.jackson.map.annotate.JacksonInject; +import org.joda.time.Interval; + import com.google.common.base.Preconditions; import com.google.common.base.Throwables; import com.google.common.collect.Iterables; @@ -38,15 +48,6 @@ import com.metamx.druid.realtime.PlumberSchool; import com.metamx.druid.realtime.Schema; import com.metamx.druid.realtime.SegmentPusher; import com.metamx.druid.realtime.Sink; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.annotate.JsonTypeName; -import org.codehaus.jackson.map.annotate.JacksonInject; -import org.joda.time.Interval; - -import java.io.File; -import java.util.List; -import java.util.Set; /** * Trains plumbers that create a single historical segment. diff --git a/merger/src/main/java/com/metamx/druid/merger/common/task/AbstractTask.java b/merger/src/main/java/com/metamx/druid/merger/common/task/AbstractTask.java index 6de3eb0d73f..d176b8e76c5 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/task/AbstractTask.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/task/AbstractTask.java @@ -19,13 +19,14 @@ package com.metamx.druid.merger.common.task; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.Interval; + import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.coordinator.TaskContext; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.Interval; public abstract class AbstractTask implements Task { diff --git a/merger/src/main/java/com/metamx/druid/merger/common/task/AppendTask.java b/merger/src/main/java/com/metamx/druid/merger/common/task/AppendTask.java index f9898070aa1..a7ef651b4c7 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/task/AppendTask.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/task/AppendTask.java @@ -19,6 +19,16 @@ package com.metamx.druid.merger.common.task; +import java.io.File; +import java.util.List; +import java.util.Map; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; @@ -33,14 +43,6 @@ import com.metamx.druid.index.v1.IndexableAdapter; import com.metamx.druid.index.v1.MMappedIndexAdapter; import com.metamx.druid.index.v1.Rowboat; import com.metamx.druid.index.v1.RowboatFilteringIndexAdapter; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.io.File; -import java.util.List; -import java.util.Map; /** */ diff --git a/merger/src/main/java/com/metamx/druid/merger/common/task/DefaultMergeTask.java b/merger/src/main/java/com/metamx/druid/merger/common/task/DefaultMergeTask.java index 6dfc95c2271..7273dfda463 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/task/DefaultMergeTask.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/task/DefaultMergeTask.java @@ -19,6 +19,15 @@ package com.metamx.druid.merger.common.task; +import java.io.File; +import java.util.List; +import java.util.Map; + +import javax.annotation.Nullable; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + import com.google.common.base.Function; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; @@ -28,13 +37,6 @@ import com.metamx.druid.client.DataSegment; import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.index.v1.IndexMerger; import com.metamx.druid.index.v1.MMappedIndex; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - -import javax.annotation.Nullable; -import java.io.File; -import java.util.List; -import java.util.Map; /** */ diff --git a/merger/src/main/java/com/metamx/druid/merger/common/task/DeleteTask.java b/merger/src/main/java/com/metamx/druid/merger/common/task/DeleteTask.java index 3127a5c5c90..68145fcadf2 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/task/DeleteTask.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/task/DeleteTask.java @@ -19,6 +19,14 @@ package com.metamx.druid.merger.common.task; +import java.io.File; +import java.util.ArrayList; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.collect.Lists; import com.metamx.common.logger.Logger; import com.metamx.druid.QueryGranularity; @@ -28,19 +36,10 @@ import com.metamx.druid.index.v1.IncrementalIndex; import com.metamx.druid.index.v1.IncrementalIndexAdapter; import com.metamx.druid.index.v1.IndexMerger; import com.metamx.druid.index.v1.IndexableAdapter; -import com.metamx.druid.jackson.DefaultObjectMapper; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.common.TaskToolbox; import com.metamx.druid.merger.coordinator.TaskContext; import com.metamx.druid.shard.NoneShardSpec; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.io.File; -import java.util.ArrayList; public class DeleteTask extends AbstractTask { diff --git a/merger/src/main/java/com/metamx/druid/merger/common/task/IndexDeterminePartitionsTask.java b/merger/src/main/java/com/metamx/druid/merger/common/task/IndexDeterminePartitionsTask.java index 55edfdbc3bc..739a11f95ae 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/task/IndexDeterminePartitionsTask.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/task/IndexDeterminePartitionsTask.java @@ -19,8 +19,15 @@ package com.metamx.druid.merger.common.task; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.Interval; + import com.google.common.base.Function; -import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Ordering; @@ -38,14 +45,6 @@ import com.metamx.druid.realtime.Schema; import com.metamx.druid.shard.NoneShardSpec; import com.metamx.druid.shard.ShardSpec; import com.metamx.druid.shard.SingleDimensionShardSpec; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.util.List; -import java.util.Map; -import java.util.Set; public class IndexDeterminePartitionsTask extends AbstractTask { diff --git a/merger/src/main/java/com/metamx/druid/merger/common/task/IndexGeneratorTask.java b/merger/src/main/java/com/metamx/druid/merger/common/task/IndexGeneratorTask.java index 82da5561e24..9cc09702179 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/task/IndexGeneratorTask.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/task/IndexGeneratorTask.java @@ -19,10 +19,20 @@ package com.metamx.druid.merger.common.task; +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CopyOnWriteArrayList; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.collect.Maps; -import com.metamx.common.exception.FormattedException; import com.metamx.common.logger.Logger; import com.metamx.druid.client.DataSegment; import com.metamx.druid.input.InputRow; @@ -37,16 +47,6 @@ import com.metamx.druid.realtime.Plumber; import com.metamx.druid.realtime.Schema; import com.metamx.druid.realtime.SegmentPusher; import com.metamx.druid.realtime.Sink; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.io.File; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CopyOnWriteArrayList; public class IndexGeneratorTask extends AbstractTask { diff --git a/merger/src/main/java/com/metamx/druid/merger/common/task/IndexTask.java b/merger/src/main/java/com/metamx/druid/merger/common/task/IndexTask.java index 6074765ddbf..74160fca4b6 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/task/IndexTask.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/task/IndexTask.java @@ -19,6 +19,13 @@ package com.metamx.druid.merger.common.task; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.metamx.common.logger.Logger; @@ -31,12 +38,6 @@ import com.metamx.druid.merger.coordinator.TaskContext; import com.metamx.druid.realtime.FirehoseFactory; import com.metamx.druid.realtime.Schema; import com.metamx.druid.shard.NoneShardSpec; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.util.List; public class IndexTask extends AbstractTask { diff --git a/merger/src/main/java/com/metamx/druid/merger/common/task/MergeTask.java b/merger/src/main/java/com/metamx/druid/merger/common/task/MergeTask.java index db5ff0594da..94769db1095 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/task/MergeTask.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/task/MergeTask.java @@ -19,6 +19,20 @@ package com.metamx.druid.merger.common.task; +import java.io.File; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.annotation.Nullable; + +import org.apache.commons.codec.digest.DigestUtils; +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.annotate.JsonSubTypes; +import org.codehaus.jackson.annotate.JsonTypeInfo; +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.base.Objects; @@ -42,18 +56,6 @@ import com.metamx.druid.shard.NoneShardSpec; import com.metamx.emitter.service.AlertEvent; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; -import org.apache.commons.codec.digest.DigestUtils; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.annotate.JsonSubTypes; -import org.codehaus.jackson.annotate.JsonTypeInfo; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.io.File; -import java.util.List; -import java.util.Map; -import java.util.Set; /** */ diff --git a/merger/src/main/java/com/metamx/druid/merger/common/task/Task.java b/merger/src/main/java/com/metamx/druid/merger/common/task/Task.java index b2059210b58..c2f7f1a47db 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/task/Task.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/task/Task.java @@ -19,16 +19,13 @@ package com.metamx.druid.merger.common.task; +import org.codehaus.jackson.annotate.JsonSubTypes; +import org.codehaus.jackson.annotate.JsonTypeInfo; +import org.joda.time.Interval; + import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.common.TaskToolbox; import com.metamx.druid.merger.coordinator.TaskContext; -import com.metamx.druid.merger.common.task.IndexDeterminePartitionsTask; -import com.metamx.druid.merger.common.task.IndexGeneratorTask; -import com.metamx.druid.merger.common.task.IndexTask; -import org.codehaus.jackson.annotate.JsonSubTypes; -import org.codehaus.jackson.annotate.JsonTypeInfo; -import org.joda.time.DateTime; -import org.joda.time.Interval; /** * Represents a task that can run on a worker. Immutable. diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/DbTaskStorage.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/DbTaskStorage.java index c1dbce4fc61..5a494bebc8a 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/DbTaskStorage.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/DbTaskStorage.java @@ -19,6 +19,15 @@ package com.metamx.druid.merger.coordinator; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; +import org.skife.jdbi.v2.DBI; +import org.skife.jdbi.v2.Handle; +import org.skife.jdbi.v2.tweak.HandleCallback; + import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.base.Preconditions; @@ -29,14 +38,6 @@ import com.metamx.common.logger.Logger; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.common.task.Task; import com.metamx.druid.merger.coordinator.config.IndexerDbConnectorConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.DateTime; -import org.skife.jdbi.v2.DBI; -import org.skife.jdbi.v2.Handle; -import org.skife.jdbi.v2.tweak.HandleCallback; - -import java.util.List; -import java.util.Map; public class DbTaskStorage implements TaskStorage { diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/LocalTaskRunner.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/LocalTaskRunner.java index fc03504792f..bad4024710d 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/LocalTaskRunner.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/LocalTaskRunner.java @@ -19,16 +19,17 @@ package com.metamx.druid.merger.coordinator; +import java.io.File; +import java.util.concurrent.ExecutorService; + +import org.apache.commons.io.FileUtils; + import com.google.common.base.Throwables; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.common.logger.Logger; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.common.TaskToolbox; import com.metamx.druid.merger.common.task.Task; -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.util.concurrent.ExecutorService; /** * Runs tasks in a JVM thread using an ExecutorService. diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/LocalTaskStorage.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/LocalTaskStorage.java index 16ecd06073f..9ca8b01505c 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/LocalTaskStorage.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/LocalTaskStorage.java @@ -19,20 +19,17 @@ package com.metamx.druid.merger.coordinator; +import java.util.List; +import java.util.Map; + import com.google.common.base.Optional; import com.google.common.base.Preconditions; -import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterables; import com.google.common.collect.Maps; import com.metamx.common.logger.Logger; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.common.task.Task; -import javax.annotation.Nullable; -import java.util.List; -import java.util.Map; - /** * Implements an in-heap TaskStorage facility, with no persistence across restarts. This class is not * thread safe. diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/MergerDBCoordinator.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/MergerDBCoordinator.java index bc53ef0d4f7..3fe59b0ffa6 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/MergerDBCoordinator.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/MergerDBCoordinator.java @@ -19,14 +19,12 @@ package com.metamx.druid.merger.coordinator; -import com.google.common.base.Function; -import com.google.common.collect.Lists; -import com.google.common.collect.Ordering; -import com.metamx.common.logger.Logger; -import com.metamx.druid.TimelineObjectHolder; -import com.metamx.druid.VersionedIntervalTimeline; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.db.DbConnectorConfig; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import javax.annotation.Nullable; + import org.codehaus.jackson.map.ObjectMapper; import org.joda.time.DateTime; import org.joda.time.Interval; @@ -35,10 +33,14 @@ import org.skife.jdbi.v2.Handle; import org.skife.jdbi.v2.ResultIterator; import org.skife.jdbi.v2.tweak.HandleCallback; -import javax.annotation.Nullable; -import java.io.IOException; -import java.util.List; -import java.util.Map; +import com.google.common.base.Function; +import com.google.common.collect.Lists; +import com.google.common.collect.Ordering; +import com.metamx.common.logger.Logger; +import com.metamx.druid.TimelineObjectHolder; +import com.metamx.druid.VersionedIntervalTimeline; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.db.DbConnectorConfig; /** */ diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/RemoteTaskRunner.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/RemoteTaskRunner.java index eaf000e5276..d2843ae68e6 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/RemoteTaskRunner.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/RemoteTaskRunner.java @@ -19,6 +19,16 @@ package com.metamx.druid.merger.coordinator; +import java.util.Comparator; +import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +import org.apache.zookeeper.CreateMode; +import org.codehaus.jackson.map.ObjectMapper; + import com.google.common.base.Joiner; import com.google.common.base.Throwables; import com.google.common.collect.Maps; @@ -28,7 +38,6 @@ import com.metamx.common.ISE; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.druid.merger.common.TaskHolder; import com.metamx.druid.merger.common.TaskStatus; -import com.metamx.druid.merger.common.TaskToolbox; import com.metamx.druid.merger.common.config.IndexerZkConfig; import com.metamx.druid.merger.common.task.Task; import com.metamx.druid.merger.worker.Worker; @@ -37,15 +46,6 @@ import com.netflix.curator.framework.CuratorFramework; import com.netflix.curator.framework.recipes.cache.PathChildrenCache; import com.netflix.curator.framework.recipes.cache.PathChildrenCacheEvent; import com.netflix.curator.framework.recipes.cache.PathChildrenCacheListener; -import org.apache.zookeeper.CreateMode; -import org.codehaus.jackson.map.ObjectMapper; - -import java.util.Comparator; -import java.util.Map; -import java.util.concurrent.Callable; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; /** */ diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/RetryPolicy.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/RetryPolicy.java index 1754e426977..d10621f9b70 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/RetryPolicy.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/RetryPolicy.java @@ -19,12 +19,12 @@ package com.metamx.druid.merger.coordinator; +import java.util.List; + import com.google.common.collect.Lists; import com.metamx.druid.merger.coordinator.config.RetryPolicyConfig; import com.metamx.emitter.EmittingLogger; -import java.util.List; - /** */ public class RetryPolicy diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskContext.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskContext.java index fcbb2450cbc..4fceeb5f308 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskContext.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskContext.java @@ -19,11 +19,12 @@ package com.metamx.druid.merger.coordinator; -import com.metamx.druid.client.DataSegment; +import java.util.Set; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.util.Set; +import com.metamx.druid.client.DataSegment; /** * Information gathered by the coordinator, after acquiring a lock, that may be useful to a task. diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskGroup.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskGroup.java index 85b2ef62a04..b67aa419c8e 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskGroup.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskGroup.java @@ -19,16 +19,17 @@ package com.metamx.druid.merger.coordinator; +import java.util.Set; +import java.util.TreeSet; + +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Ordering; import com.metamx.druid.merger.common.task.Task; -import org.joda.time.Interval; - -import java.util.Set; -import java.util.TreeSet; /** * Represents a transaction as well as the lock it holds. Not immutable: the task set can change. diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskInventoryManager.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskInventoryManager.java index c8690bf5c36..fe33155b409 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskInventoryManager.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskInventoryManager.java @@ -19,6 +19,8 @@ package com.metamx.druid.merger.coordinator; +import java.util.Map; + import com.metamx.common.Pair; import com.metamx.common.logger.Logger; import com.metamx.druid.client.InventoryManagementStrategy; @@ -30,8 +32,6 @@ import com.metamx.druid.merger.worker.Worker; import com.metamx.phonebook.PhoneBook; import com.metamx.phonebook.PhoneBookPeon; -import java.util.Map; - /** * A simple {@link InventoryManager} that monitors ZK for the creation and deletion of new Workers and the * tasks each worker is assigned. diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskMaster.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskMaster.java index 0481e8f21b6..ceeeeea0696 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskMaster.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskMaster.java @@ -19,6 +19,9 @@ package com.metamx.druid.merger.coordinator; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.ReentrantLock; + import com.google.common.base.Throwables; import com.metamx.common.lifecycle.Lifecycle; import com.metamx.common.lifecycle.LifecycleStart; @@ -34,9 +37,6 @@ import com.netflix.curator.framework.recipes.leader.LeaderSelector; import com.netflix.curator.framework.recipes.leader.LeaderSelectorListener; import com.netflix.curator.framework.state.ConnectionState; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantLock; - /** * Encapsulates the indexer leadership lifecycle. */ diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskQueue.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskQueue.java index f674b8744cd..2f79d721309 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskQueue.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskQueue.java @@ -19,6 +19,20 @@ package com.metamx.druid.merger.coordinator; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.NavigableMap; +import java.util.NavigableSet; +import java.util.TreeMap; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.ReentrantLock; + +import javax.annotation.Nullable; + +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.base.Preconditions; @@ -27,7 +41,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Ordering; -import com.google.common.primitives.Booleans; import com.metamx.common.Pair; import com.metamx.common.guava.Comparators; import com.metamx.common.guava.FunctionalIterable; @@ -37,18 +50,6 @@ import com.metamx.common.logger.Logger; import com.metamx.druid.client.DataSegment; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.common.task.Task; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.NavigableMap; -import java.util.NavigableSet; -import java.util.TreeMap; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantLock; /** * Interface between task producers and task consumers. diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskStorage.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskStorage.java index 13308db86a2..ae988c44647 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskStorage.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/TaskStorage.java @@ -19,12 +19,12 @@ package com.metamx.druid.merger.coordinator; +import java.util.List; + import com.google.common.base.Optional; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.common.task.Task; -import java.util.List; - public interface TaskStorage { /** diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/config/IndexerCoordinatorConfig.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/config/IndexerCoordinatorConfig.java index 18f317525fe..11f9d90fdd9 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/config/IndexerCoordinatorConfig.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/config/IndexerCoordinatorConfig.java @@ -19,14 +19,15 @@ package com.metamx.druid.merger.coordinator.config; -import com.google.common.base.Splitter; -import com.google.common.collect.ImmutableSet; -import com.metamx.druid.merger.common.task.Task; +import java.io.File; +import java.util.Set; + import org.skife.config.Config; import org.skife.config.Default; -import java.io.File; -import java.util.Set; +import com.google.common.base.Splitter; +import com.google.common.collect.ImmutableSet; +import com.metamx.druid.merger.common.task.Task; /** */ diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/config/IndexerDbConnectorConfig.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/config/IndexerDbConnectorConfig.java index 26f0105771d..36b090c1673 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/config/IndexerDbConnectorConfig.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/config/IndexerDbConnectorConfig.java @@ -19,10 +19,11 @@ package com.metamx.druid.merger.coordinator.config; -import com.metamx.druid.db.DbConnectorConfig; import org.codehaus.jackson.annotate.JsonProperty; import org.skife.config.Config; +import com.metamx.druid.db.DbConnectorConfig; + public abstract class IndexerDbConnectorConfig extends DbConnectorConfig { @JsonProperty("taskTable") diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/exec/TaskConsumer.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/exec/TaskConsumer.java index be2bca53fbb..594fcf3da38 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/exec/TaskConsumer.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/exec/TaskConsumer.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; -import com.metamx.common.logger.Logger; import com.metamx.druid.client.DataSegment; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.common.task.Task; @@ -39,8 +38,6 @@ import com.metamx.emitter.service.AlertEvent; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; -import java.util.concurrent.ExecutorService; - public class TaskConsumer implements Runnable { private final TaskQueue queue; diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorNode.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorNode.java index 6da4c491897..4c76224dd14 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorNode.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorNode.java @@ -19,6 +19,26 @@ package com.metamx.druid.merger.coordinator.http; +import java.net.URL; +import java.util.List; +import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +import org.I0Itec.zkclient.ZkClient; +import org.codehaus.jackson.map.InjectableValues; +import org.codehaus.jackson.map.ObjectMapper; +import org.jets3t.service.S3ServiceException; +import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.jets3t.service.security.AWSCredentials; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.DefaultServlet; +import org.mortbay.jetty.servlet.FilterHolder; +import org.mortbay.jetty.servlet.ServletHolder; +import org.skife.config.ConfigurationObjectFactory; + import com.google.common.base.Charsets; import com.google.common.base.Throwables; import com.google.common.collect.Lists; @@ -80,25 +100,6 @@ import com.metamx.metrics.MonitorSchedulerConfig; import com.metamx.metrics.SysMonitor; import com.metamx.phonebook.PhoneBook; import com.netflix.curator.framework.CuratorFramework; -import org.I0Itec.zkclient.ZkClient; -import org.codehaus.jackson.map.InjectableValues; -import org.codehaus.jackson.map.ObjectMapper; -import org.jets3t.service.S3ServiceException; -import org.jets3t.service.impl.rest.httpclient.RestS3Service; -import org.jets3t.service.security.AWSCredentials; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.servlet.Context; -import org.mortbay.jetty.servlet.DefaultServlet; -import org.mortbay.jetty.servlet.FilterHolder; -import org.mortbay.jetty.servlet.ServletHolder; -import org.skife.config.ConfigurationObjectFactory; - -import java.net.URL; -import java.util.List; -import java.util.Properties; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; /** */ diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorResource.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorResource.java index 6cf9b0a7c16..a4b27012adb 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorResource.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorResource.java @@ -19,6 +19,14 @@ package com.metamx.druid.merger.coordinator.http; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Response; + import com.google.common.base.Optional; import com.google.common.collect.ImmutableMap; import com.google.inject.Inject; @@ -30,14 +38,6 @@ import com.metamx.druid.merger.coordinator.TaskQueue; import com.metamx.druid.merger.coordinator.config.IndexerCoordinatorConfig; import com.metamx.emitter.service.ServiceEmitter; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; - /** */ @Path("/mmx/merger/v1") diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorServletModule.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorServletModule.java index 9c657bdc292..ae478fbf3a9 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorServletModule.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/http/IndexerCoordinatorServletModule.java @@ -19,16 +19,17 @@ package com.metamx.druid.merger.coordinator.http; +import javax.inject.Singleton; + +import org.codehaus.jackson.jaxrs.JacksonJsonProvider; +import org.codehaus.jackson.map.ObjectMapper; + import com.google.inject.Provides; import com.metamx.druid.merger.coordinator.TaskQueue; import com.metamx.druid.merger.coordinator.config.IndexerCoordinatorConfig; import com.metamx.emitter.service.ServiceEmitter; import com.sun.jersey.guice.JerseyServletModule; import com.sun.jersey.guice.spi.container.servlet.GuiceContainer; -import org.codehaus.jackson.jaxrs.JacksonJsonProvider; -import org.codehaus.jackson.map.ObjectMapper; - -import javax.inject.Singleton; /** */ diff --git a/merger/src/main/java/com/metamx/druid/merger/worker/TaskMonitor.java b/merger/src/main/java/com/metamx/druid/merger/worker/TaskMonitor.java index b70a6e9c278..433304e7c45 100644 --- a/merger/src/main/java/com/metamx/druid/merger/worker/TaskMonitor.java +++ b/merger/src/main/java/com/metamx/druid/merger/worker/TaskMonitor.java @@ -19,6 +19,12 @@ package com.metamx.druid.merger.worker; +import java.io.File; +import java.util.concurrent.ExecutorService; + +import org.apache.commons.io.FileUtils; +import org.codehaus.jackson.map.ObjectMapper; + import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.druid.merger.common.TaskHolder; @@ -31,11 +37,6 @@ import com.netflix.curator.framework.CuratorFramework; import com.netflix.curator.framework.recipes.cache.PathChildrenCache; import com.netflix.curator.framework.recipes.cache.PathChildrenCacheEvent; import com.netflix.curator.framework.recipes.cache.PathChildrenCacheListener; -import org.apache.commons.io.FileUtils; -import org.codehaus.jackson.map.ObjectMapper; - -import java.io.File; -import java.util.concurrent.ExecutorService; /** * The monitor watches ZK at a specified path for new tasks to appear. Upon starting the monitor, a listener will be diff --git a/merger/src/main/java/com/metamx/druid/merger/worker/Worker.java b/merger/src/main/java/com/metamx/druid/merger/worker/Worker.java index 032febb79b9..bfeb7209c8c 100644 --- a/merger/src/main/java/com/metamx/druid/merger/worker/Worker.java +++ b/merger/src/main/java/com/metamx/druid/merger/worker/Worker.java @@ -19,15 +19,16 @@ package com.metamx.druid.merger.worker; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + import com.google.common.collect.ImmutableMap; import com.metamx.common.logger.Logger; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.worker.config.WorkerConfig; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; /** */ diff --git a/merger/src/main/java/com/metamx/druid/merger/worker/WorkerCuratorCoordinator.java b/merger/src/main/java/com/metamx/druid/merger/worker/WorkerCuratorCoordinator.java index 8510a890e1c..5f04ec39318 100644 --- a/merger/src/main/java/com/metamx/druid/merger/worker/WorkerCuratorCoordinator.java +++ b/merger/src/main/java/com/metamx/druid/merger/worker/WorkerCuratorCoordinator.java @@ -19,6 +19,12 @@ package com.metamx.druid.merger.worker; +import java.util.Arrays; + +import org.apache.zookeeper.CreateMode; +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; + import com.google.common.base.Joiner; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableMap; @@ -28,11 +34,6 @@ import com.metamx.common.logger.Logger; import com.metamx.druid.merger.common.TaskStatus; import com.metamx.druid.merger.common.config.IndexerZkConfig; import com.netflix.curator.framework.CuratorFramework; -import org.apache.zookeeper.CreateMode; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.DateTime; - -import java.util.Arrays; /** * The CuratorCoordinator provides methods to use Curator. Persistent ZK paths are created on {@link #start()}. diff --git a/merger/src/main/java/com/metamx/druid/merger/worker/http/WorkerNode.java b/merger/src/main/java/com/metamx/druid/merger/worker/http/WorkerNode.java index ee3888e12e4..2f45f094b53 100644 --- a/merger/src/main/java/com/metamx/druid/merger/worker/http/WorkerNode.java +++ b/merger/src/main/java/com/metamx/druid/merger/worker/http/WorkerNode.java @@ -19,6 +19,24 @@ package com.metamx.druid.merger.worker.http; +import java.io.IOException; +import java.util.List; +import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +import org.codehaus.jackson.map.InjectableValues; +import org.codehaus.jackson.map.ObjectMapper; +import org.jets3t.service.S3ServiceException; +import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.jets3t.service.security.AWSCredentials; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.DefaultServlet; +import org.mortbay.jetty.servlet.ServletHolder; +import org.skife.config.ConfigurationObjectFactory; + import com.google.common.collect.Lists; import com.google.inject.servlet.GuiceFilter; import com.metamx.common.concurrent.ScheduledExecutorFactory; @@ -57,23 +75,6 @@ import com.metamx.metrics.MonitorSchedulerConfig; import com.metamx.metrics.SysMonitor; import com.netflix.curator.framework.CuratorFramework; import com.netflix.curator.framework.recipes.cache.PathChildrenCache; -import org.codehaus.jackson.map.InjectableValues; -import org.codehaus.jackson.map.ObjectMapper; -import org.jets3t.service.S3ServiceException; -import org.jets3t.service.impl.rest.httpclient.RestS3Service; -import org.jets3t.service.security.AWSCredentials; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.servlet.Context; -import org.mortbay.jetty.servlet.DefaultServlet; -import org.mortbay.jetty.servlet.ServletHolder; -import org.skife.config.ConfigurationObjectFactory; - -import java.io.IOException; -import java.util.List; -import java.util.Properties; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; /** */ diff --git a/realtime/src/main/java/com/metamx/druid/realtime/FireDepartment.java b/realtime/src/main/java/com/metamx/druid/realtime/FireDepartment.java index b5709de1d6b..9cb310049c4 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/FireDepartment.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/FireDepartment.java @@ -19,11 +19,11 @@ package com.metamx.druid.realtime; +import java.io.IOException; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.io.IOException; - /** * A Fire Department has a Firehose and a Plumber. * diff --git a/realtime/src/main/java/com/metamx/druid/realtime/FireDepartmentConfig.java b/realtime/src/main/java/com/metamx/druid/realtime/FireDepartmentConfig.java index b2afbbc4884..cb76e1590cb 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/FireDepartmentConfig.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/FireDepartmentConfig.java @@ -19,10 +19,11 @@ package com.metamx.druid.realtime; -import com.google.common.base.Preconditions; import org.codehaus.jackson.annotate.JsonProperty; import org.joda.time.Period; +import com.google.common.base.Preconditions; + /** */ public class FireDepartmentConfig diff --git a/realtime/src/main/java/com/metamx/druid/realtime/Firehose.java b/realtime/src/main/java/com/metamx/druid/realtime/Firehose.java index e978428e057..be4c706e6ef 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/Firehose.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/Firehose.java @@ -19,10 +19,10 @@ package com.metamx.druid.realtime; -import com.metamx.druid.input.InputRow; - import java.io.Closeable; +import com.metamx.druid.input.InputRow; + /** * This is an interface that holds onto the stream of incoming data. Realtime data ingestion is built around this * abstraction. In order to add a new type of source for realtime data ingestion, all you need to do is implement diff --git a/realtime/src/main/java/com/metamx/druid/realtime/FirehoseFactory.java b/realtime/src/main/java/com/metamx/druid/realtime/FirehoseFactory.java index e090e088d08..181b3aab613 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/FirehoseFactory.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/FirehoseFactory.java @@ -19,11 +19,11 @@ package com.metamx.druid.realtime; +import java.io.IOException; + import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import java.io.IOException; - /** */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") diff --git a/realtime/src/main/java/com/metamx/druid/realtime/KafkaFirehoseFactory.java b/realtime/src/main/java/com/metamx/druid/realtime/KafkaFirehoseFactory.java index 05714ddfdbd..443c6ad1971 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/KafkaFirehoseFactory.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/KafkaFirehoseFactory.java @@ -19,20 +19,6 @@ package com.metamx.druid.realtime; -import com.google.common.base.Charsets; -import com.google.common.collect.ImmutableMap; -import com.metamx.common.exception.FormattedException; -import com.metamx.common.logger.Logger; -import com.metamx.druid.indexer.data.StringInputRowParser; -import com.metamx.druid.input.InputRow; -import kafka.consumer.Consumer; -import kafka.consumer.ConsumerConfig; -import kafka.consumer.KafkaMessageStream; -import kafka.javaapi.consumer.ConsumerConnector; -import kafka.message.Message; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import java.io.IOException; import java.nio.CharBuffer; import java.nio.charset.CoderResult; @@ -42,6 +28,22 @@ import java.util.List; import java.util.Map; import java.util.Properties; +import kafka.consumer.Consumer; +import kafka.consumer.ConsumerConfig; +import kafka.consumer.KafkaMessageStream; +import kafka.javaapi.consumer.ConsumerConnector; +import kafka.message.Message; + +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import com.google.common.base.Charsets; +import com.google.common.collect.ImmutableMap; +import com.metamx.common.exception.FormattedException; +import com.metamx.common.logger.Logger; +import com.metamx.druid.indexer.data.StringInputRowParser; +import com.metamx.druid.input.InputRow; + /** */ public class KafkaFirehoseFactory implements FirehoseFactory diff --git a/realtime/src/main/java/com/metamx/druid/realtime/MetadataUpdater.java b/realtime/src/main/java/com/metamx/druid/realtime/MetadataUpdater.java index 93c8e712fa6..7e16ba163f1 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/MetadataUpdater.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/MetadataUpdater.java @@ -19,22 +19,23 @@ package com.metamx.druid.realtime; -import com.google.common.collect.ImmutableMap; -import com.metamx.common.lifecycle.LifecycleStart; -import com.metamx.common.lifecycle.LifecycleStop; -import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.phonebook.PhoneBook; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + import org.codehaus.jackson.map.ObjectMapper; import org.joda.time.DateTime; import org.skife.jdbi.v2.DBI; import org.skife.jdbi.v2.Handle; import org.skife.jdbi.v2.tweak.HandleCallback; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import com.google.common.collect.ImmutableMap; +import com.metamx.common.lifecycle.LifecycleStart; +import com.metamx.common.lifecycle.LifecycleStop; +import com.metamx.common.logger.Logger; +import com.metamx.druid.client.DataSegment; +import com.metamx.phonebook.PhoneBook; /** */ diff --git a/realtime/src/main/java/com/metamx/druid/realtime/RealtimeManager.java b/realtime/src/main/java/com/metamx/druid/realtime/RealtimeManager.java index 97c7611801a..e7d63c34d1e 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimeManager.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimeManager.java @@ -19,6 +19,15 @@ package com.metamx.druid.realtime; +import java.io.Closeable; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import org.joda.time.DateTime; +import org.joda.time.Interval; +import org.joda.time.Period; + import com.google.common.base.Preconditions; import com.google.common.base.Throwables; import com.google.common.collect.Maps; @@ -37,14 +46,6 @@ import com.metamx.druid.query.QueryToolChest; import com.metamx.druid.query.segment.QuerySegmentWalker; import com.metamx.druid.query.segment.SegmentDescriptor; import com.metamx.emitter.EmittingLogger; -import org.joda.time.DateTime; -import org.joda.time.Interval; -import org.joda.time.Period; - -import java.io.Closeable; -import java.io.IOException; -import java.util.List; -import java.util.Map; /** */ diff --git a/realtime/src/main/java/com/metamx/druid/realtime/RealtimeMetricsMonitor.java b/realtime/src/main/java/com/metamx/druid/realtime/RealtimeMetricsMonitor.java index 3d04392aab0..2c65c28b1d0 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimeMetricsMonitor.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimeMetricsMonitor.java @@ -19,14 +19,14 @@ package com.metamx.druid.realtime; +import java.util.List; +import java.util.Map; + import com.google.common.collect.Maps; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; import com.metamx.metrics.AbstractMonitor; -import java.util.List; -import java.util.Map; - /** */ public class RealtimeMetricsMonitor extends AbstractMonitor diff --git a/realtime/src/main/java/com/metamx/druid/realtime/RealtimeNode.java b/realtime/src/main/java/com/metamx/druid/realtime/RealtimeNode.java index 4b61a0b80a5..0b8d6efac45 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimeNode.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimeNode.java @@ -19,6 +19,30 @@ package com.metamx.druid.realtime; +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.ScheduledExecutorService; + +import org.I0Itec.zkclient.ZkClient; +import org.codehaus.jackson.map.BeanProperty; +import org.codehaus.jackson.map.DeserializationContext; +import org.codehaus.jackson.map.InjectableValues; +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.map.jsontype.NamedType; +import org.codehaus.jackson.smile.SmileFactory; +import org.codehaus.jackson.type.TypeReference; +import org.jets3t.service.S3ServiceException; +import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.jets3t.service.security.AWSCredentials; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.ServletHolder; +import org.skife.config.ConfigurationObjectFactory; + import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.metamx.common.ISE; @@ -60,29 +84,6 @@ import com.metamx.metrics.MonitorScheduler; import com.metamx.metrics.MonitorSchedulerConfig; import com.metamx.metrics.SysMonitor; import com.metamx.phonebook.PhoneBook; -import org.I0Itec.zkclient.ZkClient; -import org.codehaus.jackson.map.BeanProperty; -import org.codehaus.jackson.map.DeserializationContext; -import org.codehaus.jackson.map.InjectableValues; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.jsontype.NamedType; -import org.codehaus.jackson.smile.SmileFactory; -import org.codehaus.jackson.type.TypeReference; -import org.jets3t.service.S3ServiceException; -import org.jets3t.service.impl.rest.httpclient.RestS3Service; -import org.jets3t.service.security.AWSCredentials; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.servlet.Context; -import org.mortbay.jetty.servlet.ServletHolder; -import org.skife.config.ConfigurationObjectFactory; - -import java.io.File; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.ScheduledExecutorService; /** */ diff --git a/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java index 5659758591b..314bed367c9 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java @@ -19,6 +19,27 @@ package com.metamx.druid.realtime; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +import javax.annotation.Nullable; + +import org.apache.commons.io.FileUtils; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JacksonInject; +import org.joda.time.DateTime; +import org.joda.time.Duration; +import org.joda.time.Interval; +import org.joda.time.Period; + import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.base.Throwables; @@ -46,29 +67,9 @@ import com.metamx.druid.query.QueryRunner; import com.metamx.druid.query.QueryRunnerFactory; import com.metamx.druid.query.QueryRunnerFactoryConglomerate; import com.metamx.druid.query.QueryToolChest; -import com.metamx.druid.shard.NoneShardSpec; import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; -import org.apache.commons.io.FileUtils; -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JacksonInject; -import org.joda.time.DateTime; -import org.joda.time.Duration; -import org.joda.time.Interval; -import org.joda.time.Period; - -import javax.annotation.Nullable; -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; /** */ diff --git a/realtime/src/main/java/com/metamx/druid/realtime/S3SegmentPusher.java b/realtime/src/main/java/com/metamx/druid/realtime/S3SegmentPusher.java index 6ae83c5f9bf..90b9083af1f 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/S3SegmentPusher.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/S3SegmentPusher.java @@ -19,20 +19,6 @@ package com.metamx.druid.realtime; -import com.google.common.base.Joiner; -import com.google.common.collect.ImmutableMap; -import com.google.common.io.Closeables; -import com.metamx.common.ISE; -import com.metamx.common.StreamUtils; -import com.metamx.druid.client.DataSegment; -import com.metamx.emitter.EmittingLogger; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.codehaus.jackson.map.ObjectMapper; -import org.jets3t.service.S3ServiceException; -import org.jets3t.service.impl.rest.httpclient.RestS3Service; -import org.jets3t.service.model.S3Object; - import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; @@ -42,6 +28,21 @@ import java.security.NoSuchAlgorithmException; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.codehaus.jackson.map.ObjectMapper; +import org.jets3t.service.S3ServiceException; +import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.jets3t.service.model.S3Object; + +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableMap; +import com.google.common.io.Closeables; +import com.metamx.common.ISE; +import com.metamx.common.StreamUtils; +import com.metamx.druid.client.DataSegment; +import com.metamx.emitter.EmittingLogger; + /** */ public class S3SegmentPusher implements SegmentPusher diff --git a/realtime/src/main/java/com/metamx/druid/realtime/Schema.java b/realtime/src/main/java/com/metamx/druid/realtime/Schema.java index b54c8efbbf6..83ae9388e21 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/Schema.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/Schema.java @@ -19,16 +19,16 @@ package com.metamx.druid.realtime; -import com.google.common.base.Preconditions; -import com.metamx.druid.QueryGranularity; -import com.metamx.druid.aggregation.AggregatorFactory; -import com.metamx.druid.index.v1.IndexGranularity; -import com.metamx.druid.shard.NoneShardSpec; -import com.metamx.druid.shard.ShardSpec; +import java.util.Arrays; + import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import java.util.Arrays; +import com.google.common.base.Preconditions; +import com.metamx.druid.QueryGranularity; +import com.metamx.druid.aggregation.AggregatorFactory; +import com.metamx.druid.shard.NoneShardSpec; +import com.metamx.druid.shard.ShardSpec; /** */ diff --git a/realtime/src/main/java/com/metamx/druid/realtime/SegmentPusher.java b/realtime/src/main/java/com/metamx/druid/realtime/SegmentPusher.java index 16a9253137c..1ca2544399b 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/SegmentPusher.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/SegmentPusher.java @@ -19,11 +19,11 @@ package com.metamx.druid.realtime; -import com.metamx.druid.client.DataSegment; - import java.io.File; import java.io.IOException; +import com.metamx.druid.client.DataSegment; + /** */ public interface SegmentPusher diff --git a/realtime/src/main/java/com/metamx/druid/realtime/Sink.java b/realtime/src/main/java/com/metamx/druid/realtime/Sink.java index 95d164f367f..ed23ea91c4b 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/Sink.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/Sink.java @@ -19,6 +19,15 @@ package com.metamx.druid.realtime; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +import javax.annotation.Nullable; + +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.collect.ImmutableMap; @@ -31,13 +40,6 @@ import com.metamx.druid.aggregation.AggregatorFactory; import com.metamx.druid.client.DataSegment; import com.metamx.druid.index.v1.IncrementalIndex; import com.metamx.druid.input.InputRow; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; /** */ diff --git a/server/src/main/java/com/metamx/TsvToJson.java b/server/src/main/java/com/metamx/TsvToJson.java index cca31bfd095..a0d28d4364f 100644 --- a/server/src/main/java/com/metamx/TsvToJson.java +++ b/server/src/main/java/com/metamx/TsvToJson.java @@ -19,14 +19,6 @@ package com.metamx; -import com.google.common.base.Charsets; -import com.google.common.collect.Maps; -import com.metamx.common.IAE; -import com.metamx.common.ISE; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; - import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; @@ -37,6 +29,13 @@ import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.Map; +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; + +import com.google.common.base.Charsets; +import com.google.common.collect.Maps; +import com.metamx.common.IAE; + /** */ public class TsvToJson diff --git a/server/src/main/java/com/metamx/druid/BaseStorageAdapter.java b/server/src/main/java/com/metamx/druid/BaseStorageAdapter.java index b40409d1ede..37c345da07e 100644 --- a/server/src/main/java/com/metamx/druid/BaseStorageAdapter.java +++ b/server/src/main/java/com/metamx/druid/BaseStorageAdapter.java @@ -19,6 +19,11 @@ package com.metamx.druid; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +import java.util.List; +import java.util.TreeSet; + import com.google.common.collect.Sets; import com.metamx.common.guava.FunctionalIterable; import com.metamx.druid.index.brita.Filter; @@ -29,10 +34,6 @@ import com.metamx.druid.kv.Indexed; import com.metamx.druid.query.search.SearchHit; import com.metamx.druid.query.search.SearchQuery; import com.metamx.druid.query.search.SearchQuerySpec; -import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; - -import java.util.List; -import java.util.TreeSet; /** */ diff --git a/server/src/main/java/com/metamx/druid/GroupByQueryEngine.java b/server/src/main/java/com/metamx/druid/GroupByQueryEngine.java index 60d2596bd38..b945f0bfb00 100644 --- a/server/src/main/java/com/metamx/druid/GroupByQueryEngine.java +++ b/server/src/main/java/com/metamx/druid/GroupByQueryEngine.java @@ -19,6 +19,17 @@ package com.metamx.druid; +import java.nio.ByteBuffer; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.TreeMap; + +import javax.annotation.Nullable; + +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterators; @@ -43,15 +54,6 @@ import com.metamx.druid.input.MapBasedRow; import com.metamx.druid.input.Row; import com.metamx.druid.query.dimension.DimensionSpec; import com.metamx.druid.query.group.GroupByQuery; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.nio.ByteBuffer; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.TreeMap; /** */ diff --git a/server/src/main/java/com/metamx/druid/SearchResultBuilder.java b/server/src/main/java/com/metamx/druid/SearchResultBuilder.java index 7a18d18e718..9ef4af18c6b 100644 --- a/server/src/main/java/com/metamx/druid/SearchResultBuilder.java +++ b/server/src/main/java/com/metamx/druid/SearchResultBuilder.java @@ -19,11 +19,12 @@ package com.metamx.druid; +import org.joda.time.DateTime; + import com.google.common.collect.Lists; import com.metamx.druid.query.search.SearchHit; import com.metamx.druid.result.Result; import com.metamx.druid.result.SearchResultValue; -import org.joda.time.DateTime; /** diff --git a/server/src/main/java/com/metamx/druid/StorageAdapter.java b/server/src/main/java/com/metamx/druid/StorageAdapter.java index 285d17b5b05..f17287e0d3d 100644 --- a/server/src/main/java/com/metamx/druid/StorageAdapter.java +++ b/server/src/main/java/com/metamx/druid/StorageAdapter.java @@ -19,11 +19,12 @@ package com.metamx.druid; -import com.metamx.druid.index.v1.Searchable; -import com.metamx.druid.index.v1.processing.CursorFactory; import org.joda.time.DateTime; import org.joda.time.Interval; +import com.metamx.druid.index.v1.Searchable; +import com.metamx.druid.index.v1.processing.CursorFactory; + /** */ public interface StorageAdapter extends CursorFactory, Searchable diff --git a/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeRequest.java b/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeRequest.java index 4e68ad2995e..645ef95e2b2 100644 --- a/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeRequest.java +++ b/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeRequest.java @@ -19,10 +19,11 @@ package com.metamx.druid.coordination; -import com.metamx.druid.client.DataSegment; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; +import com.metamx.druid.client.DataSegment; + /** */ @JsonTypeInfo(use=JsonTypeInfo.Id.NAME, property="action") diff --git a/server/src/main/java/com/metamx/druid/coordination/DruidClusterInfo.java b/server/src/main/java/com/metamx/druid/coordination/DruidClusterInfo.java index d5d6377a10e..88921eef822 100644 --- a/server/src/main/java/com/metamx/druid/coordination/DruidClusterInfo.java +++ b/server/src/main/java/com/metamx/druid/coordination/DruidClusterInfo.java @@ -19,12 +19,12 @@ package com.metamx.druid.coordination; -import com.metamx.druid.master.DruidMaster; -import com.metamx.phonebook.PhoneBook; - import java.util.Arrays; import java.util.Map; +import com.metamx.druid.master.DruidMaster; +import com.metamx.phonebook.PhoneBook; + /** */ public class DruidClusterInfo diff --git a/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestDrop.java b/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestDrop.java index 0093907d26e..87e69f07287 100644 --- a/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestDrop.java +++ b/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestDrop.java @@ -19,11 +19,12 @@ package com.metamx.druid.coordination; -import com.metamx.druid.client.DataSegment; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.annotate.JsonUnwrapped; +import com.metamx.druid.client.DataSegment; + /** */ public class SegmentChangeRequestDrop implements DataSegmentChangeRequest diff --git a/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestLoad.java b/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestLoad.java index c98106efdfb..d140b925942 100644 --- a/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestLoad.java +++ b/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestLoad.java @@ -19,11 +19,12 @@ package com.metamx.druid.coordination; -import com.metamx.druid.client.DataSegment; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.annotate.JsonUnwrapped; +import com.metamx.druid.client.DataSegment; + /** */ public class SegmentChangeRequestLoad implements DataSegmentChangeRequest diff --git a/server/src/main/java/com/metamx/druid/coordination/ServerManager.java b/server/src/main/java/com/metamx/druid/coordination/ServerManager.java index 97806e14fe4..7c842046c06 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ServerManager.java +++ b/server/src/main/java/com/metamx/druid/coordination/ServerManager.java @@ -19,6 +19,15 @@ package com.metamx.druid.coordination; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ExecutorService; + +import javax.annotation.Nullable; + +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.collect.Ordering; import com.metamx.common.guava.FunctionalIterable; @@ -49,13 +58,6 @@ import com.metamx.druid.query.segment.SpecificSegmentSpec; import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ExecutorService; /** */ diff --git a/server/src/main/java/com/metamx/druid/coordination/ZkCoordinator.java b/server/src/main/java/com/metamx/druid/coordination/ZkCoordinator.java index 1fb756daafe..bbcaca9af0f 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ZkCoordinator.java +++ b/server/src/main/java/com/metamx/druid/coordination/ZkCoordinator.java @@ -19,6 +19,16 @@ package com.metamx.druid.coordination; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; + import com.google.common.base.Throwables; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; @@ -33,15 +43,6 @@ import com.metamx.emitter.service.AlertEvent; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.phonebook.PhoneBook; import com.metamx.phonebook.PhoneBookPeon; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.DateTime; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; /** */ diff --git a/server/src/main/java/com/metamx/druid/coordination/ZkCoordinatorConfig.java b/server/src/main/java/com/metamx/druid/coordination/ZkCoordinatorConfig.java index 91afbcbbc5e..caf8e97c1c8 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ZkCoordinatorConfig.java +++ b/server/src/main/java/com/metamx/druid/coordination/ZkCoordinatorConfig.java @@ -19,10 +19,10 @@ package com.metamx.druid.coordination; -import org.skife.config.Config; - import java.io.File; +import org.skife.config.Config; + /** */ public abstract class ZkCoordinatorConfig diff --git a/server/src/main/java/com/metamx/druid/coordination/legacy/S3SizeLookup.java b/server/src/main/java/com/metamx/druid/coordination/legacy/S3SizeLookup.java index 29a15fea145..248b4e6863e 100644 --- a/server/src/main/java/com/metamx/druid/coordination/legacy/S3SizeLookup.java +++ b/server/src/main/java/com/metamx/druid/coordination/legacy/S3SizeLookup.java @@ -19,15 +19,15 @@ package com.metamx.druid.coordination.legacy; -import com.metamx.common.MapUtils; -import com.metamx.common.logger.Logger; +import java.util.Map; import org.jets3t.service.S3ServiceException; import org.jets3t.service.impl.rest.httpclient.RestS3Service; import org.jets3t.service.model.S3Bucket; import org.jets3t.service.model.S3Object; -import java.util.Map; +import com.metamx.common.MapUtils; +import com.metamx.common.logger.Logger; /** */ diff --git a/server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjuster.java b/server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjuster.java index 668161e5cee..07f621f2db1 100644 --- a/server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjuster.java +++ b/server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjuster.java @@ -19,15 +19,16 @@ package com.metamx.druid.coordination.legacy; +import java.io.IOException; +import java.util.Map; + +import org.I0Itec.zkclient.ZkClient; +import org.codehaus.jackson.map.ObjectMapper; + import com.google.common.base.Joiner; import com.metamx.common.MapUtils; import com.metamx.common.logger.Logger; import com.metamx.druid.client.DataSegment; -import org.I0Itec.zkclient.ZkClient; -import org.codehaus.jackson.map.ObjectMapper; - -import java.io.IOException; -import java.util.Map; /** */ diff --git a/server/src/main/java/com/metamx/druid/db/DatabaseSegmentManager.java b/server/src/main/java/com/metamx/druid/db/DatabaseSegmentManager.java index ef620cd1e38..d86e6d47f23 100644 --- a/server/src/main/java/com/metamx/druid/db/DatabaseSegmentManager.java +++ b/server/src/main/java/com/metamx/druid/db/DatabaseSegmentManager.java @@ -19,18 +19,16 @@ package com.metamx.druid.db; -import com.google.common.base.Function; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Lists; -import com.google.common.collect.Ordering; -import com.metamx.common.concurrent.ScheduledExecutors; -import com.metamx.common.lifecycle.LifecycleStart; -import com.metamx.common.lifecycle.LifecycleStop; -import com.metamx.common.logger.Logger; -import com.metamx.druid.TimelineObjectHolder; -import com.metamx.druid.VersionedIntervalTimeline; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidDataSource; +import java.sql.SQLException; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.atomic.AtomicReference; + +import javax.annotation.Nullable; + import org.codehaus.jackson.map.ObjectMapper; import org.joda.time.DateTime; import org.joda.time.Duration; @@ -43,14 +41,18 @@ import org.skife.jdbi.v2.Handle; import org.skife.jdbi.v2.StatementContext; import org.skife.jdbi.v2.tweak.HandleCallback; -import javax.annotation.Nullable; -import java.sql.SQLException; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.atomic.AtomicReference; +import com.google.common.base.Function; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.common.collect.Ordering; +import com.metamx.common.concurrent.ScheduledExecutors; +import com.metamx.common.lifecycle.LifecycleStart; +import com.metamx.common.lifecycle.LifecycleStop; +import com.metamx.common.logger.Logger; +import com.metamx.druid.TimelineObjectHolder; +import com.metamx.druid.VersionedIntervalTimeline; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.client.DruidDataSource; /** */ diff --git a/server/src/main/java/com/metamx/druid/http/InfoResource.java b/server/src/main/java/com/metamx/druid/http/InfoResource.java index 949ef7127c6..f0550803ddc 100644 --- a/server/src/main/java/com/metamx/druid/http/InfoResource.java +++ b/server/src/main/java/com/metamx/druid/http/InfoResource.java @@ -19,6 +19,24 @@ package com.metamx.druid.http; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import javax.annotation.Nullable; +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Response; + import com.google.common.base.Function; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableMap; @@ -33,23 +51,6 @@ import com.metamx.druid.client.ServerInventoryManager; import com.metamx.druid.coordination.DruidClusterInfo; import com.metamx.druid.db.DatabaseSegmentManager; -import javax.annotation.Nullable; -import javax.inject.Inject; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Response; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - /** */ @Path("/info") diff --git a/server/src/main/java/com/metamx/druid/http/MasterMain.java b/server/src/main/java/com/metamx/druid/http/MasterMain.java index 52de6ffad81..edac3707833 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterMain.java +++ b/server/src/main/java/com/metamx/druid/http/MasterMain.java @@ -19,6 +19,23 @@ package com.metamx.druid.http; +import java.net.URL; +import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledExecutorService; + +import org.I0Itec.zkclient.ZkClient; +import org.codehaus.jackson.map.ObjectMapper; +import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.jets3t.service.security.AWSCredentials; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.DefaultServlet; +import org.mortbay.jetty.servlet.FilterHolder; +import org.mortbay.jetty.servlet.ServletHolder; +import org.skife.config.ConfigurationObjectFactory; +import org.skife.jdbi.v2.DBI; + import com.google.common.base.Charsets; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; @@ -69,22 +86,6 @@ import com.metamx.phonebook.PhoneBook; import com.netflix.curator.framework.CuratorFramework; import com.netflix.curator.x.discovery.ServiceDiscovery; import com.netflix.curator.x.discovery.ServiceProvider; -import org.I0Itec.zkclient.ZkClient; -import org.codehaus.jackson.map.ObjectMapper; -import org.jets3t.service.impl.rest.httpclient.RestS3Service; -import org.jets3t.service.security.AWSCredentials; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.servlet.Context; -import org.mortbay.jetty.servlet.DefaultServlet; -import org.mortbay.jetty.servlet.FilterHolder; -import org.mortbay.jetty.servlet.ServletHolder; -import org.skife.config.ConfigurationObjectFactory; -import org.skife.jdbi.v2.DBI; - -import java.net.URL; -import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ScheduledExecutorService; /** */ diff --git a/server/src/main/java/com/metamx/druid/http/MasterResource.java b/server/src/main/java/com/metamx/druid/http/MasterResource.java index ca992815eb6..f4d79e55185 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterResource.java +++ b/server/src/main/java/com/metamx/druid/http/MasterResource.java @@ -19,19 +19,19 @@ package com.metamx.druid.http; -import com.metamx.druid.master.DruidMaster; -import com.metamx.druid.master.LoadPeonCallback; +import java.util.List; +import java.util.Map; import javax.inject.Inject; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; -import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; -import java.util.List; -import java.util.Map; + +import com.metamx.druid.master.DruidMaster; +import com.metamx.druid.master.LoadPeonCallback; /** */ diff --git a/server/src/main/java/com/metamx/druid/http/MasterServletModule.java b/server/src/main/java/com/metamx/druid/http/MasterServletModule.java index 3f42becbb8d..059771d018b 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterServletModule.java +++ b/server/src/main/java/com/metamx/druid/http/MasterServletModule.java @@ -19,6 +19,11 @@ package com.metamx.druid.http; +import javax.inject.Singleton; + +import org.codehaus.jackson.jaxrs.JacksonJsonProvider; +import org.codehaus.jackson.map.ObjectMapper; + import com.google.inject.Provides; import com.metamx.druid.client.ServerInventoryManager; import com.metamx.druid.coordination.DruidClusterInfo; @@ -26,10 +31,6 @@ import com.metamx.druid.db.DatabaseSegmentManager; import com.metamx.druid.master.DruidMaster; import com.sun.jersey.guice.JerseyServletModule; import com.sun.jersey.guice.spi.container.servlet.GuiceContainer; -import org.codehaus.jackson.jaxrs.JacksonJsonProvider; -import org.codehaus.jackson.map.ObjectMapper; - -import javax.inject.Singleton; /** */ diff --git a/server/src/main/java/com/metamx/druid/http/RedirectFilter.java b/server/src/main/java/com/metamx/druid/http/RedirectFilter.java index 45fac15d407..29887e2a316 100644 --- a/server/src/main/java/com/metamx/druid/http/RedirectFilter.java +++ b/server/src/main/java/com/metamx/druid/http/RedirectFilter.java @@ -19,11 +19,8 @@ package com.metamx.druid.http; -import com.google.common.base.Throwables; -import com.google.common.io.ByteStreams; -import com.metamx.common.logger.Logger; -import com.metamx.http.client.HttpClient; -import com.metamx.http.client.response.HttpResponseHandler; +import java.io.IOException; +import java.net.URL; import javax.servlet.Filter; import javax.servlet.FilterChain; @@ -34,8 +31,12 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.HttpMethod; -import java.io.IOException; -import java.net.URL; + +import com.google.common.base.Throwables; +import com.google.common.io.ByteStreams; +import com.metamx.common.logger.Logger; +import com.metamx.http.client.HttpClient; +import com.metamx.http.client.response.HttpResponseHandler; /** */ diff --git a/server/src/main/java/com/metamx/druid/http/RedirectServlet.java b/server/src/main/java/com/metamx/druid/http/RedirectServlet.java index f91f03d987d..0bc3d87224b 100644 --- a/server/src/main/java/com/metamx/druid/http/RedirectServlet.java +++ b/server/src/main/java/com/metamx/druid/http/RedirectServlet.java @@ -19,16 +19,18 @@ package com.metamx.druid.http; -import com.metamx.common.logger.Logger; -import org.mortbay.jetty.servlet.DefaultServlet; +import java.io.IOException; +import java.net.URL; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.URL; + +import org.mortbay.jetty.servlet.DefaultServlet; + +import com.metamx.common.logger.Logger; /** */ diff --git a/server/src/main/java/com/metamx/druid/http/ServerMain.java b/server/src/main/java/com/metamx/druid/http/ServerMain.java index 76ed21870db..ed82c45e600 100644 --- a/server/src/main/java/com/metamx/druid/http/ServerMain.java +++ b/server/src/main/java/com/metamx/druid/http/ServerMain.java @@ -19,6 +19,23 @@ package com.metamx.druid.http; +import java.nio.ByteBuffer; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ScheduledExecutorService; + +import org.I0Itec.zkclient.ZkClient; +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.smile.SmileFactory; +import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.jets3t.service.security.AWSCredentials; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.ServletHolder; +import org.skife.config.ConfigurationObjectFactory; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.metamx.common.concurrent.ExecutorServiceConfig; @@ -56,22 +73,6 @@ import com.metamx.metrics.MonitorScheduler; import com.metamx.metrics.MonitorSchedulerConfig; import com.metamx.metrics.SysMonitor; import com.metamx.phonebook.PhoneBook; -import org.I0Itec.zkclient.ZkClient; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.smile.SmileFactory; -import org.jets3t.service.impl.rest.httpclient.RestS3Service; -import org.jets3t.service.security.AWSCredentials; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.servlet.Context; -import org.mortbay.jetty.servlet.ServletHolder; -import org.skife.config.ConfigurationObjectFactory; - -import java.nio.ByteBuffer; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ScheduledExecutorService; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/brita/AndFilter.java b/server/src/main/java/com/metamx/druid/index/brita/AndFilter.java index 5132cd7bf8e..9fe56f9f894 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/AndFilter.java +++ b/server/src/main/java/com/metamx/druid/index/brita/AndFilter.java @@ -19,11 +19,12 @@ package com.metamx.druid.index.brita; -import com.google.common.collect.Lists; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import java.util.List; +import com.google.common.collect.Lists; + /** */ public class AndFilter implements Filter diff --git a/server/src/main/java/com/metamx/druid/index/brita/DimensionPredicateFilter.java b/server/src/main/java/com/metamx/druid/index/brita/DimensionPredicateFilter.java index e588a8441d1..bf6bdb12edd 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/DimensionPredicateFilter.java +++ b/server/src/main/java/com/metamx/druid/index/brita/DimensionPredicateFilter.java @@ -19,13 +19,14 @@ package com.metamx.druid.index.brita; -import com.google.common.base.Function; -import com.google.common.base.Predicate; -import com.metamx.common.guava.FunctionalIterable; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import javax.annotation.Nullable; +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import com.metamx.common.guava.FunctionalIterable; + /** */ class DimensionPredicateFilter implements Filter diff --git a/server/src/main/java/com/metamx/druid/index/brita/ExtractionFilter.java b/server/src/main/java/com/metamx/druid/index/brita/ExtractionFilter.java index 7eeb106936f..a006756f96b 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/ExtractionFilter.java +++ b/server/src/main/java/com/metamx/druid/index/brita/ExtractionFilter.java @@ -19,13 +19,14 @@ package com.metamx.druid.index.brita; -import com.google.common.collect.Lists; -import com.metamx.druid.kv.Indexed; -import com.metamx.druid.query.extraction.DimExtractionFn; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import java.util.List; +import com.google.common.collect.Lists; +import com.metamx.druid.kv.Indexed; +import com.metamx.druid.query.extraction.DimExtractionFn; + /** */ public class ExtractionFilter implements Filter diff --git a/server/src/main/java/com/metamx/druid/index/brita/Filters.java b/server/src/main/java/com/metamx/druid/index/brita/Filters.java index bb14cbf2b41..e81b4e24d5e 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/Filters.java +++ b/server/src/main/java/com/metamx/druid/index/brita/Filters.java @@ -19,6 +19,10 @@ package com.metamx.druid.index.brita; +import java.util.List; + +import javax.annotation.Nullable; + import com.google.common.base.Function; import com.google.common.collect.Lists; import com.metamx.druid.query.filter.AndDimFilter; @@ -29,9 +33,6 @@ import com.metamx.druid.query.filter.OrDimFilter; import com.metamx.druid.query.filter.RegexDimFilter; import com.metamx.druid.query.filter.SelectorDimFilter; -import javax.annotation.Nullable; -import java.util.List; - /** */ public class Filters diff --git a/server/src/main/java/com/metamx/druid/index/brita/InvertedIndexSelector.java b/server/src/main/java/com/metamx/druid/index/brita/InvertedIndexSelector.java index 5361951075a..2a7252768c8 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/InvertedIndexSelector.java +++ b/server/src/main/java/com/metamx/druid/index/brita/InvertedIndexSelector.java @@ -19,9 +19,10 @@ package com.metamx.druid.index.brita; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + import com.metamx.druid.index.v1.processing.Offset; import com.metamx.druid.kv.Indexed; -import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/brita/OrFilter.java b/server/src/main/java/com/metamx/druid/index/brita/OrFilter.java index 3de948682a9..e03a1584251 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/OrFilter.java +++ b/server/src/main/java/com/metamx/druid/index/brita/OrFilter.java @@ -19,11 +19,12 @@ package com.metamx.druid.index.brita; -import com.google.common.collect.Lists; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import java.util.List; +import com.google.common.collect.Lists; + /** */ public class OrFilter implements Filter diff --git a/server/src/main/java/com/metamx/druid/index/brita/RegexFilter.java b/server/src/main/java/com/metamx/druid/index/brita/RegexFilter.java index a638ce576a7..bfeaaa5ee01 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/RegexFilter.java +++ b/server/src/main/java/com/metamx/druid/index/brita/RegexFilter.java @@ -19,10 +19,11 @@ package com.metamx.druid.index.brita; -import com.google.common.base.Predicate; +import java.util.regex.Pattern; import javax.annotation.Nullable; -import java.util.regex.Pattern; + +import com.google.common.base.Predicate; /** diff --git a/server/src/main/java/com/metamx/druid/index/v1/ComplexMetricColumnSerializer.java b/server/src/main/java/com/metamx/druid/index/v1/ComplexMetricColumnSerializer.java index 526877176a9..b23efe2fd80 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/ComplexMetricColumnSerializer.java +++ b/server/src/main/java/com/metamx/druid/index/v1/ComplexMetricColumnSerializer.java @@ -19,16 +19,16 @@ package com.metamx.druid.index.v1; +import java.io.File; +import java.io.IOException; +import java.nio.ByteOrder; + import com.google.common.io.ByteStreams; import com.google.common.io.Files; import com.metamx.druid.index.v1.serde.ComplexMetricSerde; import com.metamx.druid.kv.FlattenedArrayWriter; import com.metamx.druid.kv.IOPeon; -import java.io.File; -import java.io.IOException; -import java.nio.ByteOrder; - /** */ public class ComplexMetricColumnSerializer implements MetricColumnSerializer diff --git a/server/src/main/java/com/metamx/druid/index/v1/ConciseOffset.java b/server/src/main/java/com/metamx/druid/index/v1/ConciseOffset.java index b08449e687c..5ccbbe85bb2 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/ConciseOffset.java +++ b/server/src/main/java/com/metamx/druid/index/v1/ConciseOffset.java @@ -19,10 +19,11 @@ package com.metamx.druid.index.v1; -import com.metamx.druid.index.v1.processing.Offset; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import it.uniroma3.mat.extendedset.intset.IntSet; +import com.metamx.druid.index.v1.processing.Offset; + /** */ public class ConciseOffset implements Offset diff --git a/server/src/main/java/com/metamx/druid/index/v1/FloatMetricColumnSerializer.java b/server/src/main/java/com/metamx/druid/index/v1/FloatMetricColumnSerializer.java index 8207897e502..947757a7323 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/FloatMetricColumnSerializer.java +++ b/server/src/main/java/com/metamx/druid/index/v1/FloatMetricColumnSerializer.java @@ -19,13 +19,13 @@ package com.metamx.druid.index.v1; -import com.google.common.io.Files; -import com.metamx.druid.kv.IOPeon; - import java.io.File; import java.io.IOException; import java.nio.ByteOrder; +import com.google.common.io.Files; +import com.metamx.druid.kv.IOPeon; + /** */ public class FloatMetricColumnSerializer implements MetricColumnSerializer diff --git a/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexAdapter.java b/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexAdapter.java index d975770f560..dc7863feee9 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexAdapter.java +++ b/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexAdapter.java @@ -19,6 +19,17 @@ package com.metamx.druid.index.v1; +import it.uniroma3.mat.extendedset.intset.ConciseSet; +import it.uniroma3.mat.extendedset.intset.IntSet; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.annotation.Nullable; + +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.collect.Maps; import com.metamx.common.guava.FunctionalIterable; @@ -29,14 +40,6 @@ import com.metamx.druid.kv.Indexed; import com.metamx.druid.kv.IndexedInts; import com.metamx.druid.kv.IndexedIterable; import com.metamx.druid.kv.ListIndexed; -import it.uniroma3.mat.extendedset.intset.ConciseSet; -import it.uniroma3.mat.extendedset.intset.IntSet; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexStorageAdapter.java b/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexStorageAdapter.java index d2486aa585f..f25923e981f 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexStorageAdapter.java +++ b/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexStorageAdapter.java @@ -19,6 +19,18 @@ package com.metamx.druid.index.v1; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.TreeSet; +import java.util.concurrent.ConcurrentNavigableMap; + +import javax.annotation.Nullable; + +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; @@ -46,16 +58,6 @@ import com.metamx.druid.processing.FloatMetricSelector; import com.metamx.druid.query.search.SearchHit; import com.metamx.druid.query.search.SearchQuery; import com.metamx.druid.query.search.SearchQuerySpec; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; -import java.util.concurrent.ConcurrentNavigableMap; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/v1/IndexGranularity.java b/server/src/main/java/com/metamx/druid/index/v1/IndexGranularity.java index 3069984739b..3e40d2630c4 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/IndexGranularity.java +++ b/server/src/main/java/com/metamx/druid/index/v1/IndexGranularity.java @@ -19,7 +19,6 @@ package com.metamx.druid.index.v1; -import com.metamx.druid.QueryGranularity; import org.codehaus.jackson.annotate.JsonCreator; import org.joda.time.DateTime; import org.joda.time.Days; @@ -32,6 +31,8 @@ import org.joda.time.Weeks; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import com.metamx.druid.QueryGranularity; + /** */ public enum IndexGranularity diff --git a/server/src/main/java/com/metamx/druid/index/v1/IndexMerger.java b/server/src/main/java/com/metamx/druid/index/v1/IndexMerger.java index 8eea1be9eb3..992d1959551 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/IndexMerger.java +++ b/server/src/main/java/com/metamx/druid/index/v1/IndexMerger.java @@ -19,6 +19,30 @@ package com.metamx.druid.index.v1; +import it.uniroma3.mat.extendedset.intset.ConciseSet; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.IntBuffer; +import java.nio.MappedByteBuffer; +import java.nio.channels.FileChannel; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.TreeSet; + +import javax.annotation.Nullable; + +import org.apache.commons.io.FileUtils; +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.collect.Iterables; @@ -57,27 +81,6 @@ import com.metamx.druid.kv.TmpFileIOPeon; import com.metamx.druid.kv.VSizeIndexedWriter; import com.metamx.druid.utils.JodaUtils; import com.metamx.druid.utils.SerializerUtils; -import it.uniroma3.mat.extendedset.intset.ConciseSet; -import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; -import org.apache.commons.io.FileUtils; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import javax.annotation.Nullable; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.IntBuffer; -import java.nio.MappedByteBuffer; -import java.nio.channels.FileChannel; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/v1/IndexStorageAdapter.java b/server/src/main/java/com/metamx/druid/index/v1/IndexStorageAdapter.java index 8d4c7691ee4..81d726dbed1 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/IndexStorageAdapter.java +++ b/server/src/main/java/com/metamx/druid/index/v1/IndexStorageAdapter.java @@ -19,6 +19,16 @@ package com.metamx.druid.index.v1; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +import java.io.Closeable; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Map; + +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -46,14 +56,6 @@ import com.metamx.druid.kv.IndexedInts; import com.metamx.druid.kv.ListIndexed; import com.metamx.druid.processing.ComplexMetricSelector; import com.metamx.druid.processing.FloatMetricSelector; -import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.io.Closeable; -import java.util.Arrays; -import java.util.Iterator; -import java.util.Map; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/v1/IndexableAdapter.java b/server/src/main/java/com/metamx/druid/index/v1/IndexableAdapter.java index 5c65a969957..4370b48cf77 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/IndexableAdapter.java +++ b/server/src/main/java/com/metamx/druid/index/v1/IndexableAdapter.java @@ -19,9 +19,10 @@ package com.metamx.druid.index.v1; +import org.joda.time.Interval; + import com.metamx.druid.kv.Indexed; import com.metamx.druid.kv.IndexedInts; -import org.joda.time.Interval; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/v1/MMappedIndexAdapter.java b/server/src/main/java/com/metamx/druid/index/v1/MMappedIndexAdapter.java index 396fb0e2de0..efb9679b66a 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/MMappedIndexAdapter.java +++ b/server/src/main/java/com/metamx/druid/index/v1/MMappedIndexAdapter.java @@ -19,6 +19,12 @@ package com.metamx.druid.index.v1; +import java.util.Iterator; +import java.util.Map; +import java.util.NoSuchElementException; + +import org.joda.time.Interval; + import com.google.common.collect.Maps; import com.google.common.io.Closeables; import com.metamx.druid.kv.ConciseCompressedIndexedInts; @@ -26,11 +32,6 @@ import com.metamx.druid.kv.Indexed; import com.metamx.druid.kv.IndexedFloats; import com.metamx.druid.kv.IndexedInts; import com.metamx.druid.kv.IndexedLongs; -import org.joda.time.Interval; - -import java.util.Iterator; -import java.util.Map; -import java.util.NoSuchElementException; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/v1/MMappedIndexStorageAdapter.java b/server/src/main/java/com/metamx/druid/index/v1/MMappedIndexStorageAdapter.java index 537f5cd55fb..d9dcb003ee8 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/MMappedIndexStorageAdapter.java +++ b/server/src/main/java/com/metamx/druid/index/v1/MMappedIndexStorageAdapter.java @@ -19,6 +19,15 @@ package com.metamx.druid.index.v1; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +import java.io.Closeable; +import java.util.Iterator; +import java.util.Map; + +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Function; import com.google.common.base.Functions; import com.google.common.collect.ImmutableList; @@ -41,13 +50,6 @@ import com.metamx.druid.kv.IndexedInts; import com.metamx.druid.kv.IndexedLongs; import com.metamx.druid.processing.ComplexMetricSelector; import com.metamx.druid.processing.FloatMetricSelector; -import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.io.Closeable; -import java.util.Iterator; -import java.util.Map; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/v1/MetricColumnSerializer.java b/server/src/main/java/com/metamx/druid/index/v1/MetricColumnSerializer.java index 253ed3cf5a4..2452f820b25 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/MetricColumnSerializer.java +++ b/server/src/main/java/com/metamx/druid/index/v1/MetricColumnSerializer.java @@ -19,8 +19,6 @@ package com.metamx.druid.index.v1; -import com.metamx.druid.aggregation.Aggregator; - import java.io.IOException; /** diff --git a/server/src/main/java/com/metamx/druid/index/v1/Rowboat.java b/server/src/main/java/com/metamx/druid/index/v1/Rowboat.java index 551bf210bb5..f30a55e53fb 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/Rowboat.java +++ b/server/src/main/java/com/metamx/druid/index/v1/Rowboat.java @@ -19,15 +19,16 @@ package com.metamx.druid.index.v1; +import java.util.Arrays; +import java.util.Map; +import java.util.TreeSet; + +import org.joda.time.DateTime; + import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.common.primitives.Ints; import com.google.common.primitives.Longs; -import org.joda.time.DateTime; - -import java.util.Arrays; -import java.util.Map; -import java.util.TreeSet; public class Rowboat implements Comparable { diff --git a/server/src/main/java/com/metamx/druid/index/v1/RowboatFilteringIndexAdapter.java b/server/src/main/java/com/metamx/druid/index/v1/RowboatFilteringIndexAdapter.java index 95061ae39a8..152118c147e 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/RowboatFilteringIndexAdapter.java +++ b/server/src/main/java/com/metamx/druid/index/v1/RowboatFilteringIndexAdapter.java @@ -19,11 +19,12 @@ package com.metamx.druid.index.v1; +import org.joda.time.Interval; + import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.metamx.druid.kv.Indexed; import com.metamx.druid.kv.IndexedInts; -import org.joda.time.Interval; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/v1/SegmentIdAttachedStorageAdapter.java b/server/src/main/java/com/metamx/druid/index/v1/SegmentIdAttachedStorageAdapter.java index 1e47528d801..6357a905bf6 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/SegmentIdAttachedStorageAdapter.java +++ b/server/src/main/java/com/metamx/druid/index/v1/SegmentIdAttachedStorageAdapter.java @@ -19,6 +19,9 @@ package com.metamx.druid.index.v1; +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.metamx.druid.Capabilities; import com.metamx.druid.QueryGranularity; import com.metamx.druid.StorageAdapter; @@ -26,8 +29,6 @@ import com.metamx.druid.index.brita.Filter; import com.metamx.druid.index.v1.processing.Cursor; import com.metamx.druid.query.search.SearchHit; import com.metamx.druid.query.search.SearchQuery; -import org.joda.time.DateTime; -import org.joda.time.Interval; /** */ diff --git a/server/src/main/java/com/metamx/druid/index/v1/processing/Cursor.java b/server/src/main/java/com/metamx/druid/index/v1/processing/Cursor.java index 419d23d11ee..913ca44fb1c 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/processing/Cursor.java +++ b/server/src/main/java/com/metamx/druid/index/v1/processing/Cursor.java @@ -19,9 +19,10 @@ package com.metamx.druid.index.v1.processing; -import com.metamx.druid.processing.MetricSelectorFactory; import org.joda.time.DateTime; +import com.metamx.druid.processing.MetricSelectorFactory; + /** */ public interface Cursor extends MetricSelectorFactory, DimensionSelectorFactory diff --git a/server/src/main/java/com/metamx/druid/index/v1/processing/CursorFactory.java b/server/src/main/java/com/metamx/druid/index/v1/processing/CursorFactory.java index b18fec4b322..d32c9921fd0 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/processing/CursorFactory.java +++ b/server/src/main/java/com/metamx/druid/index/v1/processing/CursorFactory.java @@ -19,9 +19,10 @@ package com.metamx.druid.index.v1.processing; +import org.joda.time.Interval; + import com.metamx.druid.QueryGranularity; import com.metamx.druid.index.brita.Filter; -import org.joda.time.Interval; /** */ diff --git a/server/src/main/java/com/metamx/druid/initialization/ServerInit.java b/server/src/main/java/com/metamx/druid/initialization/ServerInit.java index 4a9c68d72aa..21f69cdb9cb 100644 --- a/server/src/main/java/com/metamx/druid/initialization/ServerInit.java +++ b/server/src/main/java/com/metamx/druid/initialization/ServerInit.java @@ -19,6 +19,13 @@ package com.metamx.druid.initialization; +import java.nio.ByteBuffer; +import java.util.Map; +import java.util.concurrent.atomic.AtomicLong; + +import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.skife.config.ConfigurationObjectFactory; + import com.google.common.base.Supplier; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; @@ -44,12 +51,6 @@ import com.metamx.druid.query.search.SearchQuery; import com.metamx.druid.query.search.SearchQueryRunnerFactory; import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; import com.metamx.druid.query.timeboundary.TimeBoundaryQueryRunnerFactory; -import org.jets3t.service.impl.rest.httpclient.RestS3Service; -import org.skife.config.ConfigurationObjectFactory; - -import java.nio.ByteBuffer; -import java.util.Map; -import java.util.concurrent.atomic.AtomicLong; /** */ diff --git a/server/src/main/java/com/metamx/druid/loading/ConvertingBaseQueryableFactory.java b/server/src/main/java/com/metamx/druid/loading/ConvertingBaseQueryableFactory.java index 8cb720affd2..fb6d83bba44 100644 --- a/server/src/main/java/com/metamx/druid/loading/ConvertingBaseQueryableFactory.java +++ b/server/src/main/java/com/metamx/druid/loading/ConvertingBaseQueryableFactory.java @@ -19,13 +19,14 @@ package com.metamx.druid.loading; +import java.io.File; +import java.io.IOException; + +import org.apache.commons.io.FileUtils; + import com.metamx.common.logger.Logger; import com.metamx.druid.StorageAdapter; import com.metamx.druid.index.v1.IndexIO; -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.io.IOException; /** */ diff --git a/server/src/main/java/com/metamx/druid/loading/DelegatingStorageAdapterLoader.java b/server/src/main/java/com/metamx/druid/loading/DelegatingStorageAdapterLoader.java index 5d421df7a0a..64e73cd6396 100644 --- a/server/src/main/java/com/metamx/druid/loading/DelegatingStorageAdapterLoader.java +++ b/server/src/main/java/com/metamx/druid/loading/DelegatingStorageAdapterLoader.java @@ -19,13 +19,14 @@ package com.metamx.druid.loading; +import java.util.Map; + +import javax.inject.Inject; + import com.metamx.common.MapUtils; import com.metamx.common.logger.Logger; import com.metamx.druid.StorageAdapter; -import javax.inject.Inject; -import java.util.Map; - /** */ public class DelegatingStorageAdapterLoader implements StorageAdapterLoader diff --git a/server/src/main/java/com/metamx/druid/loading/MMappedStorageAdapterFactory.java b/server/src/main/java/com/metamx/druid/loading/MMappedStorageAdapterFactory.java index 13c65ad5c4d..c155dd6576e 100644 --- a/server/src/main/java/com/metamx/druid/loading/MMappedStorageAdapterFactory.java +++ b/server/src/main/java/com/metamx/druid/loading/MMappedStorageAdapterFactory.java @@ -19,13 +19,13 @@ package com.metamx.druid.loading; +import java.io.File; +import java.io.IOException; + import com.metamx.druid.StorageAdapter; import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.index.v1.MMappedIndexStorageAdapter; -import java.io.File; -import java.io.IOException; - /** */ public class MMappedStorageAdapterFactory extends ConvertingBaseQueryableFactory diff --git a/server/src/main/java/com/metamx/druid/loading/RealtimeSegmentGetter.java b/server/src/main/java/com/metamx/druid/loading/RealtimeSegmentGetter.java index 15a37ebf611..93f7b3da345 100644 --- a/server/src/main/java/com/metamx/druid/loading/RealtimeSegmentGetter.java +++ b/server/src/main/java/com/metamx/druid/loading/RealtimeSegmentGetter.java @@ -19,12 +19,12 @@ package com.metamx.druid.loading; -import com.google.inject.Inject; -import com.metamx.common.logger.Logger; - import java.io.File; import java.util.Map; +import com.google.inject.Inject; +import com.metamx.common.logger.Logger; + /** */ public class RealtimeSegmentGetter implements SegmentGetter diff --git a/server/src/main/java/com/metamx/druid/loading/S3SegmentGetter.java b/server/src/main/java/com/metamx/druid/loading/S3SegmentGetter.java index d0d9fb7a0bd..f35bdd7e90d 100644 --- a/server/src/main/java/com/metamx/druid/loading/S3SegmentGetter.java +++ b/server/src/main/java/com/metamx/druid/loading/S3SegmentGetter.java @@ -19,22 +19,23 @@ package com.metamx.druid.loading; -import com.google.inject.Inject; -import com.metamx.common.MapUtils; -import com.metamx.common.StreamUtils; -import com.metamx.common.logger.Logger; -import com.metamx.druid.common.s3.S3Utils; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Map; +import java.util.zip.GZIPInputStream; + import org.apache.commons.io.FileUtils; import org.jets3t.service.impl.rest.httpclient.RestS3Service; import org.jets3t.service.model.S3Bucket; import org.jets3t.service.model.S3Object; import org.joda.time.DateTime; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.Map; -import java.util.zip.GZIPInputStream; +import com.google.inject.Inject; +import com.metamx.common.MapUtils; +import com.metamx.common.StreamUtils; +import com.metamx.common.logger.Logger; +import com.metamx.druid.common.s3.S3Utils; /** */ diff --git a/server/src/main/java/com/metamx/druid/loading/S3SegmentGetterConfig.java b/server/src/main/java/com/metamx/druid/loading/S3SegmentGetterConfig.java index c2a4c7f6308..eaee8e57424 100644 --- a/server/src/main/java/com/metamx/druid/loading/S3SegmentGetterConfig.java +++ b/server/src/main/java/com/metamx/druid/loading/S3SegmentGetterConfig.java @@ -19,10 +19,10 @@ package com.metamx.druid.loading; -import org.skife.config.Config; - import java.io.File; +import org.skife.config.Config; + /** */ public abstract class S3SegmentGetterConfig diff --git a/server/src/main/java/com/metamx/druid/loading/S3ZippedSegmentGetter.java b/server/src/main/java/com/metamx/druid/loading/S3ZippedSegmentGetter.java index d90d33c586d..f36b8956832 100644 --- a/server/src/main/java/com/metamx/druid/loading/S3ZippedSegmentGetter.java +++ b/server/src/main/java/com/metamx/druid/loading/S3ZippedSegmentGetter.java @@ -19,18 +19,6 @@ package com.metamx.druid.loading; -import com.google.common.io.Closeables; -import com.metamx.common.MapUtils; -import com.metamx.common.StreamUtils; -import com.metamx.common.logger.Logger; -import com.metamx.druid.common.s3.S3Utils; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.jets3t.service.impl.rest.httpclient.RestS3Service; -import org.jets3t.service.model.S3Bucket; -import org.jets3t.service.model.S3Object; -import org.joda.time.DateTime; - import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; @@ -41,6 +29,19 @@ import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.jets3t.service.model.S3Bucket; +import org.jets3t.service.model.S3Object; +import org.joda.time.DateTime; + +import com.google.common.io.Closeables; +import com.metamx.common.MapUtils; +import com.metamx.common.StreamUtils; +import com.metamx.common.logger.Logger; +import com.metamx.druid.common.s3.S3Utils; + /** */ public class S3ZippedSegmentGetter implements SegmentGetter diff --git a/server/src/main/java/com/metamx/druid/loading/SingleStorageAdapterLoader.java b/server/src/main/java/com/metamx/druid/loading/SingleStorageAdapterLoader.java index 8c58ac1c2bd..f83dfe8e7ec 100644 --- a/server/src/main/java/com/metamx/druid/loading/SingleStorageAdapterLoader.java +++ b/server/src/main/java/com/metamx/druid/loading/SingleStorageAdapterLoader.java @@ -19,11 +19,11 @@ package com.metamx.druid.loading; +import java.util.Map; + import com.google.inject.Inject; import com.metamx.druid.StorageAdapter; -import java.util.Map; - /** */ public class SingleStorageAdapterLoader implements StorageAdapterLoader diff --git a/server/src/main/java/com/metamx/druid/loading/StorageAdapterFactory.java b/server/src/main/java/com/metamx/druid/loading/StorageAdapterFactory.java index 92fec4e7632..0ac75e7d938 100644 --- a/server/src/main/java/com/metamx/druid/loading/StorageAdapterFactory.java +++ b/server/src/main/java/com/metamx/druid/loading/StorageAdapterFactory.java @@ -19,10 +19,10 @@ package com.metamx.druid.loading; -import com.metamx.druid.StorageAdapter; - import java.io.File; +import com.metamx.druid.StorageAdapter; + /** */ public interface StorageAdapterFactory diff --git a/server/src/main/java/com/metamx/druid/loading/StorageAdapterLoader.java b/server/src/main/java/com/metamx/druid/loading/StorageAdapterLoader.java index 96afd41e2ce..8395828c4aa 100644 --- a/server/src/main/java/com/metamx/druid/loading/StorageAdapterLoader.java +++ b/server/src/main/java/com/metamx/druid/loading/StorageAdapterLoader.java @@ -19,10 +19,10 @@ package com.metamx.druid.loading; -import com.metamx.druid.StorageAdapter; - import java.util.Map; +import com.metamx.druid.StorageAdapter; + /** */ public interface StorageAdapterLoader diff --git a/server/src/main/java/com/metamx/druid/master/BalancerAnalyzer.java b/server/src/main/java/com/metamx/druid/master/BalancerAnalyzer.java index bdf475b8d1b..5974ba1083b 100644 --- a/server/src/main/java/com/metamx/druid/master/BalancerAnalyzer.java +++ b/server/src/main/java/com/metamx/druid/master/BalancerAnalyzer.java @@ -19,6 +19,10 @@ package com.metamx.druid.master; +import java.util.Collections; +import java.util.List; +import java.util.Set; + import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.metamx.common.logger.Logger; @@ -26,10 +30,6 @@ import com.metamx.druid.client.DataSegment; import com.metamx.druid.client.DruidDataSource; import com.metamx.druid.client.DruidServer; -import java.util.Collections; -import java.util.List; -import java.util.Set; - /** * The BalancerAnalyzer keeps the state of the highest and lowest percent used servers. It will update * these states and perform lookaheads to make sure the updated states result in a more balanced cluster. diff --git a/server/src/main/java/com/metamx/druid/master/DruidMaster.java b/server/src/main/java/com/metamx/druid/master/DruidMaster.java index 622899271a6..f42021606bf 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMaster.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMaster.java @@ -19,6 +19,19 @@ package com.metamx.druid.master; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import java.util.concurrent.Callable; +import java.util.concurrent.ScheduledExecutorService; + +import org.I0Itec.zkclient.exception.ZkNodeExistsException; +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.Duration; + import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -47,18 +60,6 @@ import com.metamx.emitter.service.ServiceMetricEvent; import com.metamx.phonebook.PhoneBook; import com.metamx.phonebook.PhoneBookPeon; import com.netflix.curator.x.discovery.ServiceProvider; -import org.I0Itec.zkclient.exception.ZkNodeExistsException; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.Duration; - -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; -import java.util.concurrent.Callable; -import java.util.concurrent.ScheduledExecutorService; /** */ diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterAssigner.java b/server/src/main/java/com/metamx/druid/master/DruidMasterAssigner.java index 8bbf82559ef..6ef0e9372ed 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterAssigner.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterAssigner.java @@ -19,6 +19,10 @@ package com.metamx.druid.master; +import java.util.Collection; +import java.util.Map; +import java.util.PriorityQueue; + import com.google.common.collect.ImmutableMap; import com.metamx.common.guava.Comparators; import com.metamx.common.logger.Logger; @@ -26,10 +30,6 @@ import com.metamx.druid.client.DataSegment; import com.metamx.druid.client.DruidServer; import com.metamx.emitter.service.AlertEvent; -import java.util.Collection; -import java.util.Map; -import java.util.PriorityQueue; - /** */ public class DruidMasterAssigner implements DruidMasterHelper diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java b/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java index b1e03a5e21a..26854e097fc 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java @@ -19,6 +19,11 @@ package com.metamx.druid.master; +import java.util.Comparator; +import java.util.Set; +import java.util.TreeSet; +import java.util.concurrent.ConcurrentHashMap; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import com.metamx.common.guava.Comparators; @@ -28,11 +33,6 @@ import com.metamx.druid.client.DruidServer; import com.metamx.emitter.service.AlertEvent; import com.metamx.emitter.service.ServiceEmitter; -import java.util.Comparator; -import java.util.Set; -import java.util.TreeSet; -import java.util.concurrent.ConcurrentHashMap; - /** */ public class DruidMasterBalancer implements DruidMasterHelper diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterDropper.java b/server/src/main/java/com/metamx/druid/master/DruidMasterDropper.java index acf97e3cae3..d9ef02b0187 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterDropper.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterDropper.java @@ -19,6 +19,10 @@ package com.metamx.druid.master; +import java.util.Collection; +import java.util.Map; +import java.util.Set; + import com.google.common.collect.Maps; import com.metamx.common.guava.Comparators; import com.metamx.common.logger.Logger; @@ -28,10 +32,6 @@ import com.metamx.druid.client.DataSegment; import com.metamx.druid.client.DruidDataSource; import com.metamx.druid.client.DruidServer; -import java.util.Collection; -import java.util.Map; -import java.util.Set; - /** */ public class DruidMasterDropper implements DruidMasterHelper diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterLogger.java b/server/src/main/java/com/metamx/druid/master/DruidMasterLogger.java index 47d02fd0f52..05a47cfda65 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterLogger.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterLogger.java @@ -19,6 +19,9 @@ package com.metamx.druid.master; +import java.util.Map; +import java.util.Set; + import com.metamx.common.logger.Logger; import com.metamx.druid.client.DataSegment; import com.metamx.druid.client.DruidDataSource; @@ -27,9 +30,6 @@ import com.metamx.druid.collect.CountingMap; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; -import java.util.Map; -import java.util.Set; - /** */ public class DruidMasterLogger implements DruidMasterHelper diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterReplicator.java b/server/src/main/java/com/metamx/druid/master/DruidMasterReplicator.java index b02273def84..5c0d51dfd6c 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterReplicator.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterReplicator.java @@ -19,6 +19,13 @@ package com.metamx.druid.master; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + import com.google.common.base.Function; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableMap; @@ -31,13 +38,6 @@ import com.metamx.druid.client.DruidDataSource; import com.metamx.druid.client.DruidServer; import com.metamx.emitter.service.AlertEvent; -import java.util.Collection; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - /** * The Replicator is responsible for creating and destroying replicants in the cluster. */ diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java b/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java index 2a4cd255bb4..6728615cf2a 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java @@ -19,6 +19,12 @@ package com.metamx.druid.master; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -28,12 +34,6 @@ import com.metamx.druid.client.DruidDataSource; import com.metamx.druid.client.DruidServer; import com.metamx.emitter.service.ServiceEmitter; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; - /** */ public class DruidMasterRuntimeParams diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentInfoLoader.java b/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentInfoLoader.java index 2158328c1d8..97dfd2eb4a2 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentInfoLoader.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentInfoLoader.java @@ -19,11 +19,11 @@ package com.metamx.druid.master; +import java.util.Set; + import com.metamx.common.logger.Logger; import com.metamx.druid.client.DataSegment; -import java.util.Set; - public class DruidMasterSegmentInfoLoader implements DruidMasterHelper { private final DruidMaster master; diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java b/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java index 3044b6dccbf..2395e04ef95 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java @@ -19,6 +19,13 @@ package com.metamx.druid.master; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.google.common.base.Charsets; import com.google.common.base.Function; import com.google.common.base.Preconditions; @@ -41,12 +48,6 @@ import com.metamx.http.client.HttpClientConfig; import com.metamx.http.client.HttpClientInit; import com.metamx.http.client.response.ToStringResponseHandler; import com.netflix.curator.x.discovery.ServiceProvider; -import org.codehaus.jackson.map.ObjectMapper; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.util.List; -import java.util.Map; /** */ diff --git a/server/src/main/java/com/metamx/druid/master/HttpMergerClient.java b/server/src/main/java/com/metamx/druid/master/HttpMergerClient.java index 32c77fdff3d..58d68e9bbe4 100644 --- a/server/src/main/java/com/metamx/druid/master/HttpMergerClient.java +++ b/server/src/main/java/com/metamx/druid/master/HttpMergerClient.java @@ -19,16 +19,17 @@ package com.metamx.druid.master; +import java.net.URL; +import java.util.List; + +import org.codehaus.jackson.map.ObjectMapper; + import com.google.common.base.Throwables; import com.metamx.druid.client.DataSegment; import com.metamx.druid.merge.ClientAppendQuery; import com.metamx.http.client.HttpClient; import com.metamx.http.client.response.HttpResponseHandler; import com.netflix.curator.x.discovery.ServiceProvider; -import org.codehaus.jackson.map.ObjectMapper; - -import java.net.URL; -import java.util.List; public class HttpMergerClient implements MergerClient { diff --git a/server/src/main/java/com/metamx/druid/master/LoadQueuePeon.java b/server/src/main/java/com/metamx/druid/master/LoadQueuePeon.java index 35953e26b0c..59ea8e8f2b8 100644 --- a/server/src/main/java/com/metamx/druid/master/LoadQueuePeon.java +++ b/server/src/main/java/com/metamx/druid/master/LoadQueuePeon.java @@ -19,18 +19,6 @@ package com.metamx.druid.master; -import com.google.common.base.Function; -import com.google.common.collect.Collections2; -import com.google.common.collect.Lists; -import com.metamx.common.guava.Comparators; -import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.coordination.DataSegmentChangeRequest; -import com.metamx.druid.coordination.SegmentChangeRequestDrop; -import com.metamx.druid.coordination.SegmentChangeRequestLoad; -import com.metamx.phonebook.PhoneBook; -import com.metamx.phonebook.PhoneBookPeon; - import java.util.Arrays; import java.util.Collection; import java.util.Comparator; @@ -43,6 +31,18 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; +import com.google.common.base.Function; +import com.google.common.collect.Collections2; +import com.google.common.collect.Lists; +import com.metamx.common.guava.Comparators; +import com.metamx.common.logger.Logger; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.coordination.DataSegmentChangeRequest; +import com.metamx.druid.coordination.SegmentChangeRequestDrop; +import com.metamx.druid.coordination.SegmentChangeRequestLoad; +import com.metamx.phonebook.PhoneBook; +import com.metamx.phonebook.PhoneBookPeon; + /** */ public class LoadQueuePeon implements PhoneBookPeon diff --git a/server/src/main/java/com/metamx/druid/master/MergerClient.java b/server/src/main/java/com/metamx/druid/master/MergerClient.java index c2556ccaea0..9db2cb2b416 100644 --- a/server/src/main/java/com/metamx/druid/master/MergerClient.java +++ b/server/src/main/java/com/metamx/druid/master/MergerClient.java @@ -19,10 +19,10 @@ package com.metamx.druid.master; -import com.metamx.druid.client.DataSegment; - import java.util.List; +import com.metamx.druid.client.DataSegment; + /** */ public interface MergerClient diff --git a/server/src/main/java/com/metamx/druid/metrics/ServerMonitor.java b/server/src/main/java/com/metamx/druid/metrics/ServerMonitor.java index 176f9e3d174..4015c350699 100644 --- a/server/src/main/java/com/metamx/druid/metrics/ServerMonitor.java +++ b/server/src/main/java/com/metamx/druid/metrics/ServerMonitor.java @@ -19,14 +19,14 @@ package com.metamx.druid.metrics; +import java.util.Map; + import com.metamx.druid.client.DruidServer; import com.metamx.druid.coordination.ServerManager; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; import com.metamx.metrics.AbstractMonitor; -import java.util.Map; - public class ServerMonitor extends AbstractMonitor { private final DruidServer druidServer; diff --git a/server/src/main/java/com/metamx/druid/query/DefaultQueryRunnerFactoryConglomerate.java b/server/src/main/java/com/metamx/druid/query/DefaultQueryRunnerFactoryConglomerate.java index d8db68446b0..3d2dab30266 100644 --- a/server/src/main/java/com/metamx/druid/query/DefaultQueryRunnerFactoryConglomerate.java +++ b/server/src/main/java/com/metamx/druid/query/DefaultQueryRunnerFactoryConglomerate.java @@ -19,10 +19,10 @@ package com.metamx.druid.query; -import com.metamx.druid.Query; - import java.util.Map; +import com.metamx.druid.Query; + /** */ public class DefaultQueryRunnerFactoryConglomerate implements QueryRunnerFactoryConglomerate diff --git a/server/src/main/java/com/metamx/druid/query/QueryRunnerFactory.java b/server/src/main/java/com/metamx/druid/query/QueryRunnerFactory.java index 5eda9f40514..2c6c7b34057 100644 --- a/server/src/main/java/com/metamx/druid/query/QueryRunnerFactory.java +++ b/server/src/main/java/com/metamx/druid/query/QueryRunnerFactory.java @@ -19,11 +19,11 @@ package com.metamx.druid.query; +import java.util.concurrent.ExecutorService; + import com.metamx.druid.Query; import com.metamx.druid.StorageAdapter; -import java.util.concurrent.ExecutorService; - /** */ public interface QueryRunnerFactory> diff --git a/server/src/main/java/com/metamx/druid/query/group/GroupByQueryRunnerFactory.java b/server/src/main/java/com/metamx/druid/query/group/GroupByQueryRunnerFactory.java index 01327a44c80..90b4e5783e4 100644 --- a/server/src/main/java/com/metamx/druid/query/group/GroupByQueryRunnerFactory.java +++ b/server/src/main/java/com/metamx/druid/query/group/GroupByQueryRunnerFactory.java @@ -19,6 +19,11 @@ package com.metamx.druid.query.group; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; + import com.google.common.base.Function; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; @@ -35,11 +40,6 @@ import com.metamx.druid.query.QueryRunner; import com.metamx.druid.query.QueryRunnerFactory; import com.metamx.druid.query.QueryToolChest; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; - /** */ public class GroupByQueryRunnerFactory implements QueryRunnerFactory diff --git a/server/src/main/java/com/metamx/druid/query/search/SearchQueryRunnerFactory.java b/server/src/main/java/com/metamx/druid/query/search/SearchQueryRunnerFactory.java index ce4e8e89e6e..d42c0c3051f 100644 --- a/server/src/main/java/com/metamx/druid/query/search/SearchQueryRunnerFactory.java +++ b/server/src/main/java/com/metamx/druid/query/search/SearchQueryRunnerFactory.java @@ -19,6 +19,9 @@ package com.metamx.druid.query.search; +import java.util.Iterator; +import java.util.concurrent.ExecutorService; + import com.google.common.collect.Lists; import com.metamx.common.ISE; import com.metamx.common.guava.BaseSequence; @@ -35,9 +38,6 @@ import com.metamx.druid.query.group.GroupByQuery; import com.metamx.druid.result.Result; import com.metamx.druid.result.SearchResultValue; -import java.util.Iterator; -import java.util.concurrent.ExecutorService; - /** */ public class SearchQueryRunnerFactory implements QueryRunnerFactory, SearchQuery> diff --git a/server/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryRunnerFactory.java b/server/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryRunnerFactory.java index 459a520c916..dc94a27f408 100644 --- a/server/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryRunnerFactory.java +++ b/server/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryRunnerFactory.java @@ -19,12 +19,14 @@ package com.metamx.druid.query.timeboundary; +import java.util.Iterator; +import java.util.concurrent.ExecutorService; + import com.metamx.common.ISE; import com.metamx.common.guava.BaseSequence; import com.metamx.common.guava.Sequence; import com.metamx.druid.Query; import com.metamx.druid.StorageAdapter; -import com.metamx.druid.collect.StupidPool; import com.metamx.druid.query.ChainedExecutionQueryRunner; import com.metamx.druid.query.QueryRunner; import com.metamx.druid.query.QueryRunnerFactory; @@ -33,10 +35,6 @@ import com.metamx.druid.query.group.GroupByQuery; import com.metamx.druid.result.Result; import com.metamx.druid.result.TimeBoundaryResultValue; -import java.nio.ByteBuffer; -import java.util.Iterator; -import java.util.concurrent.ExecutorService; - /** */ public class TimeBoundaryQueryRunnerFactory diff --git a/server/src/main/java/com/metamx/druid/utils/ExposeS3DataSource.java b/server/src/main/java/com/metamx/druid/utils/ExposeS3DataSource.java index 2d72961a436..d20e8621aae 100644 --- a/server/src/main/java/com/metamx/druid/utils/ExposeS3DataSource.java +++ b/server/src/main/java/com/metamx/druid/utils/ExposeS3DataSource.java @@ -19,16 +19,12 @@ package com.metamx.druid.utils; -import com.google.common.base.Joiner; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.metamx.common.Granularity; -import com.metamx.common.MapUtils; -import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.common.s3.S3Utils; -import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.zk.StringZkSerializer; +import java.io.IOException; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.Map; +import java.util.TreeSet; + import org.I0Itec.zkclient.ZkClient; import org.I0Itec.zkclient.ZkConnection; import org.apache.commons.cli.CommandLine; @@ -44,11 +40,16 @@ import org.jets3t.service.security.AWSCredentials; import org.joda.time.DateTime; import org.joda.time.Interval; -import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.util.Arrays; -import java.util.Map; -import java.util.TreeSet; +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.metamx.common.Granularity; +import com.metamx.common.MapUtils; +import com.metamx.common.logger.Logger; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.common.s3.S3Utils; +import com.metamx.druid.jackson.DefaultObjectMapper; +import com.metamx.druid.zk.StringZkSerializer; /** */ diff --git a/server/src/main/java/com/metamx/druid/utils/ZkSetup.java b/server/src/main/java/com/metamx/druid/utils/ZkSetup.java index 2c4b8f768af..dd5d6c0daa7 100644 --- a/server/src/main/java/com/metamx/druid/utils/ZkSetup.java +++ b/server/src/main/java/com/metamx/druid/utils/ZkSetup.java @@ -19,11 +19,12 @@ package com.metamx.druid.utils; +import org.I0Itec.zkclient.ZkClient; +import org.I0Itec.zkclient.ZkConnection; + import com.metamx.druid.db.DbConnector; import com.metamx.druid.db.DbConnectorConfig; import com.metamx.druid.zk.StringZkSerializer; -import org.I0Itec.zkclient.ZkClient; -import org.I0Itec.zkclient.ZkConnection; /** */ diff --git a/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestDropTest.java b/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestDropTest.java index 9673d15b3c0..df11470b5f0 100644 --- a/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestDropTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestDropTest.java @@ -19,18 +19,19 @@ package com.metamx.druid.coordination; -import com.google.common.collect.ImmutableMap; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.shard.NoneShardSpec; +import java.util.Arrays; +import java.util.Map; + import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; -import java.util.Arrays; -import java.util.Map; +import com.google.common.collect.ImmutableMap; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.jackson.DefaultObjectMapper; +import com.metamx.druid.shard.NoneShardSpec; /** */ diff --git a/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestLoadTest.java b/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestLoadTest.java index eaedcde0b6a..83d157ecd9c 100644 --- a/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestLoadTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestLoadTest.java @@ -19,18 +19,19 @@ package com.metamx.druid.coordination; -import com.google.common.collect.ImmutableMap; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.shard.NoneShardSpec; +import java.util.Arrays; +import java.util.Map; + import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; -import java.util.Arrays; -import java.util.Map; +import com.google.common.collect.ImmutableMap; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.jackson.DefaultObjectMapper; +import com.metamx.druid.shard.NoneShardSpec; /** */ diff --git a/server/src/test/java/com/metamx/druid/coordination/ServerManagerTest.java b/server/src/test/java/com/metamx/druid/coordination/ServerManagerTest.java index 1f44bd3e65f..2e8bbdbb512 100644 --- a/server/src/test/java/com/metamx/druid/coordination/ServerManagerTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/ServerManagerTest.java @@ -19,6 +19,20 @@ package com.metamx.druid.coordination; +import java.io.IOException; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; + +import org.codehaus.jackson.type.TypeReference; +import org.joda.time.DateTime; +import org.joda.time.Interval; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + import com.google.common.base.Function; import com.google.common.base.Functions; import com.google.common.collect.ImmutableList; @@ -57,19 +71,6 @@ import com.metamx.druid.result.SearchResultValue; import com.metamx.druid.shard.NoneShardSpec; import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceMetricEvent; -import org.codehaus.jackson.type.TypeReference; -import org.joda.time.DateTime; -import org.joda.time.Interval; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutorService; /** */ diff --git a/server/src/test/java/com/metamx/druid/coordination/ZkCoordinatorTest.java b/server/src/test/java/com/metamx/druid/coordination/ZkCoordinatorTest.java index a0b6fe53988..9a4b1d4c84f 100644 --- a/server/src/test/java/com/metamx/druid/coordination/ZkCoordinatorTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/ZkCoordinatorTest.java @@ -19,6 +19,19 @@ package com.metamx.druid.coordination; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.codehaus.jackson.map.ObjectMapper; +import org.easymock.EasyMock; +import org.joda.time.Interval; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.util.concurrent.MoreExecutors; @@ -32,18 +45,6 @@ import com.metamx.druid.loading.NoopStorageAdapterLoader; import com.metamx.druid.metrics.NoopServiceEmitter; import com.metamx.druid.query.NoopQueryRunnerFactoryConglomerate; import com.metamx.druid.shard.NoneShardSpec; -import org.codehaus.jackson.map.ObjectMapper; -import org.easymock.EasyMock; -import org.joda.time.Interval; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; /** */ diff --git a/server/src/test/java/com/metamx/druid/db/DatabaseSegmentManagerTest.java b/server/src/test/java/com/metamx/druid/db/DatabaseSegmentManagerTest.java index d53ac4e783e..d69929b7d13 100644 --- a/server/src/test/java/com/metamx/druid/db/DatabaseSegmentManagerTest.java +++ b/server/src/test/java/com/metamx/druid/db/DatabaseSegmentManagerTest.java @@ -19,9 +19,11 @@ package com.metamx.druid.db; -import com.google.common.base.Throwables; -import com.google.common.collect.Maps; -import com.metamx.druid.jackson.DefaultObjectMapper; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executors; + import org.easymock.EasyMock; import org.joda.time.Duration; import org.junit.After; @@ -30,12 +32,8 @@ import org.junit.Test; import org.skife.jdbi.v2.DBI; import org.skife.jdbi.v2.tweak.HandleCallback; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; +import com.google.common.collect.Maps; +import com.metamx.druid.jackson.DefaultObjectMapper; /** */ diff --git a/server/src/test/java/com/metamx/druid/index/v1/ConciseOffsetTest.java b/server/src/test/java/com/metamx/druid/index/v1/ConciseOffsetTest.java index f32ecae3a47..2a81ade14ad 100644 --- a/server/src/test/java/com/metamx/druid/index/v1/ConciseOffsetTest.java +++ b/server/src/test/java/com/metamx/druid/index/v1/ConciseOffsetTest.java @@ -19,12 +19,14 @@ package com.metamx.druid.index.v1; -import com.metamx.druid.index.v1.processing.Offset; import it.uniroma3.mat.extendedset.intset.ConciseSet; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + import org.junit.Assert; import org.junit.Test; +import com.metamx.druid.index.v1.processing.Offset; + /** */ public class ConciseOffsetTest diff --git a/server/src/test/java/com/metamx/druid/index/v1/EmptyIndexTest.java b/server/src/test/java/com/metamx/druid/index/v1/EmptyIndexTest.java index 26faef365fa..71ec8e15e3a 100644 --- a/server/src/test/java/com/metamx/druid/index/v1/EmptyIndexTest.java +++ b/server/src/test/java/com/metamx/druid/index/v1/EmptyIndexTest.java @@ -19,16 +19,17 @@ package com.metamx.druid.index.v1; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.metamx.druid.QueryGranularity; -import com.metamx.druid.aggregation.AggregatorFactory; +import java.io.File; +import java.util.ArrayList; + import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; -import java.io.File; -import java.util.ArrayList; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.metamx.druid.QueryGranularity; +import com.metamx.druid.aggregation.AggregatorFactory; public class EmptyIndexTest { diff --git a/server/src/test/java/com/metamx/druid/index/v1/processing/IntersectingOffsetTest.java b/server/src/test/java/com/metamx/druid/index/v1/processing/IntersectingOffsetTest.java index fb6a7826d1d..b270c700da6 100644 --- a/server/src/test/java/com/metamx/druid/index/v1/processing/IntersectingOffsetTest.java +++ b/server/src/test/java/com/metamx/druid/index/v1/processing/IntersectingOffsetTest.java @@ -19,11 +19,12 @@ package com.metamx.druid.index.v1.processing; -import com.google.common.collect.Lists; +import java.util.LinkedList; + import org.junit.Assert; import org.junit.Test; -import java.util.LinkedList; +import com.google.common.collect.Lists; /** */ diff --git a/server/src/test/java/com/metamx/druid/index/v1/processing/UnioningOffsetTest.java b/server/src/test/java/com/metamx/druid/index/v1/processing/UnioningOffsetTest.java index a49ab954341..68af2e19d24 100644 --- a/server/src/test/java/com/metamx/druid/index/v1/processing/UnioningOffsetTest.java +++ b/server/src/test/java/com/metamx/druid/index/v1/processing/UnioningOffsetTest.java @@ -19,11 +19,12 @@ package com.metamx.druid.index.v1.processing; -import com.google.common.collect.Lists; +import java.util.ArrayList; + import org.junit.Assert; import org.junit.Test; -import java.util.ArrayList; +import com.google.common.collect.Lists; /** */ diff --git a/server/src/test/java/com/metamx/druid/loading/NoopStorageAdapterLoader.java b/server/src/test/java/com/metamx/druid/loading/NoopStorageAdapterLoader.java index a5bcf8b0b34..5c1a15be37e 100644 --- a/server/src/test/java/com/metamx/druid/loading/NoopStorageAdapterLoader.java +++ b/server/src/test/java/com/metamx/druid/loading/NoopStorageAdapterLoader.java @@ -19,6 +19,11 @@ package com.metamx.druid.loading; +import java.util.Map; + +import org.joda.time.DateTime; +import org.joda.time.Interval; + import com.metamx.druid.Capabilities; import com.metamx.druid.QueryGranularity; import com.metamx.druid.StorageAdapter; @@ -26,10 +31,6 @@ import com.metamx.druid.index.brita.Filter; import com.metamx.druid.index.v1.processing.Cursor; import com.metamx.druid.query.search.SearchHit; import com.metamx.druid.query.search.SearchQuery; -import org.joda.time.DateTime; -import org.joda.time.Interval; - -import java.util.Map; /** */ diff --git a/server/src/test/java/com/metamx/druid/master/BalancerAnalyzerTest.java b/server/src/test/java/com/metamx/druid/master/BalancerAnalyzerTest.java index 5c5c96b520d..585f5c76f3d 100644 --- a/server/src/test/java/com/metamx/druid/master/BalancerAnalyzerTest.java +++ b/server/src/test/java/com/metamx/druid/master/BalancerAnalyzerTest.java @@ -19,16 +19,18 @@ package com.metamx.druid.master; +import junit.framework.Assert; + +import org.easymock.EasyMock; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.metamx.druid.client.DataSegment; import com.metamx.druid.client.DruidDataSource; import com.metamx.druid.client.DruidServer; -import junit.framework.Assert; -import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; /** */ diff --git a/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java b/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java index 8ed7f28e8bf..4aaf3838acd 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java @@ -19,18 +19,20 @@ package com.metamx.druid.master; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidDataSource; -import com.metamx.druid.client.DruidServer; +import java.util.Arrays; + import junit.framework.Assert; + import org.easymock.EasyMock; import org.junit.After; import org.junit.Before; import org.junit.Test; -import java.util.Arrays; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.client.DruidDataSource; +import com.metamx.druid.client.DruidServer; /** */ diff --git a/server/src/test/java/com/metamx/druid/master/DruidMasterReplicatorTest.java b/server/src/test/java/com/metamx/druid/master/DruidMasterReplicatorTest.java index cd61649a1fb..10da530d498 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterReplicatorTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterReplicatorTest.java @@ -19,20 +19,21 @@ package com.metamx.druid.master; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Sets; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidDataSource; -import com.metamx.druid.client.DruidServer; +import java.util.Arrays; + import junit.framework.Assert; + import org.easymock.EasyMock; import org.joda.time.Interval; import org.junit.After; import org.junit.Before; import org.junit.Test; -import java.util.Arrays; -import java.util.Map; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.metamx.druid.client.DataSegment; +import com.metamx.druid.client.DruidDataSource; +import com.metamx.druid.client.DruidServer; /** diff --git a/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java b/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java index ddb120a9857..6e015906adf 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java @@ -19,16 +19,18 @@ package com.metamx.druid.master; +import java.util.Collection; +import java.util.List; + +import junit.framework.Assert; + +import org.joda.time.Interval; +import org.junit.Test; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.metamx.druid.client.DataSegment; -import junit.framework.Assert; -import org.joda.time.Interval; -import org.junit.Test; - -import java.util.Collection; -import java.util.List; public class DruidMasterSegmentMergerTest { diff --git a/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java b/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java index c13f929ce0c..ebbe1f0f733 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java @@ -19,6 +19,14 @@ package com.metamx.druid.master; +import java.util.Map; + +import org.easymock.EasyMock; +import org.joda.time.Duration; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + import com.metamx.common.concurrent.ScheduledExecutorFactory; import com.metamx.common.logger.Logger; import com.metamx.druid.client.DataSegment; @@ -29,13 +37,6 @@ import com.metamx.druid.coordination.legacy.TheSizeAdjuster; import com.metamx.druid.db.DatabaseSegmentManager; import com.metamx.druid.metrics.NoopServiceEmitter; import com.metamx.phonebook.PhoneBook; -import org.easymock.EasyMock; -import org.joda.time.Duration; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.Map; /** */