From bd8d5bddd85d0527be307b959fa0e28c19dbd379 Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Tue, 30 Oct 2012 22:21:55 -0700 Subject: [PATCH 01/13] Ignored all Eclipse .settings folders. --- .gitignore | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index aa14279d85c..5c790122373 100644 --- a/.gitignore +++ b/.gitignore @@ -9,10 +9,6 @@ target .classpath .idea .project -.settings/org.eclipse.jdt.core.prefs -.settings/org.maven.ide.eclipse.prefs -client/.settings/org.eclipse.jdt.core.prefs -common/.settings/org.eclipse.jdt.core.prefs -server/.settings/org.eclipse.jdt.core.prefs +.settings/ examples/rand/RealtimeNode.out examples/twitter/RealtimeNode.out From 0d24df76282cf6b105d0395f1b6c9146006c9f22 Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Tue, 30 Oct 2012 22:22:46 -0700 Subject: [PATCH 02/13] 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; /** */ From 35f04b4df689d1b54c7322dc9b931cc257702ae4 Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Tue, 30 Oct 2012 23:26:21 -0700 Subject: [PATCH 03/13] Fixed some minor potential resource leaks. --- .../src/main/java/com/metamx/TsvToJson.java | 71 +++++++++++-------- .../metamx/druid/index/v1/IndexMerger.java | 6 +- 2 files changed, 45 insertions(+), 32 deletions(-) diff --git a/server/src/main/java/com/metamx/TsvToJson.java b/server/src/main/java/com/metamx/TsvToJson.java index a0d28d4364f..29291fdb4dc 100644 --- a/server/src/main/java/com/metamx/TsvToJson.java +++ b/server/src/main/java/com/metamx/TsvToJson.java @@ -67,42 +67,51 @@ public class TsvToJson } } - BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(inFile), Charsets.UTF_8)); - BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), Charsets.UTF_8)); - String line = null; - int count = 0; - long currTime = System.currentTimeMillis(); - long startTime = currTime; - while ((line = in.readLine()) != null) { - if (count % 1000000 == 0) { - long nowTime = System.currentTimeMillis(); - System.out.printf("Processed [%,d] lines in %,d millis. Incremental time %,d millis.%n", count, nowTime - startTime, nowTime - currTime); - currTime = nowTime; - } - ++count; - String[] splits = line.split("\t"); + BufferedReader in = null; + BufferedWriter out = null; + try { + in = new BufferedReader(new InputStreamReader(new FileInputStream(inFile), Charsets.UTF_8)); + out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), Charsets.UTF_8)); + String line = null; + int count = 0; + long currTime = System.currentTimeMillis(); + long startTime = currTime; + while ((line = in.readLine()) != null) { + if (count % 1000000 == 0) { + long nowTime = System.currentTimeMillis(); + System.out.printf("Processed [%,d] lines in %,d millis. Incremental time %,d millis.%n", count, nowTime - startTime, nowTime - currTime); + currTime = nowTime; + } + ++count; + String[] splits = line.split("\t"); - if (splits.length == 30) { - continue; - } + if (splits.length == 30) { + continue; + } - if (splits.length != handlers.length) { - throw new IAE("splits.length[%d] != handlers.length[%d]; line[%s]", splits.length, handlers.length, line); - } + if (splits.length != handlers.length) { + throw new IAE("splits.length[%d] != handlers.length[%d]; line[%s]", splits.length, handlers.length, line); + } - Map jsonMap = Maps.newLinkedHashMap(); - for (int i = 0; i < handlers.length; ++i) { - jsonMap.put(handlers[i].getFieldName(), handlers[i].process(splits[i])); - } + Map jsonMap = Maps.newLinkedHashMap(); + for (int i = 0; i < handlers.length; ++i) { + jsonMap.put(handlers[i].getFieldName(), handlers[i].process(splits[i])); + } - final String str = mapper.writeValueAsString(jsonMap); - out.write(str); - out.write("\n"); + final String str = mapper.writeValueAsString(jsonMap); + out.write(str); + out.write("\n"); + } + System.out.printf("Completed %,d lines in %,d millis.%n", count, System.currentTimeMillis() - startTime); + out.flush(); + } finally { + if (out != null) { + out.close(); + } + if (in != null) { + in.close(); + } } - System.out.printf("Completed %,d lines in %,d millis.%n", count, System.currentTimeMillis() - startTime); - out.flush(); - out.close(); - in.close(); } public static interface FieldHandler 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 992d1959551..04a4faec2d8 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 @@ -416,9 +416,11 @@ public class IndexMerger long startTime = System.currentTimeMillis(); File indexFile = new File(outDir, "index.drd"); + FileOutputStream fileOutputStream = null; FileChannel channel = null; try { - channel = new FileOutputStream(indexFile).getChannel(); + fileOutputStream = new FileOutputStream(indexFile); + channel = fileOutputStream.getChannel(); channel.write(ByteBuffer.wrap(new byte[]{IndexIO.CURRENT_VERSION_ID})); GenericIndexed.fromIterable(mergedDimensions, GenericIndexed.stringStrategy).writeToChannel(channel); @@ -438,6 +440,8 @@ public class IndexMerger finally { Closeables.closeQuietly(channel); channel = null; + Closeables.closeQuietly(fileOutputStream); + fileOutputStream = null; } IndexIO.checkFileSize(indexFile); log.info("outDir[%s] completed index.drd in %,d millis.", outDir, System.currentTimeMillis() - startTime); From c5e2a8818791ac87dafb5bc5fbbbf1de3684cee1 Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Tue, 30 Oct 2012 23:59:31 -0700 Subject: [PATCH 04/13] Resolved dead code warning by null checking the correct variable according to the associated log statement. --- server/src/main/java/com/metamx/druid/master/DruidMaster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f42021606bf..0a90e7f99da 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMaster.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMaster.java @@ -359,7 +359,7 @@ public class DruidMaster DataSegment newDataSegment = sizeAdjuster.updateDescriptor(dataSegment); - if (dataSegment == null) { + if (newDataSegment == null) { log.warn("newDataSegment was null with old dataSegment[%s]. Skipping.", dataSegment); continue; } From e24948319bd3b56b0804e09cae8551b7e097d79a Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Wed, 31 Oct 2012 00:00:30 -0700 Subject: [PATCH 05/13] Removed some dead/unused code. --- .../query/ChainedExecutionQueryRunner.java | 28 ------------------- .../metamx/druid/guava/CombiningSequence.java | 1 - .../com/metamx/druid/jackson/JodaStuff.java | 1 - .../druid/coordination/ServerManager.java | 1 - 4 files changed, 31 deletions(-) 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 1254dd96b53..63eb65d725b 100644 --- a/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java @@ -141,32 +141,4 @@ public class ChainedExecutionQueryRunner implements QueryRunner } ); } - - private static class ThreadNamingCallable implements Callable - { - private final Callable baseCallable; - private final String name; - - ThreadNamingCallable( - Callable baseCallable, - String name - ) - { - this.baseCallable = baseCallable; - this.name = name; - } - - @Override - public T call() throws Exception - { - String oldName = Thread.currentThread().getName(); - try { - Thread.currentThread().setName(name); - return baseCallable.call(); - } - finally { - Thread.currentThread().setName(oldName); - } - } - } } 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 b4c184f0c8f..5da61094f05 100644 --- a/common/src/main/java/com/metamx/druid/guava/CombiningSequence.java +++ b/common/src/main/java/com/metamx/druid/guava/CombiningSequence.java @@ -59,7 +59,6 @@ public class CombiningSequence implements Sequence } @Override - @SuppressWarnings("unchecked") public OutType accumulate(OutType initValue, final Accumulator accumulator) { final AtomicReference retVal = new AtomicReference(initValue); 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 3b907cdb5c9..186811dd869 100644 --- a/common/src/main/java/com/metamx/druid/jackson/JodaStuff.java +++ b/common/src/main/java/com/metamx/druid/jackson/JodaStuff.java @@ -80,7 +80,6 @@ public class JodaStuff super(DateTime.class); } - @SuppressWarnings("unchecked") @Override public DateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException 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 7c842046c06..935360834ce 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ServerManager.java +++ b/server/src/main/java/com/metamx/druid/coordination/ServerManager.java @@ -211,7 +211,6 @@ public class ServerManager implements QuerySegmentWalker new Function, Iterable>>() { @Override - @SuppressWarnings("unchecked") public Iterable> apply(@Nullable final TimelineObjectHolder holder) { if (holder == null) { From e8f02219bb0f06670e1a61a3ebf340f5d78e4f45 Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Wed, 31 Oct 2012 12:58:16 -0700 Subject: [PATCH 06/13] Streamlined the Maven POMs, in particular the plugin configurations. The 'mvn versions:display-plugin-updates' report is now warning free, and there are no more Maven warnings reported in Eclipse. --- client/pom.xml | 38 --------------- common/pom.xml | 33 -------------- examples/pom.xml | 61 +++---------------------- examples/rand/pom.xml | 38 --------------- examples/twitter/pom.xml | 38 --------------- index-common/pom.xml | 38 +-------------- indexer/pom.xml | 21 --------- merger/pom.xml | 32 ------------- pom.xml | 99 +++++++++++++++++++++++++++++++--------- realtime/pom.xml | 38 --------------- server/pom.xml | 40 ---------------- 11 files changed, 86 insertions(+), 390 deletions(-) diff --git a/client/pom.xml b/client/pom.xml index 4478013e8ab..f5b3ffaef08 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -22,18 +22,8 @@ 4.0.0 com.metamx.druid druid-client - 0.1.0-SNAPSHOT druid-client druid-client - - scm:git:ssh://git@github.com/metamx/druid.git - scm:git:ssh://git@github.com/metamx/druid.git - http://www.github.com/metamx/druid - - - - UTF-8 - com.metamx @@ -168,18 +158,7 @@ - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins maven-shade-plugin - 1.6 package @@ -195,24 +174,7 @@ - org.apache.maven.plugins - maven-help-plugin - 2.1.1 - - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - - - org.apache.maven.plugins maven-jar-plugin - 2.4 diff --git a/common/pom.xml b/common/pom.xml index cbf3e74dc3c..801d005fabc 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -22,14 +22,8 @@ 4.0.0 com.metamx.druid druid-common - 0.1.0-SNAPSHOT druid-common druid-common - - scm:git:ssh://git@github.com/metamx/druid.git - scm:git:ssh://git@github.com/metamx/druid.git - http://www.github.com/metamx/druid - com.metamx @@ -38,7 +32,6 @@ - UTF-8 0.16.0 @@ -145,33 +138,7 @@ - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins - maven-help-plugin - 2.1.1 - - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - - - org.apache.maven.plugins maven-jar-plugin - 2.4 diff --git a/examples/pom.xml b/examples/pom.xml index f056936fd2d..631b2e16dff 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -18,69 +18,22 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - + 4.0.0 - com.metamx druid-examples pom - 0.1.0-SNAPSHOT druid-examples druid-examples - - scm:git:ssh://git@github.com/metamx/druid.git - scm:git:ssh://git@github.com/metamx/druid.git - http://www.github.com/metamx/druid - - - UTF-8 - + + com.metamx + druid + 0.1.0-SNAPSHOT + rand twitter - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - - - - - - - pub-libs - pub-libs-local - https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local - - - repo.codahale.com - http://repo.codahale.com - - - nativelibs4java - http://nativelibs4java.sourceforge.net/maven - - - thirdparty-uploads - JBoss Thirdparty Uploads - https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads - - - - - central-local - Central - https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local - - diff --git a/examples/rand/pom.xml b/examples/rand/pom.xml index 369396c1a8e..379204d38b7 100644 --- a/examples/rand/pom.xml +++ b/examples/rand/pom.xml @@ -3,18 +3,8 @@ 4.0.0 com.metamx.druid druid-examples-rand - 0.1.0-SNAPSHOT druid-examples-rand druid-examples-rand - - scm:git:ssh://git@github.com/metamx/druid.git - scm:git:ssh://git@github.com/metamx/druid.git - http://www.github.com/metamx/druid - - - - UTF-8 - com.metamx @@ -159,18 +149,7 @@ - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins maven-shade-plugin - 1.6 package @@ -186,24 +165,7 @@ - org.apache.maven.plugins - maven-help-plugin - 2.1.1 - - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - - - org.apache.maven.plugins maven-jar-plugin - 2.4 diff --git a/examples/twitter/pom.xml b/examples/twitter/pom.xml index 2c35a040be7..a0e930229c4 100644 --- a/examples/twitter/pom.xml +++ b/examples/twitter/pom.xml @@ -3,18 +3,8 @@ 4.0.0 com.metamx.druid druid-examples-twitter - 0.1.0-SNAPSHOT druid-examples-twitter druid-examples-twitter - - scm:git:ssh://git@github.com/metamx/druid.git - scm:git:ssh://git@github.com/metamx/druid.git - http://www.github.com/metamx/druid - - - - UTF-8 - com.metamx @@ -175,18 +165,7 @@ - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins maven-shade-plugin - 1.6 package @@ -202,24 +181,7 @@ - org.apache.maven.plugins - maven-help-plugin - 2.1.1 - - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - - - org.apache.maven.plugins maven-jar-plugin - 2.4 diff --git a/index-common/pom.xml b/index-common/pom.xml index 9d3066ab1c8..651248848be 100644 --- a/index-common/pom.xml +++ b/index-common/pom.xml @@ -18,18 +18,13 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - + 4.0.0 com.metamx.druid druid-index-common - 0.1.0-SNAPSHOT druid-index-common Druid Indexer - - scm:git:git://github.com/metamx/druid-index-common.git - scm:git:ssh://git@github.com/metamx/druid-index-common.git - http://github.com/metamx/druid-index-common - com.metamx @@ -63,33 +58,4 @@ test - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - - - - - - - UTF-8 - \ No newline at end of file diff --git a/indexer/pom.xml b/indexer/pom.xml index 1d9dbb0785e..1b45e48d946 100644 --- a/indexer/pom.xml +++ b/indexer/pom.xml @@ -22,14 +22,8 @@ 4.0.0 com.metamx.druid druid-indexer - 0.1.0-SNAPSHOT druid-indexer Druid Indexer - - scm:git:git://github.com/metamx/druid-indexer.git - scm:git:ssh://git@github.com/metamx/druid-indexer.git - http://github.com/metamx/druid-indexer - com.metamx @@ -78,18 +72,7 @@ - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins maven-shade-plugin - 1.6 package @@ -112,8 +95,4 @@ - - - UTF-8 - diff --git a/merger/pom.xml b/merger/pom.xml index 016f9f545bc..6b84d6a239a 100644 --- a/merger/pom.xml +++ b/merger/pom.xml @@ -22,14 +22,8 @@ 4.0.0 com.metamx.druid druid-merger - 0.1.0-SNAPSHOT druid-merger druid-merger - - scm:git:ssh://git@github.com/metamx/druid.git - scm:git:ssh://git@github.com/metamx/druid.git - http://www.github.com/metamx/druid - com.metamx @@ -77,18 +71,7 @@ - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins maven-shade-plugin - 1.6 package @@ -103,21 +86,6 @@ - - org.apache.maven.plugins - maven-help-plugin - 2.1.1 - - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - diff --git a/pom.xml b/pom.xml index f1ebad70e01..957687dcaee 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,8 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - + 4.0.0 com.metamx druid @@ -32,6 +33,10 @@ http://www.github.com/metamx/druid + + 2.2.1 + + UTF-8 @@ -48,27 +53,77 @@ - - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - - + + + + maven-clean-plugin + 2.5 + + + maven-compiler-plugin + 2.5.1 + + 1.6 + 1.6 + + + + maven-dependency-plugin + 2.5 + + + maven-deploy-plugin + 2.7 + + + maven-help-plugin + 2.1.1 + + + maven-install-plugin + 2.3.1 + + + maven-jar-plugin + 2.4 + + + maven-resources-plugin + 2.5 + + + maven-shade-plugin + 1.7.1 + + + maven-site-plugin + 3.1 + + + maven-surefire-plugin + 2.12.2 + + + UTC + + + + + org.scala-tools + maven-scala-plugin + 2.15.2 + + + - - pub-libs - pub-libs-local - https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local - - + + pub-libs + pub-libs-local + https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local + + repo.codahale.com http://repo.codahale.com @@ -77,9 +132,9 @@ http://nativelibs4java.sourceforge.net/maven - thirdparty-uploads - JBoss Thirdparty Uploads - https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads + thirdparty-uploads + JBoss Thirdparty Uploads + https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads diff --git a/realtime/pom.xml b/realtime/pom.xml index a39774c1eb7..874a8f12d92 100644 --- a/realtime/pom.xml +++ b/realtime/pom.xml @@ -22,14 +22,8 @@ 4.0.0 com.metamx.druid druid-realtime - 0.1.0-SNAPSHOT druid-realtime druid-realtime - - scm:git:ssh://git@github.com/metamx/druid.git - scm:git:ssh://git@github.com/metamx/druid.git - http://www.github.com/metamx/druid - com.metamx @@ -139,18 +133,7 @@ - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins maven-shade-plugin - 1.6 package @@ -165,20 +148,9 @@ - - org.apache.maven.plugins - maven-dependency-plugin - 2.2 - - - org.apache.maven.plugins - maven-help-plugin - 2.1.1 - org.scala-tools maven-scala-plugin - 2.15.2 -unchecked @@ -208,16 +180,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - diff --git a/server/pom.xml b/server/pom.xml index 6097075e85d..050be3a21de 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -22,14 +22,8 @@ 4.0.0 com.metamx.druid druid-server - 0.1.0-SNAPSHOT druid-server druid-server - - scm:git:ssh://git@github.com/metamx/druid.git - scm:git:ssh://git@github.com/metamx/druid.git - http://www.github.com/metamx/druid - com.metamx @@ -178,18 +172,7 @@ - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins maven-shade-plugin - 1.6 package @@ -204,31 +187,8 @@ - - org.apache.maven.plugins - maven-dependency-plugin - 2.2 - - - org.apache.maven.plugins - maven-help-plugin - 2.1.1 - - - org.apache.maven.plugins - maven-surefire-plugin - 2.7.2 - - - UTC - - - - - org.apache.maven.plugins maven-jar-plugin - 2.4 From e7ec073d7562fff9da6bb7472810920ba19af6c1 Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Wed, 31 Oct 2012 16:10:07 -0700 Subject: [PATCH 07/13] Cleaned Maven dependency configuration. In particular the 'mvn dependency:analyze' report no longer warns of used but undeclared dependencies. --- client/pom.xml | 188 +++++++++++++++++++-------------- common/pom.xml | 115 ++++++++++----------- examples/rand/pom.xml | 163 ++++++++++++++--------------- examples/twitter/pom.xml | 192 +++++++++++++++++----------------- index-common/pom.xml | 30 +++++- indexer/pom.xml | 47 ++++++++- merger/pom.xml | 118 ++++++++++++++++++++- pom.xml | 218 +++++++++++++++++++++++++++++++++++++++ realtime/pom.xml | 93 ++++++++++++++--- server/pom.xml | 167 +++++++++++++++++++----------- 10 files changed, 921 insertions(+), 410 deletions(-) diff --git a/client/pom.xml b/client/pom.xml index f5b3ffaef08..333b98689c1 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -18,7 +18,8 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - + 4.0.0 com.metamx.druid druid-client @@ -45,112 +46,141 @@ com.metamx - http-client - 0.6.1 + emitter com.metamx - emitter - 0.0.7 - - - - org.mortbay.jetty - jetty - 6.1.26 + http-client - com.google.inject - guice - 3.0 - - - com.google.guava - guava - 11.0.1 - - - com.sun.jersey - jersey-server - 1.9.1 - - - com.sun.jersey - jersey-core - 1.9.1 - - - com.sun.jersey.contribs - jersey-guice - 1.9.1 - - - com.google.inject.extensions - guice-servlet - 3.0 - - - org.codehaus.jackson - jackson-jaxrs - 1.9.9 - - - org.codehaus.jackson - jackson-smile - 1.9.9 - - - log4j - log4j - 1.2.16 - - - org.slf4j - slf4j-log4j12 - 1.6.2 - - - com.github.sgroschupf - zkclient - 0.1 - - - commons-codec - commons-codec - 1.3 - - - org.skife.config - config-magic - 0.9 + com.metamx + java-util com.metamx server-metrics - 0.0.2 + com.davekoelle alphanum - 1.0.3 + + + commons-codec + commons-codec + + + org.skife.config + config-magic + + + com.netflix.curator + curator-client + + + com.netflix.curator + curator-framework + + + com.netflix.curator + curator-x-discovery + + + org.mortbay.jetty + jetty + + + org.mortbay.jetty + jetty-util + 6.1.26 + + + com.google.guava + guava + + + com.google.inject + guice com.ibm.icu icu4j - 4.8.1 + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-jaxrs + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-smile + + + javax.inject + javax.inject + + + com.sun.jersey + jersey-server + + + com.sun.jersey + jersey-core + + + com.sun.jersey.contribs + jersey-guice + + + joda-time + joda-time + + + com.google.code.findbugs + jsr305 + + + com.google.inject.extensions + guice-servlet + + + log4j + log4j + + + org.jboss.netty + netty + 3.2.4.Final + + + org.mortbay.jetty + servlet-api + + + org.slf4j + slf4j-log4j12 + + + com.github.sgroschupf + zkclient junit junit - 4.8.1 test org.easymock easymock - 3.0 test diff --git a/common/pom.xml b/common/pom.xml index 801d005fabc..5539f1298be 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -18,7 +18,8 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - + 4.0.0 com.metamx.druid druid-common @@ -31,66 +32,15 @@ 0.1.0-SNAPSHOT - - 0.16.0 - - com.metamx java-util - ${metamx.java-util.version} - - - joda-time - joda-time - 1.6 - - - com.google.guava - guava - 11.0.1 - - - log4j - log4j - 1.2.16 - - - commons-codec - commons-codec - 1.3 - org.codehaus.jackson - jackson-core-asl - 1.9.9 - - - org.codehaus.jackson - jackson-mapper-asl - 1.9.9 - - - it.uniroma3.mat - extendedset - 1.3.2 - - - mysql - mysql-connector-java - 5.1.18 - - - org.jdbi - jdbi - 2.32 - - - commons-pool - commons-pool - 1.6 + commons-codec + commons-codec commons-dbcp @@ -98,38 +48,79 @@ 1.4 - org.mozilla - rhino - 1.7R4 + commons-pool + commons-pool + 1.6 + + + org.skife.config + config-magic com.netflix.curator curator-recipes - 1.2.2 com.netflix.curator curator-x-discovery - 1.2.2 + + + it.uniroma3.mat + extendedset + + + com.google.guava + guava + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-mapper-asl + + + org.jdbi + jdbi + + + joda-time + joda-time + + + com.google.code.findbugs + jsr305 + + + log4j + log4j + + + mysql + mysql-connector-java + 5.1.18 + + + org.mozilla + rhino + 1.7R4 junit junit - 4.8.1 test org.easymock easymock - 3.0 test com.metamx java-util - ${metamx.java-util.version} test-jar test diff --git a/examples/rand/pom.xml b/examples/rand/pom.xml index 379204d38b7..1eae59a2ced 100644 --- a/examples/rand/pom.xml +++ b/examples/rand/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.metamx.druid druid-examples-rand @@ -31,117 +32,111 @@ com.metamx - http-client - 0.6.1 + emitter com.metamx - emitter - 0.0.7 - - - - org.mortbay.jetty - jetty - 6.1.26 + http-client - joda-time - joda-time - 2.1 - - - com.google.inject - guice - 3.0 - - - com.google.guava - guava - 11.0.1 - - - com.sun.jersey - jersey-server - 1.9.1 - - - com.sun.jersey - jersey-core - 1.9.1 - - - com.sun.jersey.contribs - jersey-guice - 1.9.1 - - - com.google.inject.extensions - guice-servlet - 3.0 - - - org.codehaus.jackson - jackson-jaxrs - 1.9.9 - - - org.codehaus.jackson - jackson-smile - 1.9.9 - - - log4j - log4j - 1.2.16 - - - org.slf4j - slf4j-log4j12 - 1.6.2 - - - com.github.sgroschupf - zkclient - 0.1 - - - commons-codec - commons-codec - 1.3 - - - org.skife.config - config-magic - 0.9 + com.metamx + java-util com.metamx server-metrics - 0.0.2 + com.davekoelle alphanum - 1.0.3 + + + commons-codec + commons-codec + + + org.skife.config + config-magic + + + com.google.guava + guava + + + com.google.inject + guice + + + com.google.inject.extensions + guice-servlet com.ibm.icu icu4j - 4.8.1 + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-jaxrs + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-smile + + + org.jdbi + jdbi + + + com.sun.jersey + jersey-core + + + com.sun.jersey.contribs + jersey-guice + + + com.sun.jersey + jersey-server + + + org.mortbay.jetty + jetty + + + joda-time + joda-time + + + log4j + log4j + + + org.slf4j + slf4j-log4j12 + + + com.github.sgroschupf + zkclient junit junit - 4.8.1 test org.easymock easymock - 3.0 test diff --git a/examples/twitter/pom.xml b/examples/twitter/pom.xml index a0e930229c4..d6d7cb89f91 100644 --- a/examples/twitter/pom.xml +++ b/examples/twitter/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.metamx.druid druid-examples-twitter @@ -31,20 +32,102 @@ com.metamx - http-client - 0.6.1 + emitter com.metamx - emitter - 0.0.7 + http-client + + + com.metamx + java-util + + + com.metamx + server-metrics - - org.twitter4j - twitter4j-core - 2.2.6 - + + com.davekoelle + alphanum + + + commons-codec + commons-codec + + + org.skife.config + config-magic + + + com.google.guava + guava + + + com.google.inject + guice + + + com.google.inject.extensions + guice-servlet + + + com.ibm.icu + icu4j + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-jaxrs + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-smile + + + org.jdbi + jdbi + + + com.sun.jersey + jersey-server + + + com.sun.jersey + jersey-core + + + com.sun.jersey.contribs + jersey-guice + + + org.mortbay.jetty + jetty + + + joda-time + joda-time + + + log4j + log4j + + + org.slf4j + slf4j-log4j12 + + + org.twitter4j + twitter4j-core + 2.2.6 + org.twitter4j twitter4j-async @@ -55,109 +138,20 @@ twitter4j-stream 2.2.6 - - - org.mortbay.jetty - jetty - 6.1.26 - - - joda-time - joda-time - 2.1 - - - com.google.inject - guice - 3.0 - - - com.google.guava - guava - 11.0.1 - - - com.sun.jersey - jersey-server - 1.9.1 - - - com.sun.jersey - jersey-core - 1.9.1 - - - com.sun.jersey.contribs - jersey-guice - 1.9.1 - - - com.google.inject.extensions - guice-servlet - 3.0 - - - org.codehaus.jackson - jackson-jaxrs - 1.9.9 - - - org.codehaus.jackson - jackson-smile - 1.9.9 - - - log4j - log4j - 1.2.16 - - - org.slf4j - slf4j-log4j12 - 1.6.2 - com.github.sgroschupf zkclient - 0.1 - - - commons-codec - commons-codec - 1.3 - - - org.skife.config - config-magic - 0.9 - - - com.metamx - server-metrics - 0.0.2 - - - com.davekoelle - alphanum - 1.0.3 - - - com.ibm.icu - icu4j - 4.8.1 junit junit - 4.8.1 test org.easymock easymock - 3.0 test diff --git a/index-common/pom.xml b/index-common/pom.xml index 651248848be..c204ac4b2a7 100644 --- a/index-common/pom.xml +++ b/index-common/pom.xml @@ -38,23 +38,45 @@ druid-common ${project.parent.version} + + + com.metamx + java-util + + com.ning compress-lzf - 0.8.4 + + + it.uniroma3.mat + extendedset + + + org.codehaus.jackson + jackson-core-asl net.java.dev.jets3t jets3t - 0.8.1 - + + joda-time + joda-time + + + com.google.code.findbugs + jsr305 + + + com.google.guava + guava + junit junit - 4.8.1 test diff --git a/indexer/pom.xml b/indexer/pom.xml index 1b45e48d946..c70c9fcf041 100644 --- a/indexer/pom.xml +++ b/indexer/pom.xml @@ -18,7 +18,8 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - + 4.0.0 com.metamx.druid druid-indexer @@ -44,10 +45,10 @@ - org.apache.hadoop - hadoop-core - 0.20.2 + com.metamx + java-util + com.amazonaws aws-java-sdk @@ -59,12 +60,48 @@ + + commons-io + commons-io + + + com.google.guava + guava + + + org.apache.hadoop + hadoop-core + 0.20.2 + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-mapper-asl + + + org.jdbi + jdbi + + + joda-time + joda-time + + + com.google.code.findbugs + jsr305 + + + com.github.sgroschupf + zkclient + junit junit - 4.8.1 test diff --git a/merger/pom.xml b/merger/pom.xml index 6b84d6a239a..e5fc6f99f69 100644 --- a/merger/pom.xml +++ b/merger/pom.xml @@ -18,7 +18,8 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - + 4.0.0 com.metamx.druid druid-merger @@ -32,6 +33,11 @@ + + com.metamx.druid + druid-common + ${project.parent.version} + com.metamx.druid druid-server @@ -42,6 +48,11 @@ druid-client ${project.parent.version} + + com.metamx.druid + druid-index-common + ${project.parent.version} + com.metamx.druid druid-indexer @@ -53,17 +64,118 @@ ${project.parent.version} + + com.metamx + emitter + + + com.metamx + http-client + + + com.metamx + java-util + + + com.metamx + server-metrics + + + + commons-codec + commons-codec + + + commons-io + commons-io + + + org.skife.config + config-magic + + + com.netflix.curator + curator-framework + + + com.netflix.curator + curator-recipes + + + com.google.guava + guava + + + com.google.inject + guice + + + com.google.inject.extensions + guice-servlet + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-jaxrs + + + org.codehaus.jackson + jackson-mapper-asl + + + javax.inject + javax.inject + + + org.jdbi + jdbi + + + com.sun.jersey + jersey-core + + + com.sun.jersey.contribs + jersey-guice + + + net.java.dev.jets3t + jets3t + + + org.mortbay.jetty + jetty + + + joda-time + joda-time + + + com.google.code.findbugs + jsr305 + + + com.github.sgroschupf + zkclient + + + org.apache.zookeeper + zookeeper + 3.4.3 + + junit junit - 4.8.1 test org.easymock easymock - 3.0 test diff --git a/pom.xml b/pom.xml index 957687dcaee..35ecc263c9a 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,224 @@ examples + + + + + com.metamx + emitter + 0.0.7 + + + com.metamx + http-client + 0.6.1 + + + com.metamx + java-util + 0.16.0 + + + com.metamx + server-metrics + 0.0.2 + + + + com.davekoelle + alphanum + 1.0.3 + + + commons-codec + commons-codec + 1.3 + + + commons-httpclient + commons-httpclient + 3.1 + + + commons-io + commons-io + 2.0.1 + + + commons-logging + commons-logging + 1.1.1 + + + com.ning + compress-lzf + 0.8.4 + + + org.skife.config + config-magic + 0.9 + + + com.netflix.curator + curator-client + 1.2.2 + + + com.netflix.curator + curator-framework + 1.2.2 + + + com.netflix.curator + curator-recipes + 1.2.2 + + + com.netflix.curator + curator-x-discovery + 1.2.2 + + + it.uniroma3.mat + extendedset + 1.3.2 + + + com.google.guava + guava + 11.0.1 + + + com.google.inject + guice + 3.0 + + + com.google.inject.extensions + guice-servlet + 3.0 + + + com.ibm.icu + icu4j + 4.8.1 + + + org.codehaus.jackson + jackson-core-asl + 1.9.9 + + + org.codehaus.jackson + jackson-jaxrs + 1.9.9 + + + org.codehaus.jackson + jackson-mapper-asl + 1.9.9 + + + org.codehaus.jackson + jackson-smile + 1.9.9 + + + javax.inject + javax.inject + 1 + + + com.jamesmurty.utils + java-xmlbuilder + 0.4 + + + org.jdbi + jdbi + 2.32 + + + com.sun.jersey + jersey-core + 1.9.1 + + + com.sun.jersey.contribs + jersey-guice + 1.9.1 + + + com.sun.jersey + jersey-server + 1.9.1 + + + net.java.dev.jets3t + jets3t + 0.8.1 + + + org.mortbay.jetty + jetty + 6.1.26 + + + joda-time + joda-time + 2.1 + + + com.google.code.findbugs + jsr305 + 2.0.1 + + + log4j + log4j + 1.2.16 + + + org.mortbay.jetty + servlet-api + 2.5-20081211 + + + org.slf4j + slf4j-log4j12 + 1.6.2 + + + com.github.sgroschupf + zkclient + 0.1 + + + + + com.metamx + java-util + test-jar + test + 0.16.0 + + + + org.easymock + easymock + 3.0 + test + + + junit + junit + 4.8.1 + test + + + diff --git a/realtime/pom.xml b/realtime/pom.xml index 874a8f12d92..0356a4a04f6 100644 --- a/realtime/pom.xml +++ b/realtime/pom.xml @@ -18,7 +18,8 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - + 4.0.0 com.metamx.druid druid-realtime @@ -46,15 +47,72 @@ druid-client ${project.parent.version} + - org.scala-lang - scala-library - ${scala.version} + com.metamx + emitter - org.scala-lang - scala-compiler - ${scala.version} + com.metamx + http-client + + + com.metamx + java-util + + + com.metamx + server-metrics + + + + org.apache.directory.studio + org.apache.commons.collections + 3.2.1 + + + commons-io + commons-io + + + org.skife.config + config-magic + + + com.google.guava + guava + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-smile + + + org.jdbi + jdbi + + + net.java.dev.jets3t + jets3t + + + org.mortbay.jetty + jetty + + + joda-time + joda-time + + + com.google.code.findbugs + jsr305 kafka @@ -68,9 +126,18 @@ - org.apache.directory.studio - org.apache.commons.collections - 3.2.1 + org.scala-lang + scala-library + ${scala.version} + + + org.scala-lang + scala-compiler + ${scala.version} + + + com.github.sgroschupf + zkclient @@ -84,25 +151,21 @@ commons-codec commons-codec - 1.3 true commons-logging commons-logging - 1.1.1 true commons-httpclient commons-httpclient - 3.1 true com.jamesmurty.utils java-xmlbuilder - 0.4 true @@ -111,13 +174,11 @@ junit junit - 4.8.1 test org.easymock easymock - 3.0 test diff --git a/server/pom.xml b/server/pom.xml index 050be3a21de..18125b45cf5 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -18,7 +18,8 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> - + 4.0.0 com.metamx.druid druid-server @@ -44,9 +45,26 @@ - org.mortbay.jetty - jetty - 6.1.26 + com.metamx + emitter + + + com.metamx + http-client + + + com.metamx + java-util + + + com.metamx + server-metrics + + + + commons-cli + commons-cli + 1.2 commons-lang @@ -56,92 +74,127 @@ commons-io commons-io - 2.0.1 - - - com.google.inject - guice - 3.0 - - - com.google.guava - guava - 11.0.1 - - - log4j - log4j - 1.2.16 - - - org.slf4j - slf4j-log4j12 - 1.6.2 - - - commons-cli - commons-cli - 1.2 - - - com.github.sgroschupf - zkclient - 0.1 com.ning compress-lzf - 0.8.4 - com.sun.jersey - jersey-server - 1.9.1 + org.skife.config + config-magic - com.sun.jersey - jersey-core - 1.9.1 + com.netflix.curator + curator-framework - com.sun.jersey.contribs - jersey-guice - 1.9.1 + com.netflix.curator + curator-x-discovery + + + it.uniroma3.mat + extendedset + + + com.google.guava + guava + + + com.google.inject + guice com.google.inject.extensions guice-servlet - 3.0 + + + org.codehaus.jackson + jackson-core-asl org.codehaus.jackson jackson-jaxrs - 1.9.6 + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-smile + + + javax.inject + javax.inject + + + org.jdbi + jdbi + + + com.sun.jersey + jersey-server + + + com.sun.jersey + jersey-core + + + com.sun.jersey.contribs + jersey-guice + + + net.java.dev.jets3t + jets3t + + + org.mortbay.jetty + jetty + + + joda-time + joda-time + + + com.google.code.findbugs + jsr305 + + + log4j + log4j + + + org.mortbay.jetty + servlet-api + + + org.slf4j + slf4j-log4j12 + + + com.github.sgroschupf + zkclient commons-codec commons-codec - 1.3 true commons-logging commons-logging - 1.1.1 true commons-httpclient commons-httpclient - 3.1 true com.jamesmurty.utils java-xmlbuilder - 0.4 true @@ -150,21 +203,19 @@ junit junit - 4.8.1 test org.easymock easymock - 3.0 test - com.metamx.druid - druid-client - ${project.parent.version} - test-jar - test + com.metamx.druid + druid-client + ${project.parent.version} + test-jar + test From 8dd6f5c059ae895aa6ad1ba8f02c66951fbad1f8 Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Thu, 1 Nov 2012 18:20:38 -0500 Subject: [PATCH 08/13] 1) Refactor the BrokerMain into a BrokerMain and a BrokerNode to allow for extensions 2) Rename ServerMain to ComputeMain 3) Refactor ComputeMain to ComputeMain and ComputeNode to allow for extensions 4) Remove "TheSizeAdjuster", was old legacy stuff that's not relevant anymore 5) Fix bug with registering different IndexIO handlers 6) Adjust it so that when a query type is unknown, it returns an error message instead of just emitting an alert and returning nothing 7) Create super classes for the various *Node classes that allow for code sharing on pieces that are common --- .../main/java/com/metamx/druid/BaseNode.java | 413 ++++++++++++++++++ ...eServerView.java => BrokerServerView.java} | 6 +- .../com/metamx/druid/client/ClientConfig.java | 23 +- .../com/metamx/druid/http/BrokerMain.java | 164 +------ .../com/metamx/druid/http/BrokerNode.java | 322 ++++++++++++++ .../druid/initialization/Initialization.java | 18 +- .../com/metamx/druid/index/v1/IndexIO.java | 2 +- .../v1/serde/ComplexMetricRegistererer.java | 15 +- .../http/IndexerCoordinatorNode.java | 6 +- .../druid/merger/worker/http/WorkerNode.java | 6 +- .../metamx/druid/realtime/RealtimeNode.java | 332 +++++--------- .../java/com/metamx/druid/BaseServerNode.java | 124 ++++++ .../druid/coordination/ServerManager.java | 37 +- .../coordination/legacy/S3SizeLookup.java | 69 --- .../coordination/legacy/TheSizeAdjuster.java | 107 ----- .../SizeLookup.java => http/ComputeMain.java} | 31 +- .../com/metamx/druid/http/ComputeNode.java | 236 ++++++++++ .../com/metamx/druid/http/MasterMain.java | 41 +- .../com/metamx/druid/http/ServerMain.java | 200 +-------- .../com/metamx/druid/master/DruidMaster.java | 15 +- .../metamx/druid/master/DruidMasterTest.java | 6 - 21 files changed, 1331 insertions(+), 842 deletions(-) create mode 100644 client/src/main/java/com/metamx/druid/BaseNode.java rename client/src/main/java/com/metamx/druid/client/{ClientSideServerView.java => BrokerServerView.java} (98%) create mode 100644 client/src/main/java/com/metamx/druid/http/BrokerNode.java rename server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjusterConfig.java => index-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricRegistererer.java (58%) create mode 100644 server/src/main/java/com/metamx/druid/BaseServerNode.java delete mode 100644 server/src/main/java/com/metamx/druid/coordination/legacy/S3SizeLookup.java delete mode 100644 server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjuster.java rename server/src/main/java/com/metamx/druid/{coordination/legacy/SizeLookup.java => http/ComputeMain.java} (55%) create mode 100644 server/src/main/java/com/metamx/druid/http/ComputeNode.java diff --git a/client/src/main/java/com/metamx/druid/BaseNode.java b/client/src/main/java/com/metamx/druid/BaseNode.java new file mode 100644 index 00000000000..7e75ea38347 --- /dev/null +++ b/client/src/main/java/com/metamx/druid/BaseNode.java @@ -0,0 +1,413 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package com.metamx.druid; + +import com.google.common.base.Preconditions; +import com.google.common.base.Throwables; +import com.google.common.collect.Lists; +import com.metamx.common.ISE; +import com.metamx.common.concurrent.ScheduledExecutorFactory; +import com.metamx.common.concurrent.ScheduledExecutors; +import com.metamx.common.lifecycle.Lifecycle; +import com.metamx.common.lifecycle.LifecycleStart; +import com.metamx.common.lifecycle.LifecycleStop; +import com.metamx.common.logger.Logger; +import com.metamx.druid.http.RequestLogger; +import com.metamx.druid.index.v1.serde.ComplexMetricRegistererer; +import com.metamx.druid.initialization.Initialization; +import com.metamx.druid.initialization.ServerConfig; +import com.metamx.druid.initialization.ZkClientConfig; +import com.metamx.druid.utils.PropUtils; +import com.metamx.emitter.EmittingLogger; +import com.metamx.emitter.core.Emitters; +import com.metamx.emitter.service.ServiceEmitter; +import com.metamx.http.client.HttpClient; +import com.metamx.http.client.HttpClientConfig; +import com.metamx.http.client.HttpClientInit; +import com.metamx.metrics.JvmMonitor; +import com.metamx.metrics.Monitor; +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.map.jsontype.NamedType; +import org.codehaus.jackson.smile.SmileFactory; +import org.mortbay.jetty.Server; +import org.skife.config.ConfigurationObjectFactory; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.util.List; +import java.util.Properties; +import java.util.concurrent.ScheduledExecutorService; + +/** + */ +public abstract class BaseNode +{ + private final Logger log; + + private final Lifecycle lifecycle; + private final ObjectMapper jsonMapper; + private final ObjectMapper smileMapper; + private final Properties props; + private final ConfigurationObjectFactory configFactory; + + private PhoneBook phoneBook = null; + private ServiceEmitter emitter = null; + private List monitors = null; + private Server server = null; + private ZkClient zkClient; + private ScheduledExecutorFactory scheduledExecutorFactory; + private RequestLogger requestLogger; + + private boolean initialized = false; + + public BaseNode( + Logger log, + Properties props, + Lifecycle lifecycle, + ObjectMapper jsonMapper, + ObjectMapper smileMapper, + ConfigurationObjectFactory configFactory + ) + { + this.log = log; + this.configFactory = configFactory; + this.props = props; + this.jsonMapper = jsonMapper; + this.lifecycle = lifecycle; + this.smileMapper = smileMapper; + + Preconditions.checkNotNull(props, "props"); + Preconditions.checkNotNull(lifecycle, "lifecycle"); + Preconditions.checkNotNull(jsonMapper, "jsonMapper"); + Preconditions.checkNotNull(smileMapper, "smileMapper"); + Preconditions.checkNotNull(configFactory, "configFactory"); + + Preconditions.checkState(smileMapper.getJsonFactory() instanceof SmileFactory, "smileMapper should use smile."); + } + + @SuppressWarnings("unchecked") + public T setZkClient(ZkClient zkClient) + { + checkFieldNotSetAndSet("zkClient", zkClient); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T setPhoneBook(PhoneBook phoneBook) + { + checkFieldNotSetAndSet("phoneBook", phoneBook); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T setEmitter(ServiceEmitter emitter) + { + checkFieldNotSetAndSet("emitter", emitter); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T setMonitors(List monitors) + { + checkFieldNotSetAndSet("monitors", monitors); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T setServer(Server server) + { + checkFieldNotSetAndSet("server", server); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T setScheduledExecutorFactory(ScheduledExecutorFactory factory) + { + checkFieldNotSetAndSet("scheduledExecutorFactory", factory); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T setRequestLogger(RequestLogger requestLogger) + { + checkFieldNotSetAndSet("requestLogger", requestLogger); + return (T) this; + } + + + @SuppressWarnings("unchecked") + public T registerJacksonSubtype(Class... clazzes) + { + jsonMapper.registerSubtypes(clazzes); + smileMapper.registerSubtypes(clazzes); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T registerJacksonSubtype(NamedType... namedTypes) + { + jsonMapper.registerSubtypes(namedTypes); + smileMapper.registerSubtypes(namedTypes); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T registerComplexMetric(ComplexMetricRegistererer registererer) + { + registererer.register(); + return (T) this; + } + + public Lifecycle getLifecycle() + { + return lifecycle; + } + + public ObjectMapper getJsonMapper() + { + return jsonMapper; + } + + public ObjectMapper getSmileMapper() + { + return smileMapper; + } + + public Properties getProps() + { + return props; + } + + public ConfigurationObjectFactory getConfigFactory() + { + return configFactory; + } + + public ZkClient getZkClient() + { + initializeZkClient(); + return zkClient; + } + + public PhoneBook getPhoneBook() + { + initializePhoneBook(); + return phoneBook; + } + + public ServiceEmitter getEmitter() + { + initializeEmitter(); + return emitter; + } + + public List getMonitors() + { + initializeMonitors(); + return monitors; + } + + public Server getServer() + { + initializeServer(); + return server; + } + + public ScheduledExecutorFactory getScheduledExecutorFactory() + { + initializeScheduledExecutorFactory(); + return scheduledExecutorFactory; + } + + public RequestLogger getRequestLogger() + { + initializeRequestLogger(); + return requestLogger; + } + + private void initializeRequestLogger() + { + if (requestLogger == null) { + try { + setRequestLogger(Initialization.makeRequestLogger(getScheduledExecutorFactory(), getProps())); + } + catch (IOException e) { + throw Throwables.propagate(e); + } + lifecycle.addManagedInstance(requestLogger); + } + } + + private void initializeScheduledExecutorFactory() + { + if (scheduledExecutorFactory == null) { + setScheduledExecutorFactory(ScheduledExecutors.createFactory(getLifecycle())); + } + } + + private void initializeZkClient() + { + if (zkClient == null) { + setZkClient(Initialization.makeZkClient(configFactory.build(ZkClientConfig.class), lifecycle)); + } + } + + private void initializePhoneBook() + { + if (phoneBook == null) { + setPhoneBook( + Initialization.createPhoneBook( + jsonMapper, + getZkClient(), + "PhoneBook--%s", + lifecycle + ) + ); + } + } + + private void initializeServer() + { + if (server == null) { + setServer(Initialization.makeJettyServer(configFactory.build(ServerConfig.class))); + + lifecycle.addHandler( + new Lifecycle.Handler() + { + @Override + public void start() throws Exception + { + log.info("Starting Jetty"); + server.start(); + } + + @Override + public void stop() + { + log.info("Stopping Jetty"); + try { + server.stop(); + } + catch (Exception e) { + log.error(e, "Exception thrown while stopping Jetty"); + } + } + } + ); + } + } + + private void initializeMonitors() + { + if (monitors == null) { + List theMonitors = Lists.newArrayList(); + theMonitors.add(new JvmMonitor()); + if (Boolean.parseBoolean(props.getProperty("druid.monitoring.monitorSystem", "false"))) { + theMonitors.add(new SysMonitor()); + } + + setMonitors(theMonitors); + } + } + + private void initializeEmitter() + { + if (emitter == null) { + final HttpClient httpClient = HttpClientInit.createClient( + HttpClientConfig.builder().withNumConnections(1).build(), lifecycle + ); + + setEmitter( + new ServiceEmitter( + PropUtils.getProperty(props, "druid.service"), + PropUtils.getProperty(props, "druid.host"), + Emitters.create(props, httpClient, jsonMapper, lifecycle) + ) + ); + } + EmittingLogger.registerEmitter(emitter); + } + + protected void init() throws Exception + { + doInit(); + initialized = true; + } + + protected abstract void doInit() throws Exception; + + @LifecycleStart + public synchronized void start() throws Exception + { + if (! initialized) { + init(); + } + + lifecycle.start(); + } + + @LifecycleStop + public synchronized void stop() + { + lifecycle.stop(); + } + + protected ScheduledExecutorService startMonitoring(List monitors) + { + final ScheduledExecutorService globalScheduledExec = getScheduledExecutorFactory().create(1, "Global--%d"); + final MonitorScheduler monitorScheduler = new MonitorScheduler( + getConfigFactory().build(MonitorSchedulerConfig.class), + globalScheduledExec, + getEmitter(), + monitors + ); + getLifecycle().addManagedInstance(monitorScheduler); + return globalScheduledExec; + } + + protected void checkFieldNotSetAndSet(String fieldName, Object value) + { + Class theClazz = this.getClass(); + while (theClazz != null && theClazz != Object.class) { + try { + final Field field = theClazz.getDeclaredField(fieldName); + field.setAccessible(true); + Preconditions.checkState(field.get(this) == null, "Cannot set %s once it has already been set.", fieldName); + + field.set(this, value); + return; + } + catch (NoSuchFieldException e) { + // Perhaps it is inherited? + theClazz = theClazz.getSuperclass(); + } + catch (IllegalAccessException e) { + throw Throwables.propagate(e); + } + } + + throw new ISE("Unknown field[%s] on class[%s]", fieldName, this.getClass()); + } +} diff --git a/client/src/main/java/com/metamx/druid/client/ClientSideServerView.java b/client/src/main/java/com/metamx/druid/client/BrokerServerView.java similarity index 98% rename from client/src/main/java/com/metamx/druid/client/ClientSideServerView.java rename to client/src/main/java/com/metamx/druid/client/BrokerServerView.java index aa5aba6fc62..197f69a7765 100644 --- a/client/src/main/java/com/metamx/druid/client/ClientSideServerView.java +++ b/client/src/main/java/com/metamx/druid/client/BrokerServerView.java @@ -40,9 +40,9 @@ import com.metamx.http.client.HttpClient; /** */ -public class ClientSideServerView implements MutableServerView +public class BrokerServerView implements MutableServerView { - private static final Logger log = new Logger(ClientSideServerView.class); + private static final Logger log = new Logger(BrokerServerView.class); private final Object lock = new Object(); @@ -55,7 +55,7 @@ public class ClientSideServerView implements MutableServerView private final ObjectMapper smileMapper; private final HttpClient httpClient; - public ClientSideServerView( + public BrokerServerView( QueryToolChestWarehouse warehose, ObjectMapper smileMapper, HttpClient httpClient diff --git a/client/src/main/java/com/metamx/druid/client/ClientConfig.java b/client/src/main/java/com/metamx/druid/client/ClientConfig.java index c04921f6d1c..1ba5240f542 100644 --- a/client/src/main/java/com/metamx/druid/client/ClientConfig.java +++ b/client/src/main/java/com/metamx/druid/client/ClientConfig.java @@ -23,19 +23,18 @@ import org.skife.config.Config; /** */ -public abstract class ClientConfig +public abstract class ClientConfig extends InventoryManagerConfig { - @Config("druid.zk.paths.announcementsPath") - public abstract String getAnnouncementsPath(); - - @Config("druid.zk.paths.servedSegmentsPath") - public abstract String getServedSegmentsPath(); - - public InventoryManagerConfig getClientInventoryManagerConfig() + public ClientConfig() { - return new InventoryManagerConfig( - getAnnouncementsPath(), - getServedSegmentsPath() - ); + super(null, null); } + + @Override + @Config("druid.zk.paths.announcementsPath") + public abstract String getInventoryIdPath(); + + @Override + @Config("druid.zk.paths.servedSegmentsPath") + public abstract String getInventoryPath(); } 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 e583393891f..a1856552a1f 100644 --- a/client/src/main/java/com/metamx/druid/http/BrokerMain.java +++ b/client/src/main/java/com/metamx/druid/http/BrokerMain.java @@ -19,56 +19,9 @@ 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; -import com.google.inject.Injector; -import com.google.inject.servlet.GuiceFilter; -import com.metamx.common.concurrent.ScheduledExecutorFactory; -import com.metamx.common.concurrent.ScheduledExecutors; -import com.metamx.common.config.Config; import com.metamx.common.lifecycle.Lifecycle; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.CachingClusteredClient; -import com.metamx.druid.client.ClientConfig; -import com.metamx.druid.client.ClientInventoryManager; -import com.metamx.druid.client.ClientSideServerView; -import com.metamx.druid.client.cache.CacheBroker; -import com.metamx.druid.client.cache.CacheMonitor; -import com.metamx.druid.client.cache.MapCacheBroker; -import com.metamx.druid.client.cache.MapCacheBrokerConfig; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.ServerConfig; -import com.metamx.druid.initialization.ServiceDiscoveryConfig; -import com.metamx.druid.initialization.ZkClientConfig; -import com.metamx.druid.jackson.DefaultObjectMapper; import com.metamx.druid.log.LogLevelAdjuster; -import com.metamx.druid.query.QueryToolChestWarehouse; -import com.metamx.druid.query.ReflectionQueryToolChestWarehouse; -import com.metamx.emitter.core.Emitters; -import com.metamx.emitter.service.ServiceEmitter; -import com.metamx.http.client.HttpClient; -import com.metamx.http.client.HttpClientConfig; -import com.metamx.http.client.HttpClientInit; -import com.metamx.metrics.JvmMonitor; -import com.metamx.metrics.Monitor; -import com.metamx.metrics.MonitorScheduler; -import com.metamx.metrics.MonitorSchedulerConfig; -import com.metamx.metrics.SysMonitor; -import com.metamx.phonebook.PhoneBook; -import com.netflix.curator.framework.CuratorFramework; -import com.netflix.curator.x.discovery.ServiceDiscovery; /** */ @@ -81,125 +34,20 @@ public class BrokerMain { LogLevelAdjuster.register(); - final ObjectMapper jsonMapper = new DefaultObjectMapper(); - final ObjectMapper smileMapper = new DefaultObjectMapper(new SmileFactory()); - smileMapper.getJsonFactory().setCodec(smileMapper); + Lifecycle lifecycle = new Lifecycle(); - final Properties props = Initialization.loadProperties(); - final Lifecycle lifecycle = new Lifecycle(); - final ConfigurationObjectFactory configFactory = Config.createFactory(props); - final ZkClient zkClient = Initialization.makeZkClient(configFactory.build(ZkClientConfig.class), lifecycle); - final PhoneBook phoneBook = Initialization.createYellowPages( - jsonMapper, zkClient, "Client-ZKYP--%s", lifecycle + lifecycle.addManagedInstance( + BrokerNode.builder().build() ); - final HttpClient httpClient = HttpClientInit.createClient( - HttpClientConfig.builder() - .withNumConnections( - Integer.parseInt(props.getProperty("druid.client.http.connections")) - ) - .build(), - lifecycle - ); - final HttpClient emitterHttpClient = HttpClientInit.createClient( - HttpClientConfig.builder().withNumConnections(1).build(), lifecycle - ); - final ServiceEmitter emitter = new ServiceEmitter( - props.getProperty("druid.service"), - props.getProperty("druid.host"), - Emitters.create(props, emitterHttpClient, jsonMapper, lifecycle) - ); - - final QueryToolChestWarehouse warehouse = new ReflectionQueryToolChestWarehouse(); - final ClientConfig clientConfig = configFactory.build(ClientConfig.class); - final ClientSideServerView view = new ClientSideServerView(warehouse, smileMapper, httpClient); - final ClientInventoryManager clientInventoryManager = new ClientInventoryManager( - clientConfig.getClientInventoryManagerConfig(), - phoneBook, - view - ); - lifecycle.addManagedInstance(clientInventoryManager); - - final CacheBroker cacheBroker = MapCacheBroker.create( - configFactory.buildWithReplacements(MapCacheBrokerConfig.class, ImmutableMap.of("prefix", "druid.bard.cache")) - ); - final CachingClusteredClient baseClient = new CachingClusteredClient(warehouse, view, cacheBroker, smileMapper); - lifecycle.addManagedInstance(baseClient); - - final ScheduledExecutorFactory scheduledExecutorFactory = ScheduledExecutors.createFactory(lifecycle); - final ScheduledExecutorService globalScheduledExec = scheduledExecutorFactory.create(1, "Global--%d"); - final MonitorScheduler monitorScheduler = new MonitorScheduler( - configFactory.build(MonitorSchedulerConfig.class), - globalScheduledExec, - emitter, - ImmutableList.of( - new JvmMonitor(), - new SysMonitor(), - new CacheMonitor(cacheBroker) - ) - ); - lifecycle.addManagedInstance(monitorScheduler); - - final ServiceDiscoveryConfig serviceDiscoveryConfig = configFactory.build(ServiceDiscoveryConfig.class); - CuratorFramework curatorFramework = Initialization.makeCuratorFrameworkClient( - serviceDiscoveryConfig.getZkHosts(), - lifecycle - ); - - final ServiceDiscovery serviceDiscovery = Initialization.makeServiceDiscoveryClient( - curatorFramework, - configFactory.build(ServiceDiscoveryConfig.class), - lifecycle - ); - - final RequestLogger requestLogger = Initialization.makeRequestLogger( - scheduledExecutorFactory.create( - 1, - "RequestLogger--%d" - ), - props - ); - lifecycle.addManagedInstance(requestLogger); - - final ClientQuerySegmentWalker texasRanger = new ClientQuerySegmentWalker(warehouse, emitter, baseClient); - - final Injector injector = Guice.createInjector(new ClientServletModule(texasRanger, clientInventoryManager, jsonMapper)); - final Server server = Initialization.makeJettyServer(configFactory.build(ServerConfig.class)); - final Context root = new Context(server, "/druid/v2", Context.SESSIONS); - - root.addServlet(new ServletHolder(new StatusServlet()), "/status"); - root.addServlet( - new ServletHolder(new QueryServlet(jsonMapper, smileMapper, texasRanger, emitter, requestLogger)), - "/*" - ); - - root.addEventListener(new GuiceServletConfig(injector)); - root.addFilter(GuiceFilter.class, "/heatmap/*", 0); - root.addFilter(GuiceFilter.class, "/datasources/*", 0); - try { lifecycle.start(); } catch (Throwable t) { - log.error(t, "Error when starting up. Failing."); - System.exit(1); + log.info(t, "Throwable caught at startup, committing seppuku"); + System.exit(2); } - Runtime.getRuntime().addShutdownHook( - new Thread( - new Runnable() - { - @Override - public void run() - { - log.info("Running shutdown hook"); - lifecycle.stop(); - } - } - ) - ); - - server.start(); - server.join(); + lifecycle.join(); } } diff --git a/client/src/main/java/com/metamx/druid/http/BrokerNode.java b/client/src/main/java/com/metamx/druid/http/BrokerNode.java new file mode 100644 index 00000000000..665a2fbd427 --- /dev/null +++ b/client/src/main/java/com/metamx/druid/http/BrokerNode.java @@ -0,0 +1,322 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package com.metamx.druid.http; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Module; +import com.google.inject.servlet.GuiceFilter; +import com.metamx.common.ISE; +import com.metamx.common.config.Config; +import com.metamx.common.lifecycle.Lifecycle; +import com.metamx.common.logger.Logger; +import com.metamx.druid.BaseNode; +import com.metamx.druid.client.BrokerServerView; +import com.metamx.druid.client.CachingClusteredClient; +import com.metamx.druid.client.ClientConfig; +import com.metamx.druid.client.ClientInventoryManager; +import com.metamx.druid.client.cache.CacheBroker; +import com.metamx.druid.client.cache.CacheMonitor; +import com.metamx.druid.client.cache.MapCacheBroker; +import com.metamx.druid.client.cache.MapCacheBrokerConfig; +import com.metamx.druid.initialization.Initialization; +import com.metamx.druid.initialization.ServiceDiscoveryConfig; +import com.metamx.druid.jackson.DefaultObjectMapper; +import com.metamx.druid.query.QueryToolChestWarehouse; +import com.metamx.druid.query.ReflectionQueryToolChestWarehouse; +import com.metamx.druid.utils.PropUtils; +import com.metamx.http.client.HttpClient; +import com.metamx.http.client.HttpClientConfig; +import com.metamx.http.client.HttpClientInit; +import com.metamx.metrics.Monitor; +import com.netflix.curator.framework.CuratorFramework; +import com.netflix.curator.x.discovery.ServiceDiscovery; +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.smile.SmileFactory; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.ServletHolder; +import org.skife.config.ConfigurationObjectFactory; + +import java.util.List; +import java.util.Properties; + +/** + */ + +public class BrokerNode extends BaseNode +{ + private static final Logger log = new Logger(BrokerNode.class); + + private final List extraModules = Lists.newArrayList(); + private final List pathsForGuiceFilter = Lists.newArrayList(); + + private QueryToolChestWarehouse warehouse = null; + private HttpClient brokerHttpClient = null; + private CacheBroker cacheBroker = null; + + private boolean useDiscovery = true; + + public static Builder builder() + { + return new Builder(); + } + + public BrokerNode( + Properties props, + Lifecycle lifecycle, + ObjectMapper jsonMapper, + ObjectMapper smileMapper, + ConfigurationObjectFactory configFactory + ) + { + super(log, props, lifecycle, jsonMapper, smileMapper, configFactory); + } + + public QueryToolChestWarehouse getWarehouse() + { + initializeWarehouse(); + return warehouse; + } + + public BrokerNode setWarehouse(QueryToolChestWarehouse warehouse) + { + checkFieldNotSetAndSet("warehouse", warehouse); + return this; + } + + public HttpClient getBrokerHttpClient() + { + initializeBrokerHttpClient(); + return brokerHttpClient; + } + + public BrokerNode setBrokerHttpClient(HttpClient brokerHttpClient) + { + checkFieldNotSetAndSet("brokerHttpClient", brokerHttpClient); + return this; + } + + public CacheBroker getCacheBroker() + { + initializeCacheBroker(); + return cacheBroker; + } + + public BrokerNode setCacheBroker(CacheBroker cacheBroker) + { + checkFieldNotSetAndSet("cacheBroker", cacheBroker); + return this; + } + + public BrokerNode useDiscovery(boolean useDiscovery) + { + this.useDiscovery = useDiscovery; + return this; + } + + /** + * This method allows you to specify more Guice modules to use primarily for injected extra Jersey resources. + * I'd like to remove the Guice dependency for this, but I don't know how to set up Jersey without Guice... + * + * This is deprecated because at some point in the future, we will eliminate the Guice dependency and anything + * that uses this will break. Use at your own risk. + * + * @param module the module to register with Guice + * + * @return this + */ + @Deprecated + public BrokerNode addModule(Module module) + { + extraModules.add(module); + return this; + } + + /** + * This method is used to specify extra paths that the GuiceFilter should pay attention to. + * + * This is deprecated for the same reason that addModule is deprecated. + * + * @param path the path that the GuiceFilter should pay attention to. + * + * @return this + */ + @Deprecated + public BrokerNode addPathForGuiceFilter(String path) + { + pathsForGuiceFilter.add(path); + return this; + } + + @Override + protected void doInit() throws Exception + { + initializeWarehouse(); + initializeBrokerHttpClient(); + initializeCacheBroker(); + initializeDiscovery(); + + final Lifecycle lifecycle = getLifecycle(); + + final List monitors = getMonitors(); + monitors.add(new CacheMonitor(cacheBroker)); + startMonitoring(monitors); + + final BrokerServerView view = new BrokerServerView(warehouse, getSmileMapper(), brokerHttpClient); + final ClientInventoryManager clientInventoryManager = new ClientInventoryManager( + getConfigFactory().build(ClientConfig.class), getPhoneBook(), view + ); + lifecycle.addManagedInstance(clientInventoryManager); + + final CachingClusteredClient baseClient = new CachingClusteredClient(warehouse, view, cacheBroker, getSmileMapper()); + lifecycle.addManagedInstance(baseClient); + + + final ClientQuerySegmentWalker texasRanger = new ClientQuerySegmentWalker(warehouse, getEmitter(), baseClient); + + List theModules = Lists.newArrayList(); + theModules.add(new ClientServletModule(texasRanger, clientInventoryManager, getJsonMapper())); + theModules.addAll(extraModules); + + final Injector injector = Guice.createInjector(theModules); + final Context root = new Context(getServer(), "/druid/v2", Context.SESSIONS); + + root.addServlet(new ServletHolder(new StatusServlet()), "/status"); + root.addServlet( + new ServletHolder(new QueryServlet(getJsonMapper(), getSmileMapper(), texasRanger, getEmitter(), getRequestLogger())), + "/*" + ); + + root.addEventListener(new GuiceServletConfig(injector)); + root.addFilter(GuiceFilter.class, "/datasources/*", 0); + + for (String path : pathsForGuiceFilter) { + root.addFilter(GuiceFilter.class, path, 0); + } + } + + private void initializeDiscovery() throws Exception + { + if (useDiscovery) { + final Lifecycle lifecycle = getLifecycle(); + + final ServiceDiscoveryConfig serviceDiscoveryConfig = getConfigFactory().build(ServiceDiscoveryConfig.class); + CuratorFramework curatorFramework = Initialization.makeCuratorFrameworkClient( + serviceDiscoveryConfig.getZkHosts(), lifecycle + ); + + final ServiceDiscovery serviceDiscovery = Initialization.makeServiceDiscoveryClient( + curatorFramework, serviceDiscoveryConfig, lifecycle + ); + } + } + + private void initializeCacheBroker() + { + if (cacheBroker == null) { + setCacheBroker( + MapCacheBroker.create( + getConfigFactory().buildWithReplacements( + MapCacheBrokerConfig.class, + ImmutableMap.of("prefix", "druid.bard.cache") + ) + ) + ); + } + } + + private void initializeBrokerHttpClient() + { + if (brokerHttpClient == null) { + setBrokerHttpClient( + HttpClientInit.createClient( + HttpClientConfig + .builder() + .withNumConnections(PropUtils.getPropertyAsInt(getProps(), "druid.client.http.connections")) + .build(), + getLifecycle() + ) + ); + } + } + + private void initializeWarehouse() + { + if (warehouse == null) { + setWarehouse(new ReflectionQueryToolChestWarehouse()); + } + } + + public static class Builder + { + private ObjectMapper jsonMapper = null; + private ObjectMapper smileMapper = null; + private Lifecycle lifecycle = null; + private Properties props = null; + private ConfigurationObjectFactory configFactory = null; + + public Builder withMappers(ObjectMapper jsonMapper, ObjectMapper smileMapper) + { + this.jsonMapper = jsonMapper; + this.smileMapper = smileMapper; + return this; + } + + public Builder withProps(Properties props) + { + this.props = props; + return this; + } + + public Builder withConfigFactory(ConfigurationObjectFactory configFactory) + { + this.configFactory = configFactory; + return this; + } + + public BrokerNode build() + { + if (jsonMapper == null && smileMapper == null) { + jsonMapper = new DefaultObjectMapper(); + smileMapper = new DefaultObjectMapper(new SmileFactory()); + smileMapper.getJsonFactory().setCodec(smileMapper); + } + else if (jsonMapper == null || smileMapper == null) { + throw new ISE("Only jsonMapper[%s] or smileMapper[%s] was set, must set neither or both.", jsonMapper, smileMapper); + } + + if (lifecycle == null) { + lifecycle = new Lifecycle(); + } + + if (props == null) { + props = Initialization.loadProperties(); + } + + if (configFactory == null) { + configFactory = Config.createFactory(props); + } + + return new BrokerNode(props, lifecycle, jsonMapper, smileMapper, configFactory); + } + } +} 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 301070d9093..fec4d0826e6 100644 --- a/client/src/main/java/com/metamx/druid/initialization/Initialization.java +++ b/client/src/main/java/com/metamx/druid/initialization/Initialization.java @@ -38,11 +38,13 @@ import com.google.common.base.Throwables; import com.google.common.io.Closeables; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.metamx.common.ISE; +import com.metamx.common.concurrent.ScheduledExecutorFactory; import com.metamx.common.lifecycle.Lifecycle; import com.metamx.common.logger.Logger; import com.metamx.druid.client.ZKPhoneBook; import com.metamx.druid.http.FileRequestLogger; import com.metamx.druid.http.RequestLogger; +import com.metamx.druid.utils.PropUtils; import com.metamx.druid.zk.StringZkSerializer; import com.netflix.curator.framework.CuratorFramework; import com.netflix.curator.framework.CuratorFrameworkFactory; @@ -88,7 +90,7 @@ public class Initialization return retVal; } - public static ZKPhoneBook createYellowPages( + public static ZKPhoneBook createPhoneBook( ObjectMapper jsonMapper, ZkClient zkClient, String threadNameFormat, Lifecycle lifecycle ) { @@ -271,15 +273,11 @@ public class Initialization return serviceProvider; } - public static RequestLogger makeRequestLogger(ScheduledExecutorService exec, Properties props) throws IOException + public static RequestLogger makeRequestLogger(ScheduledExecutorFactory factory, Properties props) throws IOException { - final String property = "druid.request.logging.dir"; - final String loggingDir = props.getProperty(property); - - if (loggingDir == null) { - throw new ISE("property[%s] not set.", property); - } - - return new FileRequestLogger(exec, new File(loggingDir)); + return new FileRequestLogger( + factory.create(1, "RequestLogger-%s"), + new File(PropUtils.getProperty(props, "druid.request.logging.dir")) + ); } } 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 2961ca4276b..9ece02720e2 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 @@ -77,7 +77,7 @@ public class IndexIO public static void registerHandler(IndexIOHandler handler) { - if (handler == null) { + if (IndexIO.handler == null) { IndexIO.handler = handler; } else { diff --git a/server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjusterConfig.java b/index-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricRegistererer.java similarity index 58% rename from server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjusterConfig.java rename to index-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricRegistererer.java index a79d20df796..c0dcade7ed9 100644 --- a/server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjusterConfig.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricRegistererer.java @@ -17,14 +17,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.coordination.legacy; - -import org.skife.config.Config; +package com.metamx.druid.index.v1.serde; /** + * This is a "factory" interface for registering complex metrics in the system. It exists because I'm unaware of + * another way to register the complex serdes in the MR jobs that run on Hadoop. As such, instances of this interface + * must be instantiatable via a no argument default constructor (the MR jobs on Hadoop use reflection to instantiate + * instances). + * + * The name is not a typo, I felt that it needed an extra "er" to make the pronunciation that much more difficult. */ -public abstract class TheSizeAdjusterConfig +public interface ComplexMetricRegistererer { - @Config("druid.zk.paths.indexesPath") - public abstract String getSegmentBasePath(); + public void register(); } 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 4c76224dd14..b65f562ce12 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 @@ -380,8 +380,8 @@ public class IndexerCoordinatorNode if (taskToolbox == null) { final RestS3Service s3Client = new RestS3Service( new AWSCredentials( - props.getProperty("com.metamx.aws.accessKey"), - props.getProperty("com.metamx.aws.secretKey") + PropUtils.getProperty(props, "com.metamx.aws.accessKey"), + PropUtils.getProperty(props, "com.metamx.aws.secretKey") ) ); final SegmentPusher segmentPusher = new S3SegmentPusher( @@ -435,7 +435,7 @@ public class IndexerCoordinatorNode { if (taskInventoryManager == null) { final ZkClient zkClient = Initialization.makeZkClient(configFactory.build(ZkClientConfig.class), lifecycle); - final PhoneBook masterYp = Initialization.createYellowPages( + final PhoneBook masterYp = Initialization.createPhoneBook( jsonMapper, zkClient, "Master-ZKYP--%s", 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 2f45f094b53..533bc7b6c28 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 @@ -280,8 +280,8 @@ public class WorkerNode if (taskToolbox == null) { final RestS3Service s3Client = new RestS3Service( new AWSCredentials( - props.getProperty("com.metamx.aws.accessKey"), - props.getProperty("com.metamx.aws.secretKey") + PropUtils.getProperty(props, "com.metamx.aws.accessKey"), + PropUtils.getProperty(props, "com.metamx.aws.secretKey") ) ); final SegmentPusher segmentPusher = new S3SegmentPusher( @@ -296,7 +296,7 @@ public class WorkerNode public void initializeCuratorFramework() throws IOException { curatorFramework = Initialization.makeCuratorFrameworkClient( - props.getProperty("druid.zk.service.host"), + PropUtils.getProperty(props, "druid.zk.service.host"), lifecycle ); } 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 0b8d6efac45..60d290992d5 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimeNode.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimeNode.java @@ -19,75 +19,53 @@ 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.base.Preconditions; +import com.google.common.base.Throwables; import com.google.common.collect.Maps; import com.metamx.common.ISE; -import com.metamx.common.concurrent.ScheduledExecutorFactory; -import com.metamx.common.concurrent.ScheduledExecutors; import com.metamx.common.config.Config; import com.metamx.common.lifecycle.Lifecycle; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.common.logger.Logger; +import com.metamx.druid.BaseServerNode; import com.metamx.druid.client.ClientConfig; import com.metamx.druid.client.ClientInventoryManager; import com.metamx.druid.client.MutableServerView; import com.metamx.druid.client.OnlyNewSegmentWatcherServerView; import com.metamx.druid.client.ServerView; -import com.metamx.druid.collect.StupidPool; import com.metamx.druid.db.DbConnector; import com.metamx.druid.db.DbConnectorConfig; import com.metamx.druid.http.QueryServlet; -import com.metamx.druid.http.RequestLogger; import com.metamx.druid.http.StatusServlet; import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.ServerConfig; -import com.metamx.druid.initialization.ServerInit; -import com.metamx.druid.initialization.ZkClientConfig; import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.query.DefaultQueryRunnerFactoryConglomerate; import com.metamx.druid.query.QueryRunnerFactoryConglomerate; import com.metamx.druid.utils.PropUtils; -import com.metamx.emitter.EmittingLogger; -import com.metamx.emitter.core.Emitters; import com.metamx.emitter.service.ServiceEmitter; -import com.metamx.http.client.HttpClient; -import com.metamx.http.client.HttpClientConfig; -import com.metamx.http.client.HttpClientInit; -import com.metamx.metrics.JvmMonitor; import com.metamx.metrics.Monitor; -import com.metamx.metrics.MonitorScheduler; -import com.metamx.metrics.MonitorSchedulerConfig; -import com.metamx.metrics.SysMonitor; -import com.metamx.phonebook.PhoneBook; +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.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.servlet.Context; +import org.mortbay.jetty.servlet.ServletHolder; +import org.skife.config.ConfigurationObjectFactory; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Properties; /** */ -public class RealtimeNode +public class RealtimeNode extends BaseServerNode { private static final Logger log = new Logger(RealtimeNode.class); @@ -96,155 +74,112 @@ public class RealtimeNode return new Builder(); } - private final Lifecycle lifecycle; - private final ObjectMapper jsonMapper; - private final ObjectMapper smileMapper; - private final Properties props; - private final ConfigurationObjectFactory configFactory; - private final Map injectablesMap = Maps.newLinkedHashMap(); - private PhoneBook phoneBook = null; - private ServiceEmitter emitter = null; - private ServerView view = null; private MetadataUpdater metadataUpdater = null; - private QueryRunnerFactoryConglomerate conglomerate = null; private SegmentPusher segmentPusher = null; private List fireDepartments = null; - private List monitors = null; - private Server server = null; + private ServerView view = null; private boolean initialized = false; public RealtimeNode( - ObjectMapper jsonMapper, - ObjectMapper smileMapper, - Lifecycle lifecycle, - Properties props, - ConfigurationObjectFactory configFactory + Properties props, + Lifecycle lifecycle, + ObjectMapper jsonMapper, + ObjectMapper smileMapper, + ConfigurationObjectFactory configFactory ) { - this.jsonMapper = jsonMapper; - this.smileMapper = smileMapper; - this.lifecycle = lifecycle; - this.props = props; - this.configFactory = configFactory; - } - - public RealtimeNode setPhoneBook(PhoneBook phoneBook) - { - this.phoneBook = phoneBook; - return this; - } - - public RealtimeNode setEmitter(ServiceEmitter emitter) - { - this.emitter = emitter; - return this; + super(log, props, lifecycle, jsonMapper, smileMapper, configFactory); } public RealtimeNode setView(ServerView view) { + Preconditions.checkState(this.view == null, "Cannot set view once it has already been set."); this.view = view; return this; } public RealtimeNode setMetadataUpdater(MetadataUpdater metadataUpdater) { + Preconditions.checkState(this.metadataUpdater == null, "Cannot set metadataUpdater once it has already been set."); this.metadataUpdater = metadataUpdater; return this; } - public RealtimeNode setConglomerate(QueryRunnerFactoryConglomerate conglomerate) - { - this.conglomerate = conglomerate; - return this; - } - public RealtimeNode setSegmentPusher(SegmentPusher segmentPusher) { + Preconditions.checkState(this.segmentPusher == null, "Cannot set segmentPusher once it has already been set."); this.segmentPusher = segmentPusher; return this; } public RealtimeNode setFireDepartments(List fireDepartments) { + Preconditions.checkState(this.fireDepartments == null, "Cannot set fireDepartments once it has already been set."); this.fireDepartments = fireDepartments; return this; } - public RealtimeNode setMonitors(List monitors) - { - this.monitors = Lists.newArrayList(monitors); - return this; - } - - public void setServer(Server server) - { - this.server = server; - } - public RealtimeNode registerJacksonInjectable(String name, Object object) { + Preconditions.checkState(injectablesMap.containsKey(name), "Already registered jackson object[%s]", name); injectablesMap.put(name, object); return this; } - public RealtimeNode registerJacksonSubtype(Class... clazzes) + public MetadataUpdater getMetadataUpdater() { - jsonMapper.registerSubtypes(clazzes); - return this; + initializeMetadataUpdater(); + return metadataUpdater; } - public RealtimeNode registerJacksonSubtype(NamedType... namedTypes) + public SegmentPusher getSegmentPusher() { - jsonMapper.registerSubtypes(namedTypes); - return this; + initializeSegmentPusher(); + return segmentPusher; } - private void init() throws Exception + public List getFireDepartments() { - if (phoneBook == null) { - final ZkClient zkClient = Initialization.makeZkClient(configFactory.build(ZkClientConfig.class), lifecycle); - phoneBook = Initialization.createYellowPages( - jsonMapper, - zkClient, - "Realtime-ZKYP--%s", - lifecycle - ); - } + initializeFireDepartments(); + return fireDepartments; + } - initializeEmitter(); + public ServerView getView() + { + initializeView(); + return view; + } + + protected void doInit() throws Exception + { initializeView(); initializeMetadataUpdater(); - initializeQueryRunnerFactoryConglomerate(); initializeSegmentPusher(); - initializeMonitors(); - initializeServer(); initializeJacksonInjectables(); + initializeFireDepartments(); + + final Lifecycle lifecycle = getLifecycle(); + final ServiceEmitter emitter = getEmitter(); + final QueryRunnerFactoryConglomerate conglomerate = getConglomerate(); + final List monitors = getMonitors(); + monitors.add(new RealtimeMetricsMonitor(fireDepartments)); final RealtimeManager realtimeManager = new RealtimeManager(fireDepartments, conglomerate); lifecycle.addManagedInstance(realtimeManager); - final ScheduledExecutorFactory scheduledExecutorFactory = ScheduledExecutors.createFactory(lifecycle); - final ScheduledExecutorService globalScheduledExec = scheduledExecutorFactory.create(1, "Global--%d"); - final MonitorScheduler monitorScheduler = new MonitorScheduler( - configFactory.build(MonitorSchedulerConfig.class), - globalScheduledExec, - emitter, - monitors - ); - lifecycle.addManagedInstance(monitorScheduler); + startMonitoring(monitors); - final RequestLogger requestLogger = Initialization.makeRequestLogger(globalScheduledExec, props); - lifecycle.addManagedInstance(requestLogger); - - final Context v2Druid = new Context(server, "/druid/v2", Context.SESSIONS); + final Context v2Druid = new Context(getServer(), "/druid/v2", Context.SESSIONS); v2Druid.addServlet(new ServletHolder(new StatusServlet()), "/status"); v2Druid.addServlet( - new ServletHolder(new QueryServlet(jsonMapper, smileMapper, realtimeManager, emitter, requestLogger)), + new ServletHolder( + new QueryServlet(getJsonMapper(), getSmileMapper(), realtimeManager, emitter, getRequestLogger()) + ), "/*" ); @@ -258,47 +193,16 @@ public class RealtimeNode init(); } - lifecycle.start(); + getLifecycle().start(); } @LifecycleStop public synchronized void stop() { - lifecycle.stop(); + getLifecycle().stop(); } - private void initializeServer() - { - if (server == null) { - server = Initialization.makeJettyServer(configFactory.build(ServerConfig.class)); - - lifecycle.addHandler( - new Lifecycle.Handler() - { - @Override - public void start() throws Exception - { - log.info("Starting Jetty"); - server.start(); - } - - @Override - public void stop() - { - log.info("Stopping Jetty"); - try { - server.stop(); - } - catch (Exception e) { - log.error(e, "Exception thrown while stopping Jetty"); - } - } - } - ); - } - } - - private void initializeJacksonInjectables() + protected void initializeJacksonInjectables() { final Map injectables = Maps.newHashMap(); @@ -306,13 +210,13 @@ public class RealtimeNode injectables.put(entry.getKey(), entry.getValue()); } - injectables.put("queryRunnerFactoryConglomerate", conglomerate); + injectables.put("queryRunnerFactoryConglomerate", getConglomerate()); injectables.put("segmentPusher", segmentPusher); injectables.put("metadataUpdater", metadataUpdater); injectables.put("serverView", view); - injectables.put("serviceEmitter", emitter); + injectables.put("serviceEmitter", getEmitter()); - jsonMapper.setInjectableValues( + getJsonMapper().setInjectableValues( new InjectableValues() { @Override @@ -326,96 +230,70 @@ public class RealtimeNode ); } - private void initializeMonitors() - { - if (monitors == null) { - monitors = Lists.newArrayList(); - monitors.add(new JvmMonitor()); - monitors.add(new SysMonitor()); - } - } - - private void initializeFireDepartments() throws IOException + private void initializeFireDepartments() { if (fireDepartments == null) { - fireDepartments = jsonMapper.readValue( - new File(PropUtils.getProperty(props, "druid.realtime.specFile")), - new TypeReference>(){} - ); + try { + fireDepartments = getJsonMapper().readValue( + new File(PropUtils.getProperty(getProps(), "druid.realtime.specFile")), + new TypeReference>(){} + ); + } + catch (IOException e) { + throw Throwables.propagate(e); + } } } - private void initializeSegmentPusher() throws S3ServiceException + private void initializeSegmentPusher() { if (segmentPusher == null) { - final RestS3Service s3Client = new RestS3Service( - new AWSCredentials( - PropUtils.getProperty(props, "com.metamx.aws.accessKey"), - PropUtils.getProperty(props, "com.metamx.aws.secretKey") - ) - ); + final Properties props = getProps(); + final RestS3Service s3Client; + try { + s3Client = new RestS3Service( + new AWSCredentials( + PropUtils.getProperty(props, "com.metamx.aws.accessKey"), + PropUtils.getProperty(props, "com.metamx.aws.secretKey") + ) + ); + } + catch (S3ServiceException e) { + throw Throwables.propagate(e); + } - segmentPusher = new S3SegmentPusher(s3Client, configFactory.build(S3SegmentPusherConfig.class), jsonMapper); + segmentPusher = new S3SegmentPusher(s3Client, getConfigFactory().build(S3SegmentPusherConfig.class), getJsonMapper()); } } - private void initializeQueryRunnerFactoryConglomerate() - { - if (conglomerate == null) { - StupidPool computationBufferPool = ServerInit.makeComputeScratchPool( - PropUtils.getPropertyAsInt(props, "druid.computation.buffer.size", 1024 * 1024 * 1024) - ); - conglomerate = new DefaultQueryRunnerFactoryConglomerate( - ServerInit.initDefaultQueryTypes(configFactory, computationBufferPool) - ); - } - } - - private void initializeMetadataUpdater() + protected void initializeMetadataUpdater() { if (metadataUpdater == null) { metadataUpdater = new MetadataUpdater( - jsonMapper, - configFactory.build(MetadataUpdaterConfig.class), - phoneBook, - new DbConnector(configFactory.build(DbConnectorConfig.class)).getDBI() + getJsonMapper(), + getConfigFactory().build(MetadataUpdaterConfig.class), + getPhoneBook(), + new DbConnector(getConfigFactory().build(DbConnectorConfig.class)).getDBI() ); - lifecycle.addManagedInstance(metadataUpdater); + getLifecycle().addManagedInstance(metadataUpdater); } } private void initializeView() { if (view == null) { - final ClientConfig clientConfig = configFactory.build(ClientConfig.class); final MutableServerView view = new OnlyNewSegmentWatcherServerView(); final ClientInventoryManager clientInventoryManager = new ClientInventoryManager( - clientConfig.getClientInventoryManagerConfig(), - phoneBook, + getConfigFactory().build(ClientConfig.class), + getPhoneBook(), view ); - lifecycle.addManagedInstance(clientInventoryManager); + getLifecycle().addManagedInstance(clientInventoryManager); this.view = view; } } - private void initializeEmitter() - { - if (emitter == null) { - final HttpClient httpClient = HttpClientInit.createClient( - HttpClientConfig.builder().withNumConnections(1).build(), lifecycle - ); - - emitter = new ServiceEmitter( - PropUtils.getProperty(props, "druid.service"), - PropUtils.getProperty(props, "druid.host"), - Emitters.create(props, httpClient, jsonMapper, lifecycle) - ); - } - EmittingLogger.registerEmitter(emitter); - } - public static class Builder { private ObjectMapper jsonMapper = null; @@ -466,7 +344,7 @@ public class RealtimeNode configFactory = Config.createFactory(props); } - return new RealtimeNode(jsonMapper, smileMapper, lifecycle, props, configFactory); + return new RealtimeNode(props, lifecycle, jsonMapper, smileMapper, configFactory); } } } \ No newline at end of file diff --git a/server/src/main/java/com/metamx/druid/BaseServerNode.java b/server/src/main/java/com/metamx/druid/BaseServerNode.java new file mode 100644 index 00000000000..fcb8a1ab46b --- /dev/null +++ b/server/src/main/java/com/metamx/druid/BaseServerNode.java @@ -0,0 +1,124 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package com.metamx.druid; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import com.metamx.common.lifecycle.Lifecycle; +import com.metamx.common.logger.Logger; +import com.metamx.druid.collect.StupidPool; +import com.metamx.druid.initialization.ServerInit; +import com.metamx.druid.query.DefaultQueryRunnerFactoryConglomerate; +import com.metamx.druid.query.QueryRunnerFactory; +import com.metamx.druid.query.QueryRunnerFactoryConglomerate; +import com.metamx.druid.utils.PropUtils; +import org.codehaus.jackson.map.ObjectMapper; +import org.skife.config.ConfigurationObjectFactory; + +import java.nio.ByteBuffer; +import java.util.Map; +import java.util.Properties; + +/** + */ +public abstract class BaseServerNode extends BaseNode +{ + private final Map, QueryRunnerFactory> additionalFactories = Maps.newLinkedHashMap(); + private QueryRunnerFactoryConglomerate conglomerate = null; + private StupidPool computeScratchPool = null; + + public BaseServerNode( + Logger log, + Properties props, + Lifecycle lifecycle, + ObjectMapper jsonMapper, + ObjectMapper smileMapper, + ConfigurationObjectFactory configFactory + ) + { + super(log, props, lifecycle, jsonMapper, smileMapper, configFactory); + } + + public QueryRunnerFactoryConglomerate getConglomerate() + { + initializeQueryRunnerFactoryConglomerate(); + return conglomerate; + } + + public StupidPool getComputeScratchPool() + { + initializeComputeScratchPool(); + return computeScratchPool; + } + + @SuppressWarnings("unchecked") + public T setConglomerate(QueryRunnerFactoryConglomerate conglomerate) + { + checkFieldNotSetAndSet("conglomerate", conglomerate); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T setComputeScratchPool(StupidPool computeScratchPool) + { + checkFieldNotSetAndSet("computeScratchPool", computeScratchPool); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T registerQueryRunnerFactory(Class queryClazz, QueryRunnerFactory factory) + { + Preconditions.checkState( + conglomerate == null, + "Registering a QueryRunnerFactory only works when a separate conglomerate is not specified." + ); + Preconditions.checkState( + !additionalFactories.containsKey(queryClazz), "Registered factory for class[%s] multiple times", queryClazz + ); + additionalFactories.put(queryClazz, factory); + return (T) this; + } + + private void initializeComputeScratchPool() + { + if (computeScratchPool == null) { + setComputeScratchPool( + ServerInit.makeComputeScratchPool( + PropUtils.getPropertyAsInt(getProps(), "druid.computation.buffer.size", 1024 * 1024 * 1024) + ) + ); + } + } + + private void initializeQueryRunnerFactoryConglomerate() + { + if (conglomerate == null) { + final Map, QueryRunnerFactory> factories = ServerInit.initDefaultQueryTypes( + getConfigFactory(), getComputeScratchPool() + ); + + for (Map.Entry, QueryRunnerFactory> entry : additionalFactories.entrySet()) { + factories.put(entry.getKey(), entry.getValue()); + } + + setConglomerate(new DefaultQueryRunnerFactoryConglomerate(factories)); + } + } +} 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 935360834ce..04ce6f0c020 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ServerManager.java +++ b/server/src/main/java/com/metamx/druid/coordination/ServerManager.java @@ -30,6 +30,7 @@ import org.joda.time.Interval; import com.google.common.base.Function; import com.google.common.collect.Ordering; +import com.metamx.common.ISE; import com.metamx.common.guava.FunctionalIterable; import com.metamx.druid.Query; import com.metamx.druid.StorageAdapter; @@ -94,12 +95,16 @@ public class ServerManager implements QuerySegmentWalker public Map getDataSourceSizes() { - return dataSourceSizes.snapshot(); + synchronized (dataSourceSizes) { + return dataSourceSizes.snapshot(); + } } public Map getDataSourceCounts() { - return dataSourceCounts.snapshot(); + synchronized (dataSourceCounts) { + return dataSourceCounts.snapshot(); + } } public void loadSegment(final DataSegment segment) throws StorageAdapterLoadingException @@ -109,7 +114,12 @@ public class ServerManager implements QuerySegmentWalker adapter = storageAdapterLoader.getAdapter(segment.getLoadSpec()); } catch (StorageAdapterLoadingException e) { - storageAdapterLoader.cleanupAdapter(segment.getLoadSpec()); + try { + storageAdapterLoader.cleanupAdapter(segment.getLoadSpec()); + } + catch (StorageAdapterLoadingException e1) { + // ignore + } throw e; } @@ -140,8 +150,12 @@ public class ServerManager implements QuerySegmentWalker loadedIntervals.add( segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(adapter) ); - dataSourceSizes.add(dataSource, segment.getSize()); - dataSourceCounts.add(dataSource, 1L); + synchronized (dataSourceSizes) { + dataSourceSizes.add(dataSource, segment.getSize()); + } + synchronized (dataSourceCounts) { + dataSourceCounts.add(dataSource, 1L); + } } } @@ -162,8 +176,12 @@ public class ServerManager implements QuerySegmentWalker StorageAdapter oldQueryable = (removed == null) ? null : removed.getObject(); if (oldQueryable != null) { - dataSourceSizes.add(dataSource, -segment.getSize()); - dataSourceCounts.add(dataSource, -1L); + synchronized (dataSourceSizes) { + dataSourceSizes.add(dataSource, -segment.getSize()); + } + synchronized (dataSourceCounts) { + dataSourceCounts.add(dataSource, -1L); + } } else { log.info( "Told to delete a queryable on dataSource[%s] for interval[%s] and version [%s] that I don't have.", @@ -181,10 +199,7 @@ public class ServerManager implements QuerySegmentWalker { final QueryRunnerFactory> factory = conglomerate.findFactory(query); if (factory == null) { - log.makeAlert("Unknown query type, [%s]", query.getClass()) - .addData("dataSource", query.getDataSource()) - .emit(); - return new NoopQueryRunner(); + throw new ISE("Unknown query type[%s].", query.getClass()); } final QueryToolChest> toolChest = factory.getToolchest(); 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 deleted file mode 100644 index 248b4e6863e..00000000000 --- a/server/src/main/java/com/metamx/druid/coordination/legacy/S3SizeLookup.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package com.metamx.druid.coordination.legacy; - -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 com.metamx.common.MapUtils; -import com.metamx.common.logger.Logger; - -/** - */ -public class S3SizeLookup implements SizeLookup -{ - private static final Logger log = new Logger(S3SizeLookup.class); - - private final RestS3Service s3Client; - - public S3SizeLookup( - RestS3Service s3Client - ) - { - this.s3Client = s3Client; - } - - @Override - public Long lookupSize(Map loadSpec) - { - String s3Bucket = MapUtils.getString(loadSpec, "bucket"); - String s3Path = MapUtils.getString(loadSpec, "key"); - - S3Object s3Obj = null; - try { - s3Obj = s3Client.getObjectDetails(new S3Bucket(s3Bucket), s3Path); - } - catch (S3ServiceException e) { - log.warn(e, "Exception when trying to lookup size for s3://%s/%s", s3Bucket, s3Path); - return null; - } - - if (s3Obj == null) { - log.warn("s3Object for s3://%s/%s was null.", s3Bucket, s3Path); - return null; - } - - return s3Obj.getContentLength(); - } -} 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 deleted file mode 100644 index 07f621f2db1..00000000000 --- a/server/src/main/java/com/metamx/druid/coordination/legacy/TheSizeAdjuster.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -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; - -/** - */ -public class TheSizeAdjuster -{ - private static final Logger log = new Logger(TheSizeAdjuster.class); - private static final Joiner JOINER = Joiner.on("/"); - - private final TheSizeAdjusterConfig config; - private final ObjectMapper jsonMapper; - private final Map lookups; - private final ZkClient zkClient; - - public TheSizeAdjuster( - TheSizeAdjusterConfig config, - ObjectMapper jsonMapper, - Map lookups, - ZkClient zkClient - ) - { - this.config = config; - this.jsonMapper = jsonMapper; - this.lookups = lookups; - this.zkClient = zkClient; - } - - public Long lookupSize(Map descriptor) - { - String type = MapUtils.getString(descriptor, "type"); - SizeLookup adjuster = lookups.get(type); - - if (adjuster == null) { - log.warn("Unknown type[%s] for SizeAdjuster, known types are %s", type, lookups.keySet()); - return null; - } - - return adjuster.lookupSize(descriptor); - } - - public DataSegment updateDescriptor(DataSegment dataSegment) - { - Long size = lookupSize(dataSegment.getLoadSpec()); - - if (size == null || size < 0) { - log.warn("Unable to determine size[%s] of segment[%s], ignoring.", size, dataSegment); - return null; - } - - final DataSegment segment = new DataSegment( - dataSegment.getDataSource(), - dataSegment.getInterval(), - dataSegment.getVersion() + "_w_size", - dataSegment.getLoadSpec(), - dataSegment.getDimensions(), - dataSegment.getMetrics(), - dataSegment.getShardSpec(), - size - ); - - String oldSegmentPath = JOINER.join(config.getSegmentBasePath(), dataSegment.getDataSource(), dataSegment.getIdentifier()); - String newSegmentPath = JOINER.join(config.getSegmentBasePath(), segment.getDataSource(), segment.getIdentifier()); - try { - String data = jsonMapper.writeValueAsString(segment); - zkClient.createPersistent(newSegmentPath, data); - log.info("Created new segment node[%s] with content[%s]", newSegmentPath, data); - zkClient.delete(oldSegmentPath); - log.info("Deleted old segment node[%s]", oldSegmentPath); - } - catch (IOException e) { - log.warn(e, "Exception thrown on segment[%s]", segment); - return null; - } - - return segment; - } -} diff --git a/server/src/main/java/com/metamx/druid/coordination/legacy/SizeLookup.java b/server/src/main/java/com/metamx/druid/http/ComputeMain.java similarity index 55% rename from server/src/main/java/com/metamx/druid/coordination/legacy/SizeLookup.java rename to server/src/main/java/com/metamx/druid/http/ComputeMain.java index 4015165c547..828d1568214 100644 --- a/server/src/main/java/com/metamx/druid/coordination/legacy/SizeLookup.java +++ b/server/src/main/java/com/metamx/druid/http/ComputeMain.java @@ -17,13 +17,36 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.coordination.legacy; +package com.metamx.druid.http; -import java.util.Map; +import com.metamx.common.lifecycle.Lifecycle; +import com.metamx.common.logger.Logger; +import com.metamx.druid.log.LogLevelAdjuster; /** */ -public interface SizeLookup +public class ComputeMain { - public Long lookupSize(Map descriptor); + private static final Logger log = new Logger(ComputeMain.class); + + public static void main(String[] args) throws Exception + { + LogLevelAdjuster.register(); + + Lifecycle lifecycle = new Lifecycle(); + + lifecycle.addManagedInstance( + ComputeNode.builder().build() + ); + + try { + lifecycle.start(); + } + catch (Throwable t) { + log.info(t, "Throwable caught at startup, committing seppuku"); + System.exit(2); + } + + lifecycle.join(); + } } diff --git a/server/src/main/java/com/metamx/druid/http/ComputeNode.java b/server/src/main/java/com/metamx/druid/http/ComputeNode.java new file mode 100644 index 00000000000..1369b0898d2 --- /dev/null +++ b/server/src/main/java/com/metamx/druid/http/ComputeNode.java @@ -0,0 +1,236 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package com.metamx.druid.http; + +import com.google.common.base.Preconditions; +import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableMap; +import com.metamx.common.ISE; +import com.metamx.common.concurrent.ExecutorServiceConfig; +import com.metamx.common.concurrent.ExecutorServices; +import com.metamx.common.config.Config; +import com.metamx.common.lifecycle.Lifecycle; +import com.metamx.common.logger.Logger; +import com.metamx.druid.BaseServerNode; +import com.metamx.druid.client.DruidServer; +import com.metamx.druid.client.DruidServerConfig; +import com.metamx.druid.coordination.ServerManager; +import com.metamx.druid.coordination.ZkCoordinator; +import com.metamx.druid.coordination.ZkCoordinatorConfig; +import com.metamx.druid.initialization.Initialization; +import com.metamx.druid.initialization.ServerInit; +import com.metamx.druid.jackson.DefaultObjectMapper; +import com.metamx.druid.loading.QueryableLoaderConfig; +import com.metamx.druid.loading.StorageAdapterLoader; +import com.metamx.druid.metrics.ServerMonitor; +import com.metamx.druid.query.QueryRunnerFactoryConglomerate; +import com.metamx.druid.utils.PropUtils; +import com.metamx.emitter.service.ServiceEmitter; +import com.metamx.metrics.Monitor; +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.smile.SmileFactory; +import org.jets3t.service.S3ServiceException; +import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.jets3t.service.security.AWSCredentials; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.ServletHolder; +import org.skife.config.ConfigurationObjectFactory; + +import java.util.List; +import java.util.Properties; +import java.util.concurrent.ExecutorService; + +/** + */ +public class ComputeNode extends BaseServerNode +{ + private static final Logger log = new Logger(ComputeNode.class); + + public static Builder builder() + { + return new Builder(); + } + + private DruidServer druidServer; + private StorageAdapterLoader adapterLoader; + + public ComputeNode( + Properties props, + Lifecycle lifecycle, + ObjectMapper jsonMapper, + ObjectMapper smileMapper, + ConfigurationObjectFactory configFactory + ) + { + super(log, props, lifecycle, jsonMapper, smileMapper, configFactory); + } + + public ComputeNode setAdapterLoader(StorageAdapterLoader storageAdapterLoader) + { + Preconditions.checkState(this.adapterLoader == null, "Cannot set adapterLoader once it has already been set."); + this.adapterLoader = storageAdapterLoader; + return this; + } + + public ComputeNode setDruidServer(DruidServer druidServer) + { + Preconditions.checkState(this.druidServer == null, "Cannot set druidServer once it has already been set."); + this.druidServer = druidServer; + return this; + } + + public DruidServer getDruidServer() + { + initializeDruidServer(); + return druidServer; + } + + public StorageAdapterLoader getAdapterLoader() + { + initializeAdapterLoader(); + return adapterLoader; + } + + protected void doInit() throws Exception + { + initializeDruidServer(); + initializeAdapterLoader(); + + final Lifecycle lifecycle = getLifecycle(); + final ServiceEmitter emitter = getEmitter(); + final List monitors = getMonitors(); + final QueryRunnerFactoryConglomerate conglomerate = getConglomerate(); + + final ExecutorService executorService = ExecutorServices.create( + getLifecycle(), + getConfigFactory().buildWithReplacements( + ExecutorServiceConfig.class, ImmutableMap.of("base_path", "druid.processing") + ) + ); + ServerManager serverManager = new ServerManager(adapterLoader, conglomerate, emitter, executorService); + + final ZkCoordinator coordinator = new ZkCoordinator( + getJsonMapper(), + getConfigFactory().build(ZkCoordinatorConfig.class), + druidServer, + getPhoneBook(), + serverManager, + emitter + ); + lifecycle.addManagedInstance(coordinator); + + monitors.add(new ServerMonitor(getDruidServer(), serverManager)); + startMonitoring(monitors); + + final Context root = new Context(getServer(), "/", Context.SESSIONS); + + root.addServlet(new ServletHolder(new StatusServlet()), "/status"); + root.addServlet( + new ServletHolder( + new QueryServlet(getJsonMapper(), getSmileMapper(), serverManager, emitter, getRequestLogger()) + ), + "/*" + ); + } + + private void initializeAdapterLoader() + { + if (adapterLoader == null) { + final Properties props = getProps(); + try { + final RestS3Service s3Client = new RestS3Service( + new AWSCredentials( + PropUtils.getProperty(props, "com.metamx.aws.accessKey"), + PropUtils.getProperty(props, "com.metamx.aws.secretKey") + ) + ); + + setAdapterLoader( + ServerInit.makeDefaultQueryableLoader(s3Client, getConfigFactory().build(QueryableLoaderConfig.class)) + ); + } + catch (S3ServiceException e) { + throw Throwables.propagate(e); + } + } + } + + private void initializeDruidServer() + { + if (druidServer == null) { + setDruidServer(new DruidServer(getConfigFactory().build(DruidServerConfig.class))); + } + } + + public static class Builder + { + private ObjectMapper jsonMapper = null; + private ObjectMapper smileMapper = null; + private Lifecycle lifecycle = null; + private Properties props = null; + private ConfigurationObjectFactory configFactory = null; + + public Builder withMappers(ObjectMapper jsonMapper, ObjectMapper smileMapper) + { + this.jsonMapper = jsonMapper; + this.smileMapper = smileMapper; + return this; + } + + public Builder withProps(Properties props) + { + this.props = props; + return this; + } + + public Builder withConfigFactory(ConfigurationObjectFactory configFactory) + { + this.configFactory = configFactory; + return this; + } + + public ComputeNode build() + { + if (jsonMapper == null && smileMapper == null) { + jsonMapper = new DefaultObjectMapper(); + smileMapper = new DefaultObjectMapper(new SmileFactory()); + smileMapper.getJsonFactory().setCodec(smileMapper); + } + else if (jsonMapper == null || smileMapper == null) { + throw new ISE("Only jsonMapper[%s] or smileMapper[%s] was set, must set neither or both.", jsonMapper, smileMapper); + } + + if (lifecycle == null) { + lifecycle = new Lifecycle(); + } + + if (props == null) { + props = Initialization.loadProperties(); + } + + if (configFactory == null) { + configFactory = Config.createFactory(props); + } + + return new ComputeNode(props, lifecycle, jsonMapper, smileMapper, configFactory); + } + } + +} 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 edac3707833..1029d6bd0c5 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterMain.java +++ b/server/src/main/java/com/metamx/druid/http/MasterMain.java @@ -39,7 +39,6 @@ import org.skife.jdbi.v2.DBI; import com.google.common.base.Charsets; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.servlet.GuiceFilter; @@ -54,10 +53,6 @@ import com.metamx.druid.client.ServerInventoryManager; import com.metamx.druid.client.ServerInventoryManagerConfig; import com.metamx.druid.coordination.DruidClusterInfo; import com.metamx.druid.coordination.DruidClusterInfoConfig; -import com.metamx.druid.coordination.legacy.S3SizeLookup; -import com.metamx.druid.coordination.legacy.SizeLookup; -import com.metamx.druid.coordination.legacy.TheSizeAdjuster; -import com.metamx.druid.coordination.legacy.TheSizeAdjusterConfig; import com.metamx.druid.db.DatabaseSegmentManager; import com.metamx.druid.db.DatabaseSegmentManagerConfig; import com.metamx.druid.db.DbConnector; @@ -71,6 +66,7 @@ import com.metamx.druid.log.LogLevelAdjuster; import com.metamx.druid.master.DruidMaster; import com.metamx.druid.master.DruidMasterConfig; import com.metamx.druid.master.LoadQueuePeon; +import com.metamx.druid.utils.PropUtils; import com.metamx.emitter.core.Emitters; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.http.client.HttpClient; @@ -86,6 +82,20 @@ 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.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; /** */ @@ -107,21 +117,14 @@ public class MasterMain ); final ServiceEmitter emitter = new ServiceEmitter( - props.getProperty("druid.service"), - props.getProperty("druid.host"), + PropUtils.getProperty(props, "druid.service"), + PropUtils.getProperty(props, "druid.host"), Emitters.create(props, httpClient, jsonMapper, lifecycle) ); - final RestS3Service s3Client = new RestS3Service( - new AWSCredentials( - props.getProperty("com.metamx.aws.accessKey"), - props.getProperty("com.metamx.aws.secretKey") - ) - ); - final ZkClient zkClient = Initialization.makeZkClient(configFactory.build(ZkClientConfig.class), lifecycle); - final PhoneBook masterYp = Initialization.createYellowPages(jsonMapper, zkClient, "Master-ZKYP--%s", lifecycle); + final PhoneBook masterYp = Initialization.createPhoneBook(jsonMapper, zkClient, "Master-ZKYP--%s", lifecycle); final ScheduledExecutorFactory scheduledExecutorFactory = ScheduledExecutors.createFactory(lifecycle); final SegmentInventoryManager segmentInventoryManager = @@ -184,14 +187,6 @@ public class MasterMain jsonMapper, databaseSegmentManager, serverInventoryManager, - new TheSizeAdjuster( - configFactory.build(TheSizeAdjusterConfig.class), - jsonMapper, - ImmutableMap.of( - "s3", new S3SizeLookup(s3Client) - ), - zkClient - ), masterYp, emitter, scheduledExecutorFactory, 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 ed82c45e600..11dcb879584 100644 --- a/server/src/main/java/com/metamx/druid/http/ServerMain.java +++ b/server/src/main/java/com/metamx/druid/http/ServerMain.java @@ -19,196 +19,26 @@ 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; -import com.metamx.common.concurrent.ExecutorServices; -import com.metamx.common.concurrent.ScheduledExecutorFactory; -import com.metamx.common.concurrent.ScheduledExecutors; -import com.metamx.common.config.Config; -import com.metamx.common.lifecycle.Lifecycle; -import com.metamx.common.logger.Logger; -import com.metamx.druid.Query; -import com.metamx.druid.client.DruidServer; -import com.metamx.druid.client.DruidServerConfig; -import com.metamx.druid.collect.StupidPool; -import com.metamx.druid.coordination.ServerManager; -import com.metamx.druid.coordination.ZkCoordinator; -import com.metamx.druid.coordination.ZkCoordinatorConfig; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.ServerConfig; -import com.metamx.druid.initialization.ServerInit; -import com.metamx.druid.initialization.ZkClientConfig; -import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.loading.QueryableLoaderConfig; -import com.metamx.druid.log.LogLevelAdjuster; -import com.metamx.druid.metrics.ServerMonitor; -import com.metamx.druid.query.DefaultQueryRunnerFactoryConglomerate; -import com.metamx.druid.query.QueryRunnerFactory; -import com.metamx.emitter.core.Emitters; -import com.metamx.emitter.service.ServiceEmitter; -import com.metamx.http.client.HttpClient; -import com.metamx.http.client.HttpClientConfig; -import com.metamx.http.client.HttpClientInit; -import com.metamx.metrics.JvmMonitor; -import com.metamx.metrics.Monitor; -import com.metamx.metrics.MonitorScheduler; -import com.metamx.metrics.MonitorSchedulerConfig; -import com.metamx.metrics.SysMonitor; -import com.metamx.phonebook.PhoneBook; - /** */ +@Deprecated public class ServerMain { - private static final Logger log = new Logger(ServerMain.class); - public static void main(String[] args) throws Exception { - LogLevelAdjuster.register(); - - final ObjectMapper jsonMapper = new DefaultObjectMapper(); - final ObjectMapper smileMapper = new DefaultObjectMapper(new SmileFactory()); - smileMapper.getJsonFactory().setCodec(smileMapper); - - final Properties props = Initialization.loadProperties(); - final ConfigurationObjectFactory configFactory = Config.createFactory(props); - final Lifecycle lifecycle = new Lifecycle(); - - final HttpClient httpClient = HttpClientInit.createClient( - HttpClientConfig.builder().withNumConnections(1).build(), lifecycle - ); - - final ServiceEmitter emitter = new ServiceEmitter( - props.getProperty("druid.service"), - props.getProperty("druid.host"), - Emitters.create(props, httpClient, jsonMapper, lifecycle) - ); - - final ExecutorService executorService = ExecutorServices.create( - lifecycle, - configFactory.buildWithReplacements( - ExecutorServiceConfig.class, ImmutableMap.of("base_path", "druid.processing") - ) - ); - - StupidPool computationBufferPool = ServerInit.makeComputeScratchPool( - Integer.parseInt(props.getProperty("druid.computation.buffer.size", String.valueOf(1024 * 1024 * 1024))) - ); - - Map, QueryRunnerFactory> queryRunners = ServerInit.initDefaultQueryTypes( - configFactory, - computationBufferPool - ); - - final RestS3Service s3Client = new RestS3Service( - new AWSCredentials(props.getProperty("com.metamx.aws.accessKey"), props.getProperty("com.metamx.aws.secretKey")) - ); - QueryableLoaderConfig queryableLoaderConfig = configFactory.build(QueryableLoaderConfig.class); - final ServerManager serverManager = new ServerManager( - ServerInit.makeDefaultQueryableLoader(s3Client, queryableLoaderConfig), - new DefaultQueryRunnerFactoryConglomerate(queryRunners), - emitter, - executorService - ); - - final ZkClient zkClient = Initialization.makeZkClient(configFactory.build(ZkClientConfig.class), lifecycle); - - final DruidServer druidServer = new DruidServer(configFactory.build(DruidServerConfig.class)); - final PhoneBook coordinatorYp = Initialization.createYellowPages( - jsonMapper, - zkClient, - "Coordinator-ZKYP--%s", - lifecycle - ); - final ZkCoordinator coordinator = new ZkCoordinator( - jsonMapper, - configFactory.build(ZkCoordinatorConfig.class), - druidServer, - coordinatorYp, - serverManager, - emitter - ); - lifecycle.addManagedInstance(coordinator); - - final ScheduledExecutorFactory scheduledExecutorFactory = ScheduledExecutors.createFactory(lifecycle); - - final ScheduledExecutorService globalScheduledExec = scheduledExecutorFactory.create(1, "Global--%d"); - final List monitors = Lists.newArrayList( - new ServerMonitor(druidServer, serverManager), - new JvmMonitor() - ); - if (Boolean.parseBoolean(props.getProperty("druid.monitoring.monitorSystem", "true"))) { - monitors.add(new SysMonitor()); - } - - final MonitorScheduler healthMonitor = new MonitorScheduler( - configFactory.build(MonitorSchedulerConfig.class), - globalScheduledExec, - emitter, - monitors - ); - lifecycle.addManagedInstance(healthMonitor); - - final RequestLogger requestLogger = Initialization.makeRequestLogger( - scheduledExecutorFactory.create( - 1, - "RequestLogger--%d" - ), - props - ); - lifecycle.addManagedInstance(requestLogger); - - try { - lifecycle.start(); - } - catch (Throwable t) { - log.error(t, "Error when starting up. Failing."); - System.exit(1); - } - - Runtime.getRuntime().addShutdownHook( - new Thread( - new Runnable() - { - @Override - public void run() - { - log.info("Running shutdown hook"); - lifecycle.stop(); - } - } - ) - ); - - final Server server = Initialization.makeJettyServer(configFactory.build(ServerConfig.class)); - final Context root = new Context(server, "/", Context.SESSIONS); - - root.addServlet(new ServletHolder(new StatusServlet()), "/status"); - root.addServlet( - new ServletHolder(new QueryServlet(jsonMapper, smileMapper, serverManager, emitter, requestLogger)), - "/*" - ); - - - server.start(); - server.join(); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("!@(*&$#!(*@(@*&$! You are running with ServerMain!!!! PLZ Stop. Use ComputeMain instead."); + System.out.println("K thx bye."); + ComputeMain.main(args); } } 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 0a90e7f99da..acbe1fc1549 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMaster.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMaster.java @@ -53,7 +53,6 @@ import com.metamx.druid.client.DruidServer; import com.metamx.druid.client.SegmentInventoryManager; import com.metamx.druid.client.ServerInventoryManager; import com.metamx.druid.coordination.DruidClusterInfo; -import com.metamx.druid.coordination.legacy.TheSizeAdjuster; import com.metamx.druid.db.DatabaseSegmentManager; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; @@ -78,7 +77,6 @@ public class DruidMaster private final DruidClusterInfo clusterInfo; private final DatabaseSegmentManager databaseSegmentManager; private final ServerInventoryManager serverInventoryManager; - private final TheSizeAdjuster sizeAdjuster; private final PhoneBook yp; private final ServiceEmitter emitter; private final ScheduledExecutorService exec; @@ -98,7 +96,6 @@ public class DruidMaster ObjectMapper jsonMapper, DatabaseSegmentManager databaseSegmentManager, ServerInventoryManager serverInventoryManager, - TheSizeAdjuster sizeAdjuster, PhoneBook zkPhoneBook, ServiceEmitter emitter, ScheduledExecutorFactory scheduledExecutorFactory, @@ -114,7 +111,6 @@ public class DruidMaster this.databaseSegmentManager = databaseSegmentManager; this.serverInventoryManager = serverInventoryManager; - this.sizeAdjuster = sizeAdjuster; this.yp = zkPhoneBook; this.emitter = emitter; @@ -355,16 +351,7 @@ public class DruidMaster for (DataSegment dataSegment : dataSegments) { if (dataSegment.getSize() < 0) { - log.info("No size on Segment[%s], setting.", dataSegment); - - DataSegment newDataSegment = sizeAdjuster.updateDescriptor(dataSegment); - - if (newDataSegment == null) { - log.warn("newDataSegment was null with old dataSegment[%s]. Skipping.", dataSegment); - continue; - } - - dataSegment = newDataSegment; + log.warn("No size on Segment[%s], wtf?", dataSegment); } availableSegments.add(dataSegment); } 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 ebbe1f0f733..ae3755e79c8 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java @@ -33,7 +33,6 @@ import com.metamx.druid.client.DataSegment; import com.metamx.druid.client.DruidServer; import com.metamx.druid.client.ServerInventoryManager; import com.metamx.druid.client.ZKPhoneBook; -import com.metamx.druid.coordination.legacy.TheSizeAdjuster; import com.metamx.druid.db.DatabaseSegmentManager; import com.metamx.druid.metrics.NoopServiceEmitter; import com.metamx.phonebook.PhoneBook; @@ -48,7 +47,6 @@ public class DruidMasterTest private PhoneBook yp; private DatabaseSegmentManager databaseSegmentManager; private ServerInventoryManager serverInventoryManager; - private TheSizeAdjuster theSizeAdjuster; private ScheduledExecutorFactory scheduledExecutorFactory; private DruidServer druidServer; private DataSegment segment; @@ -70,9 +68,6 @@ public class DruidMasterTest databaseSegmentManager = EasyMock.createNiceMock(DatabaseSegmentManager.class); EasyMock.replay(databaseSegmentManager); - theSizeAdjuster = EasyMock.createNiceMock(TheSizeAdjuster.class); - EasyMock.replay(theSizeAdjuster); - scheduledExecutorFactory = EasyMock.createNiceMock(ScheduledExecutorFactory.class); EasyMock.replay(scheduledExecutorFactory); @@ -144,7 +139,6 @@ public class DruidMasterTest null, databaseSegmentManager, serverInventoryManager, - theSizeAdjuster, yp, new NoopServiceEmitter(), scheduledExecutorFactory, From f07b15db1fbf6eb4f2460b46a570df10d2503622 Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Thu, 1 Nov 2012 18:38:26 -0500 Subject: [PATCH 09/13] Undo massive import re-ordering --- .../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 +- .../metamx/druid/client/BrokerServerView.java | 16 ++-- .../druid/client/CachingClusteredClient.java | 25 +++--- .../druid/client/ClientInventoryManager.java | 8 +- .../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 +- .../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 +- .../druid/realtime/RealtimePlumberSchool.java | 41 +++++---- .../druid/realtime/S3SegmentPusher.java | 29 ++++--- .../com/metamx/druid/realtime/Schema.java | 10 +-- .../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 +- .../druid/db/DatabaseSegmentManager.java | 42 +++++----- .../com/metamx/druid/http/InfoResource.java | 35 ++++---- .../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 +-- .../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 | 16 ++-- .../master/DruidMasterReplicatorTest.java | 15 ++-- .../master/DruidMasterSegmentMergerTest.java | 14 ++-- .../metamx/druid/master/DruidMasterTest.java | 15 ++-- 382 files changed, 1962 insertions(+), 2187 deletions(-) diff --git a/client/src/main/java/com/metamx/druid/BaseQuery.java b/client/src/main/java/com/metamx/druid/BaseQuery.java index 8213d67a553..4538467c167 100644 --- a/client/src/main/java/com/metamx/druid/BaseQuery.java +++ b/client/src/main/java/com/metamx/druid/BaseQuery.java @@ -19,18 +19,17 @@ 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 618d1adc15c..b9c2fbaca74 100644 --- a/client/src/main/java/com/metamx/druid/Druids.java +++ b/client/src/main/java/com/metamx/druid/Druids.java @@ -19,12 +19,6 @@ 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; @@ -41,6 +35,11 @@ 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 cb77ca3ed4e..f7450f86534 100644 --- a/client/src/main/java/com/metamx/druid/Query.java +++ b/client/src/main/java/com/metamx/druid/Query.java @@ -19,20 +19,19 @@ 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 01568bc27b0..972d98b3214 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 9403b55a9f2..bf87f20bbb3 100644 --- a/client/src/main/java/com/metamx/druid/SearchBinaryFn.java +++ b/client/src/main/java/com/metamx/druid/SearchBinaryFn.java @@ -19,8 +19,6 @@ 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; @@ -28,6 +26,9 @@ 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/BrokerServerView.java b/client/src/main/java/com/metamx/druid/client/BrokerServerView.java index 197f69a7765..e37e0bfeb01 100644 --- a/client/src/main/java/com/metamx/druid/client/BrokerServerView.java +++ b/client/src/main/java/com/metamx/druid/client/BrokerServerView.java @@ -19,15 +19,6 @@ 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; @@ -37,6 +28,13 @@ 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/CachingClusteredClient.java b/client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java index d933fe31ef2..6c7e588a6b7 100644 --- a/client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java +++ b/client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java @@ -19,19 +19,6 @@ 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; @@ -65,6 +52,18 @@ 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 9fdab41abe4..5ec8cf47d36 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/DataSegment.java b/client/src/main/java/com/metamx/druid/client/DataSegment.java index 1e3feede7d3..1f7fcc42d19 100644 --- a/client/src/main/java/com/metamx/druid/client/DataSegment.java +++ b/client/src/main/java/com/metamx/druid/client/DataSegment.java @@ -19,12 +19,18 @@ package com.metamx.druid.client; -import java.util.Comparator; -import java.util.List; -import java.util.Map; - -import javax.annotation.Nullable; - +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 org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonDeserialize; @@ -32,17 +38,10 @@ import org.codehaus.jackson.map.annotate.JsonSerialize; import org.joda.time.DateTime; import org.joda.time.Interval; -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; +import javax.annotation.Nullable; +import java.util.Comparator; +import java.util.List; +import java.util.Map; /** */ 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 1f4ae372062..62782a41892 100644 --- a/client/src/main/java/com/metamx/druid/client/DirectDruidClient.java +++ b/client/src/main/java/com/metamx/druid/client/DirectDruidClient.java @@ -19,26 +19,6 @@ 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; @@ -60,6 +40,25 @@ 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 611ad81f1a0..6f96e8e8672 100644 --- a/client/src/main/java/com/metamx/druid/client/DruidDataSource.java +++ b/client/src/main/java/com/metamx/druid/client/DruidDataSource.java @@ -19,15 +19,14 @@ 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 751e2d7e46c..d8f4cda8fa7 100644 --- a/client/src/main/java/com/metamx/druid/client/DruidServer.java +++ b/client/src/main/java/com/metamx/druid/client/DruidServer.java @@ -19,17 +19,16 @@ 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 9b14c56c6f0..a47f057fa43 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 8135df4042d..13f6b6aae5f 100644 --- a/client/src/main/java/com/metamx/druid/client/InventoryManager.java +++ b/client/src/main/java/com/metamx/druid/client/InventoryManager.java @@ -19,12 +19,6 @@ 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; @@ -33,6 +27,12 @@ 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 dea8065a447..3448667f106 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 0b3b075be78..5bc8633dd9b 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 27f2aca0e63..bd32a62791d 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 c5fcb30370d..4b707549387 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 cecf7cf5118..af9d552d009 100644 --- a/client/src/main/java/com/metamx/druid/client/ZKPhoneBook.java +++ b/client/src/main/java/com/metamx/druid/client/ZKPhoneBook.java @@ -19,21 +19,6 @@ 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; @@ -43,6 +28,20 @@ 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 395fba01909..59a60f060e5 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 decc68464af..943c5aae154 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,6 +19,10 @@ 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; @@ -26,10 +30,6 @@ 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 69f6f0813af..22d56e46f69 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/ClientInfoResource.java b/client/src/main/java/com/metamx/druid/http/ClientInfoResource.java index 99e788970a4..50a0475de4b 100644 --- a/client/src/main/java/com/metamx/druid/http/ClientInfoResource.java +++ b/client/src/main/java/com/metamx/druid/http/ClientInfoResource.java @@ -19,18 +19,6 @@ 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; @@ -41,6 +29,16 @@ 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 3a5492d9490..d316e8fcab5 100644 --- a/client/src/main/java/com/metamx/druid/http/ClientQuerySegmentWalker.java +++ b/client/src/main/java/com/metamx/druid/http/ClientQuerySegmentWalker.java @@ -19,10 +19,6 @@ 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; @@ -35,6 +31,9 @@ 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 52e1b4ff7aa..7ecc5d7ad81 100644 --- a/client/src/main/java/com/metamx/druid/http/ClientServletModule.java +++ b/client/src/main/java/com/metamx/druid/http/ClientServletModule.java @@ -19,16 +19,15 @@ 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 8a3d2f3e1d4..20425f9eb37 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,20 @@ package com.metamx.druid.http; -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; +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; /** */ 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 5bea2c6da4a..f68efbc1e89 100644 --- a/client/src/main/java/com/metamx/druid/http/QueryServlet.java +++ b/client/src/main/java/com/metamx/druid/http/QueryServlet.java @@ -19,20 +19,6 @@ 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; @@ -45,6 +31,18 @@ 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 474de4ef92d..e42be46fff6 100644 --- a/client/src/main/java/com/metamx/druid/http/RequestLogLine.java +++ b/client/src/main/java/com/metamx/druid/http/RequestLogLine.java @@ -19,12 +19,11 @@ package com.metamx.druid.http; -import java.util.Arrays; - -import org.joda.time.DateTime; - import com.google.common.base.Joiner; import com.metamx.druid.Query; +import org.joda.time.DateTime; + +import java.util.Arrays; 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 2d6ce4c9247..95a40c543b8 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,14 @@ package com.metamx.druid.http; -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; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; /** */ 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 fec4d0826e6..5dbd50dfc8a 100644 --- a/client/src/main/java/com/metamx/druid/initialization/Initialization.java +++ b/client/src/main/java/com/metamx/druid/initialization/Initialization.java @@ -19,21 +19,6 @@ 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; @@ -53,6 +38,20 @@ 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 4d0a5cf8f99..441adcffc3b 100644 --- a/client/src/main/java/com/metamx/druid/merge/ClientAppendQuery.java +++ b/client/src/main/java/com/metamx/druid/merge/ClientAppendQuery.java @@ -19,12 +19,11 @@ package com.metamx.druid.merge; -import java.util.List; - +import com.metamx.druid.client.DataSegment; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.metamx.druid.client.DataSegment; +import java.util.List; /** */ 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 c94814bdbe9..c5cc8045492 100644 --- a/client/src/main/java/com/metamx/druid/merge/ClientDefaultMergeQuery.java +++ b/client/src/main/java/com/metamx/druid/merge/ClientDefaultMergeQuery.java @@ -19,13 +19,12 @@ package com.metamx.druid.merge; -import java.util.List; - +import com.metamx.druid.aggregation.AggregatorFactory; +import com.metamx.druid.client.DataSegment; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.metamx.druid.aggregation.AggregatorFactory; -import com.metamx.druid.client.DataSegment; +import java.util.List; /** */ 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 06f237f7219..83f269d0db3 100644 --- a/client/src/main/java/com/metamx/druid/merge/ClientMergeQuery.java +++ b/client/src/main/java/com/metamx/druid/merge/ClientMergeQuery.java @@ -19,12 +19,11 @@ package com.metamx.druid.merge; -import java.util.List; - +import com.metamx.druid.client.DataSegment; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import com.metamx.druid.client.DataSegment; +import java.util.List; /** */ 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 5e0c5b5362c..1ecea33117f 100644 --- a/client/src/main/java/com/metamx/druid/query/BySegmentQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/BySegmentQueryRunner.java @@ -19,10 +19,6 @@ 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; @@ -33,6 +29,9 @@ 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 63eb65d725b..6a30a743892 100644 --- a/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java @@ -19,14 +19,6 @@ 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; @@ -37,6 +29,14 @@ 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 f67a959b4dc..22f11bb07a8 100644 --- a/client/src/main/java/com/metamx/druid/query/FinalizeResultsQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/FinalizeResultsQueryRunner.java @@ -19,8 +19,6 @@ 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; @@ -31,6 +29,8 @@ 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 b05f6bdb465..9c0a32eac3f 100644 --- a/client/src/main/java/com/metamx/druid/query/IntervalChunkingQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/IntervalChunkingQueryRunner.java @@ -19,15 +19,6 @@ 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; @@ -36,6 +27,13 @@ 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 3a29192c70c..44db0ac3893 100644 --- a/client/src/main/java/com/metamx/druid/query/MetricsEmittingQueryRunner.java +++ b/client/src/main/java/com/metamx/druid/query/MetricsEmittingQueryRunner.java @@ -19,8 +19,6 @@ 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; @@ -30,6 +28,8 @@ 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 7a6e3e8d53b..dd293fbdf5c 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 java.nio.ByteBuffer; -import java.util.List; - import com.google.common.collect.Lists; import com.metamx.druid.aggregation.AggregatorFactory; +import java.nio.ByteBuffer; +import java.util.List; + /** */ 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 4f97449e0e5..ebf77f64af4 100644 --- a/client/src/main/java/com/metamx/druid/query/QueryToolChest.java +++ b/client/src/main/java/com/metamx/druid/query/QueryToolChest.java @@ -19,12 +19,11 @@ 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 2be8346f5f0..cd9eba24f25 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 java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - import com.google.common.collect.Maps; import com.metamx.common.logger.Logger; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + /** */ 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 99af7eb936d..4895378cc1b 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,12 +19,11 @@ package com.metamx.druid.query.dimension; -import java.nio.ByteBuffer; - +import com.metamx.druid.query.extraction.DimExtractionFn; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.metamx.druid.query.extraction.DimExtractionFn; +import java.nio.ByteBuffer; /** */ 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 48f53d8a8ce..34310ef4c09 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,11 +19,10 @@ 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 1ad755e7ce2..ed85b840d0d 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,12 +19,11 @@ package com.metamx.druid.query.dimension; -import java.nio.ByteBuffer; - +import com.metamx.druid.query.extraction.DimExtractionFn; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.metamx.druid.query.extraction.DimExtractionFn; +import java.nio.ByteBuffer; /** */ 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 b3b3dfa65ca..9a4e11a9a5f 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,11 +19,10 @@ package com.metamx.druid.query.dimension; -import java.util.Map; - +import com.metamx.common.IAE; import org.codehaus.jackson.annotate.JsonCreator; -import com.metamx.common.IAE; +import java.util.Map; /** */ 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 2dbbf85c9f6..28ea1ebc37b 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 02189bb37e3..da3a878aa2f 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 f3d9c33bb35..57e3bfde16b 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,12 +19,11 @@ package com.metamx.druid.query.extraction; -import java.nio.ByteBuffer; - +import com.metamx.druid.query.search.SearchQuerySpec; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.metamx.druid.query.search.SearchQuerySpec; +import java.nio.ByteBuffer; /** */ 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 e9fb0179adc..dc2c2eb36cf 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,13 @@ package com.metamx.druid.query.extraction; -import java.nio.ByteBuffer; -import java.text.ParseException; -import java.util.Date; - +import com.ibm.icu.text.SimpleDateFormat; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.ibm.icu.text.SimpleDateFormat; +import java.nio.ByteBuffer; +import java.text.ParseException; +import java.util.Date; /** */ 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 b6362928dac..b0bbb581030 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,12 +19,11 @@ package com.metamx.druid.query.filter; -import java.util.List; - +import com.google.common.base.Joiner; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.google.common.base.Joiner; +import java.util.List; /** */ 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 8ce682174bf..dd5e7ad6ddd 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,12 +19,11 @@ package com.metamx.druid.query.filter; -import java.nio.ByteBuffer; - +import com.metamx.druid.query.extraction.DimExtractionFn; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.metamx.druid.query.extraction.DimExtractionFn; +import java.nio.ByteBuffer; /** */ 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 aae09b3fbc8..391ac29bfde 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 4cddd3e5943..4ebdcb8471e 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,12 +19,11 @@ package com.metamx.druid.query.filter; -import java.util.List; - +import com.google.common.base.Joiner; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.google.common.base.Joiner; +import java.util.List; /** */ 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 a582b3d2b4c..584916c9bf4 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,12 +19,11 @@ package com.metamx.druid.query.filter; -import java.nio.ByteBuffer; - +import com.google.common.base.Charsets; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.google.common.base.Charsets; +import java.nio.ByteBuffer; /** */ 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 2f6d5371232..73097ec0cd1 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 9be360d2f7e..d30af309473 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,12 +19,6 @@ 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; @@ -39,6 +33,11 @@ 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 4ab2e9973e3..d66f27f4d36 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,15 +19,6 @@ 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; @@ -50,6 +41,13 @@ 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 3c83a229095..e0a73b4bc3c 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,14 +19,13 @@ package com.metamx.druid.query.search; -import java.nio.ByteBuffer; -import java.util.List; - +import com.google.common.base.Function; +import com.google.common.collect.Lists; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.google.common.base.Function; -import com.google.common.collect.Lists; +import java.nio.ByteBuffer; +import java.util.List; /** */ 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 bad823c6e24..87a6246a5b2 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 c5d0ca990df..b7dfddef413 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,11 @@ package com.metamx.druid.query.search; -import java.util.Comparator; - import org.codehaus.jackson.annotate.JsonCreator; +import java.util.Comparator; +import java.util.Map; + /** */ public class LexicographicSearchSortSpec implements SearchSortSpec 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 3064ec1ccf4..c1c0727067a 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 7ef40272d9a..2a721431b89 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,14 +19,6 @@ 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; @@ -37,6 +29,12 @@ 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 85b768f2b99..1b6a5e1345e 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,20 +19,6 @@ 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; @@ -63,6 +49,18 @@ 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 6c19bd3b3bc..faa1cca17a7 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,9 +19,12 @@ 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 07c1b42416c..b68f074e2ce 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 8fd79701c1d..bef5de85726 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,6 +20,7 @@ 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 4bd18029e77..6d25c152ab4 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,15 @@ package com.metamx.druid.query.segment; -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; +import org.codehaus.jackson.annotate.JsonCreator; +import org.joda.time.Interval; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; /** */ 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 823f2c3a659..f81126857bc 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,16 +19,15 @@ package com.metamx.druid.query.segment; -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; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.joda.time.Interval; -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; /** */ 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 c28f8406ca5..4193934fbc0 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,17 +19,16 @@ 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 ab0ce80b2c8..ca42ce8bc8a 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,14 +19,13 @@ package com.metamx.druid.query.segment; -import java.util.List; - +import com.metamx.druid.Query; +import com.metamx.druid.query.QueryRunner; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; import org.joda.time.Interval; -import com.metamx.druid.Query; -import com.metamx.druid.query.QueryRunner; +import java.util.List; /** */ 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 526bb448b20..efb7667a370 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,10 +19,9 @@ 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 62f2f43cec7..f5289185646 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,9 +19,6 @@ 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; @@ -30,6 +27,9 @@ 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 ca1953669d5..c85ef86aa2a 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,12 @@ package com.metamx.druid.query.segment; -import java.util.Arrays; -import java.util.List; - -import org.joda.time.Interval; - import com.metamx.druid.Query; import com.metamx.druid.query.QueryRunner; +import org.joda.time.Interval; + +import java.util.Arrays; +import java.util.List; /** */ 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 be30df421f8..b68d97813ca 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,16 +19,6 @@ 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; @@ -38,6 +28,15 @@ 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 73471f8fe63..9d65ab9b47c 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,14 +19,6 @@ 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; @@ -44,6 +36,12 @@ 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 eddd10ad687..24d9637ae84 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 java.util.List; - import org.codehaus.jackson.annotate.JsonProperty; +import java.util.List; + /** */ 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 4517429039a..b324ccbab37 100644 --- a/client/src/main/java/com/metamx/druid/result/BySegmentSearchResultValue.java +++ b/client/src/main/java/com/metamx/druid/result/BySegmentSearchResultValue.java @@ -19,12 +19,11 @@ package com.metamx.druid.result; -import java.util.List; - +import com.metamx.druid.query.search.SearchHit; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.annotate.JsonValue; -import com.metamx.druid.query.search.SearchHit; +import java.util.List; /** */ 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 49cc332aa1e..9fc5aebf347 100644 --- a/client/src/main/java/com/metamx/druid/result/Result.java +++ b/client/src/main/java/com/metamx/druid/result/Result.java @@ -21,6 +21,7 @@ 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 3131b9eeeee..40f10ed85ec 100644 --- a/client/src/main/java/com/metamx/druid/result/SearchResultValue.java +++ b/client/src/main/java/com/metamx/druid/result/SearchResultValue.java @@ -19,13 +19,12 @@ package com.metamx.druid.result; -import java.util.Iterator; -import java.util.List; - +import com.metamx.druid.query.search.SearchHit; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonValue; -import com.metamx.druid.query.search.SearchHit; +import java.util.Iterator; +import java.util.List; /** */ 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 ce85ed692c7..74daa14f376 100644 --- a/client/src/main/java/com/metamx/druid/result/TimeBoundaryResultValue.java +++ b/client/src/main/java/com/metamx/druid/result/TimeBoundaryResultValue.java @@ -19,14 +19,13 @@ package com.metamx.druid.result; -import java.util.Map; - +import com.metamx.common.IAE; +import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonValue; import org.joda.time.DateTime; -import com.metamx.common.IAE; -import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; +import java.util.Map; /** */ 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 cf3dd974094..4ed756e1daf 100644 --- a/client/src/main/java/com/metamx/druid/shard/NoneShardSpec.java +++ b/client/src/main/java/com/metamx/druid/shard/NoneShardSpec.java @@ -19,11 +19,12 @@ 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 03a11a4b47d..c0127b055e9 100644 --- a/client/src/main/java/com/metamx/druid/shard/ShardSpec.java +++ b/client/src/main/java/com/metamx/druid/shard/ShardSpec.java @@ -19,13 +19,12 @@ package com.metamx.druid.shard; -import java.util.Map; - +import com.metamx.druid.input.InputRow; +import com.metamx.druid.partition.PartitionChunk; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import com.metamx.druid.input.InputRow; -import com.metamx.druid.partition.PartitionChunk; +import java.util.Map; /** * 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 c4b67073b1e..7580673b071 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 b6b08e78eac..40ccf68da17 100644 --- a/client/src/main/java/com/metamx/druid/zk/StringZkSerializer.java +++ b/client/src/main/java/com/metamx/druid/zk/StringZkSerializer.java @@ -19,12 +19,11 @@ package com.metamx.druid.zk; -import java.nio.charset.Charset; - +import com.metamx.common.IAE; import org.I0Itec.zkclient.exception.ZkMarshallingError; import org.I0Itec.zkclient.serialize.ZkSerializer; -import com.metamx.common.IAE; +import java.nio.charset.Charset; /** */ diff --git a/client/src/main/java/com/metamx/phonebook/BasePhoneBook.java b/client/src/main/java/com/metamx/phonebook/BasePhoneBook.java index dc2cad6a459..f604f341412 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 30dc22218fb..ff2dd74a63b 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 ac00c1a9777..907ee186b06 100644 --- a/client/src/main/java/com/metamx/phonebook/StoppedPhoneBook.java +++ b/client/src/main/java/com/metamx/phonebook/StoppedPhoneBook.java @@ -19,12 +19,6 @@ 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; @@ -35,6 +29,12 @@ 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 845ff5accf0..94650467656 100644 --- a/client/src/test/java/com/metamx/druid/CombiningIterableTest.java +++ b/client/src/test/java/com/metamx/druid/CombiningIterableTest.java @@ -19,17 +19,16 @@ package com.metamx.druid; -import java.util.Arrays; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; - +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 com.metamx.common.guava.nary.BinaryFn; -import com.metamx.druid.result.Result; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; /** */ diff --git a/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java b/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java index f8e86563b3d..13f99f601ac 100644 --- a/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java +++ b/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java @@ -19,12 +19,11 @@ 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 796bf5a25bc..4b6b4181d26 100644 --- a/client/src/test/java/com/metamx/druid/SearchBinaryFnTest.java +++ b/client/src/test/java/com/metamx/druid/SearchBinaryFnTest.java @@ -19,19 +19,17 @@ 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 16dc90695a4..342b3b4111c 100644 --- a/client/src/test/java/com/metamx/druid/TestHelper.java +++ b/client/src/test/java/com/metamx/druid/TestHelper.java @@ -19,14 +19,13 @@ 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 25a767fe56b..c29d10781e2 100644 --- a/client/src/test/java/com/metamx/druid/client/DataSegmentTest.java +++ b/client/src/test/java/com/metamx/druid/client/DataSegmentTest.java @@ -19,19 +19,6 @@ package com.metamx.druid.client; -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; -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.google.common.collect.Lists; @@ -39,6 +26,18 @@ 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 org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.type.TypeReference; +import org.joda.time.DateTime; +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; /** */ 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 b3d273b2bf8..fac858d2192 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 343fe1e6301..4338a23a10d 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,12 +19,11 @@ 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 4c12fc7e443..a05973af729 100644 --- a/client/src/test/java/com/metamx/druid/query/QuerySegmentSpecTest.java +++ b/client/src/test/java/com/metamx/druid/query/QuerySegmentSpecTest.java @@ -19,13 +19,6 @@ 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; @@ -34,6 +27,12 @@ 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 ed0407ff8a1..061f8122f2e 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,13 @@ package com.metamx.druid.query.extraction; -import java.util.Arrays; -import java.util.List; -import java.util.Set; - +import com.google.common.collect.Sets; import org.junit.Assert; import org.junit.Test; -import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.List; +import java.util.Set; /** */ 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 2e06a80125e..2ec3f3db239 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,12 +19,11 @@ package com.metamx.druid.query.extraction; -import java.util.Set; - +import com.google.common.collect.Sets; import org.junit.Assert; import org.junit.Test; -import com.google.common.collect.Sets; +import java.util.Set; /** */ 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 5fe1517fe8e..808c3603b6b 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,17 +19,16 @@ 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 cfba9e650a6..7f5b6eabe1c 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,12 +19,11 @@ package com.metamx.druid.query.extraction; -import java.util.Set; - +import com.google.common.collect.Sets; import org.junit.Assert; import org.junit.Test; -import com.google.common.collect.Sets; +import java.util.Set; /** */ 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 8a11b067742..d92f927767f 100644 --- a/client/src/test/java/com/metamx/druid/shard/SingleDimensionShardSpecTest.java +++ b/client/src/test/java/com/metamx/druid/shard/SingleDimensionShardSpecTest.java @@ -19,13 +19,6 @@ 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; @@ -35,6 +28,13 @@ 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 7fcc77ea33e..bf9b8ce1f21 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 java.util.Iterator; -import java.util.NoSuchElementException; - import org.joda.time.DateTime; import org.joda.time.DateTimeZone; +import java.util.Iterator; +import java.util.NoSuchElementException; + 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 6f00ff6d93f..7100656207b 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 java.util.Comparator; -import java.util.Iterator; - import com.metamx.common.guava.MergeIterable; import com.metamx.common.guava.nary.BinaryFn; +import java.util.Comparator; +import java.util.Iterator; + /** */ 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 b31e49fc1af..e8a27af0868 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 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; +import java.util.Comparator; +import java.util.Iterator; +import java.util.NoSuchElementException; + /** */ 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 9d20c3f4b17..da485b62e97 100644 --- a/common/src/main/java/com/metamx/druid/DurationGranularity.java +++ b/common/src/main/java/com/metamx/druid/DurationGranularity.java @@ -19,13 +19,12 @@ package com.metamx.druid; -import java.nio.ByteBuffer; - +import com.google.common.primitives.Longs; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.joda.time.DateTime; -import com.google.common.primitives.Longs; +import java.nio.ByteBuffer; 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 d7ab0e486b3..36a4dd01714 100644 --- a/common/src/main/java/com/metamx/druid/QueryGranularity.java +++ b/common/src/main/java/com/metamx/druid/QueryGranularity.java @@ -19,14 +19,13 @@ 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 c515066d089..403fe8bb2cb 100644 --- a/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java +++ b/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java @@ -19,9 +19,8 @@ package com.metamx.druid; -import org.joda.time.Interval; - import com.metamx.druid.partition.PartitionHolder; +import org.joda.time.Interval; /** */ diff --git a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java index 4572787ba7a..a45821c7dba 100644 --- a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java +++ b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java @@ -19,6 +19,15 @@ 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; @@ -28,16 +37,6 @@ 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 f311b09c34d..4acbd162f5a 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/Aggregator.java +++ b/common/src/main/java/com/metamx/druid/aggregation/Aggregator.java @@ -19,6 +19,7 @@ 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 34c503f5459..00722fcf5eb 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/AggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/AggregatorFactory.java @@ -19,13 +19,12 @@ package com.metamx.druid.aggregation; -import java.util.Comparator; -import java.util.List; - +import com.metamx.druid.processing.MetricSelectorFactory; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import com.metamx.druid.processing.MetricSelectorFactory; +import java.util.Comparator; +import java.util.List; /** * 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 1c15ec67054..61dcde40449 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/CountAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/CountAggregatorFactory.java @@ -19,15 +19,14 @@ package com.metamx.druid.aggregation; -import java.util.Comparator; -import java.util.List; - -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - import com.google.common.collect.ImmutableList; 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.util.Comparator; +import java.util.List; /** */ 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 507753fa1b1..21cb4691227 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 java.util.Comparator; - import com.metamx.druid.processing.FloatMetricSelector; +import java.util.Comparator; + /** */ 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 f18ae23a63f..d8166f841e7 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregatorFactory.java @@ -19,17 +19,16 @@ 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 add78ac8ca0..3e85d489db2 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 java.nio.ByteBuffer; - import com.metamx.druid.processing.FloatMetricSelector; +import java.nio.ByteBuffer; + /** */ 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 79f7ee3c211..8f081ca7ade 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/Histogram.java +++ b/common/src/main/java/com/metamx/druid/aggregation/Histogram.java @@ -19,15 +19,14 @@ 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 d5a73e1ce28..c2d9d674732 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 f2b20840557..8902ae56bef 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,18 @@ package com.metamx.druid.aggregation; -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; +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; public class HistogramAggregatorFactory implements AggregatorFactory { 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 cd25549ec05..fe4f366631c 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 a72c1612255..5ce5217e1b2 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/HistogramVisual.java +++ b/common/src/main/java/com/metamx/druid/aggregation/HistogramVisual.java @@ -19,12 +19,11 @@ package com.metamx.druid.aggregation; -import java.util.Arrays; - +import com.google.common.base.Preconditions; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.google.common.base.Preconditions; +import java.util.Arrays; 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 8a66cd2e597..80daa045d82 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 c8333ab34de..f2dd1604af4 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregatorFactory.java @@ -19,14 +19,12 @@ package com.metamx.druid.aggregation; -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 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 org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import org.mozilla.javascript.Context; @@ -34,12 +32,12 @@ import org.mozilla.javascript.Function; import org.mozilla.javascript.Script; import org.mozilla.javascript.ScriptableObject; -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 javax.annotation.Nullable; +import java.nio.ByteBuffer; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Comparator; +import java.util.List; 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 6713666e932..02fe27abda4 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 java.nio.ByteBuffer; -import java.util.List; - import com.google.common.collect.Lists; import com.metamx.druid.processing.FloatMetricSelector; +import java.nio.ByteBuffer; +import java.util.List; + 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 8377e01253b..32a81ef719f 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 952cf8f4849..a32887c2b68 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregatorFactory.java @@ -19,17 +19,16 @@ 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 d6c6f9bcc15..533f6782d5d 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 java.nio.ByteBuffer; - import com.metamx.druid.processing.FloatMetricSelector; +import java.nio.ByteBuffer; + /** */ 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 1b435b70a18..0bd0ed6f29a 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 java.util.Comparator; - import com.metamx.druid.processing.FloatMetricSelector; +import java.util.Comparator; + /** */ 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 111f0b55f2c..cd5aaf336db 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MaxAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/MaxAggregatorFactory.java @@ -19,17 +19,16 @@ 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 4c2469902e9..8a497a1ddfb 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 java.nio.ByteBuffer; - import com.metamx.druid.processing.FloatMetricSelector; +import java.nio.ByteBuffer; + /** */ 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 aeb0081e24b..1ff56fa837d 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 java.util.Comparator; - import com.metamx.druid.processing.FloatMetricSelector; +import java.util.Comparator; + /** */ 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 e62e4f156be..ee6e4d25a01 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MinAggregatorFactory.java +++ b/common/src/main/java/com/metamx/druid/aggregation/MinAggregatorFactory.java @@ -19,17 +19,16 @@ 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 9dc8a7f6d10..68e34675e36 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 java.nio.ByteBuffer; - import com.metamx.druid.processing.FloatMetricSelector; +import java.nio.ByteBuffer; + /** */ 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 b7cc2f717a8..6d16b10be06 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 8fd3dd905d9..90a5e09afbd 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,18 +19,17 @@ 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 e9ac3bedd6c..eef818db49f 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 java.util.Comparator; -import java.util.Map; - import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; +import java.util.Comparator; +import java.util.Map; + /** */ 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 bf075fc4bd1..1c3f328fa87 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 java.util.Comparator; -import java.util.Map; - import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; +import java.util.Comparator; +import java.util.Map; + /** */ 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 dc2b0568a12..5e679d64868 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 java.util.Comparator; -import java.util.Map; - import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; +import java.util.Comparator; +import java.util.Map; + /** * 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 56c06aadaa3..9f9c2eeef88 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 6f8adf78ab6..f9268aa7e1a 100644 --- a/common/src/main/java/com/metamx/druid/collect/OrderedMergeIterator.java +++ b/common/src/main/java/com/metamx/druid/collect/OrderedMergeIterator.java @@ -19,19 +19,18 @@ 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 5fc713acabc..60772e4f474 100644 --- a/common/src/main/java/com/metamx/druid/collect/OrderedMergeSequence.java +++ b/common/src/main/java/com/metamx/druid/collect/OrderedMergeSequence.java @@ -19,11 +19,6 @@ 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; @@ -35,6 +30,10 @@ 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 15eefaf240b..8d5c3f26590 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 bbc16c4c488..bda9fb1221d 100644 --- a/common/src/main/java/com/metamx/druid/db/DbConnector.java +++ b/common/src/main/java/com/metamx/druid/db/DbConnector.java @@ -19,17 +19,15 @@ package com.metamx.druid.db; -import java.util.List; -import java.util.Map; - -import javax.sql.DataSource; - +import com.metamx.common.logger.Logger; 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 com.metamx.common.logger.Logger; +import javax.sql.DataSource; +import java.util.List; +import java.util.Map; /** */ 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 5da61094f05..eb89003523c 100644 --- a/common/src/main/java/com/metamx/druid/guava/CombiningSequence.java +++ b/common/src/main/java/com/metamx/druid/guava/CombiningSequence.java @@ -19,9 +19,6 @@ 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; @@ -30,6 +27,9 @@ 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 0c6b6103615..f9d713dd1b1 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 7384d141c32..784bd06192c 100644 --- a/common/src/main/java/com/metamx/druid/guava/GuavaUtils.java +++ b/common/src/main/java/com/metamx/druid/guava/GuavaUtils.java @@ -19,6 +19,13 @@ 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; @@ -29,14 +36,6 @@ 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 f0839436661..2177bcde776 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 01d3c1b38d4..03c56e2f66d 100644 --- a/common/src/main/java/com/metamx/druid/input/MapBasedRow.java +++ b/common/src/main/java/com/metamx/druid/input/MapBasedRow.java @@ -19,21 +19,19 @@ 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 95012f25189..6f6f3f2c17c 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 ca919198050..1932746b3d0 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 f0dd0f4056a..3b270ad4aa1 100644 --- a/common/src/main/java/com/metamx/druid/jackson/CommaListJoinSerializer.java +++ b/common/src/main/java/com/metamx/druid/jackson/CommaListJoinSerializer.java @@ -19,15 +19,14 @@ package com.metamx.druid.jackson; -import java.io.IOException; -import java.util.List; - +import com.google.common.base.Joiner; 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 com.google.common.base.Joiner; +import java.io.IOException; +import java.util.List; /** */ 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 61be638a666..7c96a8a3b2b 100644 --- a/common/src/main/java/com/metamx/druid/jackson/DefaultObjectMapper.java +++ b/common/src/main/java/com/metamx/druid/jackson/DefaultObjectMapper.java @@ -19,9 +19,10 @@ package com.metamx.druid.jackson; -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; import org.codehaus.jackson.JsonFactory; import org.codehaus.jackson.JsonGenerator; import org.codehaus.jackson.JsonParser; @@ -37,10 +38,8 @@ import org.codehaus.jackson.map.SerializerProvider; import org.codehaus.jackson.map.module.SimpleModule; import org.joda.time.DateTimeZone; -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; /** */ 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 186811dd869..50d39378390 100644 --- a/common/src/main/java/com/metamx/druid/jackson/JodaStuff.java +++ b/common/src/main/java/com/metamx/druid/jackson/JodaStuff.java @@ -19,20 +19,23 @@ 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 691d11de143..e77f9f75441 100644 --- a/common/src/main/java/com/metamx/druid/log/LogLevelAdjuster.java +++ b/common/src/main/java/com/metamx/druid/log/LogLevelAdjuster.java @@ -19,13 +19,16 @@ 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 70a20479dbe..a49313711ec 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 java.util.Comparator; - import com.google.common.collect.Ordering; +import java.util.Comparator; + /** */ 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 e41c6f6bbd0..00dc3e18a43 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 7722099d10c..2b27b4d3451 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 java.util.Comparator; - import com.google.common.collect.Ordering; +import java.util.Comparator; + /** */ 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 28fd5193652..8c023c322f4 100644 --- a/common/src/main/java/com/metamx/druid/processing/MetricSelectorFactory.java +++ b/common/src/main/java/com/metamx/druid/processing/MetricSelectorFactory.java @@ -19,6 +19,7 @@ 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 08fa7f421bf..53b14618001 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,15 @@ package com.metamx.druid.utils; -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; +import org.joda.time.DateTime; +import org.joda.time.Interval; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.TreeSet; /** */ 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 273bd653f97..48909c02efe 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 java.util.Properties; - import com.metamx.common.ISE; +import java.util.Properties; + /** */ 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 a3e7ad9cbb4..0a1b58d0383 100644 --- a/common/src/main/java/com/metamx/druid/utils/SerializerUtils.java +++ b/common/src/main/java/com/metamx/druid/utils/SerializerUtils.java @@ -19,6 +19,11 @@ 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; @@ -28,11 +33,6 @@ 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 b044cf339bb..18f39ef3a1b 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 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; import org.codehaus.jackson.map.ObjectMapper; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -34,9 +34,8 @@ import org.joda.time.Weeks; import org.junit.Assert; import org.junit.Test; -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; /** */ diff --git a/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java b/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java index 61d61d2f68e..96d0fa01ce1 100644 --- a/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java +++ b/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java @@ -19,18 +19,6 @@ package com.metamx.druid; -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; -import org.joda.time.Interval; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - import com.google.common.collect.ImmutableList; import com.google.common.collect.Ordering; import com.metamx.common.Pair; @@ -39,6 +27,17 @@ 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 org.joda.time.DateTime; +import org.joda.time.Days; +import org.joda.time.Hours; +import org.joda.time.Interval; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; /** */ 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 f26e59659af..8a780146504 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 645a6a23a37..d1a87ac9c2d 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 e2910863773..d72ca031efc 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/HistogramAggregatorTest.java +++ b/common/src/test/java/com/metamx/druid/aggregation/HistogramAggregatorTest.java @@ -19,13 +19,12 @@ package com.metamx.druid.aggregation; -import java.nio.ByteBuffer; -import java.util.ArrayList; - +import com.google.common.collect.Lists; import org.junit.Assert; import org.junit.Test; -import com.google.common.collect.Lists; +import java.nio.ByteBuffer; +import java.util.ArrayList; 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 6629140c8ff..96c2606c2c2 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 java.nio.ByteBuffer; -import java.util.Arrays; - +import com.google.common.collect.Lists; +import com.google.common.primitives.Doubles; +import com.metamx.druid.processing.FloatMetricSelector; import org.junit.Assert; import org.junit.Test; -import com.google.common.collect.Lists; -import com.metamx.druid.processing.FloatMetricSelector; +import java.nio.ByteBuffer; +import java.util.Arrays; 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 aba5a4b1d92..8db1a4a4755 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 fbb9da1e7bb..c8365de19b6 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,17 +19,16 @@ 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 6495308cb35..0de6e2c62e7 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 a0ffa56795e..e413504b1ad 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,13 +19,12 @@ package com.metamx.druid.aggregation.post; -import java.util.HashMap; -import java.util.Map; - +import com.metamx.druid.aggregation.CountAggregator; import org.junit.Assert; import org.junit.Test; -import com.metamx.druid.aggregation.CountAggregator; +import java.util.HashMap; +import java.util.Map; /** */ 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 2ba2ab03ee6..f06b337e348 100644 --- a/common/src/test/java/com/metamx/druid/collect/OrderedMergeIteratorTest.java +++ b/common/src/test/java/com/metamx/druid/collect/OrderedMergeIteratorTest.java @@ -19,17 +19,15 @@ 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 3b35ee1218f..7080a50c73c 100644 --- a/common/src/test/java/com/metamx/druid/collect/OrderedMergeSequenceTest.java +++ b/common/src/test/java/com/metamx/druid/collect/OrderedMergeSequenceTest.java @@ -19,17 +19,6 @@ 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; @@ -38,6 +27,14 @@ 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 5d058758732..388b7def6a8 100644 --- a/common/src/test/java/com/metamx/druid/guava/CombiningSequenceTest.java +++ b/common/src/test/java/com/metamx/druid/guava/CombiningSequenceTest.java @@ -19,15 +19,6 @@ 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; @@ -36,6 +27,13 @@ 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 e4866234b45..e40cecaa203 100644 --- a/common/src/test/java/com/metamx/druid/histogram/HistogramTest.java +++ b/common/src/test/java/com/metamx/druid/histogram/HistogramTest.java @@ -19,16 +19,15 @@ package com.metamx.druid.histogram; -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; import org.codehaus.jackson.map.ObjectMapper; import org.junit.Assert; import org.junit.Test; -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; 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 1b00420558a..0acb92911f5 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 572c2ae70c1..c6a7cdfd005 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 9b53504d2af..6abaf485b68 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 java.util.Arrays; -import java.util.Collections; -import java.util.List; - 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; + /** */ 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 be0f8ea93f9..6fabdf04452 100644 --- a/examples/twitter/src/main/java/druid/examples/RealtimeStandaloneMain.java +++ b/examples/twitter/src/main/java/druid/examples/RealtimeStandaloneMain.java @@ -1,10 +1,5 @@ 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; @@ -18,8 +13,11 @@ 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; /** 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 57b20029a38..249ea12e3b1 100644 --- a/examples/twitter/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java +++ b/examples/twitter/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java @@ -1,6 +1,15 @@ package druid.examples.twitter; -import static java.lang.Thread.sleep; +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 java.io.IOException; import java.util.HashMap; @@ -10,24 +19,7 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; -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; +import static java.lang.Thread.*; /** 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 6284c2ee96a..c68a3e54398 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,20 +19,19 @@ package com.metamx.druid.common.s3; -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; 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 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; /** * 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 a42c5ba9405..6aa2355dc15 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 726cbf92e3f..12751ebebe8 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,13 +19,6 @@ 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; @@ -36,6 +29,14 @@ 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 8fef71c287f..090ab7b0c7a 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,11 +19,6 @@ 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; @@ -33,6 +28,11 @@ 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 c81e23ce235..27dd331a52f 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 17cf06d5d7e..b76a21176e1 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,13 +19,6 @@ 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; @@ -35,8 +28,16 @@ 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 62891f69e9a..57d326da04b 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,11 +19,6 @@ 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; @@ -34,6 +29,11 @@ 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 f5bc7df2279..7733ec7fb2f 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,11 +19,6 @@ 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; @@ -32,6 +27,11 @@ 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 b2d0f0beb1e..a3061b67030 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 c5056e80661..a46b990a2ba 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,13 +19,6 @@ 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; @@ -35,6 +28,13 @@ 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 aed0ec523cd..9a408b46a4c 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,13 +19,6 @@ 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; @@ -35,6 +28,13 @@ 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 d40419015f3..3b05c022cfb 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,21 +19,6 @@ 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; @@ -58,6 +43,19 @@ 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 8f6c2efe665..883fc38474c 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,15 +19,13 @@ 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 9ece02720e2..75352a25137 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,18 +19,6 @@ 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; @@ -43,6 +31,18 @@ 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 60a0908f96c..f23e2b7d061 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,15 +19,6 @@ 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; @@ -36,10 +27,18 @@ 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 6a010f03cc8..91cbf4f6818 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,13 +19,6 @@ 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; @@ -41,6 +34,14 @@ 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 415b46cb1a4..33093f8f825 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 96552e794a8..72a683095b9 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,13 +19,6 @@ 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; @@ -33,6 +26,11 @@ 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 ee408366314..668dbc00fff 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,12 +19,11 @@ package com.metamx.druid.indexer.data; -import java.util.List; - +import com.metamx.common.parsers.Parser; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import com.metamx.common.parsers.Parser; +import java.util.List; /** */ 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 d5df7af3c16..0cad130da33 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,13 +19,6 @@ 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; @@ -33,6 +26,11 @@ 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 1874cc86407..4c5f3d45444 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,17 +19,15 @@ 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 20fc0f51796..29d12c202d0 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,20 +19,19 @@ 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 59d1ca1ed28..4905f268ed4 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,14 +19,13 @@ package com.metamx.druid.indexer.data; -import java.util.Map; - +import com.google.common.base.Function; +import com.metamx.common.parsers.ParserUtils; 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.metamx.common.parsers.ParserUtils; +import java.util.Map; /** */ 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 dcbeab56b2f..c35d53328f2 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,16 +20,14 @@ 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 20850c2b672..aaf4d8bffef 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,10 +19,11 @@ package com.metamx.druid.kv; -import java.util.Iterator; - import com.google.common.collect.ImmutableList; +import java.util.Collections; +import java.util.Iterator; + /** */ 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 cf1a80ce0f7..4c5696a3b8f 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,12 +19,6 @@ 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; @@ -33,6 +27,12 @@ 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 ea855d8c7a3..b168c4a790d 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,6 +19,12 @@ 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; @@ -27,12 +33,6 @@ 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 1a196e24742..a6c7e42b049 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 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; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.util.Iterator; + /** */ 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 48a4879ef92..9af7e0b0337 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,6 +19,8 @@ package com.metamx.druid.kv; +import com.google.common.collect.Maps; + import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; @@ -28,8 +30,6 @@ 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 d5da8a9dd16..b77ab3ba4db 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,6 +19,10 @@ 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; @@ -26,10 +30,6 @@ 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 449253acfd9..c4bd1adad2f 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 5911192d6f7..c50ea15ad53 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,13 +19,6 @@ 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; @@ -35,6 +28,13 @@ 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 9deeb9ce1fc..850217c1f0d 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,19 @@ package com.metamx.druid.index.v1; -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 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 com.google.common.io.Closeables; -import com.google.common.primitives.Floats; -import com.metamx.druid.kv.IndexedFloats; +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; /** */ 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 bbc9cd0053c..df300cf7f23 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,20 +19,26 @@ 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 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; +import java.util.Map; /** */ 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 b299e11b903..f14fcd29f86 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,19 @@ package com.metamx.druid.index.v1; -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 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 com.google.common.io.Closeables; -import com.google.common.primitives.Longs; -import com.metamx.druid.kv.IndexedLongs; +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; /** */ 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 e0221154e5e..1746c2c2331 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,6 +19,13 @@ 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; @@ -26,14 +33,6 @@ 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 632aaffc9ab..6229d222e83 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,6 +19,9 @@ 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; @@ -27,9 +30,6 @@ 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 3aa08cf70da..bb52785b910 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,13 +19,12 @@ package com.metamx.druid.index.v1; -import java.nio.ByteOrder; - +import com.metamx.druid.kv.IndexedFloats; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import com.metamx.druid.kv.IndexedFloats; +import java.nio.ByteOrder; /** */ 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 7df50eae7e1..00c01ac52be 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,13 +19,12 @@ package com.metamx.druid.index.v1; -import java.nio.ByteOrder; - +import com.metamx.druid.kv.IndexedLongs; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import com.metamx.druid.kv.IndexedLongs; +import java.nio.ByteOrder; /** */ 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 50c1f4963e3..41e6a65ebde 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,6 +19,10 @@ 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; @@ -27,11 +31,6 @@ 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 a58ffcbabad..d7341cb5c28 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 44b4f8f53f0..39ce52a5133 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,6 +19,11 @@ 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; @@ -26,12 +31,6 @@ 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 1559996a5f3..6904522a463 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/Bucket.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/Bucket.java @@ -19,11 +19,10 @@ package com.metamx.druid.indexer; -import java.nio.ByteBuffer; - +import com.metamx.common.Pair; import org.joda.time.DateTime; -import com.metamx.common.Pair; +import java.nio.ByteBuffer; 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 b2005e296b8..d1925629bd2 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 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; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.codehaus.jackson.map.ObjectMapper; @@ -32,11 +32,10 @@ import org.skife.jdbi.v2.DBI; import org.skife.jdbi.v2.Handle; import org.skife.jdbi.v2.tweak.HandleCallback; -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; /** */ 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 409eca0dd92..a40642ebec5 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/DeterminePartitionsJob.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/DeterminePartitionsJob.java @@ -19,36 +19,6 @@ 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; @@ -71,6 +41,35 @@ 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 3bc89a56c06..d8abc55cf31 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexer.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexer.java @@ -19,18 +19,17 @@ package com.metamx.druid.indexer; -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 com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.metamx.common.Pair; import com.metamx.druid.jackson.DefaultObjectMapper; +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; /** */ 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 ef099c9564c..8d073dd7297 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerAzkWrapper.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerAzkWrapper.java @@ -19,18 +19,20 @@ package com.metamx.druid.indexer; -import java.util.List; -import java.util.Map; -import java.util.Properties; - +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 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; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Properties; /** */ 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 bd8ebf4fbc8..bcc393829b5 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerConfig.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerConfig.java @@ -19,23 +19,6 @@ 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; @@ -57,6 +40,22 @@ 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 9c1d80edd75..eae1bfa885d 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerJob.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopDruidIndexerJob.java @@ -19,17 +19,6 @@ 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; @@ -38,6 +27,16 @@ 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 2af3b200b56..21f816f4aba 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,13 @@ package com.metamx.druid.indexer; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - +import com.metamx.druid.kv.IOPeon; import org.apache.hadoop.fs.Path; import org.apache.hadoop.mapreduce.JobContext; -import com.metamx.druid.kv.IOPeon; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; /** */ 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 59c2591fb3a..d7f40087ba8 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/HadoopyShardSpec.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/HadoopyShardSpec.java @@ -19,11 +19,10 @@ 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 af0cb283c3f..c1c4578acef 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/IndexGeneratorJob.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/IndexGeneratorJob.java @@ -19,22 +19,34 @@ package com.metamx.druid.indexer; -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 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 org.apache.commons.io.FileUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; @@ -59,32 +71,20 @@ import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; 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.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; +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; /** */ 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 c5e58c7b452..3abaa7951b8 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/SortableBytes.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/SortableBytes.java @@ -19,15 +19,14 @@ package com.metamx.druid.indexer; -import java.nio.ByteBuffer; -import java.util.Arrays; - +import com.google.common.base.Charsets; 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 com.google.common.base.Charsets; +import java.nio.ByteBuffer; +import java.util.Arrays; /** */ 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 c5afc4a0928..f47075863ae 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,8 @@ package com.metamx.druid.indexer; -import org.joda.time.Interval; - import com.google.common.base.Function; +import org.joda.time.Interval; /** */ 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 38a3d42c28e..aa1c3ed2f4b 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/Utils.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/Utils.java @@ -19,13 +19,10 @@ package com.metamx.druid.indexer; -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; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.compress.CompressionCodec; @@ -36,10 +33,12 @@ import org.apache.hadoop.util.ReflectionUtils; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; -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; /** */ 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 27c3792e9d3..cd2ed44bd59 100644 --- a/indexer/src/main/java/com/metamx/druid/indexer/ZkUpdaterJob.java +++ b/indexer/src/main/java/com/metamx/druid/indexer/ZkUpdaterJob.java @@ -19,12 +19,6 @@ 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; @@ -34,6 +28,11 @@ 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 7b798e661eb..151055271ec 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,20 +19,19 @@ package com.metamx.druid.indexer.granularity; -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 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 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; 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 8357b5150cf..30ce2df1171 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,14 +19,13 @@ package com.metamx.druid.indexer.granularity; -import java.util.SortedSet; - +import com.google.common.base.Optional; 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.Optional; +import java.util.SortedSet; /** * 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 538d2bdd2bc..a1039caba1c 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,19 +19,18 @@ package com.metamx.druid.indexer.granularity; -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; 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.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; 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 b105bef9f43..a67e03c749c 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 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; +import java.io.IOException; +import java.util.Iterator; +import java.util.NoSuchElementException; + /** */ 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 9c30b0ad031..47e1676f848 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,27 +19,29 @@ package com.metamx.druid.indexer.path; -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.joda.time.DateTime; -import org.joda.time.Interval; - 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 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; /** */ 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 2359b4ec8d5..aeca725bd1c 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,10 +19,12 @@ package com.metamx.druid.indexer.path; -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; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -34,12 +36,9 @@ import org.joda.time.Interval; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; -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; /** */ 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 4c991624129..776f51c99bd 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,13 +19,12 @@ package com.metamx.druid.indexer.path; -import java.io.IOException; - +import com.metamx.druid.indexer.HadoopDruidIndexerConfig; import org.apache.hadoop.mapreduce.Job; import org.codehaus.jackson.annotate.JsonSubTypes; import org.codehaus.jackson.annotate.JsonTypeInfo; -import com.metamx.druid.indexer.HadoopDruidIndexerConfig; +import java.io.IOException; /** */ 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 6630fd84159..f46135c32cc 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,14 +19,13 @@ package com.metamx.druid.indexer.path; -import java.io.IOException; - +import com.metamx.common.logger.Logger; +import com.metamx.druid.indexer.HadoopDruidIndexerConfig; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.codehaus.jackson.annotate.JsonProperty; -import com.metamx.common.logger.Logger; -import com.metamx.druid.indexer.HadoopDruidIndexerConfig; +import java.io.IOException; /** * 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 46710512422..e2e1f9ce032 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 java.util.List; - -import org.codehaus.jackson.annotate.JsonProperty; - +import com.metamx.common.Granularity; import com.metamx.druid.QueryGranularity; import com.metamx.druid.aggregation.AggregatorFactory; +import org.codehaus.jackson.annotate.JsonProperty; + +import java.util.List; /** * 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 60b82069b53..489a8e94931 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,8 @@ package com.metamx.druid.indexer.updater; -import org.codehaus.jackson.annotate.JsonProperty; - import com.metamx.druid.db.DbConnectorConfig; +import org.codehaus.jackson.annotate.JsonProperty; /** */ 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 3523a198ba6..4818e4c99a9 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,6 +19,8 @@ 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 02928bb4a92..d9479a7dbbf 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,10 @@ package com.metamx.druid.merger.common; -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; +import org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; /** */ 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 78ed44ec860..39b38a18a93 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,17 +19,16 @@ 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 9a5df0926d6..e631db0eea2 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,12 +19,6 @@ 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; @@ -34,6 +28,11 @@ 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 3e1a068a88b..28b78f78ad6 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,25 +19,6 @@ 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; @@ -48,6 +29,24 @@ 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 28624444984..4ece129f49b 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,16 +19,6 @@ 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; @@ -48,6 +38,15 @@ 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 d176b8e76c5..6de3eb0d73f 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,14 +19,13 @@ 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 a7ef651b4c7..f9898070aa1 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,16 +19,6 @@ 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; @@ -43,6 +33,14 @@ 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 7273dfda463..6dfc95c2271 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,15 +19,6 @@ 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; @@ -37,6 +28,13 @@ 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 68145fcadf2..3127a5c5c90 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,14 +19,6 @@ 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; @@ -36,10 +28,19 @@ 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 739a11f95ae..55edfdbc3bc 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,15 +19,8 @@ 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; @@ -45,6 +38,14 @@ 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 9cc09702179..82da5561e24 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,20 +19,10 @@ 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; @@ -47,6 +37,16 @@ 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 74160fca4b6..6074765ddbf 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,13 +19,6 @@ 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; @@ -38,6 +31,12 @@ 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 94769db1095..db5ff0594da 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,20 +19,6 @@ 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; @@ -56,6 +42,18 @@ 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 c2f7f1a47db..b2059210b58 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,13 +19,16 @@ 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 5a494bebc8a..c1dbce4fc61 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,15 +19,6 @@ 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; @@ -38,6 +29,14 @@ 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 bad4024710d..fc03504792f 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,17 +19,16 @@ 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 9ca8b01505c..16ecd06073f 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,17 +19,20 @@ 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 3fe59b0ffa6..bc53ef0d4f7 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,20 +19,6 @@ package com.metamx.druid.merger.coordinator; -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; -import org.skife.jdbi.v2.DBI; -import org.skife.jdbi.v2.Handle; -import org.skife.jdbi.v2.ResultIterator; -import org.skife.jdbi.v2.tweak.HandleCallback; - import com.google.common.base.Function; import com.google.common.collect.Lists; import com.google.common.collect.Ordering; @@ -41,6 +27,18 @@ import com.metamx.druid.TimelineObjectHolder; import com.metamx.druid.VersionedIntervalTimeline; import com.metamx.druid.client.DataSegment; import com.metamx.druid.db.DbConnectorConfig; +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; +import org.joda.time.Interval; +import org.skife.jdbi.v2.DBI; +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; /** */ 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 d2843ae68e6..eaf000e5276 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,16 +19,6 @@ 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; @@ -38,6 +28,7 @@ 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; @@ -46,6 +37,15 @@ 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 d10621f9b70..1754e426977 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 4fceeb5f308..fcbb2450cbc 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,12 +19,11 @@ package com.metamx.druid.merger.coordinator; -import java.util.Set; - +import com.metamx.druid.client.DataSegment; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; -import com.metamx.druid.client.DataSegment; +import java.util.Set; /** * 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 b67aa419c8e..85b2ef62a04 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,17 +19,16 @@ 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 fe33155b409..c8690bf5c36 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,8 +19,6 @@ 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; @@ -32,6 +30,8 @@ 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 ceeeeea0696..0481e8f21b6 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,9 +19,6 @@ 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; @@ -37,6 +34,9 @@ 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 2f79d721309..f674b8744cd 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,20 +19,6 @@ 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; @@ -41,6 +27,7 @@ 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; @@ -50,6 +37,18 @@ 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 ae988c44647..13308db86a2 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 11f9d90fdd9..18f317525fe 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,15 +19,14 @@ package com.metamx.druid.merger.coordinator.config; -import java.io.File; -import java.util.Set; - -import org.skife.config.Config; -import org.skife.config.Default; - import com.google.common.base.Splitter; import com.google.common.collect.ImmutableSet; import com.metamx.druid.merger.common.task.Task; +import org.skife.config.Config; +import org.skife.config.Default; + +import java.io.File; +import java.util.Set; /** */ 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 36b090c1673..26f0105771d 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,11 +19,10 @@ 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 594fcf3da38..be2bca53fbb 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,6 +24,7 @@ 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; @@ -38,6 +39,8 @@ 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 b65f562ce12..972d25439cb 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,26 +19,6 @@ 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; @@ -100,6 +80,25 @@ 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 a4b27012adb..6cf9b0a7c16 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,14 +19,6 @@ 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; @@ -38,6 +30,14 @@ 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 ae478fbf3a9..9c657bdc292 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,17 +19,16 @@ 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 433304e7c45..b70a6e9c278 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,12 +19,6 @@ 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; @@ -37,6 +31,11 @@ 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 bfeb7209c8c..032febb79b9 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,16 +19,15 @@ 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 5f04ec39318..8510a890e1c 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,12 +19,6 @@ 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; @@ -34,6 +28,11 @@ 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 533bc7b6c28..733504b864e 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,24 +19,6 @@ 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; @@ -75,6 +57,23 @@ 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 9cb310049c4..b5709de1d6b 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 cb76e1590cb..b2afbbc4884 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/FireDepartmentConfig.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/FireDepartmentConfig.java @@ -19,11 +19,10 @@ 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 be4c706e6ef..e978428e057 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 java.io.Closeable; - import com.metamx.druid.input.InputRow; +import java.io.Closeable; + /** * 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 181b3aab613..e090e088d08 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 443c6ad1971..05714ddfdbd 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/KafkaFirehoseFactory.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/KafkaFirehoseFactory.java @@ -19,6 +19,20 @@ 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; @@ -28,22 +42,6 @@ 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 7e16ba163f1..93c8e712fa6 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/MetadataUpdater.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/MetadataUpdater.java @@ -19,23 +19,22 @@ package com.metamx.druid.realtime; -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 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 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; /** */ 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 e7d63c34d1e..97c7611801a 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimeManager.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimeManager.java @@ -19,15 +19,6 @@ 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; @@ -46,6 +37,14 @@ 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 2c65c28b1d0..3d04392aab0 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/RealtimePlumberSchool.java b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java index 314bed367c9..5659758591b 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java @@ -19,27 +19,6 @@ 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; @@ -67,9 +46,29 @@ 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 90b9083af1f..6ae83c5f9bf 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/S3SegmentPusher.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/S3SegmentPusher.java @@ -19,6 +19,20 @@ 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; @@ -28,21 +42,6 @@ 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 83ae9388e21..b54c8efbbf6 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 java.util.Arrays; - -import org.codehaus.jackson.annotate.JsonCreator; -import org.codehaus.jackson.annotate.JsonProperty; - 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 org.codehaus.jackson.annotate.JsonCreator; +import org.codehaus.jackson.annotate.JsonProperty; + +import java.util.Arrays; /** */ 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 1ca2544399b..16a9253137c 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 ed23ea91c4b..95d164f367f 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/Sink.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/Sink.java @@ -19,15 +19,6 @@ 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; @@ -40,6 +31,13 @@ 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 29291fdb4dc..9d4417fe597 100644 --- a/server/src/main/java/com/metamx/TsvToJson.java +++ b/server/src/main/java/com/metamx/TsvToJson.java @@ -19,6 +19,14 @@ 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; @@ -29,13 +37,6 @@ 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 37c345da07e..b40409d1ede 100644 --- a/server/src/main/java/com/metamx/druid/BaseStorageAdapter.java +++ b/server/src/main/java/com/metamx/druid/BaseStorageAdapter.java @@ -19,11 +19,6 @@ 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; @@ -34,6 +29,10 @@ 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 b945f0bfb00..60d2596bd38 100644 --- a/server/src/main/java/com/metamx/druid/GroupByQueryEngine.java +++ b/server/src/main/java/com/metamx/druid/GroupByQueryEngine.java @@ -19,17 +19,6 @@ 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; @@ -54,6 +43,15 @@ 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 9ef4af18c6b..7a18d18e718 100644 --- a/server/src/main/java/com/metamx/druid/SearchResultBuilder.java +++ b/server/src/main/java/com/metamx/druid/SearchResultBuilder.java @@ -19,12 +19,11 @@ 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 f17287e0d3d..285d17b5b05 100644 --- a/server/src/main/java/com/metamx/druid/StorageAdapter.java +++ b/server/src/main/java/com/metamx/druid/StorageAdapter.java @@ -19,11 +19,10 @@ package com.metamx.druid; -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; +import org.joda.time.DateTime; +import org.joda.time.Interval; /** */ 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 645ef95e2b2..4e68ad2995e 100644 --- a/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeRequest.java +++ b/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeRequest.java @@ -19,11 +19,10 @@ 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 88921eef822..d5d6377a10e 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 java.util.Arrays; -import java.util.Map; - import com.metamx.druid.master.DruidMaster; import com.metamx.phonebook.PhoneBook; +import java.util.Arrays; +import java.util.Map; + /** */ 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 87e69f07287..0093907d26e 100644 --- a/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestDrop.java +++ b/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestDrop.java @@ -19,12 +19,11 @@ 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 d140b925942..c98106efdfb 100644 --- a/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestLoad.java +++ b/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestLoad.java @@ -19,12 +19,11 @@ 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 04ce6f0c020..1d3675e570d 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ServerManager.java +++ b/server/src/main/java/com/metamx/druid/coordination/ServerManager.java @@ -19,15 +19,6 @@ 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.ISE; @@ -59,6 +50,13 @@ 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 bbcaca9af0f..1fb756daafe 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ZkCoordinator.java +++ b/server/src/main/java/com/metamx/druid/coordination/ZkCoordinator.java @@ -19,16 +19,6 @@ 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; @@ -43,6 +33,15 @@ 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 caf8e97c1c8..91afbcbbc5e 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 java.io.File; - import org.skife.config.Config; +import java.io.File; + /** */ public abstract class ZkCoordinatorConfig 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 d86e6d47f23..ef620cd1e38 100644 --- a/server/src/main/java/com/metamx/druid/db/DatabaseSegmentManager.java +++ b/server/src/main/java/com/metamx/druid/db/DatabaseSegmentManager.java @@ -19,28 +19,6 @@ package com.metamx.druid.db; -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; -import org.joda.time.Interval; -import org.skife.jdbi.v2.Batch; -import org.skife.jdbi.v2.DBI; -import org.skife.jdbi.v2.FoldController; -import org.skife.jdbi.v2.Folder3; -import org.skife.jdbi.v2.Handle; -import org.skife.jdbi.v2.StatementContext; -import org.skife.jdbi.v2.tweak.HandleCallback; - import com.google.common.base.Function; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; @@ -53,6 +31,26 @@ import com.metamx.druid.TimelineObjectHolder; import com.metamx.druid.VersionedIntervalTimeline; import com.metamx.druid.client.DataSegment; import com.metamx.druid.client.DruidDataSource; +import org.codehaus.jackson.map.ObjectMapper; +import org.joda.time.DateTime; +import org.joda.time.Duration; +import org.joda.time.Interval; +import org.skife.jdbi.v2.Batch; +import org.skife.jdbi.v2.DBI; +import org.skife.jdbi.v2.FoldController; +import org.skife.jdbi.v2.Folder3; +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; /** */ 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 f0550803ddc..949ef7127c6 100644 --- a/server/src/main/java/com/metamx/druid/http/InfoResource.java +++ b/server/src/main/java/com/metamx/druid/http/InfoResource.java @@ -19,24 +19,6 @@ 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; @@ -51,6 +33,23 @@ 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/MasterResource.java b/server/src/main/java/com/metamx/druid/http/MasterResource.java index f4d79e55185..ca992815eb6 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 java.util.List; -import java.util.Map; +import com.metamx.druid.master.DruidMaster; +import com.metamx.druid.master.LoadPeonCallback; 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 com.metamx.druid.master.DruidMaster; -import com.metamx.druid.master.LoadPeonCallback; +import java.util.List; +import java.util.Map; /** */ 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 059771d018b..3f42becbb8d 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterServletModule.java +++ b/server/src/main/java/com/metamx/druid/http/MasterServletModule.java @@ -19,11 +19,6 @@ 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; @@ -31,6 +26,10 @@ 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 29887e2a316..45fac15d407 100644 --- a/server/src/main/java/com/metamx/druid/http/RedirectFilter.java +++ b/server/src/main/java/com/metamx/druid/http/RedirectFilter.java @@ -19,8 +19,11 @@ package com.metamx.druid.http; -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; import javax.servlet.Filter; import javax.servlet.FilterChain; @@ -31,12 +34,8 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.HttpMethod; - -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; /** */ 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 0bc3d87224b..f91f03d987d 100644 --- a/server/src/main/java/com/metamx/druid/http/RedirectServlet.java +++ b/server/src/main/java/com/metamx/druid/http/RedirectServlet.java @@ -19,18 +19,16 @@ package com.metamx.druid.http; -import java.io.IOException; -import java.net.URL; +import com.metamx.common.logger.Logger; +import org.mortbay.jetty.servlet.DefaultServlet; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import org.mortbay.jetty.servlet.DefaultServlet; - -import com.metamx.common.logger.Logger; +import java.io.IOException; +import java.net.URL; /** */ 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 9fe56f9f894..5132cd7bf8e 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,12 +19,11 @@ 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 bf6bdb12edd..e588a8441d1 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,12 @@ package com.metamx.druid.index.brita; -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; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +import javax.annotation.Nullable; /** */ 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 a006756f96b..7eeb106936f 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,12 @@ package com.metamx.druid.index.brita; -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; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +import java.util.List; /** */ 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 e81b4e24d5e..bb14cbf2b41 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,10 +19,6 @@ 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; @@ -33,6 +29,9 @@ 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 2a7252768c8..5361951075a 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,10 +19,9 @@ 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 e03a1584251..3de948682a9 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,12 +19,11 @@ 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 bfeaaa5ee01..a638ce576a7 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,11 +19,10 @@ package com.metamx.druid.index.brita; -import java.util.regex.Pattern; +import com.google.common.base.Predicate; import javax.annotation.Nullable; - -import com.google.common.base.Predicate; +import java.util.regex.Pattern; /** 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 b23efe2fd80..526877176a9 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 5ccbbe85bb2..b08449e687c 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,11 +19,10 @@ 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 947757a7323..8207897e502 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 dc7863feee9..d975770f560 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,17 +19,6 @@ 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; @@ -40,6 +29,14 @@ 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 f25923e981f..d2486aa585f 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,18 +19,6 @@ 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; @@ -58,6 +46,16 @@ 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 3e40d2630c4..3069984739b 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,6 +19,7 @@ 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; @@ -31,8 +32,6 @@ 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 04a4faec2d8..639c9bb7a56 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,30 +19,6 @@ 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; @@ -81,6 +57,27 @@ 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 81d726dbed1..8d4c7691ee4 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,16 +19,6 @@ 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; @@ -56,6 +46,14 @@ 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 4370b48cf77..5c65a969957 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,10 +19,9 @@ 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 efb9679b66a..396fb0e2de0 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,12 +19,6 @@ 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; @@ -32,6 +26,11 @@ 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 d9dcb003ee8..537f5cd55fb 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,15 +19,6 @@ 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; @@ -50,6 +41,13 @@ 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 2452f820b25..253ed3cf5a4 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,6 +19,8 @@ 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 f30a55e53fb..551bf210bb5 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,16 +19,15 @@ 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 152118c147e..95061ae39a8 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,12 +19,11 @@ 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 6357a905bf6..1e47528d801 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,9 +19,6 @@ 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; @@ -29,6 +26,8 @@ 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 913ca44fb1c..419d23d11ee 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,8 @@ package com.metamx.druid.index.v1.processing; -import org.joda.time.DateTime; - import com.metamx.druid.processing.MetricSelectorFactory; +import org.joda.time.DateTime; /** */ 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 d32c9921fd0..b18fec4b322 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,10 +19,9 @@ 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 21f69cdb9cb..4a9c68d72aa 100644 --- a/server/src/main/java/com/metamx/druid/initialization/ServerInit.java +++ b/server/src/main/java/com/metamx/druid/initialization/ServerInit.java @@ -19,13 +19,6 @@ 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; @@ -51,6 +44,12 @@ 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 fb6d83bba44..8cb720affd2 100644 --- a/server/src/main/java/com/metamx/druid/loading/ConvertingBaseQueryableFactory.java +++ b/server/src/main/java/com/metamx/druid/loading/ConvertingBaseQueryableFactory.java @@ -19,14 +19,13 @@ 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 64e73cd6396..5d421df7a0a 100644 --- a/server/src/main/java/com/metamx/druid/loading/DelegatingStorageAdapterLoader.java +++ b/server/src/main/java/com/metamx/druid/loading/DelegatingStorageAdapterLoader.java @@ -19,14 +19,13 @@ 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 c155dd6576e..13c65ad5c4d 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 93f7b3da345..15a37ebf611 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 java.io.File; -import java.util.Map; - import com.google.inject.Inject; import com.metamx.common.logger.Logger; +import java.io.File; +import java.util.Map; + /** */ 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 f35bdd7e90d..d0d9fb7a0bd 100644 --- a/server/src/main/java/com/metamx/druid/loading/S3SegmentGetter.java +++ b/server/src/main/java/com/metamx/druid/loading/S3SegmentGetter.java @@ -19,23 +19,22 @@ package com.metamx.druid.loading; -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; 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 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; /** */ 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 eaee8e57424..c2a4c7f6308 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 java.io.File; - import org.skife.config.Config; +import java.io.File; + /** */ 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 f36b8956832..d90d33c586d 100644 --- a/server/src/main/java/com/metamx/druid/loading/S3ZippedSegmentGetter.java +++ b/server/src/main/java/com/metamx/druid/loading/S3ZippedSegmentGetter.java @@ -19,6 +19,18 @@ 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; @@ -29,19 +41,6 @@ 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 f83dfe8e7ec..8c58ac1c2bd 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 0ac75e7d938..92fec4e7632 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 java.io.File; - import com.metamx.druid.StorageAdapter; +import java.io.File; + /** */ 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 8395828c4aa..96afd41e2ce 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 java.util.Map; - import com.metamx.druid.StorageAdapter; +import java.util.Map; + /** */ 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 5974ba1083b..bdf475b8d1b 100644 --- a/server/src/main/java/com/metamx/druid/master/BalancerAnalyzer.java +++ b/server/src/main/java/com/metamx/druid/master/BalancerAnalyzer.java @@ -19,10 +19,6 @@ 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; @@ -30,6 +26,10 @@ 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 acbe1fc1549..c1a99fca888 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMaster.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMaster.java @@ -19,19 +19,6 @@ 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; @@ -59,6 +46,18 @@ 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 6ef0e9372ed..8bbf82559ef 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterAssigner.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterAssigner.java @@ -19,10 +19,6 @@ 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; @@ -30,6 +26,10 @@ 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 26854e097fc..b1e03a5e21a 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java @@ -19,11 +19,6 @@ 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; @@ -33,6 +28,11 @@ 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 d9ef02b0187..acf97e3cae3 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterDropper.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterDropper.java @@ -19,10 +19,6 @@ 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; @@ -32,6 +28,10 @@ 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 05a47cfda65..47d02fd0f52 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterLogger.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterLogger.java @@ -19,9 +19,6 @@ 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; @@ -30,6 +27,9 @@ 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 5c0d51dfd6c..b02273def84 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterReplicator.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterReplicator.java @@ -19,13 +19,6 @@ 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; @@ -38,6 +31,13 @@ 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 6728615cf2a..2a4cd255bb4 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java @@ -19,12 +19,6 @@ 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; @@ -34,6 +28,12 @@ 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 97dfd2eb4a2..2158328c1d8 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 2395e04ef95..3044b6dccbf 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java @@ -19,13 +19,6 @@ 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; @@ -48,6 +41,12 @@ 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 58d68e9bbe4..32c77fdff3d 100644 --- a/server/src/main/java/com/metamx/druid/master/HttpMergerClient.java +++ b/server/src/main/java/com/metamx/druid/master/HttpMergerClient.java @@ -19,17 +19,16 @@ 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 59ea8e8f2b8..35953e26b0c 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 java.util.Arrays; -import java.util.Collection; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentSkipListSet; -import java.util.concurrent.ScheduledExecutorService; -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; @@ -43,6 +31,18 @@ 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; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentSkipListSet; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; + /** */ 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 9db2cb2b416..c2556ccaea0 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 java.util.List; - import com.metamx.druid.client.DataSegment; +import java.util.List; + /** */ 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 4015c350699..176f9e3d174 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 3d2dab30266..d8db68446b0 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 java.util.Map; - import com.metamx.druid.Query; +import java.util.Map; + /** */ 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 2c6c7b34057..5eda9f40514 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 90b4e5783e4..01327a44c80 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,11 +19,6 @@ 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; @@ -40,6 +35,11 @@ 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 d42c0c3051f..ce4e8e89e6e 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,9 +19,6 @@ 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; @@ -38,6 +35,9 @@ 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 dc94a27f408..459a520c916 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,14 +19,12 @@ 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; @@ -35,6 +33,10 @@ 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 d20e8621aae..2d72961a436 100644 --- a/server/src/main/java/com/metamx/druid/utils/ExposeS3DataSource.java +++ b/server/src/main/java/com/metamx/druid/utils/ExposeS3DataSource.java @@ -19,12 +19,16 @@ package com.metamx.druid.utils; -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; import org.I0Itec.zkclient.ZkClient; import org.I0Itec.zkclient.ZkConnection; import org.apache.commons.cli.CommandLine; @@ -40,16 +44,11 @@ import org.jets3t.service.security.AWSCredentials; import org.joda.time.DateTime; import org.joda.time.Interval; -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; /** */ 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 dd5d6c0daa7..2c4b8f768af 100644 --- a/server/src/main/java/com/metamx/druid/utils/ZkSetup.java +++ b/server/src/main/java/com/metamx/druid/utils/ZkSetup.java @@ -19,12 +19,11 @@ 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 df11470b5f0..9673d15b3c0 100644 --- a/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestDropTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestDropTest.java @@ -19,19 +19,18 @@ package com.metamx.druid.coordination; -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; 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 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; /** */ 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 83d157ecd9c..eaedcde0b6a 100644 --- a/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestLoadTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestLoadTest.java @@ -19,19 +19,18 @@ package com.metamx.druid.coordination; -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; 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 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; /** */ 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 2e8bbdbb512..1f44bd3e65f 100644 --- a/server/src/test/java/com/metamx/druid/coordination/ServerManagerTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/ServerManagerTest.java @@ -19,20 +19,6 @@ 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; @@ -71,6 +57,19 @@ 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 9a4b1d4c84f..a0b6fe53988 100644 --- a/server/src/test/java/com/metamx/druid/coordination/ZkCoordinatorTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/ZkCoordinatorTest.java @@ -19,19 +19,6 @@ 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; @@ -45,6 +32,18 @@ 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 d69929b7d13..d53ac4e783e 100644 --- a/server/src/test/java/com/metamx/druid/db/DatabaseSegmentManagerTest.java +++ b/server/src/test/java/com/metamx/druid/db/DatabaseSegmentManagerTest.java @@ -19,11 +19,9 @@ package com.metamx.druid.db; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Executors; - +import com.google.common.base.Throwables; +import com.google.common.collect.Maps; +import com.metamx.druid.jackson.DefaultObjectMapper; import org.easymock.EasyMock; import org.joda.time.Duration; import org.junit.After; @@ -32,8 +30,12 @@ import org.junit.Test; import org.skife.jdbi.v2.DBI; import org.skife.jdbi.v2.tweak.HandleCallback; -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.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; /** */ 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 2a81ade14ad..f32ecae3a47 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,14 +19,12 @@ 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 71ec8e15e3a..26faef365fa 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,17 +19,16 @@ package com.metamx.druid.index.v1; -import java.io.File; -import java.util.ArrayList; - -import org.joda.time.Interval; -import org.junit.Assert; -import org.junit.Test; - import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.metamx.druid.QueryGranularity; import com.metamx.druid.aggregation.AggregatorFactory; +import org.joda.time.Interval; +import org.junit.Assert; +import org.junit.Test; + +import java.io.File; +import java.util.ArrayList; 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 b270c700da6..fb6a7826d1d 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,12 +19,11 @@ package com.metamx.druid.index.v1.processing; -import java.util.LinkedList; - +import com.google.common.collect.Lists; import org.junit.Assert; import org.junit.Test; -import com.google.common.collect.Lists; +import java.util.LinkedList; /** */ 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 68af2e19d24..a49ab954341 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,12 +19,11 @@ package com.metamx.druid.index.v1.processing; -import java.util.ArrayList; - +import com.google.common.collect.Lists; import org.junit.Assert; import org.junit.Test; -import com.google.common.collect.Lists; +import java.util.ArrayList; /** */ 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 5c1a15be37e..a5bcf8b0b34 100644 --- a/server/src/test/java/com/metamx/druid/loading/NoopStorageAdapterLoader.java +++ b/server/src/test/java/com/metamx/druid/loading/NoopStorageAdapterLoader.java @@ -19,11 +19,6 @@ 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; @@ -31,6 +26,10 @@ 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 585f5c76f3d..5c5c96b520d 100644 --- a/server/src/test/java/com/metamx/druid/master/BalancerAnalyzerTest.java +++ b/server/src/test/java/com/metamx/druid/master/BalancerAnalyzerTest.java @@ -19,18 +19,16 @@ 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 4aaf3838acd..8ed7f28e8bf 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java @@ -19,20 +19,18 @@ package com.metamx.druid.master; -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 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 junit.framework.Assert; +import org.easymock.EasyMock; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.util.Arrays; /** */ 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 10da530d498..cd61649a1fb 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterReplicatorTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterReplicatorTest.java @@ -19,21 +19,20 @@ package com.metamx.druid.master; -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; 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 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 java.util.Map; /** 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 6e015906adf..ddb120a9857 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java @@ -19,18 +19,16 @@ 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 ae3755e79c8..19458f1a7e0 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java @@ -19,14 +19,6 @@ 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; @@ -36,6 +28,13 @@ import com.metamx.druid.client.ZKPhoneBook; 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; /** */ From 63b2f502ac9ee16ff1a6e36ef21918e52f2373da Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Fri, 2 Nov 2012 11:35:23 -0500 Subject: [PATCH 10/13] 1) Make TimelineEntry in VersionedIntervalTimeline a static class with its own generic parameters to hopefully make OpenJDK happier. --- .../druid/VersionedIntervalTimeline.java | 88 ++++++++++--------- .../druid/VersionedIntervalTimelineTest.java | 6 ++ 2 files changed, 52 insertions(+), 42 deletions(-) diff --git a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java index a45821c7dba..a8c708917eb 100644 --- a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java +++ b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java @@ -61,13 +61,13 @@ public class VersionedIntervalTimeline private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true); - final NavigableMap completePartitionsTimeline = new TreeMap( + final NavigableMap> completePartitionsTimeline = Maps.newTreeMap( Comparators.intervalsByStartThenEnd() ); - final NavigableMap incompletePartitionsTimeline = new TreeMap( + final NavigableMap> incompletePartitionsTimeline = Maps.newTreeMap( Comparators.intervalsByStartThenEnd() ); - private final Map> allTimelineEntries = Maps.newHashMap(); + private final Map>> allTimelineEntries = Maps.newHashMap(); private final Comparator versionComparator; @@ -83,19 +83,23 @@ public class VersionedIntervalTimeline try { lock.writeLock().lock(); - Map exists = allTimelineEntries.get(interval); - TimelineEntry entry = null; + Map> exists = allTimelineEntries.get(interval); + TimelineEntry entry = null; if (exists == null) { - entry = new TimelineEntry(interval, version, new PartitionHolder(object)); - TreeMap versionEntry = Maps.newTreeMap(versionComparator); + entry = new TimelineEntry(interval, version, new PartitionHolder(object)); + TreeMap> versionEntry = Maps.newTreeMap(versionComparator); versionEntry.put(version, entry); allTimelineEntries.put(interval, versionEntry); } else { entry = exists.get(version); if (entry == null) { - entry = new TimelineEntry(interval, version, new PartitionHolder(object)); + entry = new TimelineEntry( + interval, + version, + new PartitionHolder(object) + ); exists.put(version, entry); } else { PartitionHolder partitionHolder = entry.getPartitionHolder(); @@ -119,12 +123,12 @@ public class VersionedIntervalTimeline try { lock.writeLock().lock(); - Map versionEntries = allTimelineEntries.get(interval); + Map> versionEntries = allTimelineEntries.get(interval); if (versionEntries == null) { return null; } - TimelineEntry entry = versionEntries.get(version); + TimelineEntry entry = versionEntries.get(version); if (entry == null) { return null; } @@ -152,7 +156,7 @@ public class VersionedIntervalTimeline { try { lock.readLock().lock(); - for (Map.Entry> entry : allTimelineEntries.entrySet()) { + for (Map.Entry>> entry : allTimelineEntries.entrySet()) { if (entry.getKey().equals(interval) || entry.getKey().contains(interval)) { TimelineEntry foundEntry = entry.getValue().get(version); if (foundEntry != null) { @@ -197,13 +201,14 @@ public class VersionedIntervalTimeline List> retVal = new ArrayList>(); Map> overShadowed = Maps.newHashMap(); - for (Map.Entry> versionEntry : allTimelineEntries.entrySet()) { + for (Map.Entry>> versionEntry : allTimelineEntries + .entrySet()) { Map versionCopy = Maps.newHashMap(); versionCopy.putAll(versionEntry.getValue()); overShadowed.put(versionEntry.getKey(), versionCopy); } - for (Map.Entry entry : completePartitionsTimeline.entrySet()) { + for (Map.Entry> entry : completePartitionsTimeline.entrySet()) { Map versionEntry = overShadowed.get(entry.getValue().getTrueInterval()); if (versionEntry != null) { versionEntry.remove(entry.getValue().getVersion()); @@ -213,7 +218,7 @@ public class VersionedIntervalTimeline } } - for (Map.Entry entry : incompletePartitionsTimeline.entrySet()) { + for (Map.Entry> entry : incompletePartitionsTimeline.entrySet()) { Map versionEntry = overShadowed.get(entry.getValue().getTrueInterval()); if (versionEntry != null) { versionEntry.remove(entry.getValue().getVersion()); @@ -225,7 +230,7 @@ public class VersionedIntervalTimeline for (Map.Entry> versionEntry : overShadowed.entrySet()) { for (Map.Entry entry : versionEntry.getValue().entrySet()) { - TimelineEntry object = entry.getValue(); + TimelineEntry object = entry.getValue(); retVal.add( new TimelineObjectHolder( object.getTrueInterval(), @@ -244,12 +249,12 @@ public class VersionedIntervalTimeline } private void add( - NavigableMap timeline, + NavigableMap> timeline, Interval interval, - TimelineEntry entry + TimelineEntry entry ) { - TimelineEntry existsInTimeline = timeline.get(interval); + TimelineEntry existsInTimeline = timeline.get(interval); if (existsInTimeline != null) { int compare = versionComparator.compare(entry.getVersion(), existsInTimeline.getVersion()); @@ -279,9 +284,9 @@ public class VersionedIntervalTimeline } private boolean addAtKey( - NavigableMap timeline, + NavigableMap> timeline, Interval key, - TimelineEntry entry + TimelineEntry entry ) { boolean retVal = false; @@ -315,7 +320,7 @@ public class VersionedIntervalTimeline } } } else if (versionCompare > 0) { - TimelineEntry oldEntry = timeline.remove(currKey); + TimelineEntry oldEntry = timeline.remove(currKey); if (currKey.contains(entryInterval)) { addIntervalToTimeline(new Interval(currKey.getStart(), entryInterval.getStart()), oldEntry, timeline); @@ -355,8 +360,8 @@ public class VersionedIntervalTimeline private void addIntervalToTimeline( Interval interval, - TimelineEntry entry, - NavigableMap timeline + TimelineEntry entry, + NavigableMap> timeline ) { if (interval != null && interval.toDurationMillis() > 0) { @@ -365,9 +370,9 @@ public class VersionedIntervalTimeline } private void remove( - NavigableMap timeline, + NavigableMap> timeline, Interval interval, - TimelineEntry entry, + TimelineEntry entry, boolean incompleteOk ) { @@ -375,9 +380,9 @@ public class VersionedIntervalTimeline TimelineEntry removed = timeline.get(interval); if (removed == null) { - Iterator> iter = timeline.entrySet().iterator(); + Iterator>> iter = timeline.entrySet().iterator(); while (iter.hasNext()) { - Map.Entry timelineEntry = iter.next(); + Map.Entry> timelineEntry = iter.next(); if (timelineEntry.getValue() == entry) { intervalsToRemove.add(timelineEntry.getKey()); } @@ -392,14 +397,15 @@ public class VersionedIntervalTimeline } private void remove( - NavigableMap timeline, + NavigableMap> timeline, Interval interval, boolean incompleteOk ) { timeline.remove(interval); - for (Map.Entry> versionEntry : allTimelineEntries.entrySet()) { + for (Map.Entry>> versionEntry : allTimelineEntries + .entrySet()) { if (versionEntry.getKey().overlap(interval) != null) { TimelineEntry timelineEntry = versionEntry.getValue().lastEntry().getValue(); if (timelineEntry.getPartitionHolder().isComplete() || incompleteOk) { @@ -412,20 +418,18 @@ public class VersionedIntervalTimeline private List> lookup(Interval interval, boolean incompleteOk) { List> retVal = new ArrayList>(); - NavigableMap timeline = (incompleteOk) - ? incompletePartitionsTimeline - : completePartitionsTimeline; + NavigableMap> timeline = (incompleteOk) + ? incompletePartitionsTimeline + : completePartitionsTimeline; - for (Map.Entry entry : timeline.entrySet()) { + for (Map.Entry> entry : timeline.entrySet()) { Interval timelineInterval = entry.getKey(); - TimelineEntry val = entry.getValue(); + TimelineEntry val = entry.getValue(); if (timelineInterval.overlaps(interval)) { retVal.add( new TimelineObjectHolder( - timelineInterval, - val.getVersion(), - val.getPartitionHolder() + timelineInterval, val.getVersion(), val.getPartitionHolder() ) ); } @@ -463,30 +467,30 @@ public class VersionedIntervalTimeline return retVal; } - public class TimelineEntry + private static class TimelineEntry { private final Interval trueInterval; private final VersionType version; private final PartitionHolder partitionHolder; - public TimelineEntry(Interval trueInterval, VersionType version, PartitionHolder partitionHolder) + private TimelineEntry(Interval trueInterval, VersionType version, PartitionHolder partitionHolder) { this.trueInterval = trueInterval; this.version = version; this.partitionHolder = partitionHolder; } - public Interval getTrueInterval() + private Interval getTrueInterval() { return trueInterval; } - public VersionType getVersion() + private VersionType getVersion() { return version; } - public PartitionHolder getPartitionHolder() + private PartitionHolder getPartitionHolder() { return partitionHolder; } diff --git a/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java b/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java index 96d0fa01ce1..90fdee34e83 100644 --- a/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java +++ b/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java @@ -21,6 +21,7 @@ package com.metamx.druid; import com.google.common.collect.ImmutableList; import com.google.common.collect.Ordering; +import com.metamx.common.ISE; import com.metamx.common.Pair; import com.metamx.druid.partition.ImmutablePartitionHolder; import com.metamx.druid.partition.IntegerPartitionChunk; @@ -28,6 +29,7 @@ import com.metamx.druid.partition.PartitionChunk; import com.metamx.druid.partition.PartitionHolder; import com.metamx.druid.partition.SingleElementPartitionChunk; import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; import org.joda.time.Days; import org.joda.time.Hours; import org.joda.time.Interval; @@ -48,6 +50,10 @@ public class VersionedIntervalTimelineTest @Before public void setUp() throws Exception { + if (! "UTC".equals(DateTimeZone.getDefault().getID())) { + throw new ISE("Tests assume default timezone of UTC, please set -Duser.timezone=UTC"); + } + timeline = makeStringIntegerTimeline(); add("2011-04-01/2011-04-03", "1", 2); From 7921be790b43aafdff450c56f62a050912dd035d Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Fri, 2 Nov 2012 14:17:50 -0500 Subject: [PATCH 11/13] 1) Bump up the maven version pre-requisite to 3.0.3 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 35ecc263c9a..cbeb399f8ed 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ - 2.2.1 + 3.0.3 From 38ed1d8b75e1d720d22acd09435814621204fdb8 Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Fri, 2 Nov 2012 14:24:09 -0500 Subject: [PATCH 12/13] 1) Revert failed attempt at making OpenJDK6 happy. --- .../druid/VersionedIntervalTimeline.java | 88 +++++++++---------- .../druid/VersionedIntervalTimelineTest.java | 6 -- 2 files changed, 42 insertions(+), 52 deletions(-) diff --git a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java index a8c708917eb..a45821c7dba 100644 --- a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java +++ b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java @@ -61,13 +61,13 @@ public class VersionedIntervalTimeline private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true); - final NavigableMap> completePartitionsTimeline = Maps.newTreeMap( + final NavigableMap completePartitionsTimeline = new TreeMap( Comparators.intervalsByStartThenEnd() ); - final NavigableMap> incompletePartitionsTimeline = Maps.newTreeMap( + final NavigableMap incompletePartitionsTimeline = new TreeMap( Comparators.intervalsByStartThenEnd() ); - private final Map>> allTimelineEntries = Maps.newHashMap(); + private final Map> allTimelineEntries = Maps.newHashMap(); private final Comparator versionComparator; @@ -83,23 +83,19 @@ public class VersionedIntervalTimeline try { lock.writeLock().lock(); - Map> exists = allTimelineEntries.get(interval); - TimelineEntry entry = null; + Map exists = allTimelineEntries.get(interval); + TimelineEntry entry = null; if (exists == null) { - entry = new TimelineEntry(interval, version, new PartitionHolder(object)); - TreeMap> versionEntry = Maps.newTreeMap(versionComparator); + entry = new TimelineEntry(interval, version, new PartitionHolder(object)); + TreeMap versionEntry = Maps.newTreeMap(versionComparator); versionEntry.put(version, entry); allTimelineEntries.put(interval, versionEntry); } else { entry = exists.get(version); if (entry == null) { - entry = new TimelineEntry( - interval, - version, - new PartitionHolder(object) - ); + entry = new TimelineEntry(interval, version, new PartitionHolder(object)); exists.put(version, entry); } else { PartitionHolder partitionHolder = entry.getPartitionHolder(); @@ -123,12 +119,12 @@ public class VersionedIntervalTimeline try { lock.writeLock().lock(); - Map> versionEntries = allTimelineEntries.get(interval); + Map versionEntries = allTimelineEntries.get(interval); if (versionEntries == null) { return null; } - TimelineEntry entry = versionEntries.get(version); + TimelineEntry entry = versionEntries.get(version); if (entry == null) { return null; } @@ -156,7 +152,7 @@ public class VersionedIntervalTimeline { try { lock.readLock().lock(); - for (Map.Entry>> entry : allTimelineEntries.entrySet()) { + for (Map.Entry> entry : allTimelineEntries.entrySet()) { if (entry.getKey().equals(interval) || entry.getKey().contains(interval)) { TimelineEntry foundEntry = entry.getValue().get(version); if (foundEntry != null) { @@ -201,14 +197,13 @@ public class VersionedIntervalTimeline List> retVal = new ArrayList>(); Map> overShadowed = Maps.newHashMap(); - for (Map.Entry>> versionEntry : allTimelineEntries - .entrySet()) { + for (Map.Entry> versionEntry : allTimelineEntries.entrySet()) { Map versionCopy = Maps.newHashMap(); versionCopy.putAll(versionEntry.getValue()); overShadowed.put(versionEntry.getKey(), versionCopy); } - for (Map.Entry> entry : completePartitionsTimeline.entrySet()) { + for (Map.Entry entry : completePartitionsTimeline.entrySet()) { Map versionEntry = overShadowed.get(entry.getValue().getTrueInterval()); if (versionEntry != null) { versionEntry.remove(entry.getValue().getVersion()); @@ -218,7 +213,7 @@ public class VersionedIntervalTimeline } } - for (Map.Entry> entry : incompletePartitionsTimeline.entrySet()) { + for (Map.Entry entry : incompletePartitionsTimeline.entrySet()) { Map versionEntry = overShadowed.get(entry.getValue().getTrueInterval()); if (versionEntry != null) { versionEntry.remove(entry.getValue().getVersion()); @@ -230,7 +225,7 @@ public class VersionedIntervalTimeline for (Map.Entry> versionEntry : overShadowed.entrySet()) { for (Map.Entry entry : versionEntry.getValue().entrySet()) { - TimelineEntry object = entry.getValue(); + TimelineEntry object = entry.getValue(); retVal.add( new TimelineObjectHolder( object.getTrueInterval(), @@ -249,12 +244,12 @@ public class VersionedIntervalTimeline } private void add( - NavigableMap> timeline, + NavigableMap timeline, Interval interval, - TimelineEntry entry + TimelineEntry entry ) { - TimelineEntry existsInTimeline = timeline.get(interval); + TimelineEntry existsInTimeline = timeline.get(interval); if (existsInTimeline != null) { int compare = versionComparator.compare(entry.getVersion(), existsInTimeline.getVersion()); @@ -284,9 +279,9 @@ public class VersionedIntervalTimeline } private boolean addAtKey( - NavigableMap> timeline, + NavigableMap timeline, Interval key, - TimelineEntry entry + TimelineEntry entry ) { boolean retVal = false; @@ -320,7 +315,7 @@ public class VersionedIntervalTimeline } } } else if (versionCompare > 0) { - TimelineEntry oldEntry = timeline.remove(currKey); + TimelineEntry oldEntry = timeline.remove(currKey); if (currKey.contains(entryInterval)) { addIntervalToTimeline(new Interval(currKey.getStart(), entryInterval.getStart()), oldEntry, timeline); @@ -360,8 +355,8 @@ public class VersionedIntervalTimeline private void addIntervalToTimeline( Interval interval, - TimelineEntry entry, - NavigableMap> timeline + TimelineEntry entry, + NavigableMap timeline ) { if (interval != null && interval.toDurationMillis() > 0) { @@ -370,9 +365,9 @@ public class VersionedIntervalTimeline } private void remove( - NavigableMap> timeline, + NavigableMap timeline, Interval interval, - TimelineEntry entry, + TimelineEntry entry, boolean incompleteOk ) { @@ -380,9 +375,9 @@ public class VersionedIntervalTimeline TimelineEntry removed = timeline.get(interval); if (removed == null) { - Iterator>> iter = timeline.entrySet().iterator(); + Iterator> iter = timeline.entrySet().iterator(); while (iter.hasNext()) { - Map.Entry> timelineEntry = iter.next(); + Map.Entry timelineEntry = iter.next(); if (timelineEntry.getValue() == entry) { intervalsToRemove.add(timelineEntry.getKey()); } @@ -397,15 +392,14 @@ public class VersionedIntervalTimeline } private void remove( - NavigableMap> timeline, + NavigableMap timeline, Interval interval, boolean incompleteOk ) { timeline.remove(interval); - for (Map.Entry>> versionEntry : allTimelineEntries - .entrySet()) { + for (Map.Entry> versionEntry : allTimelineEntries.entrySet()) { if (versionEntry.getKey().overlap(interval) != null) { TimelineEntry timelineEntry = versionEntry.getValue().lastEntry().getValue(); if (timelineEntry.getPartitionHolder().isComplete() || incompleteOk) { @@ -418,18 +412,20 @@ public class VersionedIntervalTimeline private List> lookup(Interval interval, boolean incompleteOk) { List> retVal = new ArrayList>(); - NavigableMap> timeline = (incompleteOk) - ? incompletePartitionsTimeline - : completePartitionsTimeline; + NavigableMap timeline = (incompleteOk) + ? incompletePartitionsTimeline + : completePartitionsTimeline; - for (Map.Entry> entry : timeline.entrySet()) { + for (Map.Entry entry : timeline.entrySet()) { Interval timelineInterval = entry.getKey(); - TimelineEntry val = entry.getValue(); + TimelineEntry val = entry.getValue(); if (timelineInterval.overlaps(interval)) { retVal.add( new TimelineObjectHolder( - timelineInterval, val.getVersion(), val.getPartitionHolder() + timelineInterval, + val.getVersion(), + val.getPartitionHolder() ) ); } @@ -467,30 +463,30 @@ public class VersionedIntervalTimeline return retVal; } - private static class TimelineEntry + public class TimelineEntry { private final Interval trueInterval; private final VersionType version; private final PartitionHolder partitionHolder; - private TimelineEntry(Interval trueInterval, VersionType version, PartitionHolder partitionHolder) + public TimelineEntry(Interval trueInterval, VersionType version, PartitionHolder partitionHolder) { this.trueInterval = trueInterval; this.version = version; this.partitionHolder = partitionHolder; } - private Interval getTrueInterval() + public Interval getTrueInterval() { return trueInterval; } - private VersionType getVersion() + public VersionType getVersion() { return version; } - private PartitionHolder getPartitionHolder() + public PartitionHolder getPartitionHolder() { return partitionHolder; } diff --git a/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java b/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java index 90fdee34e83..96d0fa01ce1 100644 --- a/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java +++ b/common/src/test/java/com/metamx/druid/VersionedIntervalTimelineTest.java @@ -21,7 +21,6 @@ package com.metamx.druid; import com.google.common.collect.ImmutableList; import com.google.common.collect.Ordering; -import com.metamx.common.ISE; import com.metamx.common.Pair; import com.metamx.druid.partition.ImmutablePartitionHolder; import com.metamx.druid.partition.IntegerPartitionChunk; @@ -29,7 +28,6 @@ import com.metamx.druid.partition.PartitionChunk; import com.metamx.druid.partition.PartitionHolder; import com.metamx.druid.partition.SingleElementPartitionChunk; import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import org.joda.time.Days; import org.joda.time.Hours; import org.joda.time.Interval; @@ -50,10 +48,6 @@ public class VersionedIntervalTimelineTest @Before public void setUp() throws Exception { - if (! "UTC".equals(DateTimeZone.getDefault().getID())) { - throw new ISE("Tests assume default timezone of UTC, please set -Duser.timezone=UTC"); - } - timeline = makeStringIntegerTimeline(); add("2011-04-01/2011-04-03", "1", 2); From 88a3fb842c0a7c4e5a64ad5d53f0a76e22ba5805 Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Fri, 2 Nov 2012 14:24:43 -0500 Subject: [PATCH 13/13] 1) New attempt at making OpenJDK 6 happy --- .../main/java/com/metamx/druid/VersionedIntervalTimeline.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java index a45821c7dba..bee025c8270 100644 --- a/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java +++ b/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java @@ -88,7 +88,7 @@ public class VersionedIntervalTimeline if (exists == null) { entry = new TimelineEntry(interval, version, new PartitionHolder(object)); - TreeMap versionEntry = Maps.newTreeMap(versionComparator); + TreeMap versionEntry = new TreeMap(versionComparator); versionEntry.put(version, entry); allTimelineEntries.put(interval, versionEntry); } else {