From 56e2b956d0d7634b1f689554ee06bc6eaa4df7a8 Mon Sep 17 00:00:00 2001 From: cheddar Date: Fri, 30 Aug 2013 18:20:34 -0500 Subject: [PATCH] OMG!!! A lot of stuff has been moved. Modules have been created and destroyed, but everything is compiling and unit tests are passing, OMFG this is awesome.! --- client/pom.xml | 251 ------------ .../BatchServerInventoryViewProvider.java | 31 -- .../metamx/druid/client/InventoryView.java | 9 - .../client/ServerInventoryViewProvider.java | 16 - .../client/SingleServerInventoryProvider.java | 31 -- .../druid/client/cache/CacheProvider.java | 14 - .../client/cache/MemcachedCacheConfig.java | 49 --- .../client/cache/MemcachedCacheProvider.java | 10 - .../client/indexing/IndexingService.java | 17 - .../client/selector/DiscoverySelector.java | 8 - .../metamx/druid/client/selector/Server.java | 10 - .../BatchDataSegmentAnnouncerProvider.java | 20 - .../DataSegmentAnnouncerProvider.java | 16 - .../LegacyDataSegmentAnnouncerProvider.java | 30 -- .../discovery/NoopServiceAnnouncer.java | 21 - .../curator/discovery/ServiceAnnouncer.java | 14 - .../metamx/druid/guice/AnnouncerModule.java | 35 -- .../com/metamx/druid/guice/BrokerModule.java | 28 -- .../metamx/druid/guice/ServerViewModule.java | 22 - .../druid/guice/annotations/Client.java | 17 - .../com/metamx/druid/http/ZkPathsModule.java | 14 - .../log/EmittingRequestLoggerProvider.java | 36 -- .../http/log/FileRequestLoggerProvider.java | 37 -- .../druid/http/log/NoopRequestLogger.java | 14 - .../http/log/NoopRequestLoggerProvider.java | 12 - .../druid/http/log/RequestLoggerProvider.java | 13 - .../BatchDataSegmentAnnouncerConfig.java | 30 -- .../JettyServerInitializer.java | 11 - .../query/MapQueryToolChestWarehouse.java | 29 -- .../druid/query/group/GroupByQueryConfig.java | 37 -- .../query/group/having/AlwaysHavingSpec.java | 14 - .../orderby/OrderedPriorityQueueItems.java | 43 -- .../com/metamx/druid}/LogicalSegment.java | 2 +- .../metamx/druid/TimelineObjectHolder.java | 3 +- .../metamx/druid/guice/DbConnectorModule.java | 29 -- .../druid/guice/DruidGuiceExtensions.java | 16 - .../com/metamx/druid/guice/LazySingleton.java | 18 - .../metamx/druid/guice/ManageLifecycle.java | 21 - .../druid/guice/ManageLifecycleLast.java | 21 - .../metamx/druid/guice/SupplierProvider.java | 35 -- .../druid/guice/annotations/Global.java | 17 - .../metamx/druid/guice/annotations/Json.java | 17 - .../metamx/druid/guice/annotations/Self.java | 17 - .../metamx/druid/guice/annotations/Smile.java | 17 - .../druid/jackson/AggregatorsModule.java | 20 +- .../metamx/druid/jackson/JacksonModule.java | 6 +- .../druid/guice}/guice/ConfigProvider.java | 21 +- .../druid/guice/guice/DbConnectorModule.java | 48 +++ .../guice/guice/DruidGuiceExtensions.java | 35 ++ .../druid/guice}/guice/DruidScopes.java | 21 +- .../guice}/guice/DruidSecondaryModule.java | 25 +- .../guice/JacksonConfigManagerModule.java | 21 +- .../guice}/guice/JacksonConfigProvider.java | 2 +- .../guice}/guice/JsonConfigProvider.java | 2 +- .../druid/guice}/guice/JsonConfigurator.java | 21 +- .../io/druid/guice/guice/LazySingleton.java | 37 ++ .../druid/guice}/guice/LifecycleModule.java | 2 +- .../druid/guice}/guice/LifecycleScope.java | 21 +- .../druid/guice}/guice/ListProvider.java | 2 +- .../io/druid/guice/guice/ManageLifecycle.java | 40 ++ .../guice/guice/ManageLifecycleLast.java | 40 ++ .../druid/guice}/guice/PolyBind.java | 2 +- .../druid/guice/guice/SupplierProvider.java | 54 +++ .../druid/guice/guice/annotations/Global.java | 36 ++ .../druid/guice/guice/annotations/Json.java | 36 ++ .../druid/guice/guice/annotations/Self.java | 36 ++ .../druid/guice/guice/annotations/Smile.java | 36 ++ .../aggregation/CountAggregator.java | 4 +- .../aggregation/CountAggregatorFactory.java | 4 +- .../aggregation/CountBufferAggregator.java | 4 +- .../aggregation/DoubleSumAggregator.java | 4 +- .../DoubleSumAggregatorFactory.java | 4 +- .../DoubleSumBufferAggregator.java | 4 +- .../aggregation}/aggregation/Histogram.java | 4 +- .../aggregation/HistogramAggregator.java | 4 +- .../HistogramAggregatorFactory.java | 4 +- .../HistogramBufferAggregator.java | 4 +- .../aggregation/HistogramVisual.java | 4 +- .../aggregation/JavaScriptAggregator.java | 4 +- .../JavaScriptAggregatorFactory.java | 4 +- .../JavaScriptBufferAggregator.java | 4 +- .../aggregation/LongSumAggregator.java | 4 +- .../aggregation/LongSumAggregatorFactory.java | 4 +- .../aggregation/LongSumBufferAggregator.java | 4 +- .../aggregation/MaxAggregator.java | 4 +- .../aggregation/MaxAggregatorFactory.java | 4 +- .../aggregation/MaxBufferAggregator.java | 4 +- .../aggregation/MinAggregator.java | 4 +- .../aggregation/MinAggregatorFactory.java | 4 +- .../aggregation/MinBufferAggregator.java | 4 +- .../aggregation/NoopAggregator.java | 4 +- .../aggregation/NoopBufferAggregator.java | 4 +- .../ToLowerCaseAggregatorFactory.java | 4 +- .../post/ArithmeticPostAggregator.java | 2 +- .../post/ConstantPostAggregator.java | 2 +- .../post/FieldAccessPostAggregator.java | 2 +- .../metamx/druid/histogram/HistogramTest.java | 2 +- .../guice}/guice/LifecycleScopeTest.java | 21 +- .../druid/guice}/guice/PolyBindTest.java | 2 +- .../aggregation/CountAggregatorTest.java | 4 +- .../aggregation/DoubleSumAggregatorTest.java | 4 +- .../aggregation/HistogramAggregatorTest.java | 4 +- .../aggregation/JavaScriptAggregatorTest.java | 4 +- .../aggregation/LongSumAggregatorTest.java | 4 +- .../aggregation/MaxAggregatorTest.java | 4 +- .../aggregation/MetricSelectorUtils.java | 4 +- .../aggregation/MinAggregatorTest.java | 4 +- .../aggregation/TestFloatMetricSelector.java | 4 +- .../post/ArithmeticPostAggregatorTest.java | 4 +- .../post/ConstantPostAggregatorTest.java | 4 +- .../post/FieldAccessPostAggregatorTest.java | 6 +- .../flights/FlightsFirehoseFactory.java | 4 +- .../examples/guice/RealtimeExampleModule.java | 39 +- indexing-common/pom.xml | 110 ----- .../java/com/metamx/druid/index/v1/Index.java | 166 -------- .../metamx/druid/index/v1/MMappedIndex.java | 296 -------------- .../data/ByteBufferInputRowParser.java | 14 - .../druid/indexer/data/InputRowParser.java | 10 - .../metamx/druid/kv/ByteBufferSerializer.java | 30 -- .../metamx/druid/kv/SingleIndexedInts.java | 35 -- indexing-hadoop/pom.xml | 9 +- .../metamx/druid/indexer/DbUpdaterJob.java | 4 +- .../druid/indexer/DeterminePartitionsJob.java | 8 +- .../indexer/HadoopDruidIndexerConfig.java | 22 +- .../druid/indexer/HadoopDruidIndexerJob.java | 6 +- .../indexer/HadoopDruidIndexerMapper.java | 21 +- .../metamx/druid/indexer/HadoopIOPeon.java | 4 +- .../druid/indexer/HadoopyShardSpec.java | 4 +- .../druid/indexer/IndexGeneratorJob.java | 14 +- indexing-service/pom.xml | 14 +- .../druid/indexing/common/TaskToolbox.java | 8 +- .../indexing/common/TaskToolboxFactory.java | 6 +- .../actions/RemoteTaskActionClient.java | 21 +- .../RemoteTaskActionClientFactory.java | 4 +- .../common/actions/SegmentInsertAction.java | 21 +- .../actions/SegmentListUnusedAction.java | 21 +- .../common/actions/SegmentListUsedAction.java | 21 +- .../common/actions/SegmentNukeAction.java | 21 +- .../common/actions/TaskActionToolbox.java | 21 +- .../common/config/IndexerZkConfig.java | 4 +- .../index/EventReceiverFirehoseFactory.java | 4 +- .../EventReceivingChatHandlerProvider.java | 8 +- .../common/index/StaticS3FirehoseFactory.java | 5 +- .../common/index/YeOldePlumberSchool.java | 8 +- .../indexing/common/task/AppendTask.java | 16 +- .../indexing/common/task/DeleteTask.java | 14 +- .../indexing/common/task/HadoopIndexTask.java | 4 +- .../task/IndexDeterminePartitionsTask.java | 8 +- .../common/task/IndexGeneratorTask.java | 10 +- .../druid/indexing/common/task/IndexTask.java | 6 +- .../druid/indexing/common/task/KillTask.java | 4 +- .../druid/indexing/common/task/MergeTask.java | 8 +- .../indexing/common/task/MergeTaskBase.java | 8 +- .../common/task/RealtimeIndexTask.java | 10 +- .../common/task/VersionConverterTask.java | 6 +- .../indexing/common/tasklogs/S3TaskLogs.java | 21 +- .../coordinator/ForkingTaskRunner.java | 6 +- .../coordinator/ForkingTaskRunnerFactory.java | 4 +- .../coordinator/IndexerDBCoordinator.java | 4 +- .../coordinator/RemoteTaskRunner.java | 6 +- .../coordinator/RemoteTaskRunnerFactory.java | 6 +- .../indexing/coordinator/TaskMaster.java | 10 +- .../coordinator/TaskStorageQueryAdapter.java | 4 +- .../coordinator/ThreadPoolTaskRunner.java | 4 +- .../config/IndexerCoordinatorConfig.java | 4 +- .../http/IndexerCoordinatorResource.java | 4 +- .../http/OverlordRedirectInfo.java | 2 +- .../worker/WorkerCuratorCoordinator.java | 6 +- .../indexing/worker/WorkerTaskMonitor.java | 1 - .../guice/IndexingServiceModuleHelper.java | 2 +- .../guice}/guice/MiddleManagerModule.java | 6 +- .../druid/guice}/guice/OverlordModule.java | 6 +- .../druid/guice}/guice/PeonModule.java | 2 +- .../druid/guice}/guice/TaskLogsModule.java | 2 +- .../com/metamx/druid/indexing/TestTask.java | 4 +- .../common/task/MergeTaskBaseTest.java | 4 +- .../indexing/common/task/TaskSerdeTest.java | 31 +- .../common/task/VersionConverterTaskTest.java | 6 +- .../indexing/coordinator/RealtimeishTask.java | 4 +- .../coordinator/RemoteTaskRunnerTest.java | 27 +- .../coordinator/TaskLifecycleTest.java | 6 +- .../coordinator/TestRealtimeTask.java | 4 +- .../SimpleResourceManagementStrategyTest.java | 4 +- .../indexing/worker/TaskAnnouncementTest.java | 23 +- pom.xml | 8 +- {segment => processing}/pom.xml | 27 +- .../data/input/ByteBufferInputRowParser.java | 33 ++ .../io/druid/data/input}/CSVDataSpec.java | 6 +- .../java/io/druid/data/input}/DataSpec.java | 6 +- .../druid/data/input}/DelimitedDataSpec.java | 6 +- .../io/druid/data/input/InputRowParser.java | 29 ++ .../io/druid/data/input}/JSONDataSpec.java | 6 +- .../druid/data/input}/MapInputRowParser.java | 21 +- .../data/input}/ProtoBufInputRowParser.java | 35 +- .../data/input}/StringInputRowParser.java | 4 +- .../io/druid/data/input}/TimestampSpec.java | 5 +- .../data/input}/ToLowercaseDataSpec.java | 6 +- .../io/druid/granularity/AllGranularity.java | 74 ++++ .../granularity/BaseQueryGranularity.java | 83 ++++ .../granularity/DurationGranularity.java | 128 ++++++ .../io/druid/granularity/NoneGranularity.java | 66 +++ .../druid/granularity/PeriodGranularity.java | 375 ++++++++++++++++++ .../druid/granularity/QueryGranularity.java | 91 +++++ .../io}/druid/guice/QueryToolChestModule.java | 47 ++- .../main/java/io/druid/query}/BaseQuery.java | 6 +- .../io}/druid/query/BySegmentQueryRunner.java | 8 +- .../io/druid/query}/BySegmentResultValue.java | 4 +- .../query}/BySegmentResultValueClass.java | 4 +- .../query/BySegmentSkippingQueryRunner.java | 6 +- .../java/io/druid/query/CacheStrategy.java | 0 .../query/ChainedExecutionQueryRunner.java | 6 +- .../io}/druid/query/ConcatQueryRunner.java | 6 +- .../query/DelegatingExecutorService.java | 4 +- .../src/main/java/io/druid/query}/Druids.java | 37 +- .../query/FinalizeResultsQueryRunner.java | 9 +- .../query/IntervalChunkingQueryRunner.java | 6 +- .../query/MapQueryToolChestWarehouse.java | 46 +++ .../io/druid/query}/MetricValueExtractor.java | 6 +- .../query/MetricsEmittingExecutorService.java | 4 +- .../query/MetricsEmittingQueryRunner.java | 6 +- .../java/io}/druid/query/NoopQueryRunner.java | 6 +- .../io}/druid/query/PrioritizedCallable.java | 4 +- .../query/PrioritizedExecutorService.java | 4 +- .../main/java/io}/druid/query/Queries.java | 2 +- .../src/main/java/io/druid/query/Query.java | 11 +- .../io}/druid/query/QueryCacheHelper.java | 4 +- .../main/java/io/druid/query/QueryRunner.java | 0 .../io/druid/query/QueryRunnerFactory.java | 33 ++ .../io/druid/query}/QuerySegmentWalker.java | 5 +- .../java/io/druid/query/QueryToolChest.java | 2 +- .../druid/query/QueryToolChestWarehouse.java | 7 +- .../druid/query/ReflectionLoaderThingy.java | 4 +- .../ReflectionQueryToolChestWarehouse.java | 7 +- .../src/main/java/io/druid/query}/Result.java | 4 +- .../ResultGranularTimestampComparator.java | 5 +- .../druid/query/ResultMergeQueryRunner.java | 6 +- .../io/druid/query/SegmentDescriptor.java | 3 +- .../druid/query/aggregation/Aggregator.java | 42 ++ .../query/aggregation/AggregatorFactory.java | 100 +++++ .../query/aggregation/BufferAggregator.java | 96 +++++ .../aggregation/MetricManipulationFn.java | 0 .../query/aggregation/PostAggregator.java | 38 ++ .../query/dimension/DefaultDimensionSpec.java | 4 +- .../druid/query/dimension/DimensionSpec.java | 4 +- .../dimension/ExtractionDimensionSpec.java | 4 +- .../query/dimension/LegacyDimensionSpec.java | 4 +- .../query/extraction/DimExtractionFn.java | 2 +- .../extraction/PartialDimExtractionFn.java | 2 +- .../extraction/RegexDimExtractionFn.java | 2 +- .../SearchQuerySpecDimExtractionFn.java | 4 +- .../query/extraction/TimeDimExtractionFn.java | 2 +- .../io}/druid/query/filter/AndDimFilter.java | 4 +- .../query/filter/BitmapIndexSelector.java | 35 ++ .../io}/druid/query/filter/DimFilter.java | 4 +- .../query/filter/DimFilterCacheHelper.java | 4 +- .../io}/druid/query/filter/DimFilters.java | 4 +- .../query/filter/ExtractionDimFilter.java | 4 +- .../java/io/druid/query/filter/Filter.java | 30 ++ .../query/filter/JavaScriptDimFilter.java | 21 +- .../io}/druid/query/filter/NoopDimFilter.java | 4 +- .../io}/druid/query/filter/NotDimFilter.java | 4 +- .../io}/druid/query/filter/OrDimFilter.java | 4 +- .../druid/query/filter/RegexDimFilter.java | 4 +- .../query/filter/SearchQueryDimFilter.java | 6 +- .../druid/query/filter/SelectorDimFilter.java | 4 +- .../druid/query/filter/SpatialDimFilter.java | 4 +- .../io/druid/query/filter/ValueMatcher.java | 27 ++ .../query/filter/ValueMatcherFactory.java | 32 ++ .../io/druid/query/groupby}/GroupByQuery.java | 25 +- .../query/groupby/GroupByQueryConfig.java | 56 +++ .../groupby}/GroupByQueryQueryToolChest.java | 6 +- .../groupby/having/AlwaysHavingSpec.java | 33 ++ .../query/groupby}/having/AndHavingSpec.java | 21 +- .../groupby}/having/EqualToHavingSpec.java | 21 +- .../having/GreaterThanHavingSpec.java | 21 +- .../query/groupby}/having/HavingSpec.java | 21 +- .../groupby}/having/LessThanHavingSpec.java | 21 +- .../query/groupby}/having/NotHavingSpec.java | 21 +- .../query/groupby}/having/OrHavingSpec.java | 21 +- .../groupby}/orderby/DefaultLimitSpec.java | 4 +- .../query/groupby}/orderby/LimitSpec.java | 4 +- .../query/groupby}/orderby/NoopLimitSpec.java | 4 +- .../groupby}/orderby/OrderByColumnSpec.java | 21 +- .../orderby/OrderedPriorityQueueItems.java | 62 +++ .../query/groupby}/orderby/TopNSorter.java | 21 +- .../SegmentMetadataQueryQueryToolChest.java | 9 +- .../metadata/AllColumnIncluderator.java | 4 +- .../metadata}/metadata/ColumnAnalysis.java | 19 +- .../metadata/ColumnIncluderator.java | 4 +- .../metadata/ListColumnIncluderator.java | 4 +- .../metadata/NoneColumnIncluderator.java | 4 +- .../metadata}/metadata/SegmentAnalysis.java | 4 +- .../metadata/SegmentMetadataQuery.java | 4 +- .../search}/BySegmentSearchResultValue.java | 8 +- .../druid/query/search}/SearchBinaryFn.java | 11 +- .../search/SearchQueryQueryToolChest.java | 20 +- .../query/search}/SearchResultValue.java | 6 +- .../search/FragmentSearchQuerySpec.java | 4 +- .../InsensitiveContainsSearchQuerySpec.java | 4 +- .../search/LexicographicSearchSortSpec.java | 4 +- .../druid/query/search}/search/SearchHit.java | 4 +- .../query/search}/search/SearchQuery.java | 10 +- .../search}/search/SearchQueryConfig.java | 2 +- .../query/search}/search/SearchQuerySpec.java | 4 +- .../query/search}/search/SearchSortSpec.java | 4 +- .../search}/search/StrlenSearchSortSpec.java | 4 +- .../druid/query/spec/LegacySegmentSpec.java | 0 .../spec/MultipleIntervalSegmentSpec.java | 2 +- .../spec/MultipleSpecificSegmentSpec.java | 2 +- .../io/druid/query/spec/QuerySegmentSpec.java | 2 +- .../druid/query/spec}/QuerySegmentSpecs.java | 7 +- .../spec}/SpecificSegmentQueryRunner.java | 5 +- .../query/spec}/SpecificSegmentSpec.java | 4 +- .../query/timeboundary/TimeBoundaryQuery.java | 7 +- .../TimeBoundaryQueryQueryToolChest.java | 11 +- .../TimeBoundaryResultValue.java | 6 +- .../query/timeseries}/TimeseriesBinaryFn.java | 5 +- .../query/timeseries/TimeseriesQuery.java | 11 +- .../TimeseriesQueryQueryToolChest.java | 27 +- .../timeseries}/TimeseriesResultValue.java | 5 +- .../java/io/druid/segment/Capabilities.java | 4 +- .../java/io/druid/segment/ColumnSelector.java | 0 .../ColumnSelectorBitmapIndexSelector.java | 7 +- .../druid/segment/ComplexMetricSelector.java | 4 +- .../io/druid/segment}/CompressedPools.java | 4 +- .../java/io/druid/segment}/ConciseOffset.java | 6 +- .../main/java/io/druid/segment/Cursor.java | 0 .../java/io/druid/segment/CursorFactory.java | 0 .../io/druid/segment/DimensionSelector.java | 2 +- .../segment/DimensionSelectorFactory.java | 0 .../segment}/FloatMetricColumnSerializer.java | 7 +- .../io/druid/segment/FloatMetricSelector.java | 4 +- .../segment}/IncrementalIndexSegment.java | 11 +- .../io/druid/segment}/IndexGranularity.java | 4 +- .../main/java/io/druid/segment}/IndexIO.java | 123 ++---- .../java/io/druid/segment}/IndexMerger.java | 37 +- .../io/druid/segment}/IndexableAdapter.java | 8 +- .../io/druid/segment}/IndexedIntsOffset.java | 8 +- .../java/io/druid/segment/MMappedIndex.java | 178 +++++++++ .../druid/segment}/MMappedIndexAdapter.java | 14 +- .../segment}/MetricColumnSerializer.java | 4 +- .../java/io/druid/segment}/MetricHolder.java | 20 +- .../druid/segment/MetricSelectorFactory.java | 4 +- .../druid/segment/ObjectMetricSelector.java | 4 +- .../java/io/druid/segment/QueryableIndex.java | 2 +- .../QueryableIndexIndexableAdapter.java | 19 +- .../druid/segment}/QueryableIndexSegment.java | 8 +- .../QueryableIndexStorageAdapter.java | 21 +- .../segment}/ReferenceCountingSegment.java | 7 +- .../segment}/ReferenceCountingSequence.java | 4 +- .../main/java/io/druid/segment}/Rowboat.java | 4 +- .../RowboatFilteringIndexAdapter.java | 8 +- .../main/java/io/druid/segment/Segment.java | 4 +- .../druid/segment}/SimpleQueryableIndex.java | 7 +- .../java/io/druid/segment/StorageAdapter.java | 2 +- .../druid/segment}/column/AbstractColumn.java | 13 +- .../io/druid/segment/column/BitmapIndex.java | 0 .../java/io/druid/segment/column/Column.java | 0 .../druid/segment}/column/ColumnBuilder.java | 12 +- .../segment/column/ColumnCapabilities.java | 0 .../column/ColumnCapabilitiesImpl.java | 6 +- .../segment}/column/ColumnDescriptor.java | 8 +- .../druid/segment/column/ComplexColumn.java | 0 .../segment}/column/ComplexColumnImpl.java | 9 +- .../column/DictionaryEncodedColumn.java | 2 +- .../io/druid/segment}/column/FloatColumn.java | 9 +- .../druid/segment/column/GenericColumn.java | 6 +- .../segment}/column/IndexedComplexColumn.java | 7 +- .../column/IndexedFloatsGenericColumn.java | 12 +- .../column/IndexedLongsGenericColumn.java | 12 +- .../io/druid/segment}/column/LongColumn.java | 9 +- .../druid/segment/column/RunLengthColumn.java | 0 .../druid/segment}/column/SimpleColumn.java | 12 +- .../column/SimpleDictionaryEncodedColumn.java | 13 +- .../io/druid/segment/column/SpatialIndex.java | 1 + .../io/druid/segment/column/ValueType.java | 0 .../segment/data}/ArrayBasedIndexedInts.java | 6 +- .../druid/segment/data}/ArrayBasedOffset.java | 4 +- .../io/druid/segment/data}/ArrayIndexed.java | 6 +- .../segment/data/ByteBufferSerializer.java | 49 +++ .../druid/segment/data}/ByteBufferWriter.java | 21 +- .../CompressedFloatBufferObjectStrategy.java | 4 +- .../CompressedFloatsIndexedSupplier.java | 6 +- .../CompressedFloatsSupplierSerializer.java | 6 +- .../CompressedLongBufferObjectStrategy.java | 4 +- .../data}/CompressedLongsIndexedSupplier.java | 6 +- .../CompressedLongsSupplierSerializer.java | 6 +- .../data}/CompressedObjectStrategy.java | 6 +- .../data}/ConciseCompressedIndexedInts.java | 5 +- .../druid/segment/data}/EmptyIndexedInts.java | 5 +- .../druid/segment/data}/GenericIndexed.java | 5 +- .../segment/data}/GenericIndexedWriter.java | 4 +- .../java/io/druid/segment/data}/IOPeon.java | 4 +- .../data}/InMemoryCompressedFloats.java | 6 +- .../data}/InMemoryCompressedLongs.java | 6 +- .../java/io/druid/segment}/data/Indexed.java | 2 +- .../io/druid/segment}/data/IndexedFloats.java | 2 +- .../io/druid/segment}/data/IndexedInts.java | 2 +- .../segment/data}/IndexedIntsIterator.java | 5 +- .../druid/segment/data}/IndexedIterable.java | 6 +- .../io/druid/segment/data}/IndexedList.java | 6 +- .../io/druid/segment}/data/IndexedLongs.java | 2 +- .../io/druid/segment/data}/IndexedRTree.java | 21 +- .../io/druid/segment/data}/Indexedids.java | 6 +- .../segment/data}/IntBufferIndexedInts.java | 5 +- .../segment/data}/IntersectingOffset.java | 4 +- .../io/druid/segment/data}/ListIndexed.java | 6 +- .../druid/segment/data}/ObjectStrategy.java | 4 +- .../java/io/druid/segment/data}/Offset.java | 4 +- .../druid/segment/data}/ReadableOffset.java | 4 +- .../druid/segment/data/SingleIndexedInts.java | 39 +- .../segment/data}/StartLimitedOffset.java | 4 +- .../io/druid/segment/data}/TmpFileIOPeon.java | 4 +- .../druid/segment/data}/UnioningOffset.java | 4 +- .../io/druid/segment/data}/VSizeIndexed.java | 11 +- .../druid/segment/data}/VSizeIndexedInts.java | 5 +- .../segment/data}/VSizeIndexedWriter.java | 4 +- .../io/druid/segment/filter}/AndFilter.java | 4 +- .../segment/filter}/BooleanValueMatcher.java | 4 +- .../filter}/DimensionPredicateFilter.java | 6 +- .../segment/filter}/ExtractionFilter.java | 6 +- .../io/druid/segment/filter}/Filters.java | 24 +- .../segment/filter}/JavaScriptFilter.java | 21 +- .../io/druid/segment/filter}/NotFilter.java | 4 +- .../io/druid/segment/filter}/OrFilter.java | 4 +- .../io/druid/segment/filter}/RegexFilter.java | 5 +- .../segment/filter}/SearchQueryFilter.java | 6 +- .../druid/segment/filter}/SelectorFilter.java | 4 +- .../druid/segment/filter}/SpatialFilter.java | 4 +- .../incremental}/IncrementalIndex.java | 8 +- .../incremental}/IncrementalIndexAdapter.java | 16 +- .../incremental}/IncrementalIndexSchema.java | 21 +- .../IncrementalIndexStorageAdapter.java | 16 +- .../SpatialDimensionRowFormatter.java | 4 +- .../incremental}/SpatialDimensionSchema.java | 21 +- .../serde/BitmapIndexColumnPartSupplier.java | 6 +- .../druid/segment}/serde/ColumnPartSerde.java | 6 +- .../serde/ComplexColumnPartSerde.java | 10 +- .../serde/ComplexColumnPartSupplier.java | 8 +- .../serde}/ComplexMetricColumnSerializer.java | 12 +- .../serde/ComplexMetricExtractor.java | 4 +- .../segment}/serde/ComplexMetricSerde.java | 9 +- .../druid/segment}/serde/ComplexMetrics.java | 4 +- .../DictionaryEncodedColumnPartSerde.java | 18 +- .../DictionaryEncodedColumnSupplier.java | 12 +- .../serde/FloatGenericColumnPartSerde.java | 8 +- .../serde/FloatGenericColumnSupplier.java | 8 +- .../serde/LongGenericColumnPartSerde.java | 8 +- .../serde/LongGenericColumnSupplier.java | 8 +- .../io/druid/segment}/serde/Registererer.java | 4 +- .../io/druid/segment/serde/Registererers.java | 7 +- .../serde/SpatialIndexColumnPartSupplier.java | 4 +- .../collections}/CombiningIterableTest.java | 12 +- .../data/input}/InputRowParserSerdeTest.java | 4 +- .../input}/ProtoBufInputRowParserTest.java | 26 +- .../data/input}/ProtoTestEventWrapper.java | 116 +++--- .../query/PrioritizedExecutorServiceTest.java | 4 +- .../java/io}/druid/query/QueriesTest.java | 12 +- ...ResultGranularTimestampComparatorTest.java | 5 +- .../PartialDimExtractionFnTest.java | 4 +- .../extraction/RegexDimExtractionFnTest.java | 4 +- .../SearchQuerySpecDimExtractionFnTest.java | 8 +- .../extraction/TimeDimExtractionFnTest.java | 4 +- .../query/groupby}/having/HavingSpecTest.java | 21 +- .../groupby}/orderby/TopNSorterTest.java | 21 +- .../LexicographicSearchSortSpecTest.java | 7 +- .../query/search}/SearchBinaryFnTest.java | 13 +- .../search/StrlenSearchSortSpecTest.java | 7 +- .../query/spec}/QuerySegmentSpecTest.java | 8 +- .../TimeBoundaryQueryQueryToolChestTest.java | 6 +- .../timeseries}/TimeseriesBinaryFnTest.java | 15 +- .../CompressedFloatsIndexedSupplierTest.java | 5 +- ...ompressedFloatsSupplierSerializerTest.java | 6 +- .../CompressedLongsIndexedSupplierTest.java | 5 +- ...CompressedLongsSupplierSerializerTest.java | 6 +- .../segment/data}/GenericIndexedTest.java | 5 +- .../druid/segment/data}/IOPeonForTesting.java | 5 +- .../data}/InMemoryCompressedFloatsTest.java | 5 +- .../data}/InMemoryCompressedLongsTest.java | 5 +- .../segment/data}/IncrementalIndexTest.java | 5 +- .../druid/segment/data}/IndexedIntsTest.java | 5 +- .../segment/data}/VSizeIndexedIntsTest.java | 4 +- .../druid/segment/data}/VSizeIndexedTest.java | 5 +- .../src/test/resources/ProtoTest.proto | 0 .../src/test/resources/druid.sample.tsv | 0 .../test/resources/druid.sample.tsv.bottom | 0 .../src/test/resources/druid.sample.tsv.top | 0 .../src/test/resources/prototest.desc | Bin realtime/pom.xml | 7 +- .../druid/realtime/DbSegmentPublisher.java | 4 +- .../metamx/druid/realtime/FireHydrant.java | 6 +- .../druid/realtime/NoopSegmentPublisher.java | 4 +- .../druid/realtime/RealtimeManager.java | 6 +- .../com/metamx/druid/realtime/Schema.java | 8 +- .../druid/realtime/SegmentPublisher.java | 4 +- .../firehose/KafkaFirehoseFactory.java | 4 +- .../firehose/RabbitMQFirehoseFactory.java | 21 +- .../plumber/RealtimePlumberSchool.java | 24 +- .../metamx/druid/realtime/plumber/Sink.java | 8 +- .../guice/DbSegmentPublisherProvider.java | 5 +- .../guice}/guice/FireDepartmentsProvider.java | 4 +- .../guice/NoopSegmentPublisherProvider.java | 4 +- .../guice}/guice/RealtimeManagerConfig.java | 4 +- .../druid/guice}/guice/RealtimeModule.java | 5 +- .../guice/SegmentPublisherProvider.java | 4 +- .../druid/realtime/RealtimeManagerTest.java | 8 +- .../plumber/RealtimePlumberSchoolTest.java | 16 +- .../druid/realtime/plumber/SinkTest.java | 8 +- server/pom.xml | 60 ++- .../com/metamx/druid/sql/antlr4/DruidSQL.g4 | 32 +- .../com/metamx/druid/SearchResultBuilder.java | 8 +- .../metamx/druid/TimeseriesResultBuilder.java | 4 +- .../indexing/IndexingServiceSelector.java | 24 +- .../DataSegmentChangeHandler.java | 4 +- .../DataSegmentChangeRequest.java | 3 +- .../SegmentChangeRequestDrop.java | 4 +- .../SegmentChangeRequestLoad.java | 4 +- .../druid/coordination/ServerManager.java | 20 +- .../druid/coordination/ZkCoordinator.java | 8 +- .../metamx/druid/db/DatabaseRuleManager.java | 6 +- .../druid/db/DatabaseSegmentManager.java | 8 +- .../druid/guice/annotations/Processing.java | 17 - .../druid/loading/DataSegmentKiller.java | 4 +- .../druid/loading/DataSegmentPuller.java | 4 +- .../druid/loading/DataSegmentPusher.java | 4 +- .../druid/loading/DataSegmentPusherUtil.java | 4 +- .../loading/DelegatingSegmentLoader.java | 4 +- .../druid/loading/HdfsDataSegmentPuller.java | 21 +- .../druid/loading/HdfsDataSegmentPusher.java | 6 +- .../druid/loading/LocalDataSegmentPuller.java | 4 +- .../druid/loading/LocalDataSegmentPusher.java | 6 +- .../loading/MMappedQueryableIndexFactory.java | 23 +- .../druid/loading/OmniSegmentLoader.java | 23 +- .../druid/loading/S3DataSegmentKiller.java | 4 +- .../druid/loading/S3DataSegmentPuller.java | 6 +- .../druid/loading/S3DataSegmentPusher.java | 8 +- .../metamx/druid/loading/SegmentLoader.java | 4 +- .../druid/loading/SingleSegmentLoader.java | 6 +- .../cassandra/CassandraDataSegmentPuller.java | 4 +- .../cassandra/CassandraDataSegmentPusher.java | 6 +- .../druid/master/BalancerSegmentHolder.java | 6 +- .../metamx/druid/master/BalancerStrategy.java | 36 +- .../druid/master/CostBalancerStrategy.java | 36 +- .../com/metamx/druid/master/DruidCluster.java | 4 +- .../com/metamx/druid/master/DruidMaster.java | 18 +- .../druid/master/DruidMasterBalancer.java | 38 +- .../druid/master/DruidMasterCleanup.java | 8 +- .../druid/master/DruidMasterLogger.java | 8 +- .../druid/master/DruidMasterRuleRunner.java | 4 +- .../master/DruidMasterRuntimeParams.java | 6 +- .../master/DruidMasterSegmentInfoLoader.java | 4 +- .../master/DruidMasterSegmentMerger.java | 8 +- .../metamx/druid/master/LoadQueuePeon.java | 4 +- .../druid/master/RandomBalancerStrategy.java | 36 +- .../druid/master/ReservoirSegmentSampler.java | 36 +- .../druid/master/SegmentReplicantLookup.java | 6 +- .../com/metamx/druid/master/ServerHolder.java | 6 +- .../metamx/druid/master/rules/DropRule.java | 4 +- .../druid/master/rules/IntervalDropRule.java | 5 +- .../druid/master/rules/IntervalLoadRule.java | 5 +- .../metamx/druid/master/rules/LoadRule.java | 4 +- .../druid/master/rules/PeriodDropRule.java | 5 +- .../druid/master/rules/PeriodLoadRule.java | 5 +- .../com/metamx/druid/master/rules/Rule.java | 4 +- .../druid/master/rules/SizeDropRule.java | 4 +- .../druid/master/rules/SizeLoadRule.java | 4 +- .../metamx/druid/metrics/MetricsModule.java | 27 +- .../metamx/druid/metrics/ServerMonitor.java | 4 +- .../metamx/druid/query/QueryRunnerHelper.java | 4 +- .../ReferenceCountingSegmentQueryRunner.java | 21 +- .../druid/query/group/GroupByQueryEngine.java | 8 +- .../group/GroupByQueryRunnerFactory.java | 9 +- .../druid/query/metadata/SegmentAnalyzer.java | 13 +- .../SegmentMetadataQueryRunnerFactory.java | 9 +- .../druid/query/search/SearchQueryRunner.java | 32 +- .../search/SearchQueryRunnerFactory.java | 10 +- .../TimeBoundaryQueryRunnerFactory.java | 10 +- .../timeseries/TimeseriesQueryEngine.java | 7 +- .../TimeseriesQueryRunnerFactory.java | 10 +- .../com/metamx/druid/utils/DruidSetup.java | 4 +- .../client/BatchServerInventoryView.java | 8 +- .../BatchServerInventoryViewProvider.java | 50 +++ .../io}/druid/client/BrokerServerView.java | 12 +- .../druid/client/CachingClusteredClient.java | 16 +- .../java/io}/druid/client/DataSegment.java | 8 +- .../io}/druid/client/DirectDruidClient.java | 16 +- .../io}/druid/client/DruidDataSource.java | 4 +- .../java/io}/druid/client/DruidServer.java | 8 +- .../io}/druid/client/DruidServerConfig.java | 4 +- .../java/io/druid/client/InventoryView.java | 28 ++ .../io}/druid/client/ServerInventoryView.java | 10 +- .../client/ServerInventoryViewConfig.java | 4 +- .../client/ServerInventoryViewProvider.java | 35 ++ .../java/io}/druid/client/ServerView.java | 4 +- .../client/SingleServerInventoryProvider.java | 50 +++ .../client/SingleServerInventoryView.java | 8 +- .../io}/druid/client/TimelineServerView.java | 6 +- .../client/cache/ByteCountingLRUMap.java | 4 +- .../java/io}/druid/client/cache/Cache.java | 4 +- .../io}/druid/client/cache/CacheMonitor.java | 4 +- .../io/druid/client/cache/CacheProvider.java | 33 ++ .../io}/druid/client/cache/CacheSerde.java | 4 +- .../io}/druid/client/cache/CacheStats.java | 4 +- .../io}/druid/client/cache/LZ4Transcoder.java | 4 +- .../client/cache/LocalCacheProvider.java | 4 +- .../java/io}/druid/client/cache/MapCache.java | 4 +- .../druid/client/cache/MemcachedCache.java | 4 +- .../client/cache/MemcachedCacheConfig.java | 68 ++++ .../client/cache/MemcachedCacheProvider.java | 29 ++ .../client/indexing/ClientAppendQuery.java | 6 +- .../indexing/ClientConversionQuery.java | 23 +- .../client/indexing/ClientKillQuery.java | 4 +- .../client/indexing/ClientMergeQuery.java | 6 +- .../client/indexing/IndexingService.java | 36 ++ .../indexing/IndexingServiceClient.java | 12 +- .../client/selector/DiscoverySelector.java | 27 ++ .../client/selector/QueryableDruidServer.java | 8 +- .../java/io/druid/client/selector/Server.java | 29 ++ .../druid/client/selector/ServerSelector.java | 6 +- .../java/io}/druid/curator/CuratorConfig.java | 4 +- .../java/io}/druid/curator/CuratorModule.java | 25 +- ...PotentiallyGzippedCompressionProvider.java | 5 +- .../ShutdownNowIgnoringExecutorService.java | 21 +- .../druid/curator/announcement/Announcer.java | 10 +- .../cache/PathChildrenCacheFactory.java | 4 +- .../cache/SimplePathChildrenCacheFactory.java | 4 +- .../discovery/CuratorServiceAnnouncer.java | 23 +- .../curator/discovery/DiscoveryModule.java | 29 +- .../discovery/NoopServiceAnnouncer.java | 40 ++ .../curator/discovery/ServiceAnnouncer.java | 33 ++ .../inventory/CuratorInventoryManager.java | 10 +- .../CuratorInventoryManagerStrategy.java | 4 +- .../inventory/InventoryManagerConfig.java | 4 +- .../druid/guice}/guice/AWSModule.java | 4 +- .../io/druid/guice/guice/AnnouncerModule.java | 54 +++ .../io/druid/guice/guice/BrokerModule.java | 47 +++ .../CassandraDataSegmentPusherProvider.java | 4 +- .../druid/guice}/guice/CoordinatorModule.java | 33 +- .../guice}/guice/DataSegmentPullerModule.java | 4 +- .../guice}/guice/DataSegmentPusherModule.java | 22 +- .../guice/DataSegmentPusherProvider.java | 4 +- .../guice}/guice/DruidProcessingModule.java | 10 +- .../guice/HdfsDataSegmentPusherProvider.java | 4 +- .../druid/guice}/guice/HistoricalModule.java | 4 +- .../druid/guice}/guice/HttpClientModule.java | 23 +- .../guice/IndexingServiceDiscoveryModule.java | 8 +- .../guice/LocalDataSegmentPusherProvider.java | 4 +- .../guice/QueryRunnerFactoryModule.java | 38 +- .../druid/guice}/guice/QueryableModule.java | 14 +- .../guice/S3DataSegmentPusherProvider.java | 4 +- .../druid/guice}/guice/ServerModule.java | 10 +- .../druid/guice/guice/ServerViewModule.java | 41 ++ .../druid/guice}/guice/StorageNodeModule.java | 12 +- .../druid/guice/guice/annotations/Client.java | 36 ++ .../guice/guice/annotations/Processing.java | 36 ++ .../io/druid/server}/ClientInfoResource.java | 12 +- .../server}/ClientQuerySegmentWalker.java | 20 +- .../DirectClientQuerySegmentWalker.java | 10 +- .../main/java/io/druid/server}/DruidNode.java | 2 +- .../io/druid/server}/GuiceServletConfig.java | 4 +- .../java/io/druid/server}/QueryServlet.java | 10 +- .../java/io/druid/server}/RequestLogLine.java | 4 +- .../java/io/druid/server}/StatusResource.java | 4 +- .../java/io/druid/server/ZkPathsModule.java | 33 ++ .../AbstractDataSegmentAnnouncer.java | 8 +- .../BatchDataSegmentAnnouncer.java | 12 +- .../BatchDataSegmentAnnouncerProvider.java | 39 ++ .../coordination/DataSegmentAnnouncer.java | 6 +- .../DataSegmentAnnouncerProvider.java | 35 ++ .../coordination/DruidServerMetadata.java | 4 +- .../LegacyDataSegmentAnnouncerProvider.java | 46 +++ ...aSegmentAnnouncerDataSegmentAnnouncer.java | 6 +- .../SingleDataSegmentAnnouncer.java | 10 +- .../druid/server}/http/InfoResource.java | 14 +- .../druid/server}/http/MasterMain.java | 0 .../server}/http/MasterRedirectInfo.java | 21 +- .../druid/server}/http/MasterResource.java | 4 +- .../http/MasterSegmentSettingsResource.java | 36 +- .../druid/server}/http/RedirectFilter.java | 4 +- .../druid/server}/http/RedirectInfo.java | 4 +- .../druid/server}/http/RedirectServlet.java | 4 +- .../druid/server}/http/SegmentToDrop.java | 4 +- .../druid/server}/http/SegmentToMove.java | 4 +- .../BatchDataSegmentAnnouncerConfig.java | 49 +++ .../initialization/ConfigModule.java | 6 +- .../CuratorDiscoveryConfig.java | 4 +- .../initialization/EmitterModule.java | 9 +- .../initialization/HttpEmitterConfig.java | 2 +- .../initialization/HttpEmitterModule.java | 8 +- .../initialization/Initialization.java | 12 +- .../JettyServerInitializer.java | 30 ++ .../initialization/JettyServerModule.java | 28 +- .../initialization/LogEmitterModule.java | 6 +- .../initialization/PropertiesModule.java | 2 +- .../initialization/ServerConfig.java | 4 +- .../initialization/ZkPathsConfig.java | 4 +- .../server}/log/EmittingRequestLogger.java | 6 +- .../log/EmittingRequestLoggerProvider.java | 55 +++ .../druid/server}/log/FileRequestLogger.java | 6 +- .../server/log/FileRequestLoggerProvider.java | 56 +++ .../druid/server/log/NoopRequestLogger.java | 33 ++ .../server/log/NoopRequestLoggerProvider.java | 31 ++ .../io/druid/server}/log/RequestLogger.java | 6 +- .../server/log/RequestLoggerProvider.java | 32 ++ .../server/shard}/shard/LinearShardSpec.java | 21 +- .../server/shard}/shard/NoneShardSpec.java | 4 +- .../shard}/shard/NumberedShardSpec.java | 4 +- .../druid/server/shard}/shard/ShardSpec.java | 4 +- .../shard/SingleDimensionShardSpec.java | 4 +- .../java/io/druid/server}/sql/SQLRunner.java | 12 +- .../java/io/druid/storage}/s3/S3Utils.java | 4 +- .../java/com/metamx/druid/TestHelper.java | 4 +- .../SegmentChangeRequestDropTest.java | 9 +- .../SegmentChangeRequestLoadTest.java | 9 +- .../druid/coordination/ServerManagerTest.java | 22 +- .../druid/coordination/ZkCoordinatorTest.java | 17 +- .../index/ReferenceCountingSegmentTest.java | 3 +- .../index/brita/SpatialFilterBonusTest.java | 32 +- .../druid/index/brita/SpatialFilterTest.java | 32 +- .../druid/index/v1/ConciseOffsetTest.java | 5 +- .../metamx/druid/index/v1/EmptyIndexTest.java | 7 +- .../druid/index/v1/IndexMergerTest.java | 6 +- .../com/metamx/druid/index/v1/TestIndex.java | 13 +- .../v1/processing/IntersectingOffsetTest.java | 5 +- .../v1/processing/UnioningOffsetTest.java | 5 +- .../druid/loading/CacheTestSegmentLoader.java | 4 +- .../loading/DataSegmentPusherUtilTest.java | 25 +- .../loading/SingleSegmentLoaderTest.java | 21 +- .../druid/master/DruidMasterBalancerTest.java | 40 +- .../master/DruidMasterBalancerTester.java | 23 +- .../master/DruidMasterRuleRunnerTest.java | 10 +- .../master/DruidMasterSegmentMergerTest.java | 8 +- .../metamx/druid/master/DruidMasterTest.java | 12 +- .../druid/master/LoadQueuePeonTester.java | 21 +- .../master/ReservoirSegmentSamplerTest.java | 40 +- .../master/rules/PeriodDropRuleTest.java | 6 +- .../master/rules/PeriodLoadRuleTest.java | 6 +- .../druid/query/QueryRunnerTestHelper.java | 21 +- .../query/group/GroupByQueryRunnerTest.java | 25 +- .../GroupByTimeseriesQueryRunnerTest.java | 11 +- .../query/metadata/SegmentAnalyzerTest.java | 11 +- .../query/search/SearchQueryRunnerTest.java | 15 +- .../TimeBoundaryQueryRunnerTest.java | 9 +- .../TimeseriesQueryRunnerBonusTest.java | 34 +- .../timeseries/TimeseriesQueryRunnerTest.java | 19 +- .../utils/DruidMasterBalancerProfiler.java | 40 +- .../io}/druid/client/DataSegmentTest.java | 8 +- .../client/cache/ByteCountingLRUMapTest.java | 4 +- .../io}/druid/client/cache/MapCacheTest.java | 4 +- .../client/cache/MemcachedCacheBenchmark.java | 21 +- .../client/cache/MemcachedCacheTest.java | 4 +- .../client/BatchServerInventoryViewTest.java | 19 +- .../client/selector/ServerSelectorTest.java | 16 +- .../io}/druid/curator/CuratorTestBase.java | 21 +- .../curator/announcement/AnnouncerTest.java | 4 +- .../CuratorInventoryManagerTest.java | 24 +- .../BatchDataSegmentAnnouncerTest.java | 16 +- .../shard}/shard/NumberedShardSpecTest.java | 4 +- .../shard/SingleDimensionShardSpecTest.java | 5 +- .../src/main/java/io/druid/cli/CliBroker.java | 32 +- .../java/io/druid/cli/CliCoordinator.java | 57 ++- .../main/java/io/druid/cli/CliHistorical.java | 34 +- .../java/io/druid/cli/CliMiddleManager.java | 43 +- .../main/java/io/druid/cli/CliOverlord.java | 32 +- .../src/main/java/io/druid/cli/CliPeon.java | 38 +- .../main/java/io/druid/cli/CliRealtime.java | 38 +- .../java/io/druid/cli/CliRealtimeExample.java | 22 +- .../cli/QueryJettyServerInitializer.java | 23 +- 768 files changed, 6963 insertions(+), 4349 deletions(-) delete mode 100644 client/pom.xml delete mode 100644 client/src/main/java/com/metamx/druid/client/BatchServerInventoryViewProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/client/InventoryView.java delete mode 100644 client/src/main/java/com/metamx/druid/client/ServerInventoryViewProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/client/SingleServerInventoryProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/client/cache/CacheProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/client/cache/MemcachedCacheConfig.java delete mode 100644 client/src/main/java/com/metamx/druid/client/cache/MemcachedCacheProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/client/indexing/IndexingService.java delete mode 100644 client/src/main/java/com/metamx/druid/client/selector/DiscoverySelector.java delete mode 100644 client/src/main/java/com/metamx/druid/client/selector/Server.java delete mode 100644 client/src/main/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncerProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/coordination/DataSegmentAnnouncerProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/coordination/LegacyDataSegmentAnnouncerProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/curator/discovery/NoopServiceAnnouncer.java delete mode 100644 client/src/main/java/com/metamx/druid/curator/discovery/ServiceAnnouncer.java delete mode 100644 client/src/main/java/com/metamx/druid/guice/AnnouncerModule.java delete mode 100644 client/src/main/java/com/metamx/druid/guice/BrokerModule.java delete mode 100644 client/src/main/java/com/metamx/druid/guice/ServerViewModule.java delete mode 100644 client/src/main/java/com/metamx/druid/guice/annotations/Client.java delete mode 100644 client/src/main/java/com/metamx/druid/http/ZkPathsModule.java delete mode 100644 client/src/main/java/com/metamx/druid/http/log/EmittingRequestLoggerProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/http/log/FileRequestLoggerProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/http/log/NoopRequestLogger.java delete mode 100644 client/src/main/java/com/metamx/druid/http/log/NoopRequestLoggerProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/http/log/RequestLoggerProvider.java delete mode 100644 client/src/main/java/com/metamx/druid/initialization/BatchDataSegmentAnnouncerConfig.java delete mode 100644 client/src/main/java/com/metamx/druid/initialization/JettyServerInitializer.java delete mode 100644 client/src/main/java/com/metamx/druid/query/MapQueryToolChestWarehouse.java delete mode 100644 client/src/main/java/com/metamx/druid/query/group/GroupByQueryConfig.java delete mode 100644 client/src/main/java/com/metamx/druid/query/group/having/AlwaysHavingSpec.java delete mode 100644 client/src/main/java/com/metamx/druid/query/group/orderby/OrderedPriorityQueueItems.java rename {segment/src/main/java/io/druid/segment => common/src/main/java/com/metamx/druid}/LogicalSegment.java (97%) delete mode 100644 common/src/main/java/com/metamx/druid/guice/DbConnectorModule.java delete mode 100644 common/src/main/java/com/metamx/druid/guice/DruidGuiceExtensions.java delete mode 100644 common/src/main/java/com/metamx/druid/guice/LazySingleton.java delete mode 100644 common/src/main/java/com/metamx/druid/guice/ManageLifecycle.java delete mode 100644 common/src/main/java/com/metamx/druid/guice/ManageLifecycleLast.java delete mode 100644 common/src/main/java/com/metamx/druid/guice/SupplierProvider.java delete mode 100644 common/src/main/java/com/metamx/druid/guice/annotations/Global.java delete mode 100644 common/src/main/java/com/metamx/druid/guice/annotations/Json.java delete mode 100644 common/src/main/java/com/metamx/druid/guice/annotations/Self.java delete mode 100644 common/src/main/java/com/metamx/druid/guice/annotations/Smile.java rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/ConfigProvider.java (66%) create mode 100644 common/src/main/java/io/druid/guice/guice/DbConnectorModule.java create mode 100644 common/src/main/java/io/druid/guice/guice/DruidGuiceExtensions.java rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/DruidScopes.java (62%) rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/DruidSecondaryModule.java (74%) rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/JacksonConfigManagerModule.java (60%) rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/JacksonConfigProvider.java (98%) rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/JsonConfigProvider.java (99%) rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/JsonConfigurator.java (86%) create mode 100644 common/src/main/java/io/druid/guice/guice/LazySingleton.java rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/LifecycleModule.java (99%) rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/LifecycleScope.java (66%) rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/ListProvider.java (98%) create mode 100644 common/src/main/java/io/druid/guice/guice/ManageLifecycle.java create mode 100644 common/src/main/java/io/druid/guice/guice/ManageLifecycleLast.java rename common/src/main/java/{com/metamx/druid => io/druid/guice}/guice/PolyBind.java (99%) create mode 100644 common/src/main/java/io/druid/guice/guice/SupplierProvider.java create mode 100644 common/src/main/java/io/druid/guice/guice/annotations/Global.java create mode 100644 common/src/main/java/io/druid/guice/guice/annotations/Json.java create mode 100644 common/src/main/java/io/druid/guice/guice/annotations/Self.java create mode 100644 common/src/main/java/io/druid/guice/guice/annotations/Smile.java rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/CountAggregator.java (94%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/CountAggregatorFactory.java (96%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/CountBufferAggregator.java (93%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/DoubleSumAggregator.java (95%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/DoubleSumAggregatorFactory.java (97%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/DoubleSumBufferAggregator.java (94%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/Histogram.java (97%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/HistogramAggregator.java (95%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/HistogramAggregatorFactory.java (98%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/HistogramBufferAggregator.java (96%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/HistogramVisual.java (96%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/JavaScriptAggregator.java (95%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/JavaScriptAggregatorFactory.java (98%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/JavaScriptBufferAggregator.java (95%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/LongSumAggregator.java (95%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/LongSumAggregatorFactory.java (97%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/LongSumBufferAggregator.java (94%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/MaxAggregator.java (95%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/MaxAggregatorFactory.java (97%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/MaxBufferAggregator.java (94%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/MinAggregator.java (95%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/MinAggregatorFactory.java (97%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/MinBufferAggregator.java (94%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/NoopAggregator.java (93%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/NoopBufferAggregator.java (92%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/ToLowerCaseAggregatorFactory.java (96%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/post/ArithmeticPostAggregator.java (98%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/post/ConstantPostAggregator.java (97%) rename common/src/main/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/post/FieldAccessPostAggregator.java (97%) rename common/src/test/java/{com/metamx/druid => io/druid/guice}/guice/LifecycleScopeTest.java (86%) rename common/src/test/java/{com/metamx/druid => io/druid/guice}/guice/PolyBindTest.java (99%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/CountAggregatorTest.java (95%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/DoubleSumAggregatorTest.java (96%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/HistogramAggregatorTest.java (98%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/JavaScriptAggregatorTest.java (98%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/LongSumAggregatorTest.java (95%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/MaxAggregatorTest.java (93%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/MetricSelectorUtils.java (92%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/MinAggregatorTest.java (93%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/TestFloatMetricSelector.java (92%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/post/ArithmeticPostAggregatorTest.java (96%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/post/ConstantPostAggregatorTest.java (94%) rename common/src/test/java/{com/metamx/druid => io/druid/query/aggregation}/aggregation/post/FieldAccessPostAggregatorTest.java (90%) delete mode 100644 indexing-common/pom.xml delete mode 100644 indexing-common/src/main/java/com/metamx/druid/index/v1/Index.java delete mode 100644 indexing-common/src/main/java/com/metamx/druid/index/v1/MMappedIndex.java delete mode 100644 indexing-common/src/main/java/com/metamx/druid/indexer/data/ByteBufferInputRowParser.java delete mode 100644 indexing-common/src/main/java/com/metamx/druid/indexer/data/InputRowParser.java delete mode 100644 indexing-common/src/main/java/com/metamx/druid/kv/ByteBufferSerializer.java delete mode 100644 indexing-common/src/main/java/com/metamx/druid/kv/SingleIndexedInts.java rename indexing-service/src/main/java/{com/metamx/druid => io/druid/guice}/guice/IndexingServiceModuleHelper.java (97%) rename indexing-service/src/main/java/{com/metamx/druid => io/druid/guice}/guice/MiddleManagerModule.java (94%) rename indexing-service/src/main/java/{com/metamx/druid => io/druid/guice}/guice/OverlordModule.java (98%) rename indexing-service/src/main/java/{com/metamx/druid => io/druid/guice}/guice/PeonModule.java (99%) rename indexing-service/src/main/java/{com/metamx/druid => io/druid/guice}/guice/TaskLogsModule.java (98%) rename {segment => processing}/pom.xml (89%) create mode 100644 processing/src/main/java/io/druid/data/input/ByteBufferInputRowParser.java rename {indexing-common/src/main/java/com/metamx/druid/indexer/data => processing/src/main/java/io/druid/data/input}/CSVDataSpec.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/indexer/data => processing/src/main/java/io/druid/data/input}/DataSpec.java (91%) rename {indexing-common/src/main/java/com/metamx/druid/indexer/data => processing/src/main/java/io/druid/data/input}/DelimitedDataSpec.java (95%) create mode 100644 processing/src/main/java/io/druid/data/input/InputRowParser.java rename {indexing-common/src/main/java/com/metamx/druid/indexer/data => processing/src/main/java/io/druid/data/input}/JSONDataSpec.java (93%) rename {indexing-common/src/main/java/com/metamx/druid/indexer/data => processing/src/main/java/io/druid/data/input}/MapInputRowParser.java (77%) rename {indexing-common/src/main/java/com/metamx/druid/indexer/data => processing/src/main/java/io/druid/data/input}/ProtoBufInputRowParser.java (71%) rename {indexing-common/src/main/java/com/metamx/druid/indexer/data => processing/src/main/java/io/druid/data/input}/StringInputRowParser.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/indexer/data => processing/src/main/java/io/druid/data/input}/TimestampSpec.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/indexer/data => processing/src/main/java/io/druid/data/input}/ToLowercaseDataSpec.java (92%) create mode 100644 processing/src/main/java/io/druid/granularity/AllGranularity.java create mode 100644 processing/src/main/java/io/druid/granularity/BaseQueryGranularity.java create mode 100644 processing/src/main/java/io/druid/granularity/DurationGranularity.java create mode 100644 processing/src/main/java/io/druid/granularity/NoneGranularity.java create mode 100644 processing/src/main/java/io/druid/granularity/PeriodGranularity.java create mode 100644 processing/src/main/java/io/druid/granularity/QueryGranularity.java rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/guice/QueryToolChestModule.java (50%) rename {client/src/main/java/com/metamx/druid => processing/src/main/java/io/druid/query}/BaseQuery.java (95%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/BySegmentQueryRunner.java (92%) rename {client/src/main/java/com/metamx/druid/result => processing/src/main/java/io/druid/query}/BySegmentResultValue.java (92%) rename {client/src/main/java/com/metamx/druid/result => processing/src/main/java/io/druid/query}/BySegmentResultValueClass.java (95%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/BySegmentSkippingQueryRunner.java (90%) rename {client => processing}/src/main/java/io/druid/query/CacheStrategy.java (100%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/ChainedExecutionQueryRunner.java (97%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/ConcatQueryRunner.java (91%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/DelegatingExecutorService.java (97%) rename {client/src/main/java/com/metamx/druid => processing/src/main/java/io/druid/query}/Druids.java (95%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/FinalizeResultsQueryRunner.java (92%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/IntervalChunkingQueryRunner.java (95%) create mode 100644 processing/src/main/java/io/druid/query/MapQueryToolChestWarehouse.java rename {client/src/main/java/com/metamx/druid/result => processing/src/main/java/io/druid/query}/MetricValueExtractor.java (89%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/MetricsEmittingExecutorService.java (95%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/MetricsEmittingQueryRunner.java (97%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/NoopQueryRunner.java (87%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/PrioritizedCallable.java (93%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/PrioritizedExecutorService.java (98%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/Queries.java (98%) rename {client => processing}/src/main/java/io/druid/query/Query.java (88%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/QueryCacheHelper.java (95%) rename {client => processing}/src/main/java/io/druid/query/QueryRunner.java (100%) create mode 100644 processing/src/main/java/io/druid/query/QueryRunnerFactory.java rename {client/src/main/java/com/metamx/druid/query/segment => processing/src/main/java/io/druid/query}/QuerySegmentWalker.java (91%) rename {client => processing}/src/main/java/io/druid/query/QueryToolChest.java (98%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/QueryToolChestWarehouse.java (86%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/ReflectionLoaderThingy.java (96%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/ReflectionQueryToolChestWarehouse.java (89%) rename {client/src/main/java/com/metamx/druid/result => processing/src/main/java/io/druid/query}/Result.java (96%) rename {client/src/main/java/com/metamx/druid => processing/src/main/java/io/druid/query}/ResultGranularTimestampComparator.java (92%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/ResultMergeQueryRunner.java (91%) rename {client => processing}/src/main/java/io/druid/query/SegmentDescriptor.java (98%) create mode 100644 processing/src/main/java/io/druid/query/aggregation/Aggregator.java create mode 100644 processing/src/main/java/io/druid/query/aggregation/AggregatorFactory.java create mode 100644 processing/src/main/java/io/druid/query/aggregation/BufferAggregator.java rename {client => processing}/src/main/java/io/druid/query/aggregation/MetricManipulationFn.java (100%) create mode 100644 processing/src/main/java/io/druid/query/aggregation/PostAggregator.java rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/dimension/DefaultDimensionSpec.java (95%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/dimension/DimensionSpec.java (93%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/dimension/ExtractionDimensionSpec.java (96%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/dimension/LegacyDimensionSpec.java (94%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/extraction/DimExtractionFn.java (97%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/extraction/PartialDimExtractionFn.java (97%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/extraction/RegexDimExtractionFn.java (97%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/extraction/SearchQuerySpecDimExtractionFn.java (95%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/extraction/TimeDimExtractionFn.java (98%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/AndDimFilter.java (96%) create mode 100644 processing/src/main/java/io/druid/query/filter/BitmapIndexSelector.java rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/DimFilter.java (95%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/DimFilterCacheHelper.java (95%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/DimFilters.java (96%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/ExtractionDimFilter.java (96%) create mode 100644 processing/src/main/java/io/druid/query/filter/Filter.java rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/JavaScriptDimFilter.java (60%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/NoopDimFilter.java (92%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/NotDimFilter.java (96%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/OrDimFilter.java (96%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/RegexDimFilter.java (95%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/SearchQueryDimFilter.java (93%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/SelectorDimFilter.java (96%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/filter/SpatialDimFilter.java (96%) create mode 100644 processing/src/main/java/io/druid/query/filter/ValueMatcher.java create mode 100644 processing/src/main/java/io/druid/query/filter/ValueMatcherFactory.java rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/GroupByQuery.java (95%) create mode 100644 processing/src/main/java/io/druid/query/groupby/GroupByQueryConfig.java rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/GroupByQueryQueryToolChest.java (98%) create mode 100644 processing/src/main/java/io/druid/query/groupby/having/AlwaysHavingSpec.java rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/having/AndHavingSpec.java (64%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/having/EqualToHavingSpec.java (72%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/having/GreaterThanHavingSpec.java (70%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/having/HavingSpec.java (64%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/having/LessThanHavingSpec.java (70%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/having/NotHavingSpec.java (60%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/having/OrHavingSpec.java (63%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/orderby/DefaultLimitSpec.java (98%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/orderby/LimitSpec.java (93%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/orderby/NoopLimitSpec.java (93%) rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/orderby/OrderByColumnSpec.java (82%) create mode 100644 processing/src/main/java/io/druid/query/groupby/orderby/OrderedPriorityQueueItems.java rename {client/src/main/java/com/metamx/druid/query/group => processing/src/main/java/io/druid/query/groupby}/orderby/TopNSorter.java (56%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java (96%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/metadata}/metadata/AllColumnIncluderator.java (91%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/metadata}/metadata/ColumnAnalysis.java (86%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/metadata}/metadata/ColumnIncluderator.java (94%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/metadata}/metadata/ListColumnIncluderator.java (95%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/metadata}/metadata/NoneColumnIncluderator.java (91%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/metadata}/metadata/SegmentAnalysis.java (95%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/metadata}/metadata/SegmentMetadataQuery.java (97%) rename {client/src/main/java/com/metamx/druid/result => processing/src/main/java/io/druid/query/search}/BySegmentSearchResultValue.java (91%) rename {client/src/main/java/com/metamx/druid => processing/src/main/java/io/druid/query/search}/SearchBinaryFn.java (89%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/search/SearchQueryQueryToolChest.java (96%) rename {client/src/main/java/com/metamx/druid/result => processing/src/main/java/io/druid/query/search}/SearchResultValue.java (93%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/search}/search/FragmentSearchQuerySpec.java (96%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/search}/search/InsensitiveContainsSearchQuerySpec.java (95%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/search}/search/LexicographicSearchSortSpec.java (93%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/search}/search/SearchHit.java (96%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/search}/search/SearchQuery.java (95%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/search}/search/SearchQueryConfig.java (96%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/search}/search/SearchQuerySpec.java (93%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/search}/search/SearchSortSpec.java (93%) rename {client/src/main/java/com/metamx/druid/query => processing/src/main/java/io/druid/query/search}/search/StrlenSearchSortSpec.java (93%) rename {client => processing}/src/main/java/io/druid/query/spec/LegacySegmentSpec.java (100%) rename {client => processing}/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java (97%) rename {client => processing}/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java (97%) rename {client => processing}/src/main/java/io/druid/query/spec/QuerySegmentSpec.java (96%) rename {client/src/main/java/com/metamx/druid/query/segment => processing/src/main/java/io/druid/query/spec}/QuerySegmentSpecs.java (84%) rename {client/src/main/java/com/metamx/druid/query/segment => processing/src/main/java/io/druid/query/spec}/SpecificSegmentQueryRunner.java (97%) rename {client/src/main/java/com/metamx/druid/query/segment => processing/src/main/java/io/druid/query/spec}/SpecificSegmentSpec.java (94%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/timeboundary/TimeBoundaryQuery.java (96%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java (95%) rename {client/src/main/java/com/metamx/druid/result => processing/src/main/java/io/druid/query/timeboundary}/TimeBoundaryResultValue.java (94%) rename {client/src/main/java/com/metamx/druid => processing/src/main/java/io/druid/query/timeseries}/TimeseriesBinaryFn.java (96%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/timeseries/TimeseriesQuery.java (94%) rename {client/src/main/java/com/metamx => processing/src/main/java/io}/druid/query/timeseries/TimeseriesQueryQueryToolChest.java (94%) rename {client/src/main/java/com/metamx/druid/result => processing/src/main/java/io/druid/query/timeseries}/TimeseriesResultValue.java (89%) rename {segment => processing}/src/main/java/io/druid/segment/Capabilities.java (98%) rename {segment => processing}/src/main/java/io/druid/segment/ColumnSelector.java (100%) rename {server/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/ColumnSelectorBitmapIndexSelector.java (96%) rename {segment => processing}/src/main/java/io/druid/segment/ComplexMetricSelector.java (96%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/CompressedPools.java (97%) rename {server/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/ConciseOffset.java (93%) rename {segment => processing}/src/main/java/io/druid/segment/Cursor.java (100%) rename {segment => processing}/src/main/java/io/druid/segment/CursorFactory.java (100%) rename {segment => processing}/src/main/java/io/druid/segment/DimensionSelector.java (96%) rename {segment => processing}/src/main/java/io/druid/segment/DimensionSelectorFactory.java (100%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/FloatMetricColumnSerializer.java (91%) rename {segment => processing}/src/main/java/io/druid/segment/FloatMetricSelector.java (97%) rename {server/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/IncrementalIndexSegment.java (83%) rename {server/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/IndexGranularity.java (99%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/IndexIO.java (88%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/IndexMerger.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/IndexableAdapter.java (88%) rename {server/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/IndexedIntsOffset.java (89%) create mode 100644 processing/src/main/java/io/druid/segment/MMappedIndex.java rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/MMappedIndexAdapter.java (94%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/MetricColumnSerializer.java (92%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/MetricHolder.java (92%) rename {segment => processing}/src/main/java/io/druid/segment/MetricSelectorFactory.java (97%) rename {segment => processing}/src/main/java/io/druid/segment/ObjectMetricSelector.java (92%) rename {segment => processing}/src/main/java/io/druid/segment/QueryableIndex.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/QueryableIndexIndexableAdapter.java (95%) rename {server/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/QueryableIndexSegment.java (86%) rename {server/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/QueryableIndexStorageAdapter.java (98%) rename {server/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/ReferenceCountingSegment.java (95%) rename {server/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/ReferenceCountingSequence.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/Rowboat.java (97%) rename {server/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/RowboatFilteringIndexAdapter.java (93%) rename {segment => processing}/src/main/java/io/druid/segment/Segment.java (94%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/SimpleQueryableIndex.java (94%) rename {segment => processing}/src/main/java/io/druid/segment/StorageAdapter.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/AbstractColumn.java (77%) rename {segment => processing}/src/main/java/io/druid/segment/column/BitmapIndex.java (100%) rename {segment => processing}/src/main/java/io/druid/segment/column/Column.java (100%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/ColumnBuilder.java (87%) rename {segment => processing}/src/main/java/io/druid/segment/column/ColumnCapabilities.java (100%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/ColumnCapabilitiesImpl.java (93%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/ColumnDescriptor.java (94%) rename {segment => processing}/src/main/java/io/druid/segment/column/ComplexColumn.java (100%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/ComplexColumnImpl.java (84%) rename {segment => processing}/src/main/java/io/druid/segment/column/DictionaryEncodedColumn.java (96%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/FloatColumn.java (82%) rename {segment => processing}/src/main/java/io/druid/segment/column/GenericColumn.java (91%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/IndexedComplexColumn.java (89%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/IndexedFloatsGenericColumn.java (88%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/IndexedLongsGenericColumn.java (88%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/LongColumn.java (82%) rename {segment => processing}/src/main/java/io/druid/segment/column/RunLengthColumn.java (100%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/SimpleColumn.java (86%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/column/SimpleDictionaryEncodedColumn.java (86%) rename {segment => processing}/src/main/java/io/druid/segment/column/SpatialIndex.java (99%) rename {segment => processing}/src/main/java/io/druid/segment/column/ValueType.java (100%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/ArrayBasedIndexedInts.java (91%) rename {server/src/main/java/com/metamx/druid/index/v1/processing => processing/src/main/java/io/druid/segment/data}/ArrayBasedOffset.java (94%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/ArrayIndexed.java (93%) create mode 100644 processing/src/main/java/io/druid/segment/data/ByteBufferSerializer.java rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/ByteBufferWriter.java (74%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/data}/CompressedFloatBufferObjectStrategy.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/data}/CompressedFloatsIndexedSupplier.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/data}/CompressedFloatsSupplierSerializer.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/data}/CompressedLongBufferObjectStrategy.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/data}/CompressedLongsIndexedSupplier.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/data}/CompressedLongsSupplierSerializer.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/data}/CompressedObjectStrategy.java (96%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/ConciseCompressedIndexedInts.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/EmptyIndexedInts.java (91%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/GenericIndexed.java (98%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/GenericIndexedWriter.java (98%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/IOPeon.java (92%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/data}/InMemoryCompressedFloats.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/data}/InMemoryCompressedLongs.java (97%) rename {segment/src/main/java/io/druid => processing/src/main/java/io/druid/segment}/data/Indexed.java (96%) rename {segment/src/main/java/io/druid => processing/src/main/java/io/druid/segment}/data/IndexedFloats.java (97%) rename {segment/src/main/java/io/druid => processing/src/main/java/io/druid/segment}/data/IndexedInts.java (96%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/IndexedIntsIterator.java (92%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/IndexedIterable.java (94%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/IndexedList.java (92%) rename {segment/src/main/java/io/druid => processing/src/main/java/io/druid/segment}/data/IndexedLongs.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/IndexedRTree.java (68%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/Indexedids.java (90%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/IntBufferIndexedInts.java (96%) rename {server/src/main/java/com/metamx/druid/index/v1/processing => processing/src/main/java/io/druid/segment/data}/IntersectingOffset.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/ListIndexed.java (93%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/ObjectStrategy.java (92%) rename {server/src/main/java/com/metamx/druid/index/v1/processing => processing/src/main/java/io/druid/segment/data}/Offset.java (92%) rename {server/src/main/java/com/metamx/druid/index/v1/processing => processing/src/main/java/io/druid/segment/data}/ReadableOffset.java (92%) rename indexing-common/src/main/java/com/metamx/druid/index/v1/DimensionColumn.java => processing/src/main/java/io/druid/segment/data/SingleIndexedInts.java (57%) rename {server/src/main/java/com/metamx/druid/index/v1/processing => processing/src/main/java/io/druid/segment/data}/StartLimitedOffset.java (94%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/TmpFileIOPeon.java (95%) rename {server/src/main/java/com/metamx/druid/index/v1/processing => processing/src/main/java/io/druid/segment/data}/UnioningOffset.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/VSizeIndexed.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/VSizeIndexedInts.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/kv => processing/src/main/java/io/druid/segment/data}/VSizeIndexedWriter.java (98%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/AndFilter.java (96%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/BooleanValueMatcher.java (92%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/DimensionPredicateFilter.java (95%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/ExtractionFilter.java (94%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/Filters.java (84%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/JavaScriptFilter.java (81%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/NotFilter.java (95%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/OrFilter.java (96%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/RegexFilter.java (91%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/SearchQueryFilter.java (91%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/SelectorFilter.java (94%) rename {server/src/main/java/com/metamx/druid/index/brita => processing/src/main/java/io/druid/segment/filter}/SpatialFilter.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/incremental}/IncrementalIndex.java (98%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/incremental}/IncrementalIndexAdapter.java (95%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/incremental}/IncrementalIndexSchema.java (77%) rename {server/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/incremental}/IncrementalIndexStorageAdapter.java (98%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/incremental}/SpatialDimensionRowFormatter.java (98%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/incremental}/SpatialDimensionSchema.java (51%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/BitmapIndexColumnPartSupplier.java (94%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/ColumnPartSerde.java (92%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/ComplexColumnPartSerde.java (87%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/ComplexColumnPartSupplier.java (87%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment/serde}/ComplexMetricColumnSerializer.java (87%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/serde/ComplexMetricExtractor.java (91%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/serde/ComplexMetricSerde.java (92%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/serde/ComplexMetrics.java (93%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/DictionaryEncodedColumnPartSerde.java (92%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/DictionaryEncodedColumnSupplier.java (84%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/FloatGenericColumnPartSerde.java (92%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/FloatGenericColumnSupplier.java (86%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/LongGenericColumnPartSerde.java (92%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/LongGenericColumnSupplier.java (85%) rename {indexing-common/src/main/java/com/metamx/druid/index/v1 => processing/src/main/java/io/druid/segment}/serde/Registererer.java (94%) rename client/src/main/java/com/metamx/druid/RegisteringNode.java => processing/src/main/java/io/druid/segment/serde/Registererers.java (89%) rename {indexing-common/src/main/java/com/metamx/druid/index => processing/src/main/java/io/druid/segment}/serde/SpatialIndexColumnPartSupplier.java (94%) rename {client/src/test/java/com/metamx/druid => processing/src/test/java/io/druid/collections}/CombiningIterableTest.java (88%) rename {indexing-common/src/test/java/com/metamx/druid/indexer/data => processing/src/test/java/io/druid/data/input}/InputRowParserSerdeTest.java (97%) rename {indexing-common/src/test/java/com/metamx/druid/indexer/data => processing/src/test/java/io/druid/data/input}/ProtoBufInputRowParserTest.java (69%) rename {indexing-common/src/test/java/com/metamx/druid/indexer/data => processing/src/test/java/io/druid/data/input}/ProtoTestEventWrapper.java (86%) rename {client/src/test/java/com/metamx => processing/src/test/java/io}/druid/query/PrioritizedExecutorServiceTest.java (97%) rename {client/src/test/java/com/metamx => processing/src/test/java/io}/druid/query/QueriesTest.java (94%) rename {client/src/test/java/com/metamx/druid => processing/src/test/java/io/druid/query}/ResultGranularTimestampComparatorTest.java (96%) rename {client/src/test/java/com/metamx/druid/query => processing/src/test/java/io/druid/query/extraction}/extraction/PartialDimExtractionFnTest.java (92%) rename {client/src/test/java/com/metamx/druid/query => processing/src/test/java/io/druid/query/extraction}/extraction/RegexDimExtractionFnTest.java (95%) rename {client/src/test/java/com/metamx/druid/query => processing/src/test/java/io/druid/query/extraction}/extraction/SearchQuerySpecDimExtractionFnTest.java (87%) rename {client/src/test/java/com/metamx/druid/query => processing/src/test/java/io/druid/query/extraction}/extraction/TimeDimExtractionFnTest.java (93%) rename {client/src/test/java/com/metamx/druid/query/group => processing/src/test/java/io/druid/query/groupby}/having/HavingSpecTest.java (88%) rename {client/src/test/java/com/metamx/druid/query/group => processing/src/test/java/io/druid/query/groupby}/orderby/TopNSorterTest.java (73%) rename {client/src/test/java/com/metamx => processing/src/test/java/io}/druid/query/search/LexicographicSearchSortSpecTest.java (84%) rename {client/src/test/java/com/metamx/druid => processing/src/test/java/io/druid/query/search}/SearchBinaryFnTest.java (96%) rename {client/src/test/java/com/metamx => processing/src/test/java/io}/druid/query/search/StrlenSearchSortSpecTest.java (84%) rename {client/src/test/java/com/metamx/druid/query => processing/src/test/java/io/druid/query/spec}/QuerySegmentSpecTest.java (93%) rename {client/src/test/java/com/metamx => processing/src/test/java/io}/druid/query/timeboundary/TimeBoundaryQueryQueryToolChestTest.java (95%) rename {client/src/test/java/com/metamx/druid => processing/src/test/java/io/druid/query/timeseries}/TimeseriesBinaryFnTest.java (93%) rename {indexing-common/src/test/java/com/metamx/druid/index/v1 => processing/src/test/java/io/druid/segment/data}/CompressedFloatsIndexedSupplierTest.java (98%) rename {indexing-common/src/test/java/com/metamx/druid/index/v1 => processing/src/test/java/io/druid/segment/data}/CompressedFloatsSupplierSerializerTest.java (93%) rename {indexing-common/src/test/java/com/metamx/druid/index/v1 => processing/src/test/java/io/druid/segment/data}/CompressedLongsIndexedSupplierTest.java (98%) rename {indexing-common/src/test/java/com/metamx/druid/index/v1 => processing/src/test/java/io/druid/segment/data}/CompressedLongsSupplierSerializerTest.java (93%) rename {indexing-common/src/test/java/com/metamx/druid/kv => processing/src/test/java/io/druid/segment/data}/GenericIndexedTest.java (97%) rename {indexing-common/src/test/java/com/metamx/druid/index/v1 => processing/src/test/java/io/druid/segment/data}/IOPeonForTesting.java (94%) rename {indexing-common/src/test/java/com/metamx/druid/index/v1 => processing/src/test/java/io/druid/segment/data}/InMemoryCompressedFloatsTest.java (95%) rename {indexing-common/src/test/java/com/metamx/druid/index/v1 => processing/src/test/java/io/druid/segment/data}/InMemoryCompressedLongsTest.java (95%) rename {indexing-common/src/test/java/com/metamx/druid/index/v1 => processing/src/test/java/io/druid/segment/data}/IncrementalIndexTest.java (95%) rename {indexing-common/src/test/java/com/metamx/druid/kv => processing/src/test/java/io/druid/segment/data}/IndexedIntsTest.java (94%) rename {indexing-common/src/test/java/com/metamx/druid/kv => processing/src/test/java/io/druid/segment/data}/VSizeIndexedIntsTest.java (96%) rename {indexing-common/src/test/java/com/metamx/druid/kv => processing/src/test/java/io/druid/segment/data}/VSizeIndexedTest.java (95%) rename {indexing-common => processing}/src/test/resources/ProtoTest.proto (100%) rename {indexing-common => processing}/src/test/resources/druid.sample.tsv (100%) rename {indexing-common => processing}/src/test/resources/druid.sample.tsv.bottom (100%) rename {indexing-common => processing}/src/test/resources/druid.sample.tsv.top (100%) rename {indexing-common => processing}/src/test/resources/prototest.desc (100%) rename realtime/src/main/java/{com/metamx/druid => io/druid/guice}/guice/DbSegmentPublisherProvider.java (91%) rename realtime/src/main/java/{com/metamx/druid => io/druid/guice}/guice/FireDepartmentsProvider.java (95%) rename realtime/src/main/java/{com/metamx/druid => io/druid/guice}/guice/NoopSegmentPublisherProvider.java (92%) rename realtime/src/main/java/{com/metamx/druid => io/druid/guice}/guice/RealtimeManagerConfig.java (92%) rename realtime/src/main/java/{com/metamx/druid => io/druid/guice}/guice/RealtimeModule.java (92%) rename realtime/src/main/java/{com/metamx/druid => io/druid/guice}/guice/SegmentPublisherProvider.java (93%) rename {client => server}/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 (92%) delete mode 100644 server/src/main/java/com/metamx/druid/guice/annotations/Processing.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/BatchServerInventoryView.java (94%) create mode 100644 server/src/main/java/io/druid/client/BatchServerInventoryViewProvider.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/BrokerServerView.java (96%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/CachingClusteredClient.java (97%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/DataSegment.java (98%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/DirectDruidClient.java (96%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/DruidDataSource.java (97%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/DruidServer.java (97%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/DruidServerConfig.java (93%) create mode 100644 server/src/main/java/io/druid/client/InventoryView.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/ServerInventoryView.java (97%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/ServerInventoryViewConfig.java (93%) create mode 100644 server/src/main/java/io/druid/client/ServerInventoryViewProvider.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/ServerView.java (98%) create mode 100644 server/src/main/java/io/druid/client/SingleServerInventoryProvider.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/SingleServerInventoryView.java (91%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/TimelineServerView.java (88%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/cache/ByteCountingLRUMap.java (96%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/cache/Cache.java (96%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/cache/CacheMonitor.java (97%) create mode 100644 server/src/main/java/io/druid/client/cache/CacheProvider.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/cache/CacheSerde.java (91%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/cache/CacheStats.java (96%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/cache/LZ4Transcoder.java (96%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/cache/LocalCacheProvider.java (93%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/cache/MapCache.java (97%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/cache/MemcachedCache.java (99%) create mode 100644 server/src/main/java/io/druid/client/cache/MemcachedCacheConfig.java create mode 100644 server/src/main/java/io/druid/client/cache/MemcachedCacheProvider.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/indexing/ClientAppendQuery.java (92%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/indexing/ClientConversionQuery.java (51%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/indexing/ClientKillQuery.java (94%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/indexing/ClientMergeQuery.java (93%) create mode 100644 server/src/main/java/io/druid/client/indexing/IndexingService.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/indexing/IndexingServiceClient.java (92%) create mode 100644 server/src/main/java/io/druid/client/selector/DiscoverySelector.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/selector/QueryableDruidServer.java (86%) create mode 100644 server/src/main/java/io/druid/client/selector/Server.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/client/selector/ServerSelector.java (94%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/CuratorConfig.java (93%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/CuratorModule.java (63%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/PotentiallyGzippedCompressionProvider.java (93%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/ShutdownNowIgnoringExecutorService.java (74%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/announcement/Announcer.java (97%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/cache/PathChildrenCacheFactory.java (92%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/cache/SimplePathChildrenCacheFactory.java (96%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/discovery/CuratorServiceAnnouncer.java (75%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/discovery/DiscoveryModule.java (86%) create mode 100644 server/src/main/java/io/druid/curator/discovery/NoopServiceAnnouncer.java create mode 100644 server/src/main/java/io/druid/curator/discovery/ServiceAnnouncer.java rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/inventory/CuratorInventoryManager.java (97%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/inventory/CuratorInventoryManagerStrategy.java (94%) rename {client/src/main/java/com/metamx => server/src/main/java/io}/druid/curator/inventory/InventoryManagerConfig.java (95%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/AWSModule.java (96%) create mode 100644 server/src/main/java/io/druid/guice/guice/AnnouncerModule.java create mode 100644 server/src/main/java/io/druid/guice/guice/BrokerModule.java rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/CassandraDataSegmentPusherProvider.java (94%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/CoordinatorModule.java (64%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/DataSegmentPullerModule.java (97%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/DataSegmentPusherModule.java (54%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/DataSegmentPusherProvider.java (94%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/DruidProcessingModule.java (95%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/HdfsDataSegmentPusherProvider.java (95%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/HistoricalModule.java (94%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/HttpClientModule.java (83%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/IndexingServiceDiscoveryModule.java (92%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/LocalDataSegmentPusherProvider.java (94%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/QueryRunnerFactoryModule.java (57%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/guice}/guice/QueryableModule.java (84%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/S3DataSegmentPusherProvider.java (95%) rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/ServerModule.java (86%) create mode 100644 server/src/main/java/io/druid/guice/guice/ServerViewModule.java rename server/src/main/java/{com/metamx/druid => io/druid/guice}/guice/StorageNodeModule.java (88%) create mode 100644 server/src/main/java/io/druid/guice/guice/annotations/Client.java create mode 100644 server/src/main/java/io/druid/guice/guice/annotations/Processing.java rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/ClientInfoResource.java (94%) rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/ClientQuerySegmentWalker.java (87%) rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/DirectClientQuerySegmentWalker.java (87%) rename {client/src/main/java/com/metamx/druid/initialization => server/src/main/java/io/druid/server}/DruidNode.java (98%) rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/GuiceServletConfig.java (93%) rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/QueryServlet.java (95%) rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/RequestLogLine.java (96%) rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/StatusResource.java (96%) create mode 100644 server/src/main/java/io/druid/server/ZkPathsModule.java rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server}/coordination/AbstractDataSegmentAnnouncer.java (92%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server}/coordination/BatchDataSegmentAnnouncer.java (96%) create mode 100644 server/src/main/java/io/druid/server/coordination/BatchDataSegmentAnnouncerProvider.java rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server}/coordination/DataSegmentAnnouncer.java (89%) create mode 100644 server/src/main/java/io/druid/server/coordination/DataSegmentAnnouncerProvider.java rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server}/coordination/DruidServerMetadata.java (95%) create mode 100644 server/src/main/java/io/druid/server/coordination/LegacyDataSegmentAnnouncerProvider.java rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server}/coordination/MultipleDataSegmentAnnouncerDataSegmentAnnouncer.java (94%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server}/coordination/SingleDataSegmentAnnouncer.java (91%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/InfoResource.java (98%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/MasterMain.java (100%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/MasterRedirectInfo.java (52%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/MasterResource.java (97%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/MasterSegmentSettingsResource.java (61%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/RedirectFilter.java (96%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/RedirectInfo.java (91%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/RedirectServlet.java (96%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/SegmentToDrop.java (94%) rename server/src/main/java/{com/metamx/druid => io/druid/server}/http/SegmentToMove.java (94%) create mode 100644 server/src/main/java/io/druid/server/initialization/initialization/BatchDataSegmentAnnouncerConfig.java rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/ConfigModule.java (91%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/CuratorDiscoveryConfig.java (90%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/EmitterModule.java (94%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/HttpEmitterConfig.java (95%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/HttpEmitterModule.java (92%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/Initialization.java (93%) create mode 100644 server/src/main/java/io/druid/server/initialization/initialization/JettyServerInitializer.java rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/JettyServerModule.java (82%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/LogEmitterModule.java (91%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/PropertiesModule.java (97%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/ServerConfig.java (92%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/initialization}/initialization/ZkPathsConfig.java (95%) rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/log/EmittingRequestLogger.java (96%) create mode 100644 server/src/main/java/io/druid/server/log/EmittingRequestLoggerProvider.java rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/log/FileRequestLogger.java (96%) create mode 100644 server/src/main/java/io/druid/server/log/FileRequestLoggerProvider.java create mode 100644 server/src/main/java/io/druid/server/log/NoopRequestLogger.java create mode 100644 server/src/main/java/io/druid/server/log/NoopRequestLoggerProvider.java rename {client/src/main/java/com/metamx/druid/http => server/src/main/java/io/druid/server}/log/RequestLogger.java (87%) create mode 100644 server/src/main/java/io/druid/server/log/RequestLoggerProvider.java rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/shard}/shard/LinearShardSpec.java (54%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/shard}/shard/NoneShardSpec.java (94%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/shard}/shard/NumberedShardSpec.java (96%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/shard}/shard/ShardSpec.java (95%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server/shard}/shard/SingleDimensionShardSpec.java (97%) rename {client/src/main/java/com/metamx/druid => server/src/main/java/io/druid/server}/sql/SQLRunner.java (97%) rename {indexing-common/src/main/java/com/metamx/druid/common => server/src/main/java/io/druid/storage}/s3/S3Utils.java (97%) rename {client/src/test/java/com/metamx => server/src/test/java/io}/druid/client/DataSegmentTest.java (97%) rename {client/src/test/java/com/metamx => server/src/test/java/io}/druid/client/cache/ByteCountingLRUMapTest.java (96%) rename {client/src/test/java/com/metamx => server/src/test/java/io}/druid/client/cache/MapCacheTest.java (96%) rename {client/src/test/java/com/metamx => server/src/test/java/io}/druid/client/cache/MemcachedCacheBenchmark.java (81%) rename {client/src/test/java/com/metamx => server/src/test/java/io}/druid/client/cache/MemcachedCacheTest.java (99%) rename {client/src/test/java/com/metamx/druid => server/src/test/java/io/druid/client}/client/BatchServerInventoryViewTest.java (90%) rename {client/src/test/java/com/metamx => server/src/test/java/io}/druid/client/selector/ServerSelectorTest.java (90%) rename {client/src/test/java/com/metamx => server/src/test/java/io}/druid/curator/CuratorTestBase.java (54%) rename {client/src/test/java/com/metamx => server/src/test/java/io}/druid/curator/announcement/AnnouncerTest.java (98%) rename {client/src/test/java/com/metamx => server/src/test/java/io}/druid/curator/inventory/CuratorInventoryManagerTest.java (88%) rename {client/src/test/java/com/metamx/druid => server/src/test/java/io/druid/server/coordination}/coordination/BatchDataSegmentAnnouncerTest.java (92%) rename {client/src/test/java/com/metamx/druid => server/src/test/java/io/druid/server/shard}/shard/NumberedShardSpecTest.java (97%) rename {client/src/test/java/com/metamx/druid => server/src/test/java/io/druid/server/shard}/shard/SingleDimensionShardSpecTest.java (97%) diff --git a/client/pom.xml b/client/pom.xml deleted file mode 100644 index b19cac12b06..00000000000 --- a/client/pom.xml +++ /dev/null @@ -1,251 +0,0 @@ - - - - - 4.0.0 - com.metamx.druid - druid-client - druid-client - druid-client - - - com.metamx - druid - 0.5.50-SNAPSHOT - - - - - com.metamx.druid - druid-common - ${project.parent.version} - - - com.metamx.druid - druid-indexing-common - ${project.parent.version} - - - - com.metamx - emitter - - - com.metamx - http-client - - - com.metamx - java-util - - - com.metamx - server-metrics - - - - com.davekoelle - alphanum - - - commons-codec - commons-codec - - - commons-httpclient - commons-httpclient - - - org.skife.config - config-magic - - - org.apache.curator - curator-client - - - org.apache.curator - curator-framework - - - org.apache.curator - curator-x-discovery - - - org.eclipse.jetty - jetty-server - - - org.eclipse.jetty - jetty-servlet - - - org.eclipse.jetty - jetty-servlets - - - com.google.guava - guava - - - com.google.inject - guice - - - com.google.inject.extensions - guice-servlet - - - com.ibm.icu - icu4j - - - com.fasterxml.jackson.core - jackson-core - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.dataformat - jackson-dataformat-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 - - - javax.servlet - javax.servlet-api - - - org.slf4j - slf4j-log4j12 - - - com.google.code.simple-spring-memcached - spymemcached - - - org.antlr - antlr4-runtime - - - commons-cli - commons-cli - - - com.metamx - bytebuffer-collections - - - net.jpountz.lz4 - lz4 - - - - - junit - junit - test - - - org.easymock - easymock - test - - - com.google.caliper - caliper - test - - - org.apache.curator - curator-test - test - - - - - - - - maven-jar-plugin - - - - test-jar - - - - - - - org.antlr - antlr4-maven-plugin - - - - antlr4 - - - - - - - diff --git a/client/src/main/java/com/metamx/druid/client/BatchServerInventoryViewProvider.java b/client/src/main/java/com/metamx/druid/client/BatchServerInventoryViewProvider.java deleted file mode 100644 index a0a320b1879..00000000000 --- a/client/src/main/java/com/metamx/druid/client/BatchServerInventoryViewProvider.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.metamx.druid.client; - -import com.fasterxml.jackson.annotation.JacksonInject; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.metamx.druid.initialization.ZkPathsConfig; -import org.apache.curator.framework.CuratorFramework; - -import javax.validation.constraints.NotNull; - -/** - */ -public class BatchServerInventoryViewProvider implements ServerInventoryViewProvider -{ - @JacksonInject - @NotNull - private ZkPathsConfig zkPaths = null; - - @JacksonInject - @NotNull - private CuratorFramework curator = null; - - @JacksonInject - @NotNull - private ObjectMapper jsonMapper = null; - - @Override - public ServerInventoryView get() - { - return new BatchServerInventoryView(zkPaths, curator, jsonMapper); - } -} diff --git a/client/src/main/java/com/metamx/druid/client/InventoryView.java b/client/src/main/java/com/metamx/druid/client/InventoryView.java deleted file mode 100644 index bbf7f6e46cc..00000000000 --- a/client/src/main/java/com/metamx/druid/client/InventoryView.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.metamx.druid.client; - -/** - */ -public interface InventoryView -{ - public DruidServer getInventoryValue(String string); - public Iterable getInventory(); -} diff --git a/client/src/main/java/com/metamx/druid/client/ServerInventoryViewProvider.java b/client/src/main/java/com/metamx/druid/client/ServerInventoryViewProvider.java deleted file mode 100644 index 6eea6e5a5e6..00000000000 --- a/client/src/main/java/com/metamx/druid/client/ServerInventoryViewProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.metamx.druid.client; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.inject.Provider; - -/** - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = SingleServerInventoryProvider.class) -@JsonSubTypes(value = { - @JsonSubTypes.Type(name = "legacy", value = SingleServerInventoryProvider.class), - @JsonSubTypes.Type(name = "batch", value = BatchServerInventoryViewProvider.class) -}) -public interface ServerInventoryViewProvider extends Provider -{ -} diff --git a/client/src/main/java/com/metamx/druid/client/SingleServerInventoryProvider.java b/client/src/main/java/com/metamx/druid/client/SingleServerInventoryProvider.java deleted file mode 100644 index 93fae69a77b..00000000000 --- a/client/src/main/java/com/metamx/druid/client/SingleServerInventoryProvider.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.metamx.druid.client; - -import com.fasterxml.jackson.annotation.JacksonInject; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.metamx.druid.initialization.ZkPathsConfig; -import org.apache.curator.framework.CuratorFramework; - -import javax.validation.constraints.NotNull; - -/** - */ -public class SingleServerInventoryProvider implements ServerInventoryViewProvider -{ - @JacksonInject - @NotNull - private ZkPathsConfig zkPaths = null; - - @JacksonInject - @NotNull - private CuratorFramework curator = null; - - @JacksonInject - @NotNull - private ObjectMapper jsonMapper = null; - - @Override - public ServerInventoryView get() - { - return new SingleServerInventoryView(zkPaths, curator, jsonMapper); - } -} diff --git a/client/src/main/java/com/metamx/druid/client/cache/CacheProvider.java b/client/src/main/java/com/metamx/druid/client/cache/CacheProvider.java deleted file mode 100644 index cd0e09700b9..00000000000 --- a/client/src/main/java/com/metamx/druid/client/cache/CacheProvider.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.metamx.druid.client.cache; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.inject.Provider; - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = LocalCacheProvider.class) -@JsonSubTypes(value = { - @JsonSubTypes.Type(name = "local", value = LocalCacheProvider.class), - @JsonSubTypes.Type(name = "memcached", value = MemcachedCacheProvider.class) -}) -public interface CacheProvider extends Provider -{ -} diff --git a/client/src/main/java/com/metamx/druid/client/cache/MemcachedCacheConfig.java b/client/src/main/java/com/metamx/druid/client/cache/MemcachedCacheConfig.java deleted file mode 100644 index 672fa9a2bba..00000000000 --- a/client/src/main/java/com/metamx/druid/client/cache/MemcachedCacheConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.metamx.druid.client.cache; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.constraints.NotNull; - -public class MemcachedCacheConfig -{ - @JsonProperty - private int expiration = 2592000; // What is this number? - - @JsonProperty - private int timeout = 500; - - @JsonProperty - @NotNull - private String hosts; - - @JsonProperty - private int maxObjectSize = 50 * 1024 * 1024; - - @JsonProperty - private String memcachedPrefix = "druid"; - - public int getExpiration() - { - return expiration; - } - - public int getTimeout() - { - return timeout; - } - - public String getHosts() - { - return hosts; - } - - public int getMaxObjectSize() - { - return maxObjectSize; - } - - public String getMemcachedPrefix() - { - return memcachedPrefix; - } -} diff --git a/client/src/main/java/com/metamx/druid/client/cache/MemcachedCacheProvider.java b/client/src/main/java/com/metamx/druid/client/cache/MemcachedCacheProvider.java deleted file mode 100644 index a199b6323bd..00000000000 --- a/client/src/main/java/com/metamx/druid/client/cache/MemcachedCacheProvider.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.metamx.druid.client.cache; - -public class MemcachedCacheProvider extends MemcachedCacheConfig implements CacheProvider -{ - @Override - public Cache get() - { - return MemcachedCache.create(this); - } -} diff --git a/client/src/main/java/com/metamx/druid/client/indexing/IndexingService.java b/client/src/main/java/com/metamx/druid/client/indexing/IndexingService.java deleted file mode 100644 index 4198703ee63..00000000000 --- a/client/src/main/java/com/metamx/druid/client/indexing/IndexingService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.metamx.druid.client.indexing; - -import com.google.inject.BindingAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - */ -@BindingAnnotation -@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface IndexingService -{ -} diff --git a/client/src/main/java/com/metamx/druid/client/selector/DiscoverySelector.java b/client/src/main/java/com/metamx/druid/client/selector/DiscoverySelector.java deleted file mode 100644 index 1b55472e431..00000000000 --- a/client/src/main/java/com/metamx/druid/client/selector/DiscoverySelector.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.metamx.druid.client.selector; - -/** - */ -public interface DiscoverySelector -{ - public T pick(); -} diff --git a/client/src/main/java/com/metamx/druid/client/selector/Server.java b/client/src/main/java/com/metamx/druid/client/selector/Server.java deleted file mode 100644 index a5f6b910e9a..00000000000 --- a/client/src/main/java/com/metamx/druid/client/selector/Server.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.metamx.druid.client.selector; - -/** - */ -public interface Server -{ - public String getScheme(); - public String getHost(); - public int getPort(); -} diff --git a/client/src/main/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncerProvider.java b/client/src/main/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncerProvider.java deleted file mode 100644 index 7b849575835..00000000000 --- a/client/src/main/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncerProvider.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.metamx.druid.coordination; - -import com.fasterxml.jackson.annotation.JacksonInject; - -import javax.validation.constraints.NotNull; - -/** - */ -public class BatchDataSegmentAnnouncerProvider implements DataSegmentAnnouncerProvider -{ - @JacksonInject - @NotNull - private BatchDataSegmentAnnouncer batchAnnouncer = null; - - @Override - public DataSegmentAnnouncer get() - { - return batchAnnouncer; - } -} diff --git a/client/src/main/java/com/metamx/druid/coordination/DataSegmentAnnouncerProvider.java b/client/src/main/java/com/metamx/druid/coordination/DataSegmentAnnouncerProvider.java deleted file mode 100644 index 6f43fb15c0b..00000000000 --- a/client/src/main/java/com/metamx/druid/coordination/DataSegmentAnnouncerProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.metamx.druid.coordination; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.inject.Provider; - -/** - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = LegacyDataSegmentAnnouncerProvider.class) -@JsonSubTypes(value = { - @JsonSubTypes.Type(name = "legacy", value = LegacyDataSegmentAnnouncerProvider.class), - @JsonSubTypes.Type(name = "batch", value = BatchDataSegmentAnnouncerProvider.class) -}) -public interface DataSegmentAnnouncerProvider extends Provider -{ -} diff --git a/client/src/main/java/com/metamx/druid/coordination/LegacyDataSegmentAnnouncerProvider.java b/client/src/main/java/com/metamx/druid/coordination/LegacyDataSegmentAnnouncerProvider.java deleted file mode 100644 index 86b1f5fce88..00000000000 --- a/client/src/main/java/com/metamx/druid/coordination/LegacyDataSegmentAnnouncerProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.metamx.druid.coordination; - -import com.fasterxml.jackson.annotation.JacksonInject; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.metamx.common.lifecycle.Lifecycle; -import com.metamx.druid.guice.annotations.Json; - -import javax.validation.constraints.NotNull; -import java.util.Arrays; - -/** - */ -public class LegacyDataSegmentAnnouncerProvider implements DataSegmentAnnouncerProvider -{ - @JacksonInject - @NotNull - private SingleDataSegmentAnnouncer singleAnnouncer = null; - - @JacksonInject - @NotNull - private BatchDataSegmentAnnouncer batchAnnouncer = null; - - @Override - public DataSegmentAnnouncer get() - { - return new MultipleDataSegmentAnnouncerDataSegmentAnnouncer( - Arrays.asList(singleAnnouncer, batchAnnouncer) - ); - } -} diff --git a/client/src/main/java/com/metamx/druid/curator/discovery/NoopServiceAnnouncer.java b/client/src/main/java/com/metamx/druid/curator/discovery/NoopServiceAnnouncer.java deleted file mode 100644 index 87c65bc9837..00000000000 --- a/client/src/main/java/com/metamx/druid/curator/discovery/NoopServiceAnnouncer.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.metamx.druid.curator.discovery; - -import com.metamx.druid.initialization.DruidNode; - -/** - * Does nothing. - */ -public class NoopServiceAnnouncer implements ServiceAnnouncer -{ - @Override - public void announce(DruidNode node) - { - - } - - @Override - public void unannounce(DruidNode node) - { - - } -} diff --git a/client/src/main/java/com/metamx/druid/curator/discovery/ServiceAnnouncer.java b/client/src/main/java/com/metamx/druid/curator/discovery/ServiceAnnouncer.java deleted file mode 100644 index bdd9361fd5d..00000000000 --- a/client/src/main/java/com/metamx/druid/curator/discovery/ServiceAnnouncer.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.metamx.druid.curator.discovery; - -import com.metamx.druid.initialization.DruidNode; - -/** - * Announces our ability to serve a particular function. Multiple users may announce the same service, in which - * case they are treated as interchangeable instances of that service. - */ -public interface ServiceAnnouncer -{ - public void announce(DruidNode node); - - public void unannounce(DruidNode node); -} diff --git a/client/src/main/java/com/metamx/druid/guice/AnnouncerModule.java b/client/src/main/java/com/metamx/druid/guice/AnnouncerModule.java deleted file mode 100644 index f3a6cd46a05..00000000000 --- a/client/src/main/java/com/metamx/druid/guice/AnnouncerModule.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.metamx.druid.guice; - -import com.google.inject.Binder; -import com.google.inject.Module; -import com.google.inject.Provides; -import com.metamx.druid.concurrent.Execs; -import com.metamx.druid.coordination.BatchDataSegmentAnnouncer; -import com.metamx.druid.coordination.DataSegmentAnnouncer; -import com.metamx.druid.coordination.DataSegmentAnnouncerProvider; -import com.metamx.druid.coordination.SingleDataSegmentAnnouncer; -import com.metamx.druid.curator.announcement.Announcer; -import com.metamx.druid.initialization.BatchDataSegmentAnnouncerConfig; -import org.apache.curator.framework.CuratorFramework; - -/** - */ -public class AnnouncerModule implements Module -{ - @Override - public void configure(Binder binder) - { - JsonConfigProvider.bind(binder, "druid.announcer", BatchDataSegmentAnnouncerConfig.class); - JsonConfigProvider.bind(binder, "druid.announcer", DataSegmentAnnouncerProvider.class); - binder.bind(DataSegmentAnnouncer.class).toProvider(DataSegmentAnnouncerProvider.class); - binder.bind(BatchDataSegmentAnnouncer.class).in(ManageLifecycleLast.class); - binder.bind(SingleDataSegmentAnnouncer.class).in(ManageLifecycleLast.class); - } - - @Provides - @ManageLifecycle - public Announcer getAnnouncer(CuratorFramework curator) - { - return new Announcer(curator, Execs.singleThreaded("Announcer-%s")); - } -} diff --git a/client/src/main/java/com/metamx/druid/guice/BrokerModule.java b/client/src/main/java/com/metamx/druid/guice/BrokerModule.java deleted file mode 100644 index 9cf33e4f71c..00000000000 --- a/client/src/main/java/com/metamx/druid/guice/BrokerModule.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.metamx.druid.guice; - -import com.google.inject.Binder; -import com.google.inject.Module; -import com.metamx.druid.client.BrokerServerView; -import com.metamx.druid.client.CachingClusteredClient; -import com.metamx.druid.client.TimelineServerView; -import com.metamx.druid.client.cache.Cache; -import com.metamx.druid.client.cache.CacheProvider; -import com.metamx.druid.query.MapQueryToolChestWarehouse; -import com.metamx.druid.query.QueryToolChestWarehouse; - -/** - */ -public class BrokerModule implements Module -{ - @Override - public void configure(Binder binder) - { - binder.bind(QueryToolChestWarehouse.class).to(MapQueryToolChestWarehouse.class); - - binder.bind(CachingClusteredClient.class).in(LazySingleton.class); - binder.bind(TimelineServerView.class).to(BrokerServerView.class).in(LazySingleton.class); - - binder.bind(Cache.class).toProvider(CacheProvider.class).in(ManageLifecycle.class); - JsonConfigProvider.bind(binder, "druid.broker.cache", CacheProvider.class); - } -} diff --git a/client/src/main/java/com/metamx/druid/guice/ServerViewModule.java b/client/src/main/java/com/metamx/druid/guice/ServerViewModule.java deleted file mode 100644 index 3c9dd142deb..00000000000 --- a/client/src/main/java/com/metamx/druid/guice/ServerViewModule.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.metamx.druid.guice; - -import com.google.inject.Binder; -import com.google.inject.Module; -import com.metamx.druid.client.InventoryView; -import com.metamx.druid.client.ServerInventoryView; -import com.metamx.druid.client.ServerInventoryViewProvider; -import com.metamx.druid.client.ServerView; - -/** - */ -public class ServerViewModule implements Module -{ - @Override - public void configure(Binder binder) - { - JsonConfigProvider.bind(binder, "druid.announcer", ServerInventoryViewProvider.class); - binder.bind(InventoryView.class).to(ServerInventoryView.class); - binder.bind(ServerView.class).to(ServerInventoryView.class); - binder.bind(ServerInventoryView.class).toProvider(ServerInventoryViewProvider.class).in(ManageLifecycle.class); - } -} diff --git a/client/src/main/java/com/metamx/druid/guice/annotations/Client.java b/client/src/main/java/com/metamx/druid/guice/annotations/Client.java deleted file mode 100644 index 6a8eabc28dc..00000000000 --- a/client/src/main/java/com/metamx/druid/guice/annotations/Client.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.metamx.druid.guice.annotations; - -import com.google.inject.BindingAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - */ -@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@BindingAnnotation -public @interface Client -{ -} diff --git a/client/src/main/java/com/metamx/druid/http/ZkPathsModule.java b/client/src/main/java/com/metamx/druid/http/ZkPathsModule.java deleted file mode 100644 index f0a75fce898..00000000000 --- a/client/src/main/java/com/metamx/druid/http/ZkPathsModule.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.metamx.druid.http; - -import com.google.inject.Binder; -import com.google.inject.Module; - -/** - */ -public class ZkPathsModule implements Module -{ - @Override - public void configure(Binder binder) - { - } -} diff --git a/client/src/main/java/com/metamx/druid/http/log/EmittingRequestLoggerProvider.java b/client/src/main/java/com/metamx/druid/http/log/EmittingRequestLoggerProvider.java deleted file mode 100644 index 9aaca387ab9..00000000000 --- a/client/src/main/java/com/metamx/druid/http/log/EmittingRequestLoggerProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.metamx.druid.http.log; - -import com.fasterxml.jackson.annotation.JacksonInject; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.google.inject.Inject; -import com.google.inject.Injector; -import com.metamx.emitter.service.ServiceEmitter; - -import javax.validation.constraints.NotNull; - -/** - */ -@JsonTypeName("emitter") -public class EmittingRequestLoggerProvider implements RequestLoggerProvider -{ - @JsonProperty - @NotNull - private String feed = null; - - @JacksonInject - @NotNull - private ServiceEmitter emitter = null; - - @Inject - public void injectMe(Injector injector) - { - System.out.println("YAYAYAYAYAYA!!!"); - } - - @Override - public RequestLogger get() - { - return new EmittingRequestLogger(emitter, feed); - } -} diff --git a/client/src/main/java/com/metamx/druid/http/log/FileRequestLoggerProvider.java b/client/src/main/java/com/metamx/druid/http/log/FileRequestLoggerProvider.java deleted file mode 100644 index 9526aa65ffe..00000000000 --- a/client/src/main/java/com/metamx/druid/http/log/FileRequestLoggerProvider.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.metamx.druid.http.log; - -import com.fasterxml.jackson.annotation.JacksonInject; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.metamx.common.concurrent.ScheduledExecutorFactory; -import com.metamx.druid.guice.annotations.Json; - -import javax.validation.constraints.NotNull; -import java.io.File; - -/** - */ -@JsonTypeName("file") -public class FileRequestLoggerProvider implements RequestLoggerProvider -{ - @JsonProperty - @NotNull - private File dir = null; - - @JacksonInject - @NotNull - private ScheduledExecutorFactory factory = null; - - - @JacksonInject - @NotNull - @Json - private ObjectMapper jsonMapper = null; - - @Override - public RequestLogger get() - { - return new FileRequestLogger(jsonMapper, factory.create(1, "RequestLogger-%s"), dir); - } -} diff --git a/client/src/main/java/com/metamx/druid/http/log/NoopRequestLogger.java b/client/src/main/java/com/metamx/druid/http/log/NoopRequestLogger.java deleted file mode 100644 index 062f8ddc82c..00000000000 --- a/client/src/main/java/com/metamx/druid/http/log/NoopRequestLogger.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.metamx.druid.http.log; - -import com.metamx.druid.http.RequestLogLine; - -/** - */ -public class NoopRequestLogger implements RequestLogger -{ - @Override - public void log(RequestLogLine requestLogLine) throws Exception - { - // This is a no op! - } -} diff --git a/client/src/main/java/com/metamx/druid/http/log/NoopRequestLoggerProvider.java b/client/src/main/java/com/metamx/druid/http/log/NoopRequestLoggerProvider.java deleted file mode 100644 index 0bafb7945a3..00000000000 --- a/client/src/main/java/com/metamx/druid/http/log/NoopRequestLoggerProvider.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.metamx.druid.http.log; - -/** - */ -public class NoopRequestLoggerProvider implements RequestLoggerProvider -{ - @Override - public RequestLogger get() - { - return new NoopRequestLogger(); - } -} diff --git a/client/src/main/java/com/metamx/druid/http/log/RequestLoggerProvider.java b/client/src/main/java/com/metamx/druid/http/log/RequestLoggerProvider.java deleted file mode 100644 index 0e2ecc15b44..00000000000 --- a/client/src/main/java/com/metamx/druid/http/log/RequestLoggerProvider.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.metamx.druid.http.log; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.google.inject.Provider; - -/** - * A Marker interface for things that can provide a RequestLogger. This can be combined with jackson polymorphic serde - * to provide new RequestLogger implementations as plugins. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = NoopRequestLoggerProvider.class) -public interface RequestLoggerProvider extends Provider -{ -} diff --git a/client/src/main/java/com/metamx/druid/initialization/BatchDataSegmentAnnouncerConfig.java b/client/src/main/java/com/metamx/druid/initialization/BatchDataSegmentAnnouncerConfig.java deleted file mode 100644 index 3b80641f943..00000000000 --- a/client/src/main/java/com/metamx/druid/initialization/BatchDataSegmentAnnouncerConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.metamx.druid.initialization; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; - -/** - */ -public class BatchDataSegmentAnnouncerConfig -{ - @JsonProperty - @Min(1) - private int segmentsPerNode = 50; - - @JsonProperty - @Max(1024 * 1024) - @Min(1024) - private long maxBytesPerNode = 512 * 1024; - - public int getSegmentsPerNode() - { - return segmentsPerNode; - } - - public long getMaxBytesPerNode() - { - return maxBytesPerNode; - } -} diff --git a/client/src/main/java/com/metamx/druid/initialization/JettyServerInitializer.java b/client/src/main/java/com/metamx/druid/initialization/JettyServerInitializer.java deleted file mode 100644 index 05b11c98e40..00000000000 --- a/client/src/main/java/com/metamx/druid/initialization/JettyServerInitializer.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.metamx.druid.initialization; - -import com.google.inject.Injector; -import org.eclipse.jetty.server.Server; - -/** - */ -public interface JettyServerInitializer -{ - public void initialize(Server server, Injector injector); -} diff --git a/client/src/main/java/com/metamx/druid/query/MapQueryToolChestWarehouse.java b/client/src/main/java/com/metamx/druid/query/MapQueryToolChestWarehouse.java deleted file mode 100644 index f6838425939..00000000000 --- a/client/src/main/java/com/metamx/druid/query/MapQueryToolChestWarehouse.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.metamx.druid.query; - -import com.google.inject.Inject; -import io.druid.query.Query; -import io.druid.query.QueryToolChest; - -import java.util.Map; - -/** - */ -public class MapQueryToolChestWarehouse implements QueryToolChestWarehouse -{ - private final Map, QueryToolChest> toolchests; - - @Inject - public MapQueryToolChestWarehouse( - Map, QueryToolChest> toolchests - ) - { - this.toolchests = toolchests; - } - - @Override - @SuppressWarnings("unchecked") - public > QueryToolChest getToolChest(QueryType query) - { - return toolchests.get(query.getClass()); - } -} diff --git a/client/src/main/java/com/metamx/druid/query/group/GroupByQueryConfig.java b/client/src/main/java/com/metamx/druid/query/group/GroupByQueryConfig.java deleted file mode 100644 index ea7be8f9a2c..00000000000 --- a/client/src/main/java/com/metamx/druid/query/group/GroupByQueryConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.metamx.druid.query.group; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - */ -public class GroupByQueryConfig -{ - @JsonProperty - private boolean singleThreaded = false; - - @JsonProperty - private int maxIntermediateRows = 50000; - - @JsonProperty - private int maxResults = 500000; - - public boolean isSingleThreaded() - { - return singleThreaded; - } - - public int getMaxIntermediateRows() - { - return maxIntermediateRows; - } - - public void setMaxIntermediateRows(int maxIntermediateRows) - { - this.maxIntermediateRows = maxIntermediateRows; - } - - public int getMaxResults() - { - return maxResults; - } -} diff --git a/client/src/main/java/com/metamx/druid/query/group/having/AlwaysHavingSpec.java b/client/src/main/java/com/metamx/druid/query/group/having/AlwaysHavingSpec.java deleted file mode 100644 index 3fa27b99ace..00000000000 --- a/client/src/main/java/com/metamx/druid/query/group/having/AlwaysHavingSpec.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.metamx.druid.query.group.having; - -import com.metamx.druid.input.Row; - -/** - */ -public class AlwaysHavingSpec implements HavingSpec -{ - @Override - public boolean eval(Row row) - { - return true; - } -} diff --git a/client/src/main/java/com/metamx/druid/query/group/orderby/OrderedPriorityQueueItems.java b/client/src/main/java/com/metamx/druid/query/group/orderby/OrderedPriorityQueueItems.java deleted file mode 100644 index 5b5a3f48cb6..00000000000 --- a/client/src/main/java/com/metamx/druid/query/group/orderby/OrderedPriorityQueueItems.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.metamx.druid.query.group.orderby; - -import com.google.common.collect.MinMaxPriorityQueue; - -import java.util.Iterator; - -/** - * Utility class that supports iterating a priority queue in sorted order. - */ -class OrderedPriorityQueueItems implements Iterable -{ - private MinMaxPriorityQueue rows; - - public OrderedPriorityQueueItems(MinMaxPriorityQueue rows) - { - this.rows = rows; - } - - @Override - public Iterator iterator() - { - return new Iterator() { - - @Override - public boolean hasNext() - { - return !rows.isEmpty(); - } - - @Override - public T next() - { - return rows.poll(); - } - - @Override - public void remove() - { - throw new UnsupportedOperationException("Can't remove any item from an intermediary heap for orderBy/limit"); - } - }; - } -} diff --git a/segment/src/main/java/io/druid/segment/LogicalSegment.java b/common/src/main/java/com/metamx/druid/LogicalSegment.java similarity index 97% rename from segment/src/main/java/io/druid/segment/LogicalSegment.java rename to common/src/main/java/com/metamx/druid/LogicalSegment.java index 0f29cea60be..70f89ec0b6d 100644 --- a/segment/src/main/java/io/druid/segment/LogicalSegment.java +++ b/common/src/main/java/com/metamx/druid/LogicalSegment.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment; +package com.metamx.druid; import org.joda.time.Interval; diff --git a/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java b/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java index 80e0e415bf1..defb0c128f1 100644 --- a/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java +++ b/common/src/main/java/com/metamx/druid/TimelineObjectHolder.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,7 +20,6 @@ package com.metamx.druid; import com.metamx.druid.partition.PartitionHolder; -import io.druid.segment.LogicalSegment; import org.joda.time.Interval; /** diff --git a/common/src/main/java/com/metamx/druid/guice/DbConnectorModule.java b/common/src/main/java/com/metamx/druid/guice/DbConnectorModule.java deleted file mode 100644 index 624bd030175..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/DbConnectorModule.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.metamx.druid.guice; - -import com.google.inject.Binder; -import com.google.inject.Module; -import com.google.inject.Provides; -import com.metamx.druid.db.DbConnector; -import com.metamx.druid.db.DbConnectorConfig; -import com.metamx.druid.db.DbTablesConfig; -import org.skife.jdbi.v2.IDBI; - -/** - */ -public class DbConnectorModule implements Module -{ - @Override - public void configure(Binder binder) - { - JsonConfigProvider.bind(binder, "druid.db.tables", DbTablesConfig.class); - JsonConfigProvider.bind(binder, "druid.db.connector", DbConnectorConfig.class); - - binder.bind(DbConnector.class); - } - - @Provides @LazySingleton - public IDBI getDbi(final DbConnector dbConnector) - { - return dbConnector.getDBI(); - } -} diff --git a/common/src/main/java/com/metamx/druid/guice/DruidGuiceExtensions.java b/common/src/main/java/com/metamx/druid/guice/DruidGuiceExtensions.java deleted file mode 100644 index 1010e56188c..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/DruidGuiceExtensions.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.metamx.druid.guice; - -import com.google.inject.Binder; -import com.google.inject.Module; - -/** - */ -public class DruidGuiceExtensions implements Module -{ - @Override - public void configure(Binder binder) - { - binder.requireExplicitBindings(); - binder.bindScope(LazySingleton.class, DruidScopes.SINGLETON); - } -} diff --git a/common/src/main/java/com/metamx/druid/guice/LazySingleton.java b/common/src/main/java/com/metamx/druid/guice/LazySingleton.java deleted file mode 100644 index 005e9795de4..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/LazySingleton.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.metamx.druid.guice; - -import com.google.inject.ScopeAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - */ -@Target({ ElementType.TYPE, ElementType.METHOD }) -@Retention(RUNTIME) -@ScopeAnnotation -public @interface LazySingleton -{ -} diff --git a/common/src/main/java/com/metamx/druid/guice/ManageLifecycle.java b/common/src/main/java/com/metamx/druid/guice/ManageLifecycle.java deleted file mode 100644 index 24e269ae00b..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/ManageLifecycle.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.metamx.druid.guice; - -import com.google.inject.ScopeAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Marks the object to be managed by {@link com.metamx.common.lifecycle.Lifecycle} - * - * This Scope gets defined by {@link com.metamx.druid.guice.LifecycleModule} - */ -@Target({ ElementType.TYPE, ElementType.METHOD }) -@Retention(RUNTIME) -@ScopeAnnotation -public @interface ManageLifecycle -{ -} diff --git a/common/src/main/java/com/metamx/druid/guice/ManageLifecycleLast.java b/common/src/main/java/com/metamx/druid/guice/ManageLifecycleLast.java deleted file mode 100644 index ae34f21dc9e..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/ManageLifecycleLast.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.metamx.druid.guice; - -import com.google.inject.ScopeAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Marks the object to be managed by {@link com.metamx.common.lifecycle.Lifecycle} and set to be on Stage.LAST - * - * This Scope gets defined by {@link com.metamx.druid.guice.LifecycleModule} - */ -@Target({ ElementType.TYPE, ElementType.METHOD }) -@Retention(RUNTIME) -@ScopeAnnotation -public @interface ManageLifecycleLast -{ -} diff --git a/common/src/main/java/com/metamx/druid/guice/SupplierProvider.java b/common/src/main/java/com/metamx/druid/guice/SupplierProvider.java deleted file mode 100644 index e7dcc875949..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/SupplierProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.metamx.druid.guice; - -import com.google.common.base.Supplier; -import com.google.inject.Inject; -import com.google.inject.Injector; -import com.google.inject.Key; -import com.google.inject.Provider; - -/** - */ -public class SupplierProvider implements Provider -{ - private final Key> supplierKey; - - private Provider> supplierProvider; - - public SupplierProvider( - Key> supplierKey - ) - { - this.supplierKey = supplierKey; - } - - @Inject - public void configure(Injector injector) - { - this.supplierProvider = injector.getProvider(supplierKey); - } - - @Override - public T get() - { - return supplierProvider.get().get(); - } -} diff --git a/common/src/main/java/com/metamx/druid/guice/annotations/Global.java b/common/src/main/java/com/metamx/druid/guice/annotations/Global.java deleted file mode 100644 index 497e1d17c6c..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/annotations/Global.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.metamx.druid.guice.annotations; - -import com.google.inject.BindingAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - */ -@BindingAnnotation -@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Global -{ -} diff --git a/common/src/main/java/com/metamx/druid/guice/annotations/Json.java b/common/src/main/java/com/metamx/druid/guice/annotations/Json.java deleted file mode 100644 index c20a3f5f2f0..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/annotations/Json.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.metamx.druid.guice.annotations; - -import com.google.inject.BindingAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - */ -@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@BindingAnnotation -public @interface Json -{ -} diff --git a/common/src/main/java/com/metamx/druid/guice/annotations/Self.java b/common/src/main/java/com/metamx/druid/guice/annotations/Self.java deleted file mode 100644 index f3e9073a7ca..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/annotations/Self.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.metamx.druid.guice.annotations; - -import com.google.inject.BindingAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - */ -@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@BindingAnnotation -public @interface Self -{ -} diff --git a/common/src/main/java/com/metamx/druid/guice/annotations/Smile.java b/common/src/main/java/com/metamx/druid/guice/annotations/Smile.java deleted file mode 100644 index c3bee835d6c..00000000000 --- a/common/src/main/java/com/metamx/druid/guice/annotations/Smile.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.metamx.druid.guice.annotations; - -import com.google.inject.BindingAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - */ -@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@BindingAnnotation -public @interface Smile -{ -} diff --git a/common/src/main/java/com/metamx/druid/jackson/AggregatorsModule.java b/common/src/main/java/com/metamx/druid/jackson/AggregatorsModule.java index 978d556534d..506dbf5130c 100644 --- a/common/src/main/java/com/metamx/druid/jackson/AggregatorsModule.java +++ b/common/src/main/java/com/metamx/druid/jackson/AggregatorsModule.java @@ -22,18 +22,18 @@ package com.metamx.druid.jackson; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.module.SimpleModule; -import com.metamx.druid.aggregation.CountAggregatorFactory; -import com.metamx.druid.aggregation.DoubleSumAggregatorFactory; -import com.metamx.druid.aggregation.HistogramAggregatorFactory; -import com.metamx.druid.aggregation.JavaScriptAggregatorFactory; -import com.metamx.druid.aggregation.LongSumAggregatorFactory; -import com.metamx.druid.aggregation.MaxAggregatorFactory; -import com.metamx.druid.aggregation.MinAggregatorFactory; -import com.metamx.druid.aggregation.post.ArithmeticPostAggregator; -import com.metamx.druid.aggregation.post.ConstantPostAggregator; -import com.metamx.druid.aggregation.post.FieldAccessPostAggregator; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.aggregation.aggregation.CountAggregatorFactory; +import io.druid.query.aggregation.aggregation.DoubleSumAggregatorFactory; +import io.druid.query.aggregation.aggregation.HistogramAggregatorFactory; +import io.druid.query.aggregation.aggregation.JavaScriptAggregatorFactory; +import io.druid.query.aggregation.aggregation.LongSumAggregatorFactory; +import io.druid.query.aggregation.aggregation.MaxAggregatorFactory; +import io.druid.query.aggregation.aggregation.MinAggregatorFactory; +import io.druid.query.aggregation.aggregation.post.ArithmeticPostAggregator; +import io.druid.query.aggregation.aggregation.post.ConstantPostAggregator; +import io.druid.query.aggregation.aggregation.post.FieldAccessPostAggregator; /** */ diff --git a/common/src/main/java/com/metamx/druid/jackson/JacksonModule.java b/common/src/main/java/com/metamx/druid/jackson/JacksonModule.java index 694f4d2bf4c..73ee342b92c 100644 --- a/common/src/main/java/com/metamx/druid/jackson/JacksonModule.java +++ b/common/src/main/java/com/metamx/druid/jackson/JacksonModule.java @@ -25,9 +25,9 @@ import com.google.inject.Binder; import com.google.inject.Key; import com.google.inject.Module; import com.google.inject.Provides; -import com.metamx.druid.guice.LazySingleton; -import com.metamx.druid.guice.annotations.Json; -import com.metamx.druid.guice.annotations.Smile; +import io.druid.guice.guice.LazySingleton; +import io.druid.guice.guice.annotations.Json; +import io.druid.guice.guice.annotations.Smile; /** */ diff --git a/common/src/main/java/com/metamx/druid/guice/ConfigProvider.java b/common/src/main/java/io/druid/guice/guice/ConfigProvider.java similarity index 66% rename from common/src/main/java/com/metamx/druid/guice/ConfigProvider.java rename to common/src/main/java/io/druid/guice/guice/ConfigProvider.java index 40559a1e798..6822b48f334 100644 --- a/common/src/main/java/com/metamx/druid/guice/ConfigProvider.java +++ b/common/src/main/java/io/druid/guice/guice/ConfigProvider.java @@ -1,4 +1,23 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.google.common.base.Preconditions; import com.google.inject.Binder; diff --git a/common/src/main/java/io/druid/guice/guice/DbConnectorModule.java b/common/src/main/java/io/druid/guice/guice/DbConnectorModule.java new file mode 100644 index 00000000000..1daf09c4f73 --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/DbConnectorModule.java @@ -0,0 +1,48 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; + +import com.google.inject.Binder; +import com.google.inject.Module; +import com.google.inject.Provides; +import com.metamx.druid.db.DbConnector; +import com.metamx.druid.db.DbConnectorConfig; +import com.metamx.druid.db.DbTablesConfig; +import org.skife.jdbi.v2.IDBI; + +/** + */ +public class DbConnectorModule implements Module +{ + @Override + public void configure(Binder binder) + { + JsonConfigProvider.bind(binder, "druid.db.tables", DbTablesConfig.class); + JsonConfigProvider.bind(binder, "druid.db.connector", DbConnectorConfig.class); + + binder.bind(DbConnector.class); + } + + @Provides @LazySingleton + public IDBI getDbi(final DbConnector dbConnector) + { + return dbConnector.getDBI(); + } +} diff --git a/common/src/main/java/io/druid/guice/guice/DruidGuiceExtensions.java b/common/src/main/java/io/druid/guice/guice/DruidGuiceExtensions.java new file mode 100644 index 00000000000..0588495701a --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/DruidGuiceExtensions.java @@ -0,0 +1,35 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; + +import com.google.inject.Binder; +import com.google.inject.Module; + +/** + */ +public class DruidGuiceExtensions implements Module +{ + @Override + public void configure(Binder binder) + { + binder.requireExplicitBindings(); + binder.bindScope(LazySingleton.class, DruidScopes.SINGLETON); + } +} diff --git a/common/src/main/java/com/metamx/druid/guice/DruidScopes.java b/common/src/main/java/io/druid/guice/guice/DruidScopes.java similarity index 62% rename from common/src/main/java/com/metamx/druid/guice/DruidScopes.java rename to common/src/main/java/io/druid/guice/guice/DruidScopes.java index 151325e587b..117f01f8cb7 100644 --- a/common/src/main/java/com/metamx/druid/guice/DruidScopes.java +++ b/common/src/main/java/io/druid/guice/guice/DruidScopes.java @@ -1,4 +1,23 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.google.inject.Inject; import com.google.inject.Key; diff --git a/common/src/main/java/com/metamx/druid/guice/DruidSecondaryModule.java b/common/src/main/java/io/druid/guice/guice/DruidSecondaryModule.java similarity index 74% rename from common/src/main/java/com/metamx/druid/guice/DruidSecondaryModule.java rename to common/src/main/java/io/druid/guice/guice/DruidSecondaryModule.java index 2793b9481a8..943e9d09ed1 100644 --- a/common/src/main/java/com/metamx/druid/guice/DruidSecondaryModule.java +++ b/common/src/main/java/io/druid/guice/guice/DruidSecondaryModule.java @@ -1,4 +1,23 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair; @@ -10,8 +29,8 @@ import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.Module; import com.google.inject.Provides; -import com.metamx.druid.guice.annotations.Json; -import com.metamx.druid.guice.annotations.Smile; +import io.druid.guice.guice.annotations.Json; +import io.druid.guice.guice.annotations.Smile; import org.skife.config.ConfigurationObjectFactory; import javax.validation.Validator; diff --git a/common/src/main/java/com/metamx/druid/guice/JacksonConfigManagerModule.java b/common/src/main/java/io/druid/guice/guice/JacksonConfigManagerModule.java similarity index 60% rename from common/src/main/java/com/metamx/druid/guice/JacksonConfigManagerModule.java rename to common/src/main/java/io/druid/guice/guice/JacksonConfigManagerModule.java index 8bb33dafabf..4edb08b40e9 100644 --- a/common/src/main/java/com/metamx/druid/guice/JacksonConfigManagerModule.java +++ b/common/src/main/java/io/druid/guice/guice/JacksonConfigManagerModule.java @@ -1,4 +1,23 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.google.common.base.Supplier; import com.google.inject.Binder; diff --git a/common/src/main/java/com/metamx/druid/guice/JacksonConfigProvider.java b/common/src/main/java/io/druid/guice/guice/JacksonConfigProvider.java similarity index 98% rename from common/src/main/java/com/metamx/druid/guice/JacksonConfigProvider.java rename to common/src/main/java/io/druid/guice/guice/JacksonConfigProvider.java index 0d4bb53f01d..b48ff8aee50 100644 --- a/common/src/main/java/com/metamx/druid/guice/JacksonConfigProvider.java +++ b/common/src/main/java/io/druid/guice/guice/JacksonConfigProvider.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.base.Supplier; diff --git a/common/src/main/java/com/metamx/druid/guice/JsonConfigProvider.java b/common/src/main/java/io/druid/guice/guice/JsonConfigProvider.java similarity index 99% rename from common/src/main/java/com/metamx/druid/guice/JsonConfigProvider.java rename to common/src/main/java/io/druid/guice/guice/JsonConfigProvider.java index 3066286ea7f..2315279bdc9 100644 --- a/common/src/main/java/com/metamx/druid/guice/JsonConfigProvider.java +++ b/common/src/main/java/io/druid/guice/guice/JsonConfigProvider.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; diff --git a/common/src/main/java/com/metamx/druid/guice/JsonConfigurator.java b/common/src/main/java/io/druid/guice/guice/JsonConfigurator.java similarity index 86% rename from common/src/main/java/com/metamx/druid/guice/JsonConfigurator.java rename to common/src/main/java/io/druid/guice/guice/JsonConfigurator.java index a06636dad35..573f6d2d0d6 100644 --- a/common/src/main/java/com/metamx/druid/guice/JsonConfigurator.java +++ b/common/src/main/java/io/druid/guice/guice/JsonConfigurator.java @@ -1,4 +1,23 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.fasterxml.jackson.annotation.JacksonInject; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/io/druid/guice/guice/LazySingleton.java b/common/src/main/java/io/druid/guice/guice/LazySingleton.java new file mode 100644 index 00000000000..2dfa5802125 --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/LazySingleton.java @@ -0,0 +1,37 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; + +import com.google.inject.ScopeAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + */ +@Target({ ElementType.TYPE, ElementType.METHOD }) +@Retention(RUNTIME) +@ScopeAnnotation +public @interface LazySingleton +{ +} diff --git a/common/src/main/java/com/metamx/druid/guice/LifecycleModule.java b/common/src/main/java/io/druid/guice/guice/LifecycleModule.java similarity index 99% rename from common/src/main/java/com/metamx/druid/guice/LifecycleModule.java rename to common/src/main/java/io/druid/guice/guice/LifecycleModule.java index 5ec992a96b1..b1a13dc973c 100644 --- a/common/src/main/java/com/metamx/druid/guice/LifecycleModule.java +++ b/common/src/main/java/io/druid/guice/guice/LifecycleModule.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.common.base.Preconditions; import com.google.inject.Binder; diff --git a/common/src/main/java/com/metamx/druid/guice/LifecycleScope.java b/common/src/main/java/io/druid/guice/guice/LifecycleScope.java similarity index 66% rename from common/src/main/java/com/metamx/druid/guice/LifecycleScope.java rename to common/src/main/java/io/druid/guice/guice/LifecycleScope.java index a4b076ebb67..320803c1dad 100644 --- a/common/src/main/java/com/metamx/druid/guice/LifecycleScope.java +++ b/common/src/main/java/io/druid/guice/guice/LifecycleScope.java @@ -1,4 +1,23 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.google.common.collect.Lists; import com.google.inject.Key; diff --git a/common/src/main/java/com/metamx/druid/guice/ListProvider.java b/common/src/main/java/io/druid/guice/guice/ListProvider.java similarity index 98% rename from common/src/main/java/com/metamx/druid/guice/ListProvider.java rename to common/src/main/java/io/druid/guice/guice/ListProvider.java index 86d7a03c24a..b3f5c5f01d5 100644 --- a/common/src/main/java/com/metamx/druid/guice/ListProvider.java +++ b/common/src/main/java/io/druid/guice/guice/ListProvider.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.common.collect.Lists; import com.google.inject.Inject; diff --git a/common/src/main/java/io/druid/guice/guice/ManageLifecycle.java b/common/src/main/java/io/druid/guice/guice/ManageLifecycle.java new file mode 100644 index 00000000000..106ff9f1afb --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/ManageLifecycle.java @@ -0,0 +1,40 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; + +import com.google.inject.ScopeAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Marks the object to be managed by {@link com.metamx.common.lifecycle.Lifecycle} + * + * This Scope gets defined by {@link io.druid.guice.guice.LifecycleModule} + */ +@Target({ ElementType.TYPE, ElementType.METHOD }) +@Retention(RUNTIME) +@ScopeAnnotation +public @interface ManageLifecycle +{ +} diff --git a/common/src/main/java/io/druid/guice/guice/ManageLifecycleLast.java b/common/src/main/java/io/druid/guice/guice/ManageLifecycleLast.java new file mode 100644 index 00000000000..d420ccb8717 --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/ManageLifecycleLast.java @@ -0,0 +1,40 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; + +import com.google.inject.ScopeAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Marks the object to be managed by {@link com.metamx.common.lifecycle.Lifecycle} and set to be on Stage.LAST + * + * This Scope gets defined by {@link io.druid.guice.guice.LifecycleModule} + */ +@Target({ ElementType.TYPE, ElementType.METHOD }) +@Retention(RUNTIME) +@ScopeAnnotation +public @interface ManageLifecycleLast +{ +} diff --git a/common/src/main/java/com/metamx/druid/guice/PolyBind.java b/common/src/main/java/io/druid/guice/guice/PolyBind.java similarity index 99% rename from common/src/main/java/com/metamx/druid/guice/PolyBind.java rename to common/src/main/java/io/druid/guice/guice/PolyBind.java index 195f2923306..ba7df6e49d0 100644 --- a/common/src/main/java/com/metamx/druid/guice/PolyBind.java +++ b/common/src/main/java/io/druid/guice/guice/PolyBind.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.inject.Binder; import com.google.inject.Inject; diff --git a/common/src/main/java/io/druid/guice/guice/SupplierProvider.java b/common/src/main/java/io/druid/guice/guice/SupplierProvider.java new file mode 100644 index 00000000000..b9a0e236511 --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/SupplierProvider.java @@ -0,0 +1,54 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; + +import com.google.common.base.Supplier; +import com.google.inject.Inject; +import com.google.inject.Injector; +import com.google.inject.Key; +import com.google.inject.Provider; + +/** + */ +public class SupplierProvider implements Provider +{ + private final Key> supplierKey; + + private Provider> supplierProvider; + + public SupplierProvider( + Key> supplierKey + ) + { + this.supplierKey = supplierKey; + } + + @Inject + public void configure(Injector injector) + { + this.supplierProvider = injector.getProvider(supplierKey); + } + + @Override + public T get() + { + return supplierProvider.get().get(); + } +} diff --git a/common/src/main/java/io/druid/guice/guice/annotations/Global.java b/common/src/main/java/io/druid/guice/guice/annotations/Global.java new file mode 100644 index 00000000000..cca8afefc3c --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/annotations/Global.java @@ -0,0 +1,36 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice.annotations; + +import com.google.inject.BindingAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + */ +@BindingAnnotation +@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface Global +{ +} diff --git a/common/src/main/java/io/druid/guice/guice/annotations/Json.java b/common/src/main/java/io/druid/guice/guice/annotations/Json.java new file mode 100644 index 00000000000..a52008fa5eb --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/annotations/Json.java @@ -0,0 +1,36 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice.annotations; + +import com.google.inject.BindingAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + */ +@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@BindingAnnotation +public @interface Json +{ +} diff --git a/common/src/main/java/io/druid/guice/guice/annotations/Self.java b/common/src/main/java/io/druid/guice/guice/annotations/Self.java new file mode 100644 index 00000000000..fe5e2df0dce --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/annotations/Self.java @@ -0,0 +1,36 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice.annotations; + +import com.google.inject.BindingAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + */ +@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@BindingAnnotation +public @interface Self +{ +} diff --git a/common/src/main/java/io/druid/guice/guice/annotations/Smile.java b/common/src/main/java/io/druid/guice/guice/annotations/Smile.java new file mode 100644 index 00000000000..0e5537ef04a --- /dev/null +++ b/common/src/main/java/io/druid/guice/guice/annotations/Smile.java @@ -0,0 +1,36 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice.annotations; + +import com.google.inject.BindingAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + */ +@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@BindingAnnotation +public @interface Smile +{ +} diff --git a/common/src/main/java/com/metamx/druid/aggregation/CountAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/CountAggregator.java similarity index 94% rename from common/src/main/java/com/metamx/druid/aggregation/CountAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/CountAggregator.java index 6c307fecb64..65091226992 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/CountAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/CountAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.Aggregator; diff --git a/common/src/main/java/com/metamx/druid/aggregation/CountAggregatorFactory.java b/common/src/main/java/io/druid/query/aggregation/aggregation/CountAggregatorFactory.java similarity index 96% rename from common/src/main/java/com/metamx/druid/aggregation/CountAggregatorFactory.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/CountAggregatorFactory.java index dcc389084b6..c5d67db8012 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/CountAggregatorFactory.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/CountAggregatorFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/CountBufferAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/CountBufferAggregator.java similarity index 93% rename from common/src/main/java/com/metamx/druid/aggregation/CountBufferAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/CountBufferAggregator.java index 9cc0e41c42c..3a9966660b7 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/CountBufferAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/CountBufferAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.BufferAggregator; diff --git a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/DoubleSumAggregator.java similarity index 95% rename from common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/DoubleSumAggregator.java index 318c1d8fbf2..7cc8d9181ab 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/DoubleSumAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.google.common.collect.Ordering; import com.google.common.primitives.Doubles; diff --git a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregatorFactory.java b/common/src/main/java/io/druid/query/aggregation/aggregation/DoubleSumAggregatorFactory.java similarity index 97% rename from common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregatorFactory.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/DoubleSumAggregatorFactory.java index e130f9d90a4..4dbda6ad359 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumAggregatorFactory.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/DoubleSumAggregatorFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumBufferAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/DoubleSumBufferAggregator.java similarity index 94% rename from common/src/main/java/com/metamx/druid/aggregation/DoubleSumBufferAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/DoubleSumBufferAggregator.java index 72436c51b6e..2d1689b0ba0 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/DoubleSumBufferAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/DoubleSumBufferAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.BufferAggregator; import io.druid.segment.FloatMetricSelector; diff --git a/common/src/main/java/com/metamx/druid/aggregation/Histogram.java b/common/src/main/java/io/druid/query/aggregation/aggregation/Histogram.java similarity index 97% rename from common/src/main/java/com/metamx/druid/aggregation/Histogram.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/Histogram.java index 5c2c0f5f069..40880b97230 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/Histogram.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/Histogram.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.fasterxml.jackson.annotation.JsonValue; import com.google.common.base.Preconditions; diff --git a/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/HistogramAggregator.java similarity index 95% rename from common/src/main/java/com/metamx/druid/aggregation/HistogramAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/HistogramAggregator.java index cf2f24e2c30..bbb73a4fc96 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/HistogramAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.google.common.primitives.Longs; import io.druid.query.aggregation.Aggregator; diff --git a/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregatorFactory.java b/common/src/main/java/io/druid/query/aggregation/aggregation/HistogramAggregatorFactory.java similarity index 98% rename from common/src/main/java/com/metamx/druid/aggregation/HistogramAggregatorFactory.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/HistogramAggregatorFactory.java index f4d4f00dafc..7901228df72 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/HistogramAggregatorFactory.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/HistogramAggregatorFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/HistogramBufferAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/HistogramBufferAggregator.java similarity index 96% rename from common/src/main/java/com/metamx/druid/aggregation/HistogramBufferAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/HistogramBufferAggregator.java index e312f187593..8404c6e054f 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/HistogramBufferAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/HistogramBufferAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.google.common.primitives.Floats; import com.google.common.primitives.Longs; diff --git a/common/src/main/java/com/metamx/druid/aggregation/HistogramVisual.java b/common/src/main/java/io/druid/query/aggregation/aggregation/HistogramVisual.java similarity index 96% rename from common/src/main/java/com/metamx/druid/aggregation/HistogramVisual.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/HistogramVisual.java index 8c696638aa9..e81d42686fa 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/HistogramVisual.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/HistogramVisual.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/JavaScriptAggregator.java similarity index 95% rename from common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/JavaScriptAggregator.java index fb6de96192a..e97e1da5d02 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/JavaScriptAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.google.common.collect.Lists; import io.druid.query.aggregation.Aggregator; diff --git a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregatorFactory.java b/common/src/main/java/io/druid/query/aggregation/aggregation/JavaScriptAggregatorFactory.java similarity index 98% rename from common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregatorFactory.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/JavaScriptAggregatorFactory.java index ae2375069b5..e2b72b40cf0 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptAggregatorFactory.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/JavaScriptAggregatorFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptBufferAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/JavaScriptBufferAggregator.java similarity index 95% rename from common/src/main/java/com/metamx/druid/aggregation/JavaScriptBufferAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/JavaScriptBufferAggregator.java index cf55c32ce07..880b12d6cbb 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/JavaScriptBufferAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/JavaScriptBufferAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.google.common.collect.Lists; import io.druid.query.aggregation.BufferAggregator; diff --git a/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/LongSumAggregator.java similarity index 95% rename from common/src/main/java/com/metamx/druid/aggregation/LongSumAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/LongSumAggregator.java index 3defff46019..1e1c4932d35 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/LongSumAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.google.common.primitives.Longs; import io.druid.query.aggregation.Aggregator; diff --git a/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregatorFactory.java b/common/src/main/java/io/druid/query/aggregation/aggregation/LongSumAggregatorFactory.java similarity index 97% rename from common/src/main/java/com/metamx/druid/aggregation/LongSumAggregatorFactory.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/LongSumAggregatorFactory.java index 7ff27a47fdd..e653e45ebba 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/LongSumAggregatorFactory.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/LongSumAggregatorFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/LongSumBufferAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/LongSumBufferAggregator.java similarity index 94% rename from common/src/main/java/com/metamx/druid/aggregation/LongSumBufferAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/LongSumBufferAggregator.java index f0cbca7098b..854a3affe42 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/LongSumBufferAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/LongSumBufferAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.BufferAggregator; import io.druid.segment.FloatMetricSelector; diff --git a/common/src/main/java/com/metamx/druid/aggregation/MaxAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/MaxAggregator.java similarity index 95% rename from common/src/main/java/com/metamx/druid/aggregation/MaxAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/MaxAggregator.java index 337615730d8..273af8980e0 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MaxAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/MaxAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.Aggregator; import io.druid.segment.FloatMetricSelector; diff --git a/common/src/main/java/com/metamx/druid/aggregation/MaxAggregatorFactory.java b/common/src/main/java/io/druid/query/aggregation/aggregation/MaxAggregatorFactory.java similarity index 97% rename from common/src/main/java/com/metamx/druid/aggregation/MaxAggregatorFactory.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/MaxAggregatorFactory.java index e9e85ae45cc..5ccac95330b 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MaxAggregatorFactory.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/MaxAggregatorFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/MaxBufferAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/MaxBufferAggregator.java similarity index 94% rename from common/src/main/java/com/metamx/druid/aggregation/MaxBufferAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/MaxBufferAggregator.java index b5a07cd288c..c51767c6002 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MaxBufferAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/MaxBufferAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.BufferAggregator; import io.druid.segment.FloatMetricSelector; diff --git a/common/src/main/java/com/metamx/druid/aggregation/MinAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/MinAggregator.java similarity index 95% rename from common/src/main/java/com/metamx/druid/aggregation/MinAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/MinAggregator.java index 586556915c8..3d2f8c2bc92 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MinAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/MinAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.Aggregator; import io.druid.segment.FloatMetricSelector; diff --git a/common/src/main/java/com/metamx/druid/aggregation/MinAggregatorFactory.java b/common/src/main/java/io/druid/query/aggregation/aggregation/MinAggregatorFactory.java similarity index 97% rename from common/src/main/java/com/metamx/druid/aggregation/MinAggregatorFactory.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/MinAggregatorFactory.java index ad31b46142e..00ab840bd7e 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MinAggregatorFactory.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/MinAggregatorFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/MinBufferAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/MinBufferAggregator.java similarity index 94% rename from common/src/main/java/com/metamx/druid/aggregation/MinBufferAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/MinBufferAggregator.java index 7eab06f06c7..b77f9d5f8f5 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/MinBufferAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/MinBufferAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.BufferAggregator; import io.druid.segment.FloatMetricSelector; diff --git a/common/src/main/java/com/metamx/druid/aggregation/NoopAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/NoopAggregator.java similarity index 93% rename from common/src/main/java/com/metamx/druid/aggregation/NoopAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/NoopAggregator.java index f5907f100eb..8f778ff7c0e 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/NoopAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/NoopAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.Aggregator; diff --git a/common/src/main/java/com/metamx/druid/aggregation/NoopBufferAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/NoopBufferAggregator.java similarity index 92% rename from common/src/main/java/com/metamx/druid/aggregation/NoopBufferAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/NoopBufferAggregator.java index 51ceafe04c8..931863dc26a 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/NoopBufferAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/NoopBufferAggregator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.BufferAggregator; diff --git a/common/src/main/java/com/metamx/druid/aggregation/ToLowerCaseAggregatorFactory.java b/common/src/main/java/io/druid/query/aggregation/aggregation/ToLowerCaseAggregatorFactory.java similarity index 96% rename from common/src/main/java/com/metamx/druid/aggregation/ToLowerCaseAggregatorFactory.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/ToLowerCaseAggregatorFactory.java index a48b33c4f77..06cd02deb53 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/ToLowerCaseAggregatorFactory.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/ToLowerCaseAggregatorFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.query.aggregation.Aggregator; import io.druid.query.aggregation.AggregatorFactory; diff --git a/common/src/main/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/post/ArithmeticPostAggregator.java similarity index 98% rename from common/src/main/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/post/ArithmeticPostAggregator.java index 5d0c9b7647e..8f449e23a85 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/post/ArithmeticPostAggregator.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation.post; +package io.druid.query.aggregation.aggregation.post; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/post/ConstantPostAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/post/ConstantPostAggregator.java similarity index 97% rename from common/src/main/java/com/metamx/druid/aggregation/post/ConstantPostAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/post/ConstantPostAggregator.java index b60ac62b6a8..85cb3bf67f0 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/post/ConstantPostAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/post/ConstantPostAggregator.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation.post; +package io.druid.query.aggregation.aggregation.post; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/common/src/main/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregator.java b/common/src/main/java/io/druid/query/aggregation/aggregation/post/FieldAccessPostAggregator.java similarity index 97% rename from common/src/main/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregator.java rename to common/src/main/java/io/druid/query/aggregation/aggregation/post/FieldAccessPostAggregator.java index 777090451d2..c33b63959cd 100644 --- a/common/src/main/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregator.java +++ b/common/src/main/java/io/druid/query/aggregation/aggregation/post/FieldAccessPostAggregator.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation.post; +package io.druid.query.aggregation.aggregation.post; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; 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 dd71ef22553..6d20d255708 100644 --- a/common/src/test/java/com/metamx/druid/histogram/HistogramTest.java +++ b/common/src/test/java/com/metamx/druid/histogram/HistogramTest.java @@ -21,8 +21,8 @@ package com.metamx.druid.histogram; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Maps; -import com.metamx.druid.aggregation.Histogram; import com.metamx.druid.jackson.DefaultObjectMapper; +import io.druid.query.aggregation.aggregation.Histogram; import org.junit.Assert; import org.junit.Test; diff --git a/common/src/test/java/com/metamx/druid/guice/LifecycleScopeTest.java b/common/src/test/java/io/druid/guice/guice/LifecycleScopeTest.java similarity index 86% rename from common/src/test/java/com/metamx/druid/guice/LifecycleScopeTest.java rename to common/src/test/java/io/druid/guice/guice/LifecycleScopeTest.java index 9948dfe1470..999d9c1ef8b 100644 --- a/common/src/test/java/com/metamx/druid/guice/LifecycleScopeTest.java +++ b/common/src/test/java/io/druid/guice/guice/LifecycleScopeTest.java @@ -1,4 +1,23 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.google.inject.Binder; import com.google.inject.Guice; diff --git a/common/src/test/java/com/metamx/druid/guice/PolyBindTest.java b/common/src/test/java/io/druid/guice/guice/PolyBindTest.java similarity index 99% rename from common/src/test/java/com/metamx/druid/guice/PolyBindTest.java rename to common/src/test/java/io/druid/guice/guice/PolyBindTest.java index a5f24e220fe..002ef99fedf 100644 --- a/common/src/test/java/com/metamx/druid/guice/PolyBindTest.java +++ b/common/src/test/java/io/druid/guice/guice/PolyBindTest.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.common.collect.Iterables; import com.google.inject.Binder; diff --git a/common/src/test/java/com/metamx/druid/aggregation/CountAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/CountAggregatorTest.java similarity index 95% rename from common/src/test/java/com/metamx/druid/aggregation/CountAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/CountAggregatorTest.java index 8a780146504..1de3f4166e9 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/CountAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/CountAggregatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import org.junit.Assert; import org.junit.Test; diff --git a/common/src/test/java/com/metamx/druid/aggregation/DoubleSumAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/DoubleSumAggregatorTest.java similarity index 96% rename from common/src/test/java/com/metamx/druid/aggregation/DoubleSumAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/DoubleSumAggregatorTest.java index d1a87ac9c2d..9d686904dc4 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/DoubleSumAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/DoubleSumAggregatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import org.junit.Assert; import org.junit.Test; diff --git a/common/src/test/java/com/metamx/druid/aggregation/HistogramAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/HistogramAggregatorTest.java similarity index 98% rename from common/src/test/java/com/metamx/druid/aggregation/HistogramAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/HistogramAggregatorTest.java index 93079506b81..83672731c00 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/HistogramAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/HistogramAggregatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.google.common.collect.Lists; import io.druid.query.aggregation.Aggregator; diff --git a/common/src/test/java/com/metamx/druid/aggregation/JavaScriptAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/JavaScriptAggregatorTest.java similarity index 98% rename from common/src/test/java/com/metamx/druid/aggregation/JavaScriptAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/JavaScriptAggregatorTest.java index bf287cce344..3b526ee9381 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/JavaScriptAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/JavaScriptAggregatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import com.google.common.collect.Lists; import com.google.common.collect.Maps; diff --git a/common/src/test/java/com/metamx/druid/aggregation/LongSumAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/LongSumAggregatorTest.java similarity index 95% rename from common/src/test/java/com/metamx/druid/aggregation/LongSumAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/LongSumAggregatorTest.java index 8db1a4a4755..4caf2c89a2d 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/LongSumAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/LongSumAggregatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import org.junit.Assert; import org.junit.Test; diff --git a/common/src/test/java/com/metamx/druid/aggregation/MaxAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/MaxAggregatorTest.java similarity index 93% rename from common/src/test/java/com/metamx/druid/aggregation/MaxAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/MaxAggregatorTest.java index ed2a55efbb2..f30b03dc54d 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/MaxAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/MaxAggregatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import org.junit.Assert; import org.junit.Test; diff --git a/common/src/test/java/com/metamx/druid/aggregation/MetricSelectorUtils.java b/common/src/test/java/io/druid/query/aggregation/aggregation/MetricSelectorUtils.java similarity index 92% rename from common/src/test/java/com/metamx/druid/aggregation/MetricSelectorUtils.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/MetricSelectorUtils.java index 3cb856fdd2d..e42e13df020 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/MetricSelectorUtils.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/MetricSelectorUtils.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2013 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.segment.FloatMetricSelector; import io.druid.segment.ObjectMetricSelector; diff --git a/common/src/test/java/com/metamx/druid/aggregation/MinAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/MinAggregatorTest.java similarity index 93% rename from common/src/test/java/com/metamx/druid/aggregation/MinAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/MinAggregatorTest.java index 9544595ec82..998de6ac084 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/MinAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/MinAggregatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import org.junit.Assert; import org.junit.Test; diff --git a/common/src/test/java/com/metamx/druid/aggregation/TestFloatMetricSelector.java b/common/src/test/java/io/druid/query/aggregation/aggregation/TestFloatMetricSelector.java similarity index 92% rename from common/src/test/java/com/metamx/druid/aggregation/TestFloatMetricSelector.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/TestFloatMetricSelector.java index 759a33a9902..e3fe63a0565 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/TestFloatMetricSelector.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/TestFloatMetricSelector.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation; +package io.druid.query.aggregation.aggregation; import io.druid.segment.FloatMetricSelector; diff --git a/common/src/test/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/post/ArithmeticPostAggregatorTest.java similarity index 96% rename from common/src/test/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/post/ArithmeticPostAggregatorTest.java index 144483392bd..33c8cef519b 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/post/ArithmeticPostAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/post/ArithmeticPostAggregatorTest.java @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation.post; +package io.druid.query.aggregation.aggregation.post; import com.google.common.collect.Lists; -import com.metamx.druid.aggregation.CountAggregator; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.aggregation.aggregation.CountAggregator; import org.junit.Assert; import org.junit.Test; diff --git a/common/src/test/java/com/metamx/druid/aggregation/post/ConstantPostAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/post/ConstantPostAggregatorTest.java similarity index 94% rename from common/src/test/java/com/metamx/druid/aggregation/post/ConstantPostAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/post/ConstantPostAggregatorTest.java index 0de6e2c62e7..fb235581b50 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/post/ConstantPostAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/post/ConstantPostAggregatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation.post; +package io.druid.query.aggregation.aggregation.post; import org.junit.Assert; import org.junit.Test; diff --git a/common/src/test/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregatorTest.java b/common/src/test/java/io/druid/query/aggregation/aggregation/post/FieldAccessPostAggregatorTest.java similarity index 90% rename from common/src/test/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregatorTest.java rename to common/src/test/java/io/druid/query/aggregation/aggregation/post/FieldAccessPostAggregatorTest.java index e413504b1ad..d2de2aef34f 100644 --- a/common/src/test/java/com/metamx/druid/aggregation/post/FieldAccessPostAggregatorTest.java +++ b/common/src/test/java/io/druid/query/aggregation/aggregation/post/FieldAccessPostAggregatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.aggregation.post; +package io.druid.query.aggregation.aggregation.post; -import com.metamx.druid.aggregation.CountAggregator; +import io.druid.query.aggregation.aggregation.CountAggregator; import org.junit.Assert; import org.junit.Test; diff --git a/examples/src/main/java/druid/examples/flights/FlightsFirehoseFactory.java b/examples/src/main/java/druid/examples/flights/FlightsFirehoseFactory.java index 66b8de4450c..d008a4d0997 100644 --- a/examples/src/main/java/druid/examples/flights/FlightsFirehoseFactory.java +++ b/examples/src/main/java/druid/examples/flights/FlightsFirehoseFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -25,10 +25,10 @@ import com.google.common.base.Charsets; import com.google.common.base.Throwables; import com.google.common.collect.Iterators; import com.google.common.io.Closeables; -import com.metamx.druid.indexer.data.StringInputRowParser; import com.metamx.druid.input.InputRow; import com.metamx.druid.realtime.firehose.Firehose; import com.metamx.druid.realtime.firehose.FirehoseFactory; +import io.druid.data.input.StringInputRowParser; import java.io.BufferedReader; import java.io.File; diff --git a/examples/src/main/java/druid/examples/guice/RealtimeExampleModule.java b/examples/src/main/java/druid/examples/guice/RealtimeExampleModule.java index d2ebf350968..046589fde04 100644 --- a/examples/src/main/java/druid/examples/guice/RealtimeExampleModule.java +++ b/examples/src/main/java/druid/examples/guice/RealtimeExampleModule.java @@ -1,3 +1,22 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 druid.examples.guice; import com.fasterxml.jackson.databind.jsontype.NamedType; @@ -6,16 +25,6 @@ import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.TypeLiteral; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; -import com.metamx.druid.client.InventoryView; -import com.metamx.druid.client.ServerView; -import com.metamx.druid.coordination.DataSegmentAnnouncer; -import com.metamx.druid.guice.FireDepartmentsProvider; -import com.metamx.druid.guice.JsonConfigProvider; -import com.metamx.druid.guice.ManageLifecycle; -import com.metamx.druid.guice.NoopSegmentPublisherProvider; -import com.metamx.druid.guice.RealtimeManagerConfig; import com.metamx.druid.loading.DataSegmentPusher; import com.metamx.druid.realtime.FireDepartment; import com.metamx.druid.realtime.RealtimeManager; @@ -24,7 +33,17 @@ import druid.examples.flights.FlightsFirehoseFactory; import druid.examples.rand.RandomFirehoseFactory; import druid.examples.twitter.TwitterSpritzerFirehoseFactory; import druid.examples.web.WebFirehoseFactory; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; +import io.druid.client.InventoryView; +import io.druid.client.ServerView; +import io.druid.guice.guice.FireDepartmentsProvider; +import io.druid.guice.guice.JsonConfigProvider; +import io.druid.guice.guice.ManageLifecycle; +import io.druid.guice.guice.NoopSegmentPublisherProvider; +import io.druid.guice.guice.RealtimeManagerConfig; import io.druid.initialization.DruidModule; +import io.druid.server.coordination.DataSegmentAnnouncer; import java.io.File; import java.io.IOException; diff --git a/indexing-common/pom.xml b/indexing-common/pom.xml deleted file mode 100644 index 6bd76a53385..00000000000 --- a/indexing-common/pom.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - 4.0.0 - com.metamx.druid - druid-indexing-common - druid-indexing-common - Druid Indexing Common - - - com.metamx - druid - 0.5.50-SNAPSHOT - - - - - com.metamx.druid - druid-common - ${project.parent.version} - - - - com.metamx - java-util - - - com.metamx - bytebuffer-collections - - - - com.ning - compress-lzf - - - it.uniroma3.mat - extendedset - - - com.fasterxml.jackson.core - jackson-core - - - net.java.dev.jets3t - jets3t - - - joda-time - joda-time - - - com.google.code.findbugs - jsr305 - - - com.google.guava - guava - - - commons-io - commons-io - - - com.google.protobuf - protobuf-java - - - - - - junit - junit - test - - - - - - - maven-jar-plugin - - - - test-jar - - - - - - - diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/Index.java b/indexing-common/src/main/java/com/metamx/druid/index/v1/Index.java deleted file mode 100644 index fcec6135b86..00000000000 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/Index.java +++ /dev/null @@ -1,166 +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.index.v1; - -import com.metamx.collections.spatial.ImmutableRTree; -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; - -/** - * In-memory representation of a segment - */ -public class Index -{ - private static final Logger log = new Logger(Index.class); - private static final ImmutableConciseSet emptySet = new ImmutableConciseSet(); - - final Map dimToPositionMap = new HashMap(); - final Map metricToPositionMap = new HashMap(); - - final String[] dimensions; - final String[] metrics; - final Interval dataInterval; - final long[] timeOffsets; - final Map metricVals; - final Map> dimIdLookup; - final Map reverseDimLookup; - final Map indexes; - final Map spatialIndexes; - final Map dimensionValues; - - /* - * If we name the various occurrences of String and int then the types are more informative: - * - * dimToPositionMap : Dim -> DimColumn - * dimensions : DimColumn -> Dim - * metricToPositionMap : Met -> MetColumn - * metrics : MetColumn -> Met - * - * dataInterval : Interval - * - * timeOffsets : Milli[] - * metricVals : float[] (size() == timeOffsets.size() * metrics.size()) - * - * dimIdLookup : Dim -> Value -> ValueID - * reverseDimLookup : Dim -> ValueID -> Value - * indexes : Dim -> ValueID -> Row[] - * - * dimensionValues : Dim -> - * getRowValues : Row -> ExpansionID - * getDimensionExpansions : ExpansionID -> ValueID[] - * getDimValues : Row -> ValueID[] - */ - - public Index( - String[] dimensions, - String[] metrics, - Interval dataInterval, - long[] timeOffsets, - Map metricVals, - Map> dimIdLookup, - Map reverseDimLookup, - Map indexes, - Map spatialIndexes, - Map dimensionValues - ) - { - this.dimensions = dimensions; - this.metrics = metrics; - this.dataInterval = dataInterval; - this.timeOffsets = timeOffsets; - this.metricVals = metricVals; - this.dimIdLookup = dimIdLookup; - this.reverseDimLookup = reverseDimLookup; - this.indexes = indexes; - this.spatialIndexes = spatialIndexes; - this.dimensionValues = dimensionValues; - - for (int i = 0; i < dimensions.length; i++) { - dimToPositionMap.put(dimensions[i].toLowerCase(), i); - } - for (int i = 0; i < metrics.length; i++) { - metricToPositionMap.put(metrics[i].toLowerCase(), i); - } - } - - public ImmutableConciseSet getInvertedIndex(String dimension, String value) - { - final Map lookup = dimIdLookup.get(dimension); - if (lookup == null) { - return emptySet; - } - - final Integer integer = lookup.get(value); - if (integer == null) { - return emptySet; - } - - try { - return indexes.get(dimension)[integer]; - } - catch (NullPointerException e) { - log.warn( - e, - "NPE on dimension[%s], value[%s], with index over interval[%s]", - dimension, - value, - dataInterval - ); - return emptySet; - } - } - - public ImmutableConciseSet getInvertedIndex(String dimension, int valueIndex) - { - try { - return indexes.get(dimension)[valueIndex]; - } - catch (NullPointerException e) { - log.warn( - e, - "NPE on dimension[%s], valueIndex[%d], with index over interval[%s]", - dimension, - valueIndex, - dataInterval - ); - return emptySet; - } - } - - public ImmutableRTree getSpatialIndex(String dimension) - { - try { - return spatialIndexes.get(dimension); - } - catch (NullPointerException e) { - log.warn( - e, - "NPE on dimension[%s] over interval[%s]", - dimension, - dataInterval - ); - return new ImmutableRTree(); - } - } -} diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/MMappedIndex.java b/indexing-common/src/main/java/com/metamx/druid/index/v1/MMappedIndex.java deleted file mode 100644 index 83a32dedfbe..00000000000 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/MMappedIndex.java +++ /dev/null @@ -1,296 +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.index.v1; - -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import com.google.common.collect.Maps; -import com.google.common.primitives.Ints; -import com.metamx.collections.spatial.ImmutableRTree; -import com.metamx.common.io.smoosh.SmooshedFileMapper; -import com.metamx.common.logger.Logger; -import com.metamx.druid.kv.ConciseCompressedIndexedInts; -import com.metamx.druid.kv.GenericIndexed; -import com.metamx.druid.kv.IndexedList; -import com.metamx.druid.kv.VSizeIndexed; -import com.metamx.druid.kv.VSizeIndexedInts; -import io.druid.data.Indexed; -import io.druid.data.IndexedLongs; -import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; -import org.joda.time.Interval; - -import java.io.IOException; -import java.nio.ByteOrder; -import java.nio.LongBuffer; -import java.util.Arrays; -import java.util.Map; - -/** - */ -public class MMappedIndex -{ - private static final Logger log = new Logger(MMappedIndex.class); - private static final ImmutableConciseSet emptySet = new ImmutableConciseSet(); - - final GenericIndexed availableDimensions; - final GenericIndexed availableMetrics; - final Interval dataInterval; - final CompressedLongsIndexedSupplier timestamps; - final Map metrics; - final Map> dimValueLookups; - final Map dimColumns; - final Map> invertedIndexes; - final Map spatialIndexes; - final SmooshedFileMapper fileMapper; - - private final Map metricIndexes = Maps.newHashMap(); - - public MMappedIndex( - GenericIndexed availableDimensions, - GenericIndexed availableMetrics, - Interval dataInterval, - CompressedLongsIndexedSupplier timestamps, - Map metrics, - Map> dimValueLookups, - Map dimColumns, - Map> invertedIndexes, - Map spatialIndexes, - SmooshedFileMapper fileMapper - ) - { - this.availableDimensions = availableDimensions; - this.availableMetrics = availableMetrics; - this.dataInterval = dataInterval; - this.timestamps = timestamps; - this.metrics = metrics; - this.dimValueLookups = dimValueLookups; - this.dimColumns = dimColumns; - this.invertedIndexes = invertedIndexes; - this.spatialIndexes = spatialIndexes; - this.fileMapper = fileMapper; - - for (int i = 0; i < availableMetrics.size(); i++) { - metricIndexes.put(availableMetrics.get(i), i); - } - } - - public CompressedLongsIndexedSupplier getTimestamps() - { - return timestamps; - } - - public GenericIndexed getAvailableDimensions() - { - return availableDimensions; - } - - public GenericIndexed getAvailableMetrics() - { - return availableMetrics; - } - - public Map getMetrics() - { - return metrics; - } - - public Integer getMetricIndex(String metricName) - { - return metricIndexes.get(metricName); - } - - public Interval getDataInterval() - { - return dataInterval; - } - - public IndexedLongs getReadOnlyTimestamps() - { - return timestamps.get(); - } - - public MetricHolder getMetricHolder(String metric) - { - final MetricHolder retVal = metrics.get(metric); - - if (retVal == null) { - return null; - } - - return retVal; - } - - public GenericIndexed getDimValueLookup(String dimension) - { - return dimValueLookups.get(dimension); - } - - public VSizeIndexed getDimColumn(String dimension) - { - return dimColumns.get(dimension); - } - - public Map> getInvertedIndexes() - { - return invertedIndexes; - } - - public Map getSpatialIndexes() - { - return spatialIndexes; - } - - public ImmutableConciseSet getInvertedIndex(String dimension, String value) - { - final GenericIndexed lookup = dimValueLookups.get(dimension); - if (lookup == null) { - return emptySet; - } - - int indexOf = lookup.indexOf(value); - if (indexOf < 0) { - return emptySet; - } - - ImmutableConciseSet retVal = invertedIndexes.get(dimension).get(indexOf); - return (retVal == null) ? emptySet : retVal; - } - - public SmooshedFileMapper getFileMapper() - { - return fileMapper; - } - - public void close() throws IOException - { - if (fileMapper != null) { - fileMapper.close(); - } - } - - public static MMappedIndex fromIndex(Index index) - { - log.info("Converting timestamps"); - CompressedLongsIndexedSupplier timestamps = CompressedLongsIndexedSupplier.fromLongBuffer( - LongBuffer.wrap(index.timeOffsets), ByteOrder.nativeOrder() - ); - - log.info("Converting dimValueLookups"); - Map> dimValueLookups = Maps.newHashMap(); - for (Map.Entry entry : index.reverseDimLookup.entrySet()) { - String[] theValues = Arrays.copyOf(entry.getValue(), entry.getValue().length); - Arrays.sort(theValues); - - dimValueLookups.put(entry.getKey(), GenericIndexed.fromArray(theValues, GenericIndexed.stringStrategy)); - } - - Map dimColumns = Maps.newHashMap(); - Map> invertedIndexes = Maps.newLinkedHashMap(); - Map spatialIndexes = Maps.newLinkedHashMap(); - - for (String dimension : Arrays.asList(index.dimensions)) { - final String[] dimVals = index.reverseDimLookup.get(dimension); - final DimensionColumn dimColumn = index.dimensionValues.get(dimension); - - log.info( - "Converting dim[%s] with valueCardinality[%,d] and expansionCardinality[%,d]", - dimension, - dimColumn.getDimensionExpansions().length, - dimVals.length - ); - - final Indexed lookup = dimValueLookups.get(dimension); - final int[] expansionConversion = new int[dimVals.length]; - final int[] reverseExpansionConversion = new int[dimVals.length]; - for (int i = 0; i < expansionConversion.length; i++) { - expansionConversion[i] = lookup.indexOf(dimVals[i]); - reverseExpansionConversion[expansionConversion[i]] = i; - } - - int[][] originalDimExpansions = dimColumn.getDimensionExpansions(); - final int[][] dimensionExpansions = new int[originalDimExpansions.length][]; - for (int i = 0; i < originalDimExpansions.length; i++) { - int[] originalDimExpansion = originalDimExpansions[i]; - int[] mappedValues = new int[originalDimExpansion.length]; - - for (int j = 0; j < originalDimExpansion.length; j++) { - mappedValues[j] = expansionConversion[originalDimExpansion[j]]; - } - Arrays.sort(mappedValues); - - dimensionExpansions[i] = mappedValues; - } - - final int[] originalRows = dimColumn.getDimensionRowValues(); - final ImmutableConciseSet[] origInvertedIndexes = index.indexes.get(dimension); - - dimColumns.put( - dimension, - VSizeIndexed.fromIterable( - Iterables.transform( - Ints.asList(originalRows), - new Function() - { - @Override - public VSizeIndexedInts apply(Integer input) - { - return VSizeIndexedInts.fromArray(dimensionExpansions[input], dimVals.length - 1); - } - } - ) - ) - ); - - invertedIndexes.put( - dimension, - GenericIndexed.fromIterable( - Iterables.transform( - new IndexedList(lookup), - new Function() - { - @Override - public ImmutableConciseSet apply(String input) - { - return origInvertedIndexes[reverseExpansionConversion[lookup.indexOf(input)]]; - } - } - ), - ConciseCompressedIndexedInts.objectStrategy - ) - ); - - spatialIndexes.put(dimension, index.getSpatialIndex(dimension)); - } - - log.info("Making MMappedIndex"); - return new MMappedIndex( - GenericIndexed.fromArray(index.dimensions, GenericIndexed.stringStrategy), - GenericIndexed.fromArray(index.metrics, GenericIndexed.stringStrategy), - index.dataInterval, - timestamps, - index.metricVals, - dimValueLookups, - dimColumns, - invertedIndexes, - spatialIndexes, - null - ); - } -} diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ByteBufferInputRowParser.java b/indexing-common/src/main/java/com/metamx/druid/indexer/data/ByteBufferInputRowParser.java deleted file mode 100644 index d0764e72a26..00000000000 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ByteBufferInputRowParser.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.metamx.druid.indexer.data; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -import java.nio.ByteBuffer; - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = StringInputRowParser.class) -@JsonSubTypes(value = { - @JsonSubTypes.Type(name = "protobuf", value = ProtoBufInputRowParser.class), - @JsonSubTypes.Type(name = "string", value = StringInputRowParser.class) -}) -public interface ByteBufferInputRowParser extends InputRowParser { -} diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/InputRowParser.java b/indexing-common/src/main/java/com/metamx/druid/indexer/data/InputRowParser.java deleted file mode 100644 index 231cbd44102..00000000000 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/InputRowParser.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.metamx.druid.indexer.data; - -import com.metamx.common.exception.FormattedException; -import com.metamx.druid.input.InputRow; - -public interface InputRowParser -{ - public InputRow parse(T input) throws FormattedException; - public void addDimensionExclusion(String dimension); -} diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/ByteBufferSerializer.java b/indexing-common/src/main/java/com/metamx/druid/kv/ByteBufferSerializer.java deleted file mode 100644 index 93f49451941..00000000000 --- a/indexing-common/src/main/java/com/metamx/druid/kv/ByteBufferSerializer.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.metamx.druid.kv; - -import com.google.common.primitives.Ints; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.channels.WritableByteChannel; - -/** - */ -public class ByteBufferSerializer -{ - public static T read(ByteBuffer buffer, ObjectStrategy strategy) - { - int size = buffer.getInt(); - ByteBuffer bufferToUse = buffer.asReadOnlyBuffer(); - bufferToUse.limit(bufferToUse.position() + size); - buffer.position(bufferToUse.limit()); - - return strategy.fromByteBuffer(bufferToUse, size); - } - - public static void writeToChannel(T obj, ObjectStrategy strategy, WritableByteChannel channel) - throws IOException - { - byte[] toWrite = strategy.toBytes(obj); - channel.write(ByteBuffer.allocate(Ints.BYTES).putInt(0, toWrite.length)); - channel.write(ByteBuffer.wrap(toWrite)); - } -} diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/SingleIndexedInts.java b/indexing-common/src/main/java/com/metamx/druid/kv/SingleIndexedInts.java deleted file mode 100644 index 57bd0d957bb..00000000000 --- a/indexing-common/src/main/java/com/metamx/druid/kv/SingleIndexedInts.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.metamx.druid.kv; - -import com.google.common.collect.Iterators; -import io.druid.data.IndexedInts; - -import java.util.Iterator; - -/** -*/ -public class SingleIndexedInts implements IndexedInts -{ - private final int value; - - public SingleIndexedInts(int value) { - this.value = value; - } - - @Override - public int size() - { - return 1; - } - - @Override - public int get(int index) - { - return value; - } - - @Override - public Iterator iterator() - { - return Iterators.singletonIterator(value); - } -} diff --git a/indexing-hadoop/pom.xml b/indexing-hadoop/pom.xml index be2d75deff9..1571eacff50 100644 --- a/indexing-hadoop/pom.xml +++ b/indexing-hadoop/pom.xml @@ -1,7 +1,7 @@ @@ -99,13 +111,6 @@ easymock test - - com.metamx.druid - druid-indexing-common - ${project.parent.version} - test-jar - test - diff --git a/processing/src/main/java/io/druid/data/input/ByteBufferInputRowParser.java b/processing/src/main/java/io/druid/data/input/ByteBufferInputRowParser.java new file mode 100644 index 00000000000..d033013bc6d --- /dev/null +++ b/processing/src/main/java/io/druid/data/input/ByteBufferInputRowParser.java @@ -0,0 +1,33 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.data.input; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import java.nio.ByteBuffer; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = StringInputRowParser.class) +@JsonSubTypes(value = { + @JsonSubTypes.Type(name = "protobuf", value = ProtoBufInputRowParser.class), + @JsonSubTypes.Type(name = "string", value = StringInputRowParser.class) +}) +public interface ByteBufferInputRowParser extends InputRowParser { +} diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/CSVDataSpec.java b/processing/src/main/java/io/druid/data/input/CSVDataSpec.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/indexer/data/CSVDataSpec.java rename to processing/src/main/java/io/druid/data/input/CSVDataSpec.java index 60303703e18..c0cedfe2095 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/CSVDataSpec.java +++ b/processing/src/main/java/io/druid/data/input/CSVDataSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.indexer.data; +package io.druid.data.input; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -25,7 +25,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.metamx.common.parsers.CSVParser; import com.metamx.common.parsers.Parser; -import com.metamx.druid.index.v1.SpatialDimensionSchema; +import io.druid.segment.incremental.SpatialDimensionSchema; import java.util.List; diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/DataSpec.java b/processing/src/main/java/io/druid/data/input/DataSpec.java similarity index 91% rename from indexing-common/src/main/java/com/metamx/druid/indexer/data/DataSpec.java rename to processing/src/main/java/io/druid/data/input/DataSpec.java index 099d0c8d535..b45faec2a9a 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/DataSpec.java +++ b/processing/src/main/java/io/druid/data/input/DataSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.indexer.data; +package io.druid.data.input; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.metamx.common.parsers.Parser; -import com.metamx.druid.index.v1.SpatialDimensionSchema; +import io.druid.segment.incremental.SpatialDimensionSchema; import java.util.List; diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/DelimitedDataSpec.java b/processing/src/main/java/io/druid/data/input/DelimitedDataSpec.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/indexer/data/DelimitedDataSpec.java rename to processing/src/main/java/io/druid/data/input/DelimitedDataSpec.java index c9aa2d253ce..f9e819f07ec 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/DelimitedDataSpec.java +++ b/processing/src/main/java/io/druid/data/input/DelimitedDataSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.indexer.data; +package io.druid.data.input; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -25,7 +25,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.metamx.common.parsers.DelimitedParser; import com.metamx.common.parsers.Parser; -import com.metamx.druid.index.v1.SpatialDimensionSchema; +import io.druid.segment.incremental.SpatialDimensionSchema; import java.util.List; diff --git a/processing/src/main/java/io/druid/data/input/InputRowParser.java b/processing/src/main/java/io/druid/data/input/InputRowParser.java new file mode 100644 index 00000000000..d4159437cee --- /dev/null +++ b/processing/src/main/java/io/druid/data/input/InputRowParser.java @@ -0,0 +1,29 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.data.input; + +import com.metamx.common.exception.FormattedException; +import com.metamx.druid.input.InputRow; + +public interface InputRowParser +{ + public InputRow parse(T input) throws FormattedException; + public void addDimensionExclusion(String dimension); +} diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/JSONDataSpec.java b/processing/src/main/java/io/druid/data/input/JSONDataSpec.java similarity index 93% rename from indexing-common/src/main/java/com/metamx/druid/indexer/data/JSONDataSpec.java rename to processing/src/main/java/io/druid/data/input/JSONDataSpec.java index 0f07161b4bf..9badb3e2527 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/JSONDataSpec.java +++ b/processing/src/main/java/io/druid/data/input/JSONDataSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,14 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.indexer.data; +package io.druid.data.input; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Lists; import com.metamx.common.parsers.JSONParser; import com.metamx.common.parsers.Parser; -import com.metamx.druid.index.v1.SpatialDimensionSchema; +import io.druid.segment.incremental.SpatialDimensionSchema; import java.util.List; diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/MapInputRowParser.java b/processing/src/main/java/io/druid/data/input/MapInputRowParser.java similarity index 77% rename from indexing-common/src/main/java/com/metamx/druid/indexer/data/MapInputRowParser.java rename to processing/src/main/java/io/druid/data/input/MapInputRowParser.java index b39b70471fa..a152f3acd59 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/MapInputRowParser.java +++ b/processing/src/main/java/io/druid/data/input/MapInputRowParser.java @@ -1,4 +1,23 @@ -package com.metamx.druid.indexer.data; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.data.input; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ProtoBufInputRowParser.java b/processing/src/main/java/io/druid/data/input/ProtoBufInputRowParser.java similarity index 71% rename from indexing-common/src/main/java/com/metamx/druid/indexer/data/ProtoBufInputRowParser.java rename to processing/src/main/java/io/druid/data/input/ProtoBufInputRowParser.java index 3130a86a1b4..ec5d33362a5 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ProtoBufInputRowParser.java +++ b/processing/src/main/java/io/druid/data/input/ProtoBufInputRowParser.java @@ -1,4 +1,23 @@ -package com.metamx.druid.indexer.data; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.data.input; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -9,6 +28,7 @@ import com.google.protobuf.Descriptors; import com.google.protobuf.DynamicMessage; import com.google.protobuf.InvalidProtocolBufferException; import com.metamx.common.exception.FormattedException; +import com.metamx.common.logger.Logger; import com.metamx.druid.input.InputRow; import java.io.InputStream; @@ -22,6 +42,7 @@ import static com.google.protobuf.Descriptors.FileDescriptor; public class ProtoBufInputRowParser implements ByteBufferInputRowParser { + private static final Logger log = new Logger(ProtoBufInputRowParser.class); private final MapInputRowParser inputRowCreator; private final Descriptor descriptor; @@ -42,8 +63,8 @@ public class ProtoBufInputRowParser implements ByteBufferInputRowParser @Override public InputRow parse(ByteBuffer input) throws FormattedException { - // TODO there should be a ProtoBufBasedInputRow that does not need an intermediate map but accesses - // the DynamicMessage directly + // We should really create a ProtoBufBasedInputRow that does not need an intermediate map but accesses + // the DynamicMessage directly... Map theMap = buildStringKeyMap(input); return inputRowCreator.parse(theMap); @@ -64,9 +85,8 @@ public class ProtoBufInputRowParser implements ByteBufferInputRowParser if (theMap.containsKey(name)) { continue; - // TODO - // throw new RuntimeException("dupicate key " + name + " in " + - // message); + // Perhaps throw an exception here? + // throw new RuntimeException("dupicate key " + name + " in " + message); } Object value = entry.getValue(); if(value instanceof Descriptors.EnumValueDescriptor) { @@ -79,8 +99,7 @@ public class ProtoBufInputRowParser implements ByteBufferInputRowParser } catch (InvalidProtocolBufferException e) { - // TODO - e.printStackTrace(); + log.warn(e, "Problem with protobuf something"); } return theMap; } diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java b/processing/src/main/java/io/druid/data/input/StringInputRowParser.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java rename to processing/src/main/java/io/druid/data/input/StringInputRowParser.java index 3d23d5d1dde..28b9bff649f 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java +++ b/processing/src/main/java/io/druid/data/input/StringInputRowParser.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.indexer.data; +package io.druid.data.input; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/TimestampSpec.java b/processing/src/main/java/io/druid/data/input/TimestampSpec.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/indexer/data/TimestampSpec.java rename to processing/src/main/java/io/druid/data/input/TimestampSpec.java index ab216a2b415..4052cb63537 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/TimestampSpec.java +++ b/processing/src/main/java/io/druid/data/input/TimestampSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.indexer.data; +package io.druid.data.input; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.metamx.common.parsers.ParserUtils; - import org.joda.time.DateTime; import java.util.Map; diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ToLowercaseDataSpec.java b/processing/src/main/java/io/druid/data/input/ToLowercaseDataSpec.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/indexer/data/ToLowercaseDataSpec.java rename to processing/src/main/java/io/druid/data/input/ToLowercaseDataSpec.java index c4eda7ffc55..cba57080af6 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/ToLowercaseDataSpec.java +++ b/processing/src/main/java/io/druid/data/input/ToLowercaseDataSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.indexer.data; +package io.druid.data.input; import com.fasterxml.jackson.annotation.JsonValue; import com.metamx.common.parsers.Parser; import com.metamx.common.parsers.ToLowerCaseParser; -import com.metamx.druid.index.v1.SpatialDimensionSchema; +import io.druid.segment.incremental.SpatialDimensionSchema; import java.util.List; diff --git a/processing/src/main/java/io/druid/granularity/AllGranularity.java b/processing/src/main/java/io/druid/granularity/AllGranularity.java new file mode 100644 index 00000000000..eebe4c43ab1 --- /dev/null +++ b/processing/src/main/java/io/druid/granularity/AllGranularity.java @@ -0,0 +1,74 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.granularity; + +import com.google.common.collect.ImmutableList; + +public final class AllGranularity extends BaseQueryGranularity +{ + @Override + public long next(long offset) + { + return Long.MAX_VALUE; + } + + @Override + public long truncate(long offset) + { + return Long.MIN_VALUE; + } + + @Override + public byte[] cacheKey() + { + return new byte[]{0x7f}; + } + + @Override + public Iterable iterable(long start, long end) + { + return ImmutableList.of(start); + } + + @Override + public boolean equals(Object o) + { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + return true; + } + + @Override + public int hashCode() + { + return 0; + } + + @Override + public String toString() + { + return "AllGranularity"; + } +} diff --git a/processing/src/main/java/io/druid/granularity/BaseQueryGranularity.java b/processing/src/main/java/io/druid/granularity/BaseQueryGranularity.java new file mode 100644 index 00000000000..b9755a4ed03 --- /dev/null +++ b/processing/src/main/java/io/druid/granularity/BaseQueryGranularity.java @@ -0,0 +1,83 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.granularity; + +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); + + public abstract long truncate(long offset); + + public abstract byte[] cacheKey(); + + public DateTime toDateTime(long offset) + { + return new DateTime(offset, DateTimeZone.UTC); + } + + public Iterable iterable(final long start, final long end) + { + return new Iterable() + { + @Override + public Iterator iterator() + { + return new Iterator() + { + long curr = truncate(start); + long next = BaseQueryGranularity.this.next(curr); + + @Override + public boolean hasNext() + { + return curr < end; + } + + @Override + public Long next() + { + if (!hasNext()) { + throw new NoSuchElementException(); + } + + long retVal = curr; + + curr = next; + next = BaseQueryGranularity.this.next(curr); + + return retVal; + } + + @Override + public void remove() + { + throw new UnsupportedOperationException(); + } + }; + } + }; + } +} diff --git a/processing/src/main/java/io/druid/granularity/DurationGranularity.java b/processing/src/main/java/io/druid/granularity/DurationGranularity.java new file mode 100644 index 00000000000..a4e8393eabd --- /dev/null +++ b/processing/src/main/java/io/druid/granularity/DurationGranularity.java @@ -0,0 +1,128 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.granularity; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.primitives.Longs; +import org.joda.time.DateTime; + +import java.nio.ByteBuffer; + +public class DurationGranularity extends BaseQueryGranularity +{ + private final long length; + private final long origin; + + @JsonCreator + public DurationGranularity( + @JsonProperty("duration") long duration, + @JsonProperty("origin") DateTime origin + ) + { + this(duration, origin == null ? 0 : origin.getMillis()); + } + + public DurationGranularity(long millis, long origin) + { + this.length = millis; + this.origin = origin % length; + } + + @JsonProperty("duration") + public long getDuration() + { + return length; + } + + @JsonProperty("origin") + public DateTime getOrigin() + { + return new DateTime(origin); + } + + public long getOriginMillis() + { + return origin; + } + + @Override + public long next(long t) + { + return t + getDurationMillis(); + } + + @Override + public long truncate(long t) + { + final long duration = getDurationMillis(); + return t - t % duration + origin; + } + + @Override + public byte[] cacheKey() + { + return ByteBuffer.allocate(2 * Longs.BYTES).putLong(length).putLong(origin).array(); + } + + public long getDurationMillis() + { + return length; + } + + @Override + public boolean equals(Object o) + { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DurationGranularity that = (DurationGranularity) o; + + if (length != that.length) { + return false; + } + if (origin != that.origin) { + return false; + } + + return true; + } + + @Override + public int hashCode() + { + int result = (int) (length ^ (length >>> 32)); + result = 31 * result + (int) (origin ^ (origin >>> 32)); + return result; + } + + @Override + public String toString() + { + return "DurationGranularity{" + + "length=" + length + + ", origin=" + origin + + '}'; + } +} diff --git a/processing/src/main/java/io/druid/granularity/NoneGranularity.java b/processing/src/main/java/io/druid/granularity/NoneGranularity.java new file mode 100644 index 00000000000..3cf9398733a --- /dev/null +++ b/processing/src/main/java/io/druid/granularity/NoneGranularity.java @@ -0,0 +1,66 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.granularity; + +public final class NoneGranularity extends BaseQueryGranularity +{ + @Override + public long next(long offset) + { + return offset + 1; + } + + @Override + public long truncate(long offset) + { + return offset; + } + + @Override + public byte[] cacheKey() + { + return new byte[]{0x0}; + } + + @Override + public boolean equals(Object o) + { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + return true; + } + + @Override + public int hashCode() + { + return 0; + } + + @Override + public String toString() + { + return "NoneGranularity"; + } +} diff --git a/processing/src/main/java/io/druid/granularity/PeriodGranularity.java b/processing/src/main/java/io/druid/granularity/PeriodGranularity.java new file mode 100644 index 00000000000..cc8faf66d41 --- /dev/null +++ b/processing/src/main/java/io/druid/granularity/PeriodGranularity.java @@ -0,0 +1,375 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.granularity; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.joda.time.Chronology; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.joda.time.Period; +import org.joda.time.chrono.ISOChronology; + +public class PeriodGranularity extends BaseQueryGranularity +{ + private final Period period; + private final Chronology chronology; + private final long origin; + private final boolean hasOrigin; + + private final boolean isCompound; + + @JsonCreator + public PeriodGranularity( + @JsonProperty("period") Period period, + @JsonProperty("origin") DateTime origin, + @JsonProperty("timeZone") DateTimeZone tz + ) + { + this.period = period; + this.chronology = tz == null ? ISOChronology.getInstanceUTC() : ISOChronology.getInstance(tz); + if(origin == null) + { + // default to origin in given time zone when aligning multi-period granularities + this.origin = new DateTime(0, DateTimeZone.UTC).withZoneRetainFields(chronology.getZone()).getMillis(); + this.hasOrigin = false; + } + else + { + this.origin = origin.getMillis(); + this.hasOrigin = true; + } + this.isCompound = isCompoundPeriod(period); + } + + @JsonProperty("period") + public Period getPeriod() + { + return period; + } + + @JsonProperty("timeZone") + public DateTimeZone getTimeZone() + { + return chronology.getZone(); + } + + @JsonProperty("origin") + public DateTime getOrigin() + { + return hasOrigin ? new DateTime(origin) : null; + } + + @Override + public DateTime toDateTime(long t) + { + return new DateTime(t, chronology.getZone()); + } + + @Override + public long next(long t) + { + return chronology.add(period, t, 1); + } + + @Override + public long truncate(long t) + { + if(isCompound) + { + try { + return truncateMillisPeriod(t); + } catch(UnsupportedOperationException e) { + return truncateCompoundPeriod(t); + } + } + + final int years = period.getYears(); + if(years > 0) + { + if(years > 1 || hasOrigin) + { + int y = chronology.years().getDifference(t, origin); + y -= y % years; + long tt = chronology.years().add(origin, y); + // always round down to the previous period (for timestamps prior to origin) + if(t < tt) t = chronology.years().add(tt, -years); + else t = tt; + return t; + } + else + { + return chronology.year().roundFloor(t); + } + } + + final int months = period.getMonths(); + if(months > 0) + { + if(months > 1 || hasOrigin) + { + int m = chronology.months().getDifference(t, origin); + m -= m % months; + long tt = chronology.months().add(origin, m); + // always round down to the previous period (for timestamps prior to origin) + if(t < tt) t = chronology.months().add(tt, -months); + else t = tt; + return t; + } + else + { + return chronology.monthOfYear().roundFloor(t); + } + } + + final int weeks = period.getWeeks(); + if(weeks > 0) + { + if(weeks > 1 || hasOrigin) + { + // align on multiples from origin + int w = chronology.weeks().getDifference(t, origin); + w -= w % weeks; + long tt = chronology.weeks().add(origin, w); + // always round down to the previous period (for timestamps prior to origin) + if(t < tt) t = chronology.weeks().add(tt, -weeks); + else t = tt; + return t; + } + else + { + t = chronology.dayOfWeek().roundFloor(t); + // default to Monday as beginning of the week + return chronology.dayOfWeek().set(t, 1); + } + } + + final int days = period.getDays(); + if(days > 0) + { + if(days > 1 || hasOrigin) + { + // align on multiples from origin + int d = chronology.days().getDifference(t, origin); + d -= d % days; + long tt = chronology.days().add(origin, d); + // always round down to the previous period (for timestamps prior to origin) + if(t < tt) t = chronology.days().add(tt, -days); + else t = tt; + return t; + } + else + { + t = chronology.hourOfDay().roundFloor(t); + return chronology.hourOfDay().set(t, 0); + } + } + + final int hours = period.getHours(); + if(hours > 0) + { + if(hours > 1 || hasOrigin) + { + // align on multiples from origin + long h = chronology.hours().getDifferenceAsLong(t, origin); + h -= h % hours; + long tt = chronology.hours().add(origin, h); + // always round down to the previous period (for timestamps prior to origin) + if(t < tt) t = chronology.hours().add(tt, -hours); + else t = tt; + return t; + } + else + { + t = chronology.minuteOfHour().roundFloor(t); + return chronology.minuteOfHour().set(t, 0); + } + } + + final int minutes = period.getMinutes(); + if(minutes > 0) + { + // align on multiples from origin + if(minutes > 1 || hasOrigin) + { + long m = chronology.minutes().getDifferenceAsLong(t, origin); + m -= m % minutes; + long tt = chronology.minutes().add(origin, m); + // always round down to the previous period (for timestamps prior to origin) + if(t < tt) t = chronology.minutes().add(tt, -minutes); + else t = tt; + return t; + } + else + { + t = chronology.secondOfMinute().roundFloor(t); + return chronology.secondOfMinute().set(t, 0); + } + } + + final int seconds = period.getSeconds(); + if(seconds > 0) + { + // align on multiples from origin + if(seconds > 1 || hasOrigin) + { + long s = chronology.seconds().getDifferenceAsLong(t, origin); + s -= s % seconds; + long tt = chronology.seconds().add(origin, s); + // always round down to the previous period (for timestamps prior to origin) + if(t < tt) t = chronology.seconds().add(tt, -seconds); + else t = tt; + return t; + } + else + { + return chronology.millisOfSecond().set(t, 0); + } + } + + final int millis = period.getMillis(); + if(millis > 0) + { + if(millis > 1) + { + long ms = chronology.millis().getDifferenceAsLong(t, origin); + ms -= ms % millis; + long tt = chronology.millis().add(origin, ms); + // always round down to the previous period (for timestamps prior to origin) + if(t < tt) t = chronology.millis().add(tt, -millis); + else t = tt; + return t; + } + else { + return t; + } + } + + return t; + } + + private static boolean isCompoundPeriod(Period period) + { + int[] values = period.getValues(); + boolean single = false; + for(int v : values) + { + if(v > 0) + { + if(single) return true; + single = true; + } + } + return false; + } + + private long truncateCompoundPeriod(long t) + { + long current; + if(t >= origin) + { + long next = origin; + do { + current = next; + next = chronology.add(period, current, 1); + } while(t >= next); + } + else + { + current = origin; + do { + current = chronology.add(period, current, -1); + } while(t < current); + } + return current; + } + + private long truncateMillisPeriod(long t) + { + // toStandardDuration assumes days are always 24h, and hours are always 60 minutes, + // which may not always be the case, e.g if there are daylight saving changes. + if(chronology.days().isPrecise() && chronology.hours().isPrecise()) { + final long millis = period.toStandardDuration().getMillis(); + t -= t % millis + origin % millis; + return t; + } + else + { + throw new UnsupportedOperationException( + "Period cannot be converted to milliseconds as some fields mays vary in length with chronology " + + chronology.toString() + ); + } + } + + @Override + public byte[] cacheKey() + { + return (period.toString() + ":" + chronology.getZone().toString()).getBytes(); + } + + @Override + public boolean equals(Object o) + { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + PeriodGranularity that = (PeriodGranularity) o; + + if (hasOrigin != that.hasOrigin) { + return false; + } + if (origin != that.origin) { + return false; + } + if (!chronology.equals(that.chronology)) { + return false; + } + if (!period.equals(that.period)) { + return false; + } + + return true; + } + + @Override + public int hashCode() + { + int result = period.hashCode(); + result = 31 * result + chronology.hashCode(); + result = 31 * result + (int) (origin ^ (origin >>> 32)); + result = 31 * result + (hasOrigin ? 1 : 0); + return result; + } + + @Override + public String toString() + { + return "PeriodGranularity{" + + "period=" + period + + ", timeZone=" + chronology .getZone() + + ", origin=" + (hasOrigin ? origin : "null") + + '}'; + } +} diff --git a/processing/src/main/java/io/druid/granularity/QueryGranularity.java b/processing/src/main/java/io/druid/granularity/QueryGranularity.java new file mode 100644 index 00000000000..16b86ac397d --- /dev/null +++ b/processing/src/main/java/io/druid/granularity/QueryGranularity.java @@ -0,0 +1,91 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.granularity; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.metamx.common.IAE; +import org.joda.time.DateTime; +import org.joda.time.ReadableDuration; + +public abstract class QueryGranularity +{ + public abstract long next(long offset); + + public abstract long truncate(long offset); + + public abstract byte[] cacheKey(); + + public abstract DateTime toDateTime(long offset); + + public abstract Iterable iterable(final long start, final long end); + + public static final QueryGranularity ALL = new AllGranularity(); + public static final QueryGranularity NONE = new NoneGranularity(); + + public static final QueryGranularity MINUTE = fromString("MINUTE"); + public static final QueryGranularity HOUR = fromString("HOUR"); + public static final QueryGranularity DAY = fromString("DAY"); + public static final QueryGranularity SECOND = fromString("SECOND"); + + @JsonCreator + public static QueryGranularity fromString(String str) + { + String name = str.toUpperCase(); + if(name.equals("ALL")) + { + return QueryGranularity.ALL; + } + else if(name.equals("NONE")) + { + return QueryGranularity.NONE; + } + return new DurationGranularity(convertValue(str), 0); + } + + private static enum MillisIn + { + SECOND ( 1000), + MINUTE ( 60 * 1000), + FIFTEEN_MINUTE (15 * 60 * 1000), + THIRTY_MINUTE (30 * 60 * 1000), + HOUR ( 3600 * 1000), + DAY (24 * 3600 * 1000); + + private final long millis; + MillisIn(final long millis) { this.millis = millis; } + } + + private static long convertValue(Object o) + { + if(o instanceof String) + { + return MillisIn.valueOf(((String) o).toUpperCase()).millis; + } + else if(o instanceof ReadableDuration) + { + return ((ReadableDuration)o).getMillis(); + } + else if(o instanceof Number) + { + return ((Number)o).longValue(); + } + throw new IAE("Cannot convert [%s] to QueryGranularity", o.getClass()); + } +} diff --git a/client/src/main/java/com/metamx/druid/guice/QueryToolChestModule.java b/processing/src/main/java/io/druid/guice/QueryToolChestModule.java similarity index 50% rename from client/src/main/java/com/metamx/druid/guice/QueryToolChestModule.java rename to processing/src/main/java/io/druid/guice/QueryToolChestModule.java index ffdf639ea7a..8cbc9801367 100644 --- a/client/src/main/java/com/metamx/druid/guice/QueryToolChestModule.java +++ b/processing/src/main/java/io/druid/guice/QueryToolChestModule.java @@ -1,24 +1,45 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice; import com.google.common.collect.ImmutableMap; import com.google.inject.Binder; import com.google.inject.Module; import com.google.inject.TypeLiteral; import com.google.inject.multibindings.MapBinder; -import com.metamx.druid.query.group.GroupByQuery; -import com.metamx.druid.query.group.GroupByQueryConfig; -import com.metamx.druid.query.group.GroupByQueryQueryToolChest; -import com.metamx.druid.query.metadata.SegmentMetadataQuery; -import com.metamx.druid.query.metadata.SegmentMetadataQueryQueryToolChest; -import com.metamx.druid.query.search.SearchQuery; -import com.metamx.druid.query.search.SearchQueryConfig; -import com.metamx.druid.query.search.SearchQueryQueryToolChest; -import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; -import com.metamx.druid.query.timeboundary.TimeBoundaryQueryQueryToolChest; -import com.metamx.druid.query.timeseries.TimeseriesQuery; -import com.metamx.druid.query.timeseries.TimeseriesQueryQueryToolChest; +import io.druid.guice.guice.JsonConfigProvider; +import io.druid.guice.guice.LazySingleton; import io.druid.query.Query; import io.druid.query.QueryToolChest; +import io.druid.query.groupby.GroupByQuery; +import io.druid.query.groupby.GroupByQueryConfig; +import io.druid.query.groupby.GroupByQueryQueryToolChest; +import io.druid.query.metadata.SegmentMetadataQueryQueryToolChest; +import io.druid.query.metadata.metadata.SegmentMetadataQuery; +import io.druid.query.search.SearchQueryQueryToolChest; +import io.druid.query.search.search.SearchQuery; +import io.druid.query.search.search.SearchQueryConfig; +import io.druid.query.timeboundary.TimeBoundaryQuery; +import io.druid.query.timeboundary.TimeBoundaryQueryQueryToolChest; +import io.druid.query.timeseries.TimeseriesQuery; +import io.druid.query.timeseries.TimeseriesQueryQueryToolChest; import java.util.Map; diff --git a/client/src/main/java/com/metamx/druid/BaseQuery.java b/processing/src/main/java/io/druid/query/BaseQuery.java similarity index 95% rename from client/src/main/java/com/metamx/druid/BaseQuery.java rename to processing/src/main/java/io/druid/query/BaseQuery.java index 02c75bd48ac..b1e1a587123 100644 --- a/client/src/main/java/com/metamx/druid/BaseQuery.java +++ b/processing/src/main/java/io/druid/query/BaseQuery.java @@ -17,15 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.query; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.metamx.common.guava.Sequence; -import com.metamx.druid.query.segment.QuerySegmentWalker; -import io.druid.query.Query; -import io.druid.query.QueryRunner; import io.druid.query.spec.QuerySegmentSpec; import org.joda.time.Duration; import org.joda.time.Interval; @@ -55,7 +52,6 @@ public abstract class BaseQuery implements Query this.dataSource = dataSource.toLowerCase(); this.context = context; this.querySegmentSpec = querySegmentSpec; - } @JsonProperty diff --git a/client/src/main/java/com/metamx/druid/query/BySegmentQueryRunner.java b/processing/src/main/java/io/druid/query/BySegmentQueryRunner.java similarity index 92% rename from client/src/main/java/com/metamx/druid/query/BySegmentQueryRunner.java rename to processing/src/main/java/io/druid/query/BySegmentQueryRunner.java index 43b2f7be7c4..79c6a4e03a9 100644 --- a/client/src/main/java/com/metamx/druid/query/BySegmentQueryRunner.java +++ b/processing/src/main/java/io/druid/query/BySegmentQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.collect.Lists; import com.metamx.common.guava.Accumulator; @@ -26,10 +26,6 @@ import com.metamx.common.guava.Sequences; import com.metamx.common.guava.Yielder; import com.metamx.common.guava.Yielders; import com.metamx.common.guava.YieldingAccumulator; -import com.metamx.druid.result.BySegmentResultValueClass; -import com.metamx.druid.result.Result; -import io.druid.query.Query; -import io.druid.query.QueryRunner; import org.joda.time.DateTime; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/result/BySegmentResultValue.java b/processing/src/main/java/io/druid/query/BySegmentResultValue.java similarity index 92% rename from client/src/main/java/com/metamx/druid/result/BySegmentResultValue.java rename to processing/src/main/java/io/druid/query/BySegmentResultValue.java index df92619fc4d..3d2dc0802f3 100644 --- a/client/src/main/java/com/metamx/druid/result/BySegmentResultValue.java +++ b/processing/src/main/java/io/druid/query/BySegmentResultValue.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.result; +package io.druid.query; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/result/BySegmentResultValueClass.java b/processing/src/main/java/io/druid/query/BySegmentResultValueClass.java similarity index 95% rename from client/src/main/java/com/metamx/druid/result/BySegmentResultValueClass.java rename to processing/src/main/java/io/druid/query/BySegmentResultValueClass.java index 9bc3ae81e2c..c26bfb35706 100644 --- a/client/src/main/java/com/metamx/druid/result/BySegmentResultValueClass.java +++ b/processing/src/main/java/io/druid/query/BySegmentResultValueClass.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.result; +package io.druid.query; import com.fasterxml.jackson.annotation.JsonProperty; import org.joda.time.Interval; diff --git a/client/src/main/java/com/metamx/druid/query/BySegmentSkippingQueryRunner.java b/processing/src/main/java/io/druid/query/BySegmentSkippingQueryRunner.java similarity index 90% rename from client/src/main/java/com/metamx/druid/query/BySegmentSkippingQueryRunner.java rename to processing/src/main/java/io/druid/query/BySegmentSkippingQueryRunner.java index 004481a4a90..1711fb316f9 100644 --- a/client/src/main/java/com/metamx/druid/query/BySegmentSkippingQueryRunner.java +++ b/processing/src/main/java/io/druid/query/BySegmentSkippingQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.metamx.common.guava.Sequence; -import io.druid.query.Query; -import io.druid.query.QueryRunner; /** */ diff --git a/client/src/main/java/io/druid/query/CacheStrategy.java b/processing/src/main/java/io/druid/query/CacheStrategy.java similarity index 100% rename from client/src/main/java/io/druid/query/CacheStrategy.java rename to processing/src/main/java/io/druid/query/CacheStrategy.java diff --git a/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java b/processing/src/main/java/io/druid/query/ChainedExecutionQueryRunner.java similarity index 97% rename from client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java rename to processing/src/main/java/io/druid/query/ChainedExecutionQueryRunner.java index f29642e5cce..8710b627ece 100644 --- a/client/src/main/java/com/metamx/druid/query/ChainedExecutionQueryRunner.java +++ b/processing/src/main/java/io/druid/query/ChainedExecutionQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.base.Function; import com.google.common.base.Predicates; @@ -30,8 +30,6 @@ import com.metamx.common.guava.MergeIterable; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.common.logger.Logger; -import io.druid.query.Query; -import io.druid.query.QueryRunner; import java.util.Arrays; import java.util.Iterator; diff --git a/client/src/main/java/com/metamx/druid/query/ConcatQueryRunner.java b/processing/src/main/java/io/druid/query/ConcatQueryRunner.java similarity index 91% rename from client/src/main/java/com/metamx/druid/query/ConcatQueryRunner.java rename to processing/src/main/java/io/druid/query/ConcatQueryRunner.java index 95bc6dceea0..9735d0f5a94 100644 --- a/client/src/main/java/com/metamx/druid/query/ConcatQueryRunner.java +++ b/processing/src/main/java/io/druid/query/ConcatQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.base.Function; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; -import io.druid.query.Query; -import io.druid.query.QueryRunner; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/DelegatingExecutorService.java b/processing/src/main/java/io/druid/query/DelegatingExecutorService.java similarity index 97% rename from client/src/main/java/com/metamx/druid/query/DelegatingExecutorService.java rename to processing/src/main/java/io/druid/query/DelegatingExecutorService.java index f9d377694e8..5a6be3f854c 100644 --- a/client/src/main/java/com/metamx/druid/query/DelegatingExecutorService.java +++ b/processing/src/main/java/io/druid/query/DelegatingExecutorService.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import java.util.Collection; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/Druids.java b/processing/src/main/java/io/druid/query/Druids.java similarity index 95% rename from client/src/main/java/com/metamx/druid/Druids.java rename to processing/src/main/java/io/druid/query/Druids.java index b6a3aa5db6e..99d5acdc6f6 100644 --- a/client/src/main/java/com/metamx/druid/Druids.java +++ b/processing/src/main/java/io/druid/query/Druids.java @@ -17,28 +17,27 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.query; import com.google.common.collect.Lists; -import com.metamx.druid.query.filter.AndDimFilter; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.query.filter.NoopDimFilter; -import com.metamx.druid.query.filter.NotDimFilter; -import com.metamx.druid.query.filter.OrDimFilter; -import com.metamx.druid.query.filter.SelectorDimFilter; -import com.metamx.druid.query.search.InsensitiveContainsSearchQuerySpec; -import com.metamx.druid.query.search.SearchQuery; -import com.metamx.druid.query.search.SearchQuerySpec; -import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; -import com.metamx.druid.query.timeseries.TimeseriesQuery; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.SearchResultValue; -import com.metamx.druid.result.TimeBoundaryResultValue; import io.druid.granularity.QueryGranularity; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.filter.AndDimFilter; +import io.druid.query.filter.DimFilter; +import io.druid.query.filter.NoopDimFilter; +import io.druid.query.filter.NotDimFilter; +import io.druid.query.filter.OrDimFilter; +import io.druid.query.filter.SelectorDimFilter; +import io.druid.query.search.SearchResultValue; +import io.druid.query.search.search.InsensitiveContainsSearchQuerySpec; +import io.druid.query.search.search.SearchQuery; +import io.druid.query.search.search.SearchQuerySpec; import io.druid.query.spec.LegacySegmentSpec; import io.druid.query.spec.QuerySegmentSpec; +import io.druid.query.timeboundary.TimeBoundaryQuery; +import io.druid.query.timeboundary.TimeBoundaryResultValue; +import io.druid.query.timeseries.TimeseriesQuery; import org.joda.time.DateTime; import org.joda.time.Interval; @@ -295,7 +294,7 @@ public class Druids * .build(); * * - * @see com.metamx.druid.query.timeseries.TimeseriesQuery + * @see io.druid.query.timeseries.TimeseriesQuery */ public static class TimeseriesQueryBuilder { @@ -489,7 +488,7 @@ public class Druids * .build(); * * - * @see com.metamx.druid.query.search.SearchQuery + * @see io.druid.query.search.search.SearchQuery */ public static class SearchQueryBuilder { @@ -673,7 +672,7 @@ public class Druids * .build(); * * - * @see com.metamx.druid.query.timeboundary.TimeBoundaryQuery + * @see io.druid.query.timeboundary.TimeBoundaryQuery */ public static class TimeBoundaryQueryBuilder { @@ -754,7 +753,7 @@ public class Druids * .build(); * * - * @see com.metamx.druid.result.Result + * @see Result */ public static class ResultBuilder { diff --git a/client/src/main/java/com/metamx/druid/query/FinalizeResultsQueryRunner.java b/processing/src/main/java/io/druid/query/FinalizeResultsQueryRunner.java similarity index 92% rename from client/src/main/java/com/metamx/druid/query/FinalizeResultsQueryRunner.java rename to processing/src/main/java/io/druid/query/FinalizeResultsQueryRunner.java index cd0e2a3108b..77823a60730 100644 --- a/client/src/main/java/com/metamx/druid/query/FinalizeResultsQueryRunner.java +++ b/processing/src/main/java/io/druid/query/FinalizeResultsQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,18 +17,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.base.Function; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; -import com.metamx.druid.result.BySegmentResultValueClass; -import com.metamx.druid.result.Result; -import io.druid.query.Query; -import io.druid.query.QueryRunner; -import io.druid.query.QueryToolChest; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.MetricManipulationFn; diff --git a/client/src/main/java/com/metamx/druid/query/IntervalChunkingQueryRunner.java b/processing/src/main/java/io/druid/query/IntervalChunkingQueryRunner.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/IntervalChunkingQueryRunner.java rename to processing/src/main/java/io/druid/query/IntervalChunkingQueryRunner.java index bbb12ce7e01..53e889306f5 100644 --- a/client/src/main/java/com/metamx/druid/query/IntervalChunkingQueryRunner.java +++ b/processing/src/main/java/io/druid/query/IntervalChunkingQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.base.Function; import com.google.common.collect.Lists; @@ -25,8 +25,6 @@ import com.metamx.common.guava.FunctionalIterable; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import io.druid.granularity.PeriodGranularity; -import io.druid.query.Query; -import io.druid.query.QueryRunner; import io.druid.query.spec.MultipleIntervalSegmentSpec; import org.joda.time.Interval; import org.joda.time.Period; diff --git a/processing/src/main/java/io/druid/query/MapQueryToolChestWarehouse.java b/processing/src/main/java/io/druid/query/MapQueryToolChestWarehouse.java new file mode 100644 index 00000000000..c39af79654d --- /dev/null +++ b/processing/src/main/java/io/druid/query/MapQueryToolChestWarehouse.java @@ -0,0 +1,46 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query; + +import com.google.inject.Inject; + +import java.util.Map; + +/** + */ +public class MapQueryToolChestWarehouse implements QueryToolChestWarehouse +{ + private final Map, QueryToolChest> toolchests; + + @Inject + public MapQueryToolChestWarehouse( + Map, QueryToolChest> toolchests + ) + { + this.toolchests = toolchests; + } + + @Override + @SuppressWarnings("unchecked") + public > QueryToolChest getToolChest(QueryType query) + { + return toolchests.get(query.getClass()); + } +} diff --git a/client/src/main/java/com/metamx/druid/result/MetricValueExtractor.java b/processing/src/main/java/io/druid/query/MetricValueExtractor.java similarity index 89% rename from client/src/main/java/com/metamx/druid/result/MetricValueExtractor.java rename to processing/src/main/java/io/druid/query/MetricValueExtractor.java index f330a12400d..a364200f9d9 100644 --- a/client/src/main/java/com/metamx/druid/result/MetricValueExtractor.java +++ b/processing/src/main/java/io/druid/query/MetricValueExtractor.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.result; +package io.druid.query; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.Double;import java.lang.Float;import java.lang.Long;import java.lang.Number;import java.lang.Object;import java.lang.Override;import java.lang.String;import java.util.Map; +import java.util.Map; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/MetricsEmittingExecutorService.java b/processing/src/main/java/io/druid/query/MetricsEmittingExecutorService.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/MetricsEmittingExecutorService.java rename to processing/src/main/java/io/druid/query/MetricsEmittingExecutorService.java index 65f6f2833e9..4893ebd8adf 100644 --- a/client/src/main/java/com/metamx/druid/query/MetricsEmittingExecutorService.java +++ b/processing/src/main/java/io/druid/query/MetricsEmittingExecutorService.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; diff --git a/client/src/main/java/com/metamx/druid/query/MetricsEmittingQueryRunner.java b/processing/src/main/java/io/druid/query/MetricsEmittingQueryRunner.java similarity index 97% rename from client/src/main/java/com/metamx/druid/query/MetricsEmittingQueryRunner.java rename to processing/src/main/java/io/druid/query/MetricsEmittingQueryRunner.java index 9b346099a53..9da3101003c 100644 --- a/client/src/main/java/com/metamx/druid/query/MetricsEmittingQueryRunner.java +++ b/processing/src/main/java/io/druid/query/MetricsEmittingQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.base.Function; import com.metamx.common.guava.Accumulator; @@ -26,8 +26,6 @@ import com.metamx.common.guava.Yielder; import com.metamx.common.guava.YieldingAccumulator; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; -import io.druid.query.Query; -import io.druid.query.QueryRunner; import java.io.IOException; diff --git a/client/src/main/java/com/metamx/druid/query/NoopQueryRunner.java b/processing/src/main/java/io/druid/query/NoopQueryRunner.java similarity index 87% rename from client/src/main/java/com/metamx/druid/query/NoopQueryRunner.java rename to processing/src/main/java/io/druid/query/NoopQueryRunner.java index a143a43641d..355ee4f7a20 100644 --- a/client/src/main/java/com/metamx/druid/query/NoopQueryRunner.java +++ b/processing/src/main/java/io/druid/query/NoopQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; -import io.druid.query.Query; -import io.druid.query.QueryRunner; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/PrioritizedCallable.java b/processing/src/main/java/io/druid/query/PrioritizedCallable.java similarity index 93% rename from client/src/main/java/com/metamx/druid/query/PrioritizedCallable.java rename to processing/src/main/java/io/druid/query/PrioritizedCallable.java index 3771b8a03c2..e664a8d682b 100644 --- a/client/src/main/java/com/metamx/druid/query/PrioritizedCallable.java +++ b/processing/src/main/java/io/druid/query/PrioritizedCallable.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import java.util.concurrent.Callable; diff --git a/client/src/main/java/com/metamx/druid/query/PrioritizedExecutorService.java b/processing/src/main/java/io/druid/query/PrioritizedExecutorService.java similarity index 98% rename from client/src/main/java/com/metamx/druid/query/PrioritizedExecutorService.java rename to processing/src/main/java/io/druid/query/PrioritizedExecutorService.java index b3892477a3d..f390fe1b7a4 100644 --- a/client/src/main/java/com/metamx/druid/query/PrioritizedExecutorService.java +++ b/processing/src/main/java/io/druid/query/PrioritizedExecutorService.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.primitives.Ints; import com.google.common.util.concurrent.ThreadFactoryBuilder; diff --git a/client/src/main/java/com/metamx/druid/query/Queries.java b/processing/src/main/java/io/druid/query/Queries.java similarity index 98% rename from client/src/main/java/com/metamx/druid/query/Queries.java rename to processing/src/main/java/io/druid/query/Queries.java index 2913f8f6f3d..3fd1f802189 100644 --- a/client/src/main/java/com/metamx/druid/query/Queries.java +++ b/processing/src/main/java/io/druid/query/Queries.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.base.Function; import com.google.common.base.Preconditions; diff --git a/client/src/main/java/io/druid/query/Query.java b/processing/src/main/java/io/druid/query/Query.java similarity index 88% rename from client/src/main/java/io/druid/query/Query.java rename to processing/src/main/java/io/druid/query/Query.java index 342a0b332b3..daf1410308e 100644 --- a/client/src/main/java/io/druid/query/Query.java +++ b/processing/src/main/java/io/druid/query/Query.java @@ -22,13 +22,12 @@ package io.druid.query; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.metamx.common.guava.Sequence; -import com.metamx.druid.query.group.GroupByQuery; -import com.metamx.druid.query.metadata.SegmentMetadataQuery; -import com.metamx.druid.query.search.SearchQuery; -import com.metamx.druid.query.segment.QuerySegmentWalker; -import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; -import com.metamx.druid.query.timeseries.TimeseriesQuery; +import io.druid.query.groupby.GroupByQuery; +import io.druid.query.metadata.metadata.SegmentMetadataQuery; +import io.druid.query.search.search.SearchQuery; import io.druid.query.spec.QuerySegmentSpec; +import io.druid.query.timeboundary.TimeBoundaryQuery; +import io.druid.query.timeseries.TimeseriesQuery; import org.joda.time.Duration; import org.joda.time.Interval; diff --git a/client/src/main/java/com/metamx/druid/query/QueryCacheHelper.java b/processing/src/main/java/io/druid/query/QueryCacheHelper.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/QueryCacheHelper.java rename to processing/src/main/java/io/druid/query/QueryCacheHelper.java index 16b3a0836c1..d61a5778d03 100644 --- a/client/src/main/java/com/metamx/druid/query/QueryCacheHelper.java +++ b/processing/src/main/java/io/druid/query/QueryCacheHelper.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.collect.Lists; import io.druid.query.aggregation.AggregatorFactory; diff --git a/client/src/main/java/io/druid/query/QueryRunner.java b/processing/src/main/java/io/druid/query/QueryRunner.java similarity index 100% rename from client/src/main/java/io/druid/query/QueryRunner.java rename to processing/src/main/java/io/druid/query/QueryRunner.java diff --git a/processing/src/main/java/io/druid/query/QueryRunnerFactory.java b/processing/src/main/java/io/druid/query/QueryRunnerFactory.java new file mode 100644 index 00000000000..3cbe11d6241 --- /dev/null +++ b/processing/src/main/java/io/druid/query/QueryRunnerFactory.java @@ -0,0 +1,33 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query; + +import io.druid.segment.Segment; + +import java.util.concurrent.ExecutorService; + +/** + */ +public interface QueryRunnerFactory> +{ + public QueryRunner createRunner(Segment segment); + public QueryRunner mergeRunners(ExecutorService queryExecutor, Iterable> queryRunners); + public QueryToolChest getToolchest(); +} diff --git a/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentWalker.java b/processing/src/main/java/io/druid/query/QuerySegmentWalker.java similarity index 91% rename from client/src/main/java/com/metamx/druid/query/segment/QuerySegmentWalker.java rename to processing/src/main/java/io/druid/query/QuerySegmentWalker.java index 541eede6e94..8e8c6b8c0fe 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentWalker.java +++ b/processing/src/main/java/io/druid/query/QuerySegmentWalker.java @@ -17,11 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.segment; +package io.druid.query; -import io.druid.query.Query; -import io.druid.query.QueryRunner; -import io.druid.query.SegmentDescriptor; import org.joda.time.Interval; /** diff --git a/client/src/main/java/io/druid/query/QueryToolChest.java b/processing/src/main/java/io/druid/query/QueryToolChest.java similarity index 98% rename from client/src/main/java/io/druid/query/QueryToolChest.java rename to processing/src/main/java/io/druid/query/QueryToolChest.java index 4ed1e40d79e..3d4726bc434 100644 --- a/client/src/main/java/io/druid/query/QueryToolChest.java +++ b/processing/src/main/java/io/druid/query/QueryToolChest.java @@ -22,9 +22,9 @@ package io.druid.query; import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.base.Function; import com.metamx.common.guava.Sequence; +import com.metamx.druid.LogicalSegment; import com.metamx.emitter.service.ServiceMetricEvent; import io.druid.query.aggregation.MetricManipulationFn; -import io.druid.segment.LogicalSegment; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/query/QueryToolChestWarehouse.java b/processing/src/main/java/io/druid/query/QueryToolChestWarehouse.java similarity index 86% rename from client/src/main/java/com/metamx/druid/query/QueryToolChestWarehouse.java rename to processing/src/main/java/io/druid/query/QueryToolChestWarehouse.java index a7a61b2aede..c501eec5885 100644 --- a/client/src/main/java/com/metamx/druid/query/QueryToolChestWarehouse.java +++ b/processing/src/main/java/io/druid/query/QueryToolChestWarehouse.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; - -import io.druid.query.Query; -import io.druid.query.QueryToolChest; +package io.druid.query; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/ReflectionLoaderThingy.java b/processing/src/main/java/io/druid/query/ReflectionLoaderThingy.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/ReflectionLoaderThingy.java rename to processing/src/main/java/io/druid/query/ReflectionLoaderThingy.java index cd9eba24f25..75636554217 100644 --- a/client/src/main/java/com/metamx/druid/query/ReflectionLoaderThingy.java +++ b/processing/src/main/java/io/druid/query/ReflectionLoaderThingy.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.collect.Maps; import com.metamx.common.logger.Logger; diff --git a/client/src/main/java/com/metamx/druid/query/ReflectionQueryToolChestWarehouse.java b/processing/src/main/java/io/druid/query/ReflectionQueryToolChestWarehouse.java similarity index 89% rename from client/src/main/java/com/metamx/druid/query/ReflectionQueryToolChestWarehouse.java rename to processing/src/main/java/io/druid/query/ReflectionQueryToolChestWarehouse.java index 75db6b8fb2f..37ad0e979c6 100644 --- a/client/src/main/java/com/metamx/druid/query/ReflectionQueryToolChestWarehouse.java +++ b/processing/src/main/java/io/druid/query/ReflectionQueryToolChestWarehouse.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; - -import io.druid.query.Query; -import io.druid.query.QueryToolChest; +package io.druid.query; /** */ diff --git a/client/src/main/java/com/metamx/druid/result/Result.java b/processing/src/main/java/io/druid/query/Result.java similarity index 96% rename from client/src/main/java/com/metamx/druid/result/Result.java rename to processing/src/main/java/io/druid/query/Result.java index e807ce1ddfa..bb299d51c78 100644 --- a/client/src/main/java/com/metamx/druid/result/Result.java +++ b/processing/src/main/java/io/druid/query/Result.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.result; +package io.druid.query; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/ResultGranularTimestampComparator.java b/processing/src/main/java/io/druid/query/ResultGranularTimestampComparator.java similarity index 92% rename from client/src/main/java/com/metamx/druid/ResultGranularTimestampComparator.java rename to processing/src/main/java/io/druid/query/ResultGranularTimestampComparator.java index a66ae16bf6f..a7d5c509346 100644 --- a/client/src/main/java/com/metamx/druid/ResultGranularTimestampComparator.java +++ b/processing/src/main/java/io/druid/query/ResultGranularTimestampComparator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.query; import com.google.common.primitives.Longs; -import com.metamx.druid.result.Result; import io.druid.granularity.QueryGranularity; import java.util.Comparator; diff --git a/client/src/main/java/com/metamx/druid/query/ResultMergeQueryRunner.java b/processing/src/main/java/io/druid/query/ResultMergeQueryRunner.java similarity index 91% rename from client/src/main/java/com/metamx/druid/query/ResultMergeQueryRunner.java rename to processing/src/main/java/io/druid/query/ResultMergeQueryRunner.java index 5bcb3edc278..f1ba9185fe8 100644 --- a/client/src/main/java/com/metamx/druid/query/ResultMergeQueryRunner.java +++ b/processing/src/main/java/io/druid/query/ResultMergeQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,14 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.collect.Ordering; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.nary.BinaryFn; import com.metamx.druid.guava.CombiningSequence; -import io.druid.query.Query; -import io.druid.query.QueryRunner; /** */ diff --git a/client/src/main/java/io/druid/query/SegmentDescriptor.java b/processing/src/main/java/io/druid/query/SegmentDescriptor.java similarity index 98% rename from client/src/main/java/io/druid/query/SegmentDescriptor.java rename to processing/src/main/java/io/druid/query/SegmentDescriptor.java index 0146a33bcbd..6805cd3c8bd 100644 --- a/client/src/main/java/io/druid/query/SegmentDescriptor.java +++ b/processing/src/main/java/io/druid/query/SegmentDescriptor.java @@ -35,7 +35,8 @@ public class SegmentDescriptor public SegmentDescriptor( @JsonProperty("itvl") Interval interval, @JsonProperty("ver") String version, - @JsonProperty("part") int partitionNumber) + @JsonProperty("part") int partitionNumber + ) { this.interval = interval; this.version = version; diff --git a/processing/src/main/java/io/druid/query/aggregation/Aggregator.java b/processing/src/main/java/io/druid/query/aggregation/Aggregator.java new file mode 100644 index 00000000000..4ca3d64c302 --- /dev/null +++ b/processing/src/main/java/io/druid/query/aggregation/Aggregator.java @@ -0,0 +1,42 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.aggregation; + +/** + * An Aggregator is an object that can aggregate metrics. Its aggregation-related methods (namely, aggregate() and get()) + * do not take any arguments as the assumption is that the Aggregator was given something in its constructor that + * it can use to get at the next bit of data. + * + * Thus, an Aggregator can be thought of as a closure over some other thing that is stateful and changes between calls + * to aggregate(). This is currently (as of this documentation) implemented through the use of Offset and + * FloatMetricSelector objects. The Aggregator has a handle on a FloatMetricSelector object which has a handle on an Offset. + * QueryableIndex has both the Aggregators and the Offset object and iterates through the Offset calling the aggregate() + * method on the Aggregators for each applicable row. + * + * This interface is old and going away. It is being replaced by BufferAggregator + */ +public interface Aggregator { + void aggregate(); + void reset(); + Object get(); + float getFloat(); + String getName(); + void close(); +} diff --git a/processing/src/main/java/io/druid/query/aggregation/AggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/AggregatorFactory.java new file mode 100644 index 00000000000..18168b81986 --- /dev/null +++ b/processing/src/main/java/io/druid/query/aggregation/AggregatorFactory.java @@ -0,0 +1,100 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.aggregation; + +import io.druid.segment.MetricSelectorFactory; + +import java.util.Comparator; +import java.util.List; + +/** + * Processing related interface + * + * An AggregatorFactory is an object that knows how to generate an Aggregator using a MetricSelectorFactory. + * + * This is useful as an abstraction to allow Aggregator classes to be written in terms of MetricSelector objects + * without making any assumptions about how they are pulling values out of the base data. That is, the data is + * provided to the Aggregator through the MetricSelector object, so whatever creates that object gets to choose how + * the data is actually stored and accessed. + */ +public interface AggregatorFactory +{ + public Aggregator factorize(MetricSelectorFactory metricFactory); + public BufferAggregator factorizeBuffered(MetricSelectorFactory metricFactory); + public Comparator getComparator(); + + /** + * A method that knows how to combine the outputs of the getIntermediate() method from the Aggregators + * produced via factorize(). Note, even though this is called combine, this method's contract *does* + * allow for mutation of the input objects. Thus, any use of lhs or rhs after calling this method is + * highly discouraged. + * + * @param lhs The left hand side of the combine + * @param rhs The right hand side of the combine + * @return an object representing the combination of lhs and rhs, this can be a new object or a mutation of the inputs + */ + public Object combine(Object lhs, Object rhs); + + /** + * Returns an AggregatorFactory that can be used to combine the output of aggregators from this factory. This + * generally amounts to simply creating a new factory that is the same as the current except with its input + * column renamed to the same as the output column. + * + * @return a new Factory that can be used for operations on top of data output from the current factory. + */ + public AggregatorFactory getCombiningFactory(); + + /** + * A method that knows how to "deserialize" the object from whatever form it might have been put into + * in order to transfer via JSON. + * + * @param object the object to deserialize + * @return the deserialized object + */ + public Object deserialize(Object object); + + /** + * "Finalizes" the computation of an object. Primarily useful for complex types that have a different mergeable + * intermediate format than their final resultant output. + * + * @param object the object to be finalized + * @return the finalized value that should be returned for the initial query + */ + public Object finalizeComputation(Object object); + + public String getName(); + public List requiredFields(); + public byte[] getCacheKey(); + public String getTypeName(); + + /** + * Returns the maximum size that this aggregator will require in bytes for intermediate storage of results. + * + * @return the maximum number of bytes that an aggregator of this type will require for intermediate result storage. + */ + public int getMaxIntermediateSize(); + + /** + * Returns the starting value for a corresponding aggregator. For example, 0 for sums, - Infinity for max, an empty mogrifier + * + * @return the starting value for a corresponding aggregator. + */ + public Object getAggregatorStartValue(); +} diff --git a/processing/src/main/java/io/druid/query/aggregation/BufferAggregator.java b/processing/src/main/java/io/druid/query/aggregation/BufferAggregator.java new file mode 100644 index 00000000000..da581ae3064 --- /dev/null +++ b/processing/src/main/java/io/druid/query/aggregation/BufferAggregator.java @@ -0,0 +1,96 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.aggregation; + +import java.nio.ByteBuffer; + +/** + * A BufferAggregator is an object that can aggregate metrics into a ByteBuffer. Its aggregation-related methods + * (namely, aggregate(...) and get(...)) only take the ByteBuffer and position because it is assumed that the Aggregator + * was given something (one or more MetricSelector(s)) in its constructor that it can use to get at the next bit of data. + * + * Thus, an Aggregator can be thought of as a closure over some other thing that is stateful and changes between calls + * to aggregate(...). + */ +public interface BufferAggregator +{ + /** + * Initializes the buffer location + * + * Implementations of this method must initialize the byte buffer at the given position + * + * Implementations must not change the position, limit or mark of the given buffer + * + * This method must not exceed the number of bytes returned by {@link AggregatorFactory#getMaxIntermediateSize()} + * in the corresponding {@link AggregatorFactory} + * + * @param buf byte buffer to initialize + * @param position offset within the byte buffer for initialization + */ + void init(ByteBuffer buf, int position); + + /** + * Aggregates metric values into the given aggregate byte representation + * + * Implementations of this method must read in the aggregate value from the buffer at the given position, + * aggregate the next element of data and write the updated aggregate value back into the buffer. + * + * Implementations must not change the position, limit or mark of the given buffer + * + * @param buf byte buffer storing the byte array representation of the aggregate + * @param position offset within the byte buffer at which the current aggregate value is stored + */ + void aggregate(ByteBuffer buf, int position); + + /** + * Returns the intermediate object representation of the given aggregate. + * + * Converts the given byte buffer representation into an intermediate aggregate Object + * + * Implementations must not change the position, limit or mark of the given buffer + * + * @param buf byte buffer storing the byte array representation of the aggregate + * @param position offset within the byte buffer at which the aggregate value is stored + * @return the Object representation of the aggregate + */ + Object get(ByteBuffer buf, int position); + + /** + * Returns the float representation of the given aggregate byte array + * + * Converts the given byte buffer representation into the intermediate aggregate value. + * + * Implementations must not change the position, limit or mark of the given buffer + * + * Implementations are only required to support this method if they are aggregations which + * have an {@link AggregatorFactory#getTypeName()} of "float". + * If unimplemented, throwing an {@link UnsupportedOperationException} is common and recommended. + * + * @param buf byte buffer storing the byte array representation of the aggregate + * @param position offset within the byte buffer at which the aggregate value is stored + * @return the float representation of the aggregate + */ + float getFloat(ByteBuffer buf, int position); + + /** + * Release any resources used by the aggregator + */ + void close(); +} diff --git a/client/src/main/java/io/druid/query/aggregation/MetricManipulationFn.java b/processing/src/main/java/io/druid/query/aggregation/MetricManipulationFn.java similarity index 100% rename from client/src/main/java/io/druid/query/aggregation/MetricManipulationFn.java rename to processing/src/main/java/io/druid/query/aggregation/MetricManipulationFn.java diff --git a/processing/src/main/java/io/druid/query/aggregation/PostAggregator.java b/processing/src/main/java/io/druid/query/aggregation/PostAggregator.java new file mode 100644 index 00000000000..37d0ce3e03b --- /dev/null +++ b/processing/src/main/java/io/druid/query/aggregation/PostAggregator.java @@ -0,0 +1,38 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.aggregation; + +import java.util.Comparator; +import java.util.Map; +import java.util.Set; + +/** + * Functionally similar to an Aggregator. See the Aggregator interface for more comments. + */ +public interface PostAggregator +{ + public Set getDependentFields(); + + public Comparator getComparator(); + + public Object compute(Map combinedAggregators); + + public String getName(); +} diff --git a/client/src/main/java/com/metamx/druid/query/dimension/DefaultDimensionSpec.java b/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/dimension/DefaultDimensionSpec.java rename to processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java index 2f57b60135f..3a9137b008e 100644 --- a/client/src/main/java/com/metamx/druid/query/dimension/DefaultDimensionSpec.java +++ b/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.dimension; +package io.druid.query.dimension; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.query.extraction.DimExtractionFn; +import io.druid.query.extraction.DimExtractionFn; import java.nio.ByteBuffer; diff --git a/client/src/main/java/com/metamx/druid/query/dimension/DimensionSpec.java b/processing/src/main/java/io/druid/query/dimension/DimensionSpec.java similarity index 93% rename from client/src/main/java/com/metamx/druid/query/dimension/DimensionSpec.java rename to processing/src/main/java/io/druid/query/dimension/DimensionSpec.java index 09c2b4316d8..3c552e20763 100644 --- a/client/src/main/java/com/metamx/druid/query/dimension/DimensionSpec.java +++ b/processing/src/main/java/io/druid/query/dimension/DimensionSpec.java @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.dimension; +package io.druid.query.dimension; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.metamx.druid.query.extraction.DimExtractionFn; +import io.druid.query.extraction.DimExtractionFn; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/dimension/ExtractionDimensionSpec.java b/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/dimension/ExtractionDimensionSpec.java rename to processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java index 1089df851d5..82fba73d0a1 100644 --- a/client/src/main/java/com/metamx/druid/query/dimension/ExtractionDimensionSpec.java +++ b/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.dimension; +package io.druid.query.dimension; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.query.extraction.DimExtractionFn; +import io.druid.query.extraction.DimExtractionFn; import java.nio.ByteBuffer; diff --git a/client/src/main/java/com/metamx/druid/query/dimension/LegacyDimensionSpec.java b/processing/src/main/java/io/druid/query/dimension/LegacyDimensionSpec.java similarity index 94% rename from client/src/main/java/com/metamx/druid/query/dimension/LegacyDimensionSpec.java rename to processing/src/main/java/io/druid/query/dimension/LegacyDimensionSpec.java index 352142c1166..6e1088ed788 100644 --- a/client/src/main/java/com/metamx/druid/query/dimension/LegacyDimensionSpec.java +++ b/processing/src/main/java/io/druid/query/dimension/LegacyDimensionSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.dimension; +package io.druid.query.dimension; import com.fasterxml.jackson.annotation.JsonCreator; import com.metamx.common.IAE; diff --git a/client/src/main/java/com/metamx/druid/query/extraction/DimExtractionFn.java b/processing/src/main/java/io/druid/query/extraction/DimExtractionFn.java similarity index 97% rename from client/src/main/java/com/metamx/druid/query/extraction/DimExtractionFn.java rename to processing/src/main/java/io/druid/query/extraction/DimExtractionFn.java index 88326e536bb..65b5c2a5d7b 100644 --- a/client/src/main/java/com/metamx/druid/query/extraction/DimExtractionFn.java +++ b/processing/src/main/java/io/druid/query/extraction/DimExtractionFn.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.extraction; +package io.druid.query.extraction; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/client/src/main/java/com/metamx/druid/query/extraction/PartialDimExtractionFn.java b/processing/src/main/java/io/druid/query/extraction/PartialDimExtractionFn.java similarity index 97% rename from client/src/main/java/com/metamx/druid/query/extraction/PartialDimExtractionFn.java rename to processing/src/main/java/io/druid/query/extraction/PartialDimExtractionFn.java index 4dc830e5aa7..5ae4e2bf019 100644 --- a/client/src/main/java/com/metamx/druid/query/extraction/PartialDimExtractionFn.java +++ b/processing/src/main/java/io/druid/query/extraction/PartialDimExtractionFn.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.extraction; +package io.druid.query.extraction; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/extraction/RegexDimExtractionFn.java b/processing/src/main/java/io/druid/query/extraction/RegexDimExtractionFn.java similarity index 97% rename from client/src/main/java/com/metamx/druid/query/extraction/RegexDimExtractionFn.java rename to processing/src/main/java/io/druid/query/extraction/RegexDimExtractionFn.java index c839486e816..c25d0ba6c7a 100644 --- a/client/src/main/java/com/metamx/druid/query/extraction/RegexDimExtractionFn.java +++ b/processing/src/main/java/io/druid/query/extraction/RegexDimExtractionFn.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.extraction; +package io.druid.query.extraction; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFn.java b/processing/src/main/java/io/druid/query/extraction/SearchQuerySpecDimExtractionFn.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFn.java rename to processing/src/main/java/io/druid/query/extraction/SearchQuerySpecDimExtractionFn.java index 0d5f674c011..02c13eca630 100644 --- a/client/src/main/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFn.java +++ b/processing/src/main/java/io/druid/query/extraction/SearchQuerySpecDimExtractionFn.java @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.extraction; +package io.druid.query.extraction; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.query.search.SearchQuerySpec; +import io.druid.query.search.search.SearchQuerySpec; import java.nio.ByteBuffer; diff --git a/client/src/main/java/com/metamx/druid/query/extraction/TimeDimExtractionFn.java b/processing/src/main/java/io/druid/query/extraction/TimeDimExtractionFn.java similarity index 98% rename from client/src/main/java/com/metamx/druid/query/extraction/TimeDimExtractionFn.java rename to processing/src/main/java/io/druid/query/extraction/TimeDimExtractionFn.java index 1f8b834279b..57b7f6617d8 100644 --- a/client/src/main/java/com/metamx/druid/query/extraction/TimeDimExtractionFn.java +++ b/processing/src/main/java/io/druid/query/extraction/TimeDimExtractionFn.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.extraction; +package io.druid.query.extraction; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/filter/AndDimFilter.java b/processing/src/main/java/io/druid/query/filter/AndDimFilter.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/filter/AndDimFilter.java rename to processing/src/main/java/io/druid/query/filter/AndDimFilter.java index 6a1bb9109aa..00b15c42e71 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/AndDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/AndDimFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/processing/src/main/java/io/druid/query/filter/BitmapIndexSelector.java b/processing/src/main/java/io/druid/query/filter/BitmapIndexSelector.java new file mode 100644 index 00000000000..c0a2abca40b --- /dev/null +++ b/processing/src/main/java/io/druid/query/filter/BitmapIndexSelector.java @@ -0,0 +1,35 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.filter; + +import com.metamx.collections.spatial.ImmutableRTree; +import io.druid.segment.data.Indexed; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +/** + */ +public interface BitmapIndexSelector +{ + public Indexed getDimensionValues(String dimension); + public int getNumRows(); + public ImmutableConciseSet getConciseInvertedIndex(String dimension, String value); + public ImmutableConciseSet getConciseInvertedIndex(String dimension, int idx); + public ImmutableRTree getSpatialIndex(String dimension); +} diff --git a/client/src/main/java/com/metamx/druid/query/filter/DimFilter.java b/processing/src/main/java/io/druid/query/filter/DimFilter.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/filter/DimFilter.java rename to processing/src/main/java/io/druid/query/filter/DimFilter.java index 26f9bf8519c..7e303f0f253 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/DimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/DimFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/client/src/main/java/com/metamx/druid/query/filter/DimFilterCacheHelper.java b/processing/src/main/java/io/druid/query/filter/DimFilterCacheHelper.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/filter/DimFilterCacheHelper.java rename to processing/src/main/java/io/druid/query/filter/DimFilterCacheHelper.java index 02d20ea528c..5fa3a7386b6 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/DimFilterCacheHelper.java +++ b/processing/src/main/java/io/druid/query/filter/DimFilterCacheHelper.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import java.nio.ByteBuffer; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/query/filter/DimFilters.java b/processing/src/main/java/io/druid/query/filter/DimFilters.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/filter/DimFilters.java rename to processing/src/main/java/io/druid/query/filter/DimFilters.java index 0b74f443c3e..5147565d7ca 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/DimFilters.java +++ b/processing/src/main/java/io/druid/query/filter/DimFilters.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import com.google.common.base.Function; import com.google.common.collect.Lists; diff --git a/client/src/main/java/com/metamx/druid/query/filter/ExtractionDimFilter.java b/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/filter/ExtractionDimFilter.java rename to processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java index aa1fb1efd2b..8ce26f71f99 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/ExtractionDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import com.metamx.druid.query.extraction.DimExtractionFn; +import io.druid.query.extraction.DimExtractionFn; import java.nio.ByteBuffer; diff --git a/processing/src/main/java/io/druid/query/filter/Filter.java b/processing/src/main/java/io/druid/query/filter/Filter.java new file mode 100644 index 00000000000..73d39074c75 --- /dev/null +++ b/processing/src/main/java/io/druid/query/filter/Filter.java @@ -0,0 +1,30 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.filter; + +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; + +/** + */ +public interface Filter +{ + public ImmutableConciseSet goConcise(BitmapIndexSelector selector); + public ValueMatcher makeMatcher(ValueMatcherFactory factory); +} diff --git a/client/src/main/java/com/metamx/druid/query/filter/JavaScriptDimFilter.java b/processing/src/main/java/io/druid/query/filter/JavaScriptDimFilter.java similarity index 60% rename from client/src/main/java/com/metamx/druid/query/filter/JavaScriptDimFilter.java rename to processing/src/main/java/io/druid/query/filter/JavaScriptDimFilter.java index 00db76b4f05..b9cef360238 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/JavaScriptDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/JavaScriptDimFilter.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.filter; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/filter/NoopDimFilter.java b/processing/src/main/java/io/druid/query/filter/NoopDimFilter.java similarity index 92% rename from client/src/main/java/com/metamx/druid/query/filter/NoopDimFilter.java rename to processing/src/main/java/io/druid/query/filter/NoopDimFilter.java index 6ceb7f565cd..1d518c07171 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/NoopDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/NoopDimFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import java.nio.ByteBuffer; diff --git a/client/src/main/java/com/metamx/druid/query/filter/NotDimFilter.java b/processing/src/main/java/io/druid/query/filter/NotDimFilter.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/filter/NotDimFilter.java rename to processing/src/main/java/io/druid/query/filter/NotDimFilter.java index 9f690f1322d..b2037b49ba9 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/NotDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/NotDimFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/filter/OrDimFilter.java b/processing/src/main/java/io/druid/query/filter/OrDimFilter.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/filter/OrDimFilter.java rename to processing/src/main/java/io/druid/query/filter/OrDimFilter.java index 4fdde0f46bb..bb4cb769a33 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/OrDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/OrDimFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/filter/RegexDimFilter.java b/processing/src/main/java/io/druid/query/filter/RegexDimFilter.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/filter/RegexDimFilter.java rename to processing/src/main/java/io/druid/query/filter/RegexDimFilter.java index edbd1b7fc5d..0644250f819 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/RegexDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/RegexDimFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/filter/SearchQueryDimFilter.java b/processing/src/main/java/io/druid/query/filter/SearchQueryDimFilter.java similarity index 93% rename from client/src/main/java/com/metamx/druid/query/filter/SearchQueryDimFilter.java rename to processing/src/main/java/io/druid/query/filter/SearchQueryDimFilter.java index edb7ce791e0..76c5ecd0148 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/SearchQueryDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/SearchQueryDimFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Charsets; import com.google.common.base.Preconditions; -import com.metamx.druid.query.search.SearchQuerySpec; +import io.druid.query.search.search.SearchQuerySpec; import java.nio.ByteBuffer; diff --git a/client/src/main/java/com/metamx/druid/query/filter/SelectorDimFilter.java b/processing/src/main/java/io/druid/query/filter/SelectorDimFilter.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/filter/SelectorDimFilter.java rename to processing/src/main/java/io/druid/query/filter/SelectorDimFilter.java index dd2f39dfe13..b8d1580a169 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/SelectorDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/SelectorDimFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.filter; +package io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/filter/SpatialDimFilter.java b/processing/src/main/java/io/druid/query/filter/SpatialDimFilter.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/filter/SpatialDimFilter.java rename to processing/src/main/java/io/druid/query/filter/SpatialDimFilter.java index 4a50668b2e5..6899d306602 100644 --- a/client/src/main/java/com/metamx/druid/query/filter/SpatialDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/SpatialDimFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -16,7 +16,7 @@ * 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.query.filter; +package io.druid.query.filter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/processing/src/main/java/io/druid/query/filter/ValueMatcher.java b/processing/src/main/java/io/druid/query/filter/ValueMatcher.java new file mode 100644 index 00000000000..aac95f44633 --- /dev/null +++ b/processing/src/main/java/io/druid/query/filter/ValueMatcher.java @@ -0,0 +1,27 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.filter; + +/** + */ +public interface ValueMatcher +{ + public boolean matches(); +} diff --git a/processing/src/main/java/io/druid/query/filter/ValueMatcherFactory.java b/processing/src/main/java/io/druid/query/filter/ValueMatcherFactory.java new file mode 100644 index 00000000000..45834974639 --- /dev/null +++ b/processing/src/main/java/io/druid/query/filter/ValueMatcherFactory.java @@ -0,0 +1,32 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.filter; + +import com.google.common.base.Predicate; +import com.metamx.collections.spatial.search.Bound; + +/** + */ +public interface ValueMatcherFactory +{ + public ValueMatcher makeValueMatcher(String dimension, String value); + public ValueMatcher makeValueMatcher(String dimension, Predicate value); + public ValueMatcher makeValueMatcher(String dimension, Bound bound); +} diff --git a/client/src/main/java/com/metamx/druid/query/group/GroupByQuery.java b/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/group/GroupByQuery.java rename to processing/src/main/java/io/druid/query/groupby/GroupByQuery.java index dbfbc9f1bd4..bd75455bb02 100644 --- a/client/src/main/java/com/metamx/druid/query/group/GroupByQuery.java +++ b/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.group; +package io.druid.query.groupby; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -30,21 +30,20 @@ import com.google.common.collect.Lists; import com.metamx.common.ISE; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; -import com.metamx.druid.BaseQuery; import com.metamx.druid.input.Row; -import com.metamx.druid.query.Queries; -import com.metamx.druid.query.dimension.DefaultDimensionSpec; -import com.metamx.druid.query.dimension.DimensionSpec; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.query.group.having.HavingSpec; -import com.metamx.druid.query.group.orderby.DefaultLimitSpec; -import com.metamx.druid.query.group.orderby.LimitSpec; -import com.metamx.druid.query.group.orderby.NoopLimitSpec; -import com.metamx.druid.query.group.orderby.OrderByColumnSpec; import io.druid.granularity.QueryGranularity; -import io.druid.query.Query; +import io.druid.query.BaseQuery; +import io.druid.query.Queries; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.dimension.DefaultDimensionSpec; +import io.druid.query.dimension.DimensionSpec; +import io.druid.query.filter.DimFilter; +import io.druid.query.groupby.having.HavingSpec; +import io.druid.query.groupby.orderby.DefaultLimitSpec; +import io.druid.query.groupby.orderby.LimitSpec; +import io.druid.query.groupby.orderby.NoopLimitSpec; +import io.druid.query.groupby.orderby.OrderByColumnSpec; import io.druid.query.spec.LegacySegmentSpec; import io.druid.query.spec.QuerySegmentSpec; @@ -210,7 +209,7 @@ public class GroupByQuery extends BaseQuery @Override public String getType() { - return Query.GROUP_BY; + return GROUP_BY; } public Sequence applyLimit(Sequence results) diff --git a/processing/src/main/java/io/druid/query/groupby/GroupByQueryConfig.java b/processing/src/main/java/io/druid/query/groupby/GroupByQueryConfig.java new file mode 100644 index 00000000000..98062a4f4c9 --- /dev/null +++ b/processing/src/main/java/io/druid/query/groupby/GroupByQueryConfig.java @@ -0,0 +1,56 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + */ +public class GroupByQueryConfig +{ + @JsonProperty + private boolean singleThreaded = false; + + @JsonProperty + private int maxIntermediateRows = 50000; + + @JsonProperty + private int maxResults = 500000; + + public boolean isSingleThreaded() + { + return singleThreaded; + } + + public int getMaxIntermediateRows() + { + return maxIntermediateRows; + } + + public void setMaxIntermediateRows(int maxIntermediateRows) + { + this.maxIntermediateRows = maxIntermediateRows; + } + + public int getMaxResults() + { + return maxResults; + } +} diff --git a/client/src/main/java/com/metamx/druid/query/group/GroupByQueryQueryToolChest.java b/processing/src/main/java/io/druid/query/groupby/GroupByQueryQueryToolChest.java similarity index 98% rename from client/src/main/java/com/metamx/druid/query/group/GroupByQueryQueryToolChest.java rename to processing/src/main/java/io/druid/query/groupby/GroupByQueryQueryToolChest.java index d4e4e00f816..030bd20e7fd 100644 --- a/client/src/main/java/com/metamx/druid/query/group/GroupByQueryQueryToolChest.java +++ b/processing/src/main/java/io/druid/query/groupby/GroupByQueryQueryToolChest.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.group; +package io.druid.query.groupby; import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.base.Function; @@ -32,11 +32,9 @@ import com.metamx.common.guava.Accumulator; import com.metamx.common.guava.ConcatSequence; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; -import com.metamx.druid.index.v1.IncrementalIndex; import com.metamx.druid.input.MapBasedRow; import com.metamx.druid.input.Row; import com.metamx.druid.input.Rows; -import com.metamx.druid.query.dimension.DimensionSpec; import com.metamx.emitter.service.ServiceMetricEvent; import io.druid.granularity.QueryGranularity; import io.druid.query.Query; @@ -44,6 +42,8 @@ import io.druid.query.QueryRunner; import io.druid.query.QueryToolChest; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.MetricManipulationFn; +import io.druid.query.dimension.DimensionSpec; +import io.druid.segment.incremental.IncrementalIndex; import org.joda.time.Interval; import org.joda.time.Minutes; diff --git a/processing/src/main/java/io/druid/query/groupby/having/AlwaysHavingSpec.java b/processing/src/main/java/io/druid/query/groupby/having/AlwaysHavingSpec.java new file mode 100644 index 00000000000..f4e45b8bb1d --- /dev/null +++ b/processing/src/main/java/io/druid/query/groupby/having/AlwaysHavingSpec.java @@ -0,0 +1,33 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.having; + +import com.metamx.druid.input.Row; + +/** + */ +public class AlwaysHavingSpec implements HavingSpec +{ + @Override + public boolean eval(Row row) + { + return true; + } +} diff --git a/client/src/main/java/com/metamx/druid/query/group/having/AndHavingSpec.java b/processing/src/main/java/io/druid/query/groupby/having/AndHavingSpec.java similarity index 64% rename from client/src/main/java/com/metamx/druid/query/group/having/AndHavingSpec.java rename to processing/src/main/java/io/druid/query/groupby/having/AndHavingSpec.java index f474bc67c95..0cd712a976f 100644 --- a/client/src/main/java/com/metamx/druid/query/group/having/AndHavingSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/having/AndHavingSpec.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.having; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.having; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/group/having/EqualToHavingSpec.java b/processing/src/main/java/io/druid/query/groupby/having/EqualToHavingSpec.java similarity index 72% rename from client/src/main/java/com/metamx/druid/query/group/having/EqualToHavingSpec.java rename to processing/src/main/java/io/druid/query/groupby/having/EqualToHavingSpec.java index f7e5060e4e9..65eb9444df9 100644 --- a/client/src/main/java/com/metamx/druid/query/group/having/EqualToHavingSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/having/EqualToHavingSpec.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.having; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.having; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/group/having/GreaterThanHavingSpec.java b/processing/src/main/java/io/druid/query/groupby/having/GreaterThanHavingSpec.java similarity index 70% rename from client/src/main/java/com/metamx/druid/query/group/having/GreaterThanHavingSpec.java rename to processing/src/main/java/io/druid/query/groupby/having/GreaterThanHavingSpec.java index a64f5ee5050..41f7864063c 100644 --- a/client/src/main/java/com/metamx/druid/query/group/having/GreaterThanHavingSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/having/GreaterThanHavingSpec.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.having; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.having; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/group/having/HavingSpec.java b/processing/src/main/java/io/druid/query/groupby/having/HavingSpec.java similarity index 64% rename from client/src/main/java/com/metamx/druid/query/group/having/HavingSpec.java rename to processing/src/main/java/io/druid/query/groupby/having/HavingSpec.java index b40ae662534..4d1dca3ad0f 100644 --- a/client/src/main/java/com/metamx/druid/query/group/having/HavingSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/having/HavingSpec.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.having; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.having; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/client/src/main/java/com/metamx/druid/query/group/having/LessThanHavingSpec.java b/processing/src/main/java/io/druid/query/groupby/having/LessThanHavingSpec.java similarity index 70% rename from client/src/main/java/com/metamx/druid/query/group/having/LessThanHavingSpec.java rename to processing/src/main/java/io/druid/query/groupby/having/LessThanHavingSpec.java index 86ff4dfaf9c..d54e1975b59 100644 --- a/client/src/main/java/com/metamx/druid/query/group/having/LessThanHavingSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/having/LessThanHavingSpec.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.having; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.having; import com.fasterxml.jackson.annotation.JsonProperty; import com.metamx.druid.input.Row; diff --git a/client/src/main/java/com/metamx/druid/query/group/having/NotHavingSpec.java b/processing/src/main/java/io/druid/query/groupby/having/NotHavingSpec.java similarity index 60% rename from client/src/main/java/com/metamx/druid/query/group/having/NotHavingSpec.java rename to processing/src/main/java/io/druid/query/groupby/having/NotHavingSpec.java index 9324268fbda..67397a568a4 100644 --- a/client/src/main/java/com/metamx/druid/query/group/having/NotHavingSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/having/NotHavingSpec.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.having; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.having; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/group/having/OrHavingSpec.java b/processing/src/main/java/io/druid/query/groupby/having/OrHavingSpec.java similarity index 63% rename from client/src/main/java/com/metamx/druid/query/group/having/OrHavingSpec.java rename to processing/src/main/java/io/druid/query/groupby/having/OrHavingSpec.java index 76c8920182f..92a48cd7a55 100644 --- a/client/src/main/java/com/metamx/druid/query/group/having/OrHavingSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/having/OrHavingSpec.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.having; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.having; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/group/orderby/DefaultLimitSpec.java b/processing/src/main/java/io/druid/query/groupby/orderby/DefaultLimitSpec.java similarity index 98% rename from client/src/main/java/com/metamx/druid/query/group/orderby/DefaultLimitSpec.java rename to processing/src/main/java/io/druid/query/groupby/orderby/DefaultLimitSpec.java index 050527454c8..0b3933be110 100644 --- a/client/src/main/java/com/metamx/druid/query/group/orderby/DefaultLimitSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/orderby/DefaultLimitSpec.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.group.orderby; +package io.druid.query.groupby.orderby; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -32,9 +32,9 @@ import com.metamx.common.ISE; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.druid.input.Row; -import com.metamx.druid.query.dimension.DimensionSpec; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.dimension.DimensionSpec; import javax.annotation.Nullable; import java.util.ArrayList; diff --git a/client/src/main/java/com/metamx/druid/query/group/orderby/LimitSpec.java b/processing/src/main/java/io/druid/query/groupby/orderby/LimitSpec.java similarity index 93% rename from client/src/main/java/com/metamx/druid/query/group/orderby/LimitSpec.java rename to processing/src/main/java/io/druid/query/groupby/orderby/LimitSpec.java index 88037488d4a..72a4417a051 100644 --- a/client/src/main/java/com/metamx/druid/query/group/orderby/LimitSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/orderby/LimitSpec.java @@ -17,16 +17,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.group.orderby; +package io.druid.query.groupby.orderby; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.google.common.base.Function; import com.metamx.common.guava.Sequence; import com.metamx.druid.input.Row; -import com.metamx.druid.query.dimension.DimensionSpec; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.dimension.DimensionSpec; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/query/group/orderby/NoopLimitSpec.java b/processing/src/main/java/io/druid/query/groupby/orderby/NoopLimitSpec.java similarity index 93% rename from client/src/main/java/com/metamx/druid/query/group/orderby/NoopLimitSpec.java rename to processing/src/main/java/io/druid/query/groupby/orderby/NoopLimitSpec.java index 542caf29908..0e2b6f3ed78 100644 --- a/client/src/main/java/com/metamx/druid/query/group/orderby/NoopLimitSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/orderby/NoopLimitSpec.java @@ -17,15 +17,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.group.orderby; +package io.druid.query.groupby.orderby; import com.google.common.base.Function; import com.google.common.base.Functions; import com.metamx.common.guava.Sequence; import com.metamx.druid.input.Row; -import com.metamx.druid.query.dimension.DimensionSpec; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.dimension.DimensionSpec; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/query/group/orderby/OrderByColumnSpec.java b/processing/src/main/java/io/druid/query/groupby/orderby/OrderByColumnSpec.java similarity index 82% rename from client/src/main/java/com/metamx/druid/query/group/orderby/OrderByColumnSpec.java rename to processing/src/main/java/io/druid/query/groupby/orderby/OrderByColumnSpec.java index 6a02ec962f8..147f1911816 100644 --- a/client/src/main/java/com/metamx/druid/query/group/orderby/OrderByColumnSpec.java +++ b/processing/src/main/java/io/druid/query/groupby/orderby/OrderByColumnSpec.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.orderby; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.orderby; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/processing/src/main/java/io/druid/query/groupby/orderby/OrderedPriorityQueueItems.java b/processing/src/main/java/io/druid/query/groupby/orderby/OrderedPriorityQueueItems.java new file mode 100644 index 00000000000..c2ae523345a --- /dev/null +++ b/processing/src/main/java/io/druid/query/groupby/orderby/OrderedPriorityQueueItems.java @@ -0,0 +1,62 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.orderby; + +import com.google.common.collect.MinMaxPriorityQueue; + +import java.util.Iterator; + +/** + * Utility class that supports iterating a priority queue in sorted order. + */ +class OrderedPriorityQueueItems implements Iterable +{ + private MinMaxPriorityQueue rows; + + public OrderedPriorityQueueItems(MinMaxPriorityQueue rows) + { + this.rows = rows; + } + + @Override + public Iterator iterator() + { + return new Iterator() { + + @Override + public boolean hasNext() + { + return !rows.isEmpty(); + } + + @Override + public T next() + { + return rows.poll(); + } + + @Override + public void remove() + { + throw new UnsupportedOperationException("Can't remove any item from an intermediary heap for orderBy/limit"); + } + }; + } +} diff --git a/client/src/main/java/com/metamx/druid/query/group/orderby/TopNSorter.java b/processing/src/main/java/io/druid/query/groupby/orderby/TopNSorter.java similarity index 56% rename from client/src/main/java/com/metamx/druid/query/group/orderby/TopNSorter.java rename to processing/src/main/java/io/druid/query/groupby/orderby/TopNSorter.java index 7160ba62074..d612e5784be 100644 --- a/client/src/main/java/com/metamx/druid/query/group/orderby/TopNSorter.java +++ b/processing/src/main/java/io/druid/query/groupby/orderby/TopNSorter.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.orderby; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.orderby; import com.google.common.collect.ImmutableList; import com.google.common.collect.MinMaxPriorityQueue; diff --git a/client/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java b/processing/src/main/java/io/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java rename to processing/src/main/java/io/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java index 7d09f7e9d5c..40e4aeac0b5 100644 --- a/client/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java +++ b/processing/src/main/java/io/druid/query/metadata/SegmentMetadataQueryQueryToolChest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.metadata; +package io.druid.query.metadata; import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.base.Function; @@ -32,14 +32,17 @@ import com.metamx.common.guava.MergeSequence; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.nary.BinaryFn; import com.metamx.druid.collect.OrderedMergeSequence; -import com.metamx.druid.query.ResultMergeQueryRunner; import com.metamx.druid.utils.JodaUtils; import com.metamx.emitter.service.ServiceMetricEvent; import io.druid.query.CacheStrategy; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryToolChest; +import io.druid.query.ResultMergeQueryRunner; import io.druid.query.aggregation.MetricManipulationFn; +import io.druid.query.metadata.metadata.ColumnAnalysis; +import io.druid.query.metadata.metadata.SegmentAnalysis; +import io.druid.query.metadata.metadata.SegmentMetadataQuery; import org.joda.time.Interval; import org.joda.time.Minutes; diff --git a/client/src/main/java/com/metamx/druid/query/metadata/AllColumnIncluderator.java b/processing/src/main/java/io/druid/query/metadata/metadata/AllColumnIncluderator.java similarity index 91% rename from client/src/main/java/com/metamx/druid/query/metadata/AllColumnIncluderator.java rename to processing/src/main/java/io/druid/query/metadata/metadata/AllColumnIncluderator.java index cd96b5d718a..905025db7ca 100644 --- a/client/src/main/java/com/metamx/druid/query/metadata/AllColumnIncluderator.java +++ b/processing/src/main/java/io/druid/query/metadata/metadata/AllColumnIncluderator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.metadata; +package io.druid.query.metadata.metadata; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/metadata/ColumnAnalysis.java b/processing/src/main/java/io/druid/query/metadata/metadata/ColumnAnalysis.java similarity index 86% rename from client/src/main/java/com/metamx/druid/query/metadata/ColumnAnalysis.java rename to processing/src/main/java/io/druid/query/metadata/metadata/ColumnAnalysis.java index 8c353964a30..c41bd629ca4 100644 --- a/client/src/main/java/com/metamx/druid/query/metadata/ColumnAnalysis.java +++ b/processing/src/main/java/io/druid/query/metadata/metadata/ColumnAnalysis.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.metadata; +package io.druid.query.metadata.metadata; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import io.druid.segment.column.ValueType; /** */ @@ -31,7 +30,7 @@ public class ColumnAnalysis public static ColumnAnalysis error(String reason) { - return new ColumnAnalysis(ValueType.STRING, -1, null, ERROR_PREFIX + reason); + return new ColumnAnalysis("STRING", -1, null, ERROR_PREFIX + reason); } private final String type; @@ -41,21 +40,11 @@ public class ColumnAnalysis @JsonCreator public ColumnAnalysis( - @JsonProperty("type") ValueType type, + @JsonProperty("type") String type, @JsonProperty("size") long size, @JsonProperty("cardinality") Integer cardinality, @JsonProperty("errorMessage") String errorMessage ) - { - this(type.name(), size, cardinality, errorMessage); - } - - private ColumnAnalysis( - String type, - long size, - Integer cardinality, - String errorMessage - ) { this.type = type; this.size = size; diff --git a/client/src/main/java/com/metamx/druid/query/metadata/ColumnIncluderator.java b/processing/src/main/java/io/druid/query/metadata/metadata/ColumnIncluderator.java similarity index 94% rename from client/src/main/java/com/metamx/druid/query/metadata/ColumnIncluderator.java rename to processing/src/main/java/io/druid/query/metadata/metadata/ColumnIncluderator.java index 230c21a2498..5b5b09940a3 100644 --- a/client/src/main/java/com/metamx/druid/query/metadata/ColumnIncluderator.java +++ b/processing/src/main/java/io/druid/query/metadata/metadata/ColumnIncluderator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.metadata; +package io.druid.query.metadata.metadata; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/client/src/main/java/com/metamx/druid/query/metadata/ListColumnIncluderator.java b/processing/src/main/java/io/druid/query/metadata/metadata/ListColumnIncluderator.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/metadata/ListColumnIncluderator.java rename to processing/src/main/java/io/druid/query/metadata/metadata/ListColumnIncluderator.java index d6f4b99d74b..89b5cf8dd6b 100644 --- a/client/src/main/java/com/metamx/druid/query/metadata/ListColumnIncluderator.java +++ b/processing/src/main/java/io/druid/query/metadata/metadata/ListColumnIncluderator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.metadata; +package io.druid.query.metadata.metadata; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/metadata/NoneColumnIncluderator.java b/processing/src/main/java/io/druid/query/metadata/metadata/NoneColumnIncluderator.java similarity index 91% rename from client/src/main/java/com/metamx/druid/query/metadata/NoneColumnIncluderator.java rename to processing/src/main/java/io/druid/query/metadata/metadata/NoneColumnIncluderator.java index d1d66d26778..afe36427be4 100644 --- a/client/src/main/java/com/metamx/druid/query/metadata/NoneColumnIncluderator.java +++ b/processing/src/main/java/io/druid/query/metadata/metadata/NoneColumnIncluderator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.metadata; +package io.druid.query.metadata.metadata; /** */ diff --git a/client/src/main/java/com/metamx/druid/query/metadata/SegmentAnalysis.java b/processing/src/main/java/io/druid/query/metadata/metadata/SegmentAnalysis.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/metadata/SegmentAnalysis.java rename to processing/src/main/java/io/druid/query/metadata/metadata/SegmentAnalysis.java index 359e1020273..077fe3c99c6 100644 --- a/client/src/main/java/com/metamx/druid/query/metadata/SegmentAnalysis.java +++ b/processing/src/main/java/io/druid/query/metadata/metadata/SegmentAnalysis.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.metadata; +package io.druid.query.metadata.metadata; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQuery.java b/processing/src/main/java/io/druid/query/metadata/metadata/SegmentMetadataQuery.java similarity index 97% rename from client/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQuery.java rename to processing/src/main/java/io/druid/query/metadata/metadata/SegmentMetadataQuery.java index 0818f85a488..37361815968 100644 --- a/client/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQuery.java +++ b/processing/src/main/java/io/druid/query/metadata/metadata/SegmentMetadataQuery.java @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.metadata; +package io.druid.query.metadata.metadata; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.BaseQuery; +import io.druid.query.BaseQuery; import io.druid.query.Query; import io.druid.query.spec.QuerySegmentSpec; diff --git a/client/src/main/java/com/metamx/druid/result/BySegmentSearchResultValue.java b/processing/src/main/java/io/druid/query/search/BySegmentSearchResultValue.java similarity index 91% rename from client/src/main/java/com/metamx/druid/result/BySegmentSearchResultValue.java rename to processing/src/main/java/io/druid/query/search/BySegmentSearchResultValue.java index 64d2d6a7ec8..0ecbdf509c2 100644 --- a/client/src/main/java/com/metamx/druid/result/BySegmentSearchResultValue.java +++ b/processing/src/main/java/io/druid/query/search/BySegmentSearchResultValue.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.result; +package io.druid.query.search; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import com.metamx.druid.query.search.SearchHit; +import io.druid.query.BySegmentResultValue; +import io.druid.query.Result; +import io.druid.query.search.search.SearchHit; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/SearchBinaryFn.java b/processing/src/main/java/io/druid/query/search/SearchBinaryFn.java similarity index 89% rename from client/src/main/java/com/metamx/druid/SearchBinaryFn.java rename to processing/src/main/java/io/druid/query/search/SearchBinaryFn.java index b459ead8cd3..99093911739 100644 --- a/client/src/main/java/com/metamx/druid/SearchBinaryFn.java +++ b/processing/src/main/java/io/druid/query/search/SearchBinaryFn.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,17 +17,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.query.search; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.metamx.common.guava.nary.BinaryFn; -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 io.druid.granularity.AllGranularity; import io.druid.granularity.QueryGranularity; +import io.druid.query.Result; +import io.druid.query.search.search.SearchHit; +import io.druid.query.search.search.SearchSortSpec; import java.util.TreeSet; diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchQueryQueryToolChest.java b/processing/src/main/java/io/druid/query/search/SearchQueryQueryToolChest.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/search/SearchQueryQueryToolChest.java rename to processing/src/main/java/io/druid/query/search/SearchQueryQueryToolChest.java index efcdfe7e465..5fe1c591d6c 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchQueryQueryToolChest.java +++ b/processing/src/main/java/io/druid/query/search/SearchQueryQueryToolChest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search; import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.base.Function; @@ -35,21 +35,21 @@ import com.metamx.common.guava.MergeSequence; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.common.guava.nary.BinaryFn; -import com.metamx.druid.ResultGranularTimestampComparator; -import com.metamx.druid.SearchBinaryFn; import com.metamx.druid.collect.OrderedMergeSequence; -import com.metamx.druid.query.IntervalChunkingQueryRunner; -import com.metamx.druid.query.ResultMergeQueryRunner; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.result.BySegmentSearchResultValue; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.SearchResultValue; import com.metamx.emitter.service.ServiceMetricEvent; import io.druid.query.CacheStrategy; +import io.druid.query.IntervalChunkingQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryToolChest; +import io.druid.query.Result; +import io.druid.query.ResultGranularTimestampComparator; +import io.druid.query.ResultMergeQueryRunner; import io.druid.query.aggregation.MetricManipulationFn; +import io.druid.query.filter.DimFilter; +import io.druid.query.search.search.SearchHit; +import io.druid.query.search.search.SearchQuery; +import io.druid.query.search.search.SearchQueryConfig; import org.joda.time.DateTime; import org.joda.time.Interval; import org.joda.time.Minutes; diff --git a/client/src/main/java/com/metamx/druid/result/SearchResultValue.java b/processing/src/main/java/io/druid/query/search/SearchResultValue.java similarity index 93% rename from client/src/main/java/com/metamx/druid/result/SearchResultValue.java rename to processing/src/main/java/io/druid/query/search/SearchResultValue.java index 1403d111945..1ffbf510c96 100644 --- a/client/src/main/java/com/metamx/druid/result/SearchResultValue.java +++ b/processing/src/main/java/io/druid/query/search/SearchResultValue.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.result; +package io.druid.query.search; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import com.metamx.druid.query.search.SearchHit; +import io.druid.query.search.search.SearchHit; import java.util.Iterator; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/query/search/FragmentSearchQuerySpec.java b/processing/src/main/java/io/druid/query/search/search/FragmentSearchQuerySpec.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/search/FragmentSearchQuerySpec.java rename to processing/src/main/java/io/druid/query/search/search/FragmentSearchQuerySpec.java index 3abf19d5124..6f5092d6d85 100644 --- a/client/src/main/java/com/metamx/druid/query/search/FragmentSearchQuerySpec.java +++ b/processing/src/main/java/io/druid/query/search/search/FragmentSearchQuerySpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search.search; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/search/InsensitiveContainsSearchQuerySpec.java b/processing/src/main/java/io/druid/query/search/search/InsensitiveContainsSearchQuerySpec.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/search/InsensitiveContainsSearchQuerySpec.java rename to processing/src/main/java/io/druid/query/search/search/InsensitiveContainsSearchQuerySpec.java index 44b0ee07197..acc23576fea 100644 --- a/client/src/main/java/com/metamx/druid/query/search/InsensitiveContainsSearchQuerySpec.java +++ b/processing/src/main/java/io/druid/query/search/search/InsensitiveContainsSearchQuerySpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search.search; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/search/LexicographicSearchSortSpec.java b/processing/src/main/java/io/druid/query/search/search/LexicographicSearchSortSpec.java similarity index 93% rename from client/src/main/java/com/metamx/druid/query/search/LexicographicSearchSortSpec.java rename to processing/src/main/java/io/druid/query/search/search/LexicographicSearchSortSpec.java index 99ac489cadd..588aca7493a 100644 --- a/client/src/main/java/com/metamx/druid/query/search/LexicographicSearchSortSpec.java +++ b/processing/src/main/java/io/druid/query/search/search/LexicographicSearchSortSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search.search; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchHit.java b/processing/src/main/java/io/druid/query/search/search/SearchHit.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/search/SearchHit.java rename to processing/src/main/java/io/druid/query/search/search/SearchHit.java index 1b2acad6f16..d9deba2b639 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchHit.java +++ b/processing/src/main/java/io/druid/query/search/search/SearchHit.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search.search; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchQuery.java b/processing/src/main/java/io/druid/query/search/search/SearchQuery.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/search/SearchQuery.java rename to processing/src/main/java/io/druid/query/search/search/SearchQuery.java index 4e042772f04..0ca276b53a6 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchQuery.java +++ b/processing/src/main/java/io/druid/query/search/search/SearchQuery.java @@ -17,19 +17,19 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search.search; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; -import com.metamx.druid.BaseQuery; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.SearchResultValue; import io.druid.granularity.QueryGranularity; +import io.druid.query.BaseQuery; import io.druid.query.Query; +import io.druid.query.Result; +import io.druid.query.filter.DimFilter; +import io.druid.query.search.SearchResultValue; import io.druid.query.spec.QuerySegmentSpec; import javax.annotation.Nullable; diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchQueryConfig.java b/processing/src/main/java/io/druid/query/search/search/SearchQueryConfig.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/search/SearchQueryConfig.java rename to processing/src/main/java/io/druid/query/search/search/SearchQueryConfig.java index f9b06988262..611fecc2c11 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchQueryConfig.java +++ b/processing/src/main/java/io/druid/query/search/search/SearchQueryConfig.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search.search; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchQuerySpec.java b/processing/src/main/java/io/druid/query/search/search/SearchQuerySpec.java similarity index 93% rename from client/src/main/java/com/metamx/druid/query/search/SearchQuerySpec.java rename to processing/src/main/java/io/druid/query/search/search/SearchQuerySpec.java index a54aae35ea8..1a2b67cd4b5 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchQuerySpec.java +++ b/processing/src/main/java/io/druid/query/search/search/SearchQuerySpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search.search; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/client/src/main/java/com/metamx/druid/query/search/SearchSortSpec.java b/processing/src/main/java/io/druid/query/search/search/SearchSortSpec.java similarity index 93% rename from client/src/main/java/com/metamx/druid/query/search/SearchSortSpec.java rename to processing/src/main/java/io/druid/query/search/search/SearchSortSpec.java index 7510cb582e1..e2e721a4acf 100644 --- a/client/src/main/java/com/metamx/druid/query/search/SearchSortSpec.java +++ b/processing/src/main/java/io/druid/query/search/search/SearchSortSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search.search; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/client/src/main/java/com/metamx/druid/query/search/StrlenSearchSortSpec.java b/processing/src/main/java/io/druid/query/search/search/StrlenSearchSortSpec.java similarity index 93% rename from client/src/main/java/com/metamx/druid/query/search/StrlenSearchSortSpec.java rename to processing/src/main/java/io/druid/query/search/search/StrlenSearchSortSpec.java index e269c241f2d..517463ab9fe 100644 --- a/client/src/main/java/com/metamx/druid/query/search/StrlenSearchSortSpec.java +++ b/processing/src/main/java/io/druid/query/search/search/StrlenSearchSortSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search.search; import java.util.Comparator; diff --git a/client/src/main/java/io/druid/query/spec/LegacySegmentSpec.java b/processing/src/main/java/io/druid/query/spec/LegacySegmentSpec.java similarity index 100% rename from client/src/main/java/io/druid/query/spec/LegacySegmentSpec.java rename to processing/src/main/java/io/druid/query/spec/LegacySegmentSpec.java diff --git a/client/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java b/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java similarity index 97% rename from client/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java rename to processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java index 5044679f9cf..c8b1884b691 100644 --- a/client/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java @@ -21,10 +21,10 @@ package io.druid.query.spec; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.query.segment.QuerySegmentWalker; import com.metamx.druid.utils.JodaUtils; import io.druid.query.Query; import io.druid.query.QueryRunner; +import io.druid.query.QuerySegmentWalker; import org.joda.time.Interval; import java.util.Collections; diff --git a/client/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java b/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java similarity index 97% rename from client/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java rename to processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java index 993f2c01d9e..dbd536340b5 100644 --- a/client/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java @@ -23,10 +23,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.google.common.collect.Iterables; -import com.metamx.druid.query.segment.QuerySegmentWalker; import com.metamx.druid.utils.JodaUtils; import io.druid.query.Query; import io.druid.query.QueryRunner; +import io.druid.query.QuerySegmentWalker; import io.druid.query.SegmentDescriptor; import org.joda.time.Interval; diff --git a/client/src/main/java/io/druid/query/spec/QuerySegmentSpec.java b/processing/src/main/java/io/druid/query/spec/QuerySegmentSpec.java similarity index 96% rename from client/src/main/java/io/druid/query/spec/QuerySegmentSpec.java rename to processing/src/main/java/io/druid/query/spec/QuerySegmentSpec.java index 2bf8c5d7425..2a5014d76f2 100644 --- a/client/src/main/java/io/druid/query/spec/QuerySegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/QuerySegmentSpec.java @@ -21,9 +21,9 @@ package io.druid.query.spec; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.metamx.druid.query.segment.QuerySegmentWalker; import io.druid.query.Query; import io.druid.query.QueryRunner; +import io.druid.query.QuerySegmentWalker; import org.joda.time.Interval; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentSpecs.java b/processing/src/main/java/io/druid/query/spec/QuerySegmentSpecs.java similarity index 84% rename from client/src/main/java/com/metamx/druid/query/segment/QuerySegmentSpecs.java rename to processing/src/main/java/io/druid/query/spec/QuerySegmentSpecs.java index 7c61493f056..bfb3fe77a3c 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/QuerySegmentSpecs.java +++ b/processing/src/main/java/io/druid/query/spec/QuerySegmentSpecs.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.segment; +package io.druid.query.spec; -import io.druid.query.spec.LegacySegmentSpec; -import io.druid.query.spec.MultipleIntervalSegmentSpec; -import io.druid.query.spec.QuerySegmentSpec; import org.joda.time.Interval; import java.util.Arrays; diff --git a/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentQueryRunner.java b/processing/src/main/java/io/druid/query/spec/SpecificSegmentQueryRunner.java similarity index 97% rename from client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentQueryRunner.java rename to processing/src/main/java/io/druid/query/spec/SpecificSegmentQueryRunner.java index d074f45a948..e9bcd73139d 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentQueryRunner.java +++ b/processing/src/main/java/io/druid/query/spec/SpecificSegmentQueryRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.segment; +package io.druid.query.spec; import com.google.common.base.Throwables; import com.metamx.common.guava.Accumulator; @@ -26,7 +26,6 @@ import com.metamx.common.guava.Yielder; import com.metamx.common.guava.YieldingAccumulator; import io.druid.query.Query; import io.druid.query.QueryRunner; -import io.druid.query.spec.QuerySegmentSpec; import java.io.IOException; import java.util.concurrent.Callable; diff --git a/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentSpec.java b/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java similarity index 94% rename from client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentSpec.java rename to processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java index 33465daba52..be48d55e651 100644 --- a/client/src/main/java/com/metamx/druid/query/segment/SpecificSegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.segment; +package io.druid.query.spec; import io.druid.query.Query; import io.druid.query.QueryRunner; +import io.druid.query.QuerySegmentWalker; import io.druid.query.SegmentDescriptor; -import io.druid.query.spec.QuerySegmentSpec; import org.joda.time.Interval; import java.util.Arrays; diff --git a/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQuery.java b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java similarity index 96% rename from client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQuery.java rename to processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java index e32e4617d3d..957390acf15 100644 --- a/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQuery.java +++ b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java @@ -17,17 +17,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.timeboundary; +package io.druid.query.timeboundary; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import com.metamx.druid.BaseQuery; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeBoundaryResultValue; +import io.druid.query.BaseQuery; import io.druid.query.Query; +import io.druid.query.Result; import io.druid.query.spec.MultipleIntervalSegmentSpec; import io.druid.query.spec.QuerySegmentSpec; import org.joda.time.DateTime; diff --git a/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java similarity index 95% rename from client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java rename to processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java index e3e4924c418..a84f238e02d 100644 --- a/client/src/main/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java +++ b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQueryQueryToolChest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.timeboundary; +package io.druid.query.timeboundary; import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.base.Function; @@ -29,17 +29,16 @@ import com.google.common.collect.Ordering; import com.metamx.common.guava.MergeSequence; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; +import com.metamx.druid.LogicalSegment; import com.metamx.druid.collect.OrderedMergeSequence; -import com.metamx.druid.query.BySegmentSkippingQueryRunner; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeBoundaryResultValue; import com.metamx.emitter.service.ServiceMetricEvent; +import io.druid.query.BySegmentSkippingQueryRunner; import io.druid.query.CacheStrategy; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryToolChest; +import io.druid.query.Result; import io.druid.query.aggregation.MetricManipulationFn; -import io.druid.segment.LogicalSegment; import org.joda.time.DateTime; import javax.annotation.Nullable; diff --git a/client/src/main/java/com/metamx/druid/result/TimeBoundaryResultValue.java b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryResultValue.java similarity index 94% rename from client/src/main/java/com/metamx/druid/result/TimeBoundaryResultValue.java rename to processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryResultValue.java index 455119dcd28..1210e95af2c 100644 --- a/client/src/main/java/com/metamx/druid/result/TimeBoundaryResultValue.java +++ b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryResultValue.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.result; +package io.druid.query.timeboundary; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.metamx.common.IAE; -import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; - import org.joda.time.DateTime; import java.util.Map; diff --git a/client/src/main/java/com/metamx/druid/TimeseriesBinaryFn.java b/processing/src/main/java/io/druid/query/timeseries/TimeseriesBinaryFn.java similarity index 96% rename from client/src/main/java/com/metamx/druid/TimeseriesBinaryFn.java rename to processing/src/main/java/io/druid/query/timeseries/TimeseriesBinaryFn.java index 94377f543d0..f8530ce334f 100644 --- a/client/src/main/java/com/metamx/druid/TimeseriesBinaryFn.java +++ b/processing/src/main/java/io/druid/query/timeseries/TimeseriesBinaryFn.java @@ -17,13 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.query.timeseries; import com.metamx.common.guava.nary.BinaryFn; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import io.druid.granularity.AllGranularity; import io.druid.granularity.QueryGranularity; +import io.druid.query.Result; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; diff --git a/client/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQuery.java b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java similarity index 94% rename from client/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQuery.java rename to processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java index 2b962a9e7a0..ab5b649a896 100644 --- a/client/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQuery.java +++ b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java @@ -17,21 +17,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.timeseries; +package io.druid.query.timeseries; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; import com.google.common.collect.ImmutableList; -import com.metamx.druid.BaseQuery; -import com.metamx.druid.query.Queries; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import io.druid.granularity.QueryGranularity; +import io.druid.query.BaseQuery; +import io.druid.query.Queries; import io.druid.query.Query; +import io.druid.query.Result; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.filter.DimFilter; import io.druid.query.spec.QuerySegmentSpec; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryQueryToolChest.java b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQueryQueryToolChest.java similarity index 94% rename from client/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryQueryToolChest.java rename to processing/src/main/java/io/druid/query/timeseries/TimeseriesQueryQueryToolChest.java index 1dbf46a8d60..48c2cef25bf 100644 --- a/client/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryQueryToolChest.java +++ b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQueryQueryToolChest.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.timeseries; +package io.druid.query.timeseries; import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.base.Function; @@ -28,24 +28,22 @@ import com.google.common.collect.Ordering; import com.metamx.common.guava.MergeSequence; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.nary.BinaryFn; -import com.metamx.druid.ResultGranularTimestampComparator; -import com.metamx.druid.TimeseriesBinaryFn; import com.metamx.druid.collect.OrderedMergeSequence; -import com.metamx.druid.query.IntervalChunkingQueryRunner; -import com.metamx.druid.query.QueryCacheHelper; -import com.metamx.druid.query.ResultMergeQueryRunner; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import com.metamx.emitter.service.ServiceMetricEvent; import io.druid.granularity.QueryGranularity; import io.druid.query.CacheStrategy; +import io.druid.query.IntervalChunkingQueryRunner; import io.druid.query.Query; +import io.druid.query.QueryCacheHelper; import io.druid.query.QueryRunner; import io.druid.query.QueryToolChest; +import io.druid.query.Result; +import io.druid.query.ResultGranularTimestampComparator; +import io.druid.query.ResultMergeQueryRunner; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.MetricManipulationFn; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.filter.DimFilter; import org.joda.time.DateTime; import org.joda.time.Interval; import org.joda.time.Minutes; @@ -64,12 +62,11 @@ public class TimeseriesQueryQueryToolChest extends QueryToolChest> TYPE_REFERENCE = new TypeReference>() - { - }; - private static final TypeReference OBJECT_TYPE_REFERENCE = new TypeReference() - { - }; + private static final TypeReference OBJECT_TYPE_REFERENCE = + new TypeReference(){}; + + private static final TypeReference> TYPE_REFERENCE = + new TypeReference>() {}; @Override public QueryRunner> mergeResults(QueryRunner> queryRunner) diff --git a/client/src/main/java/com/metamx/druid/result/TimeseriesResultValue.java b/processing/src/main/java/io/druid/query/timeseries/TimeseriesResultValue.java similarity index 89% rename from client/src/main/java/com/metamx/druid/result/TimeseriesResultValue.java rename to processing/src/main/java/io/druid/query/timeseries/TimeseriesResultValue.java index add4bfe6b62..511494c04de 100644 --- a/client/src/main/java/com/metamx/druid/result/TimeseriesResultValue.java +++ b/processing/src/main/java/io/druid/query/timeseries/TimeseriesResultValue.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.result; +package io.druid.query.timeseries; import com.fasterxml.jackson.annotation.JsonCreator; +import io.druid.query.MetricValueExtractor; import java.util.Map; diff --git a/segment/src/main/java/io/druid/segment/Capabilities.java b/processing/src/main/java/io/druid/segment/Capabilities.java similarity index 98% rename from segment/src/main/java/io/druid/segment/Capabilities.java rename to processing/src/main/java/io/druid/segment/Capabilities.java index 574f07f4efe..ca2764d1c9a 100644 --- a/segment/src/main/java/io/druid/segment/Capabilities.java +++ b/processing/src/main/java/io/druid/segment/Capabilities.java @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment;/** +package io.druid.segment; + +/** */ public class Capabilities { diff --git a/segment/src/main/java/io/druid/segment/ColumnSelector.java b/processing/src/main/java/io/druid/segment/ColumnSelector.java similarity index 100% rename from segment/src/main/java/io/druid/segment/ColumnSelector.java rename to processing/src/main/java/io/druid/segment/ColumnSelector.java diff --git a/server/src/main/java/com/metamx/druid/index/v1/ColumnSelectorBitmapIndexSelector.java b/processing/src/main/java/io/druid/segment/ColumnSelectorBitmapIndexSelector.java similarity index 96% rename from server/src/main/java/com/metamx/druid/index/v1/ColumnSelectorBitmapIndexSelector.java rename to processing/src/main/java/io/druid/segment/ColumnSelectorBitmapIndexSelector.java index 6489655a59a..fc124621cb8 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/ColumnSelectorBitmapIndexSelector.java +++ b/processing/src/main/java/io/druid/segment/ColumnSelectorBitmapIndexSelector.java @@ -17,17 +17,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.io.Closeables; import com.metamx.collections.spatial.ImmutableRTree; -import com.metamx.druid.kv.IndexedIterable; -import io.druid.data.Indexed; import io.druid.query.filter.BitmapIndexSelector; -import io.druid.segment.ColumnSelector; import io.druid.segment.column.Column; import io.druid.segment.column.DictionaryEncodedColumn; import io.druid.segment.column.GenericColumn; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedIterable; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import java.util.Iterator; diff --git a/segment/src/main/java/io/druid/segment/ComplexMetricSelector.java b/processing/src/main/java/io/druid/segment/ComplexMetricSelector.java similarity index 96% rename from segment/src/main/java/io/druid/segment/ComplexMetricSelector.java rename to processing/src/main/java/io/druid/segment/ComplexMetricSelector.java index 67a733c00ae..0403562c1c9 100644 --- a/segment/src/main/java/io/druid/segment/ComplexMetricSelector.java +++ b/processing/src/main/java/io/druid/segment/ComplexMetricSelector.java @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment;/** +package io.druid.segment; + +/** */ public interface ComplexMetricSelector { diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedPools.java b/processing/src/main/java/io/druid/segment/CompressedPools.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedPools.java rename to processing/src/main/java/io/druid/segment/CompressedPools.java index a3061b67030..658a09d263a 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedPools.java +++ b/processing/src/main/java/io/druid/segment/CompressedPools.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.base.Supplier; import com.metamx.common.logger.Logger; diff --git a/server/src/main/java/com/metamx/druid/index/v1/ConciseOffset.java b/processing/src/main/java/io/druid/segment/ConciseOffset.java similarity index 93% rename from server/src/main/java/com/metamx/druid/index/v1/ConciseOffset.java rename to processing/src/main/java/io/druid/segment/ConciseOffset.java index b08449e687c..2fd9120f22a 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/ConciseOffset.java +++ b/processing/src/main/java/io/druid/segment/ConciseOffset.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; -import com.metamx.druid.index.v1.processing.Offset; +import io.druid.segment.data.Offset; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import it.uniroma3.mat.extendedset.intset.IntSet; diff --git a/segment/src/main/java/io/druid/segment/Cursor.java b/processing/src/main/java/io/druid/segment/Cursor.java similarity index 100% rename from segment/src/main/java/io/druid/segment/Cursor.java rename to processing/src/main/java/io/druid/segment/Cursor.java diff --git a/segment/src/main/java/io/druid/segment/CursorFactory.java b/processing/src/main/java/io/druid/segment/CursorFactory.java similarity index 100% rename from segment/src/main/java/io/druid/segment/CursorFactory.java rename to processing/src/main/java/io/druid/segment/CursorFactory.java diff --git a/segment/src/main/java/io/druid/segment/DimensionSelector.java b/processing/src/main/java/io/druid/segment/DimensionSelector.java similarity index 96% rename from segment/src/main/java/io/druid/segment/DimensionSelector.java rename to processing/src/main/java/io/druid/segment/DimensionSelector.java index 8011af47eaf..3922d345049 100644 --- a/segment/src/main/java/io/druid/segment/DimensionSelector.java +++ b/processing/src/main/java/io/druid/segment/DimensionSelector.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment;import io.druid.data.IndexedInts; +package io.druid.segment;import io.druid.segment.data.IndexedInts; /** */ diff --git a/segment/src/main/java/io/druid/segment/DimensionSelectorFactory.java b/processing/src/main/java/io/druid/segment/DimensionSelectorFactory.java similarity index 100% rename from segment/src/main/java/io/druid/segment/DimensionSelectorFactory.java rename to processing/src/main/java/io/druid/segment/DimensionSelectorFactory.java diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/FloatMetricColumnSerializer.java b/processing/src/main/java/io/druid/segment/FloatMetricColumnSerializer.java similarity index 91% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/FloatMetricColumnSerializer.java rename to processing/src/main/java/io/druid/segment/FloatMetricColumnSerializer.java index 20ec5a4d30d..4caa6b95fe2 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/FloatMetricColumnSerializer.java +++ b/processing/src/main/java/io/druid/segment/FloatMetricColumnSerializer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.io.Files; -import com.metamx.druid.kv.IOPeon; +import io.druid.segment.data.CompressedFloatsSupplierSerializer; +import io.druid.segment.data.IOPeon; import java.io.File; import java.io.IOException; diff --git a/segment/src/main/java/io/druid/segment/FloatMetricSelector.java b/processing/src/main/java/io/druid/segment/FloatMetricSelector.java similarity index 97% rename from segment/src/main/java/io/druid/segment/FloatMetricSelector.java rename to processing/src/main/java/io/druid/segment/FloatMetricSelector.java index 300ab25b0dd..f71d918a226 100644 --- a/segment/src/main/java/io/druid/segment/FloatMetricSelector.java +++ b/processing/src/main/java/io/druid/segment/FloatMetricSelector.java @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment;/** +package io.druid.segment; + +/** * An object that gets a metric value. Metric values are always floats and there is an assumption that the * FloatMetricSelector has a handle onto some other stateful object (e.g. an Offset) which is changing between calls * to get() (though, that doesn't have to be the case if you always want the same value...). diff --git a/server/src/main/java/com/metamx/druid/index/IncrementalIndexSegment.java b/processing/src/main/java/io/druid/segment/IncrementalIndexSegment.java similarity index 83% rename from server/src/main/java/com/metamx/druid/index/IncrementalIndexSegment.java rename to processing/src/main/java/io/druid/segment/IncrementalIndexSegment.java index 2675d864f60..9e04e2af836 100644 --- a/server/src/main/java/com/metamx/druid/index/IncrementalIndexSegment.java +++ b/processing/src/main/java/io/druid/segment/IncrementalIndexSegment.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index; +package io.druid.segment; -import com.metamx.druid.index.v1.IncrementalIndex; -import com.metamx.druid.index.v1.IncrementalIndexStorageAdapter; -import io.druid.segment.QueryableIndex; -import io.druid.segment.Segment; -import io.druid.segment.StorageAdapter; +import io.druid.segment.incremental.IncrementalIndex; +import io.druid.segment.incremental.IncrementalIndexStorageAdapter; import org.joda.time.Interval; import java.io.IOException; diff --git a/server/src/main/java/com/metamx/druid/index/v1/IndexGranularity.java b/processing/src/main/java/io/druid/segment/IndexGranularity.java similarity index 99% rename from server/src/main/java/com/metamx/druid/index/v1/IndexGranularity.java rename to processing/src/main/java/io/druid/segment/IndexGranularity.java index 2900d479611..29b3564b4fc 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/IndexGranularity.java +++ b/processing/src/main/java/io/druid/segment/IndexGranularity.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.fasterxml.jackson.annotation.JsonCreator; import io.druid.granularity.QueryGranularity; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexIO.java b/processing/src/main/java/io/druid/segment/IndexIO.java similarity index 88% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/IndexIO.java rename to processing/src/main/java/io/druid/segment/IndexIO.java index b2977cfbf65..38d6367a360 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexIO.java +++ b/processing/src/main/java/io/druid/segment/IndexIO.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Preconditions; @@ -39,32 +39,32 @@ import com.metamx.common.io.smoosh.Smoosh; import com.metamx.common.io.smoosh.SmooshedFileMapper; import com.metamx.common.io.smoosh.SmooshedWriter; import com.metamx.common.logger.Logger; -import com.metamx.druid.index.SimpleQueryableIndex; -import com.metamx.druid.index.column.ColumnBuilder; -import com.metamx.druid.index.column.ColumnDescriptor; -import com.metamx.druid.index.serde.BitmapIndexColumnPartSupplier; -import com.metamx.druid.index.serde.ComplexColumnPartSerde; -import com.metamx.druid.index.serde.ComplexColumnPartSupplier; -import com.metamx.druid.index.serde.DictionaryEncodedColumnPartSerde; -import com.metamx.druid.index.serde.DictionaryEncodedColumnSupplier; -import com.metamx.druid.index.serde.FloatGenericColumnPartSerde; -import com.metamx.druid.index.serde.FloatGenericColumnSupplier; -import com.metamx.druid.index.serde.LongGenericColumnPartSerde; -import com.metamx.druid.index.serde.LongGenericColumnSupplier; -import com.metamx.druid.index.serde.SpatialIndexColumnPartSupplier; import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.kv.ArrayIndexed; -import com.metamx.druid.kv.ByteBufferSerializer; -import com.metamx.druid.kv.ConciseCompressedIndexedInts; -import com.metamx.druid.kv.GenericIndexed; -import com.metamx.druid.kv.IndexedIterable; -import com.metamx.druid.kv.IndexedRTree; -import com.metamx.druid.kv.VSizeIndexed; -import com.metamx.druid.kv.VSizeIndexedInts; import com.metamx.druid.utils.SerializerUtils; -import io.druid.segment.QueryableIndex; +import com.metamx.emitter.EmittingLogger; import io.druid.segment.column.Column; +import io.druid.segment.column.ColumnBuilder; +import io.druid.segment.column.ColumnDescriptor; import io.druid.segment.column.ValueType; +import io.druid.segment.data.ArrayIndexed; +import io.druid.segment.data.ByteBufferSerializer; +import io.druid.segment.data.CompressedLongsIndexedSupplier; +import io.druid.segment.data.ConciseCompressedIndexedInts; +import io.druid.segment.data.GenericIndexed; +import io.druid.segment.data.IndexedIterable; +import io.druid.segment.data.IndexedRTree; +import io.druid.segment.data.VSizeIndexed; +import io.druid.segment.data.VSizeIndexedInts; +import io.druid.segment.serde.BitmapIndexColumnPartSupplier; +import io.druid.segment.serde.ComplexColumnPartSerde; +import io.druid.segment.serde.ComplexColumnPartSupplier; +import io.druid.segment.serde.DictionaryEncodedColumnPartSerde; +import io.druid.segment.serde.DictionaryEncodedColumnSupplier; +import io.druid.segment.serde.FloatGenericColumnPartSerde; +import io.druid.segment.serde.FloatGenericColumnSupplier; +import io.druid.segment.serde.LongGenericColumnPartSerde; +import io.druid.segment.serde.LongGenericColumnSupplier; +import io.druid.segment.serde.SpatialIndexColumnPartSupplier; import it.uniroma3.mat.extendedset.intset.ConciseSet; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import org.joda.time.Interval; @@ -105,7 +105,7 @@ public class IndexIO .put(9, new V9IndexLoader()) .build(); - private static final Logger log = new Logger(IndexIO.class); + private static final EmittingLogger log = new EmittingLogger(IndexIO.class); private static final SerializerUtils serializerUtils = new SerializerUtils(); public static final ByteOrder BYTE_ORDER = ByteOrder.nativeOrder(); @@ -115,18 +115,6 @@ public class IndexIO private static volatile IndexIOHandler handler = null; public static final int CURRENT_VERSION_ID = V9_VERSION; - public static Index readIndex(File inDir) throws IOException - { - init(); - return handler.readIndex(inDir); - } - - public static boolean canBeMapped(final File inDir) throws IOException - { - init(); - return handler.canBeMapped(inDir); - } - @Deprecated public static MMappedIndex mapDir(final File inDir) throws IOException { @@ -148,11 +136,6 @@ public class IndexIO } } - public static void storeLatest(Index index, File file) throws IOException - { - handler.storeLatest(index, file); - } - public static boolean hasHandler() { return (IndexIO.handler != null); @@ -210,16 +193,10 @@ public class IndexIO case 1: case 2: case 3: - final String mappableDirName = "mappable"; - if (toConvert.getName().equals(mappableDirName)) { - throw new ISE("Infinite recursion at play! OMFG quit it, please, it hurts!"); - } - - File mappable = new File(toConvert, mappableDirName); - final Index index = readIndex(toConvert); - storeLatest(index, mappable); - - return convertSegment(mappable, converted); + log.makeAlert("Attempt to load segment of version <= 3.") + .addData("version", version) + .emit(); + return false; case 4: case 5: case 6: @@ -241,51 +218,13 @@ public class IndexIO public static interface IndexIOHandler { - /** - * This only exists for some legacy compatibility reasons, Metamarkets is working on getting rid of it in - * future versions - * - * @param inDir - * - * @return - */ - public Index readIndex(File inDir) throws IOException; - - /** - * This should really always return true, but it exists for legacy compatibility reasons, Metamarkets - * is working on getting rid of it in future versions - * - * @return - */ - public boolean canBeMapped(File inDir) throws IOException; - public MMappedIndex mapDir(File inDir) throws IOException; - - /** - * This only exists for some legacy compatibility reasons, Metamarkets is working on getting rid of it in - * future versions. Normal persisting of indexes is done via IndexMerger. - * - * @param file - */ - public void storeLatest(Index index, File file) throws IOException; } public static class DefaultIndexIOHandler implements IndexIOHandler { private static final Logger log = new Logger(DefaultIndexIOHandler.class); - @Override - public Index readIndex(File inDir) - { - throw new UnsupportedOperationException("Shouldn't ever happen in a cluster that is not owned by MMX."); - } - - @Override - public boolean canBeMapped(File inDir) - { - return true; - } - @Override public MMappedIndex mapDir(File inDir) throws IOException { @@ -384,12 +323,6 @@ public class IndexIO return retVal; } - @Override - public void storeLatest(Index index, File file) - { - throw new UnsupportedOperationException("Shouldn't ever happen in a cluster that is not owned by MMX."); - } - public static void convertV8toV9(File v8Dir, File v9Dir) throws IOException { log.info("Converting v8[%s] to v9[%s]", v8Dir, v9Dir); diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexMerger.java b/processing/src/main/java/io/druid/segment/IndexMerger.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/IndexMerger.java rename to processing/src/main/java/io/druid/segment/IndexMerger.java index b03fbbbbcaf..4f63cf33ee5 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexMerger.java +++ b/processing/src/main/java/io/druid/segment/IndexMerger.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.base.Function; import com.google.common.base.Objects; @@ -44,26 +44,29 @@ import com.metamx.common.guava.nary.BinaryFn; import com.metamx.common.io.smoosh.Smoosh; import com.metamx.common.logger.Logger; import com.metamx.druid.CombiningIterable; -import com.metamx.druid.aggregation.ToLowerCaseAggregatorFactory; import com.metamx.druid.guava.FileOutputSupplier; import com.metamx.druid.guava.GuavaUtils; -import com.metamx.druid.index.v1.serde.ComplexMetricSerde; -import com.metamx.druid.index.v1.serde.ComplexMetrics; -import com.metamx.druid.kv.ByteBufferWriter; -import com.metamx.druid.kv.ConciseCompressedIndexedInts; -import com.metamx.druid.kv.GenericIndexed; -import com.metamx.druid.kv.GenericIndexedWriter; -import com.metamx.druid.kv.IOPeon; -import com.metamx.druid.kv.IndexedIterable; -import com.metamx.druid.kv.IndexedRTree; -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 io.druid.data.Indexed; -import io.druid.data.IndexedInts; import io.druid.query.aggregation.AggregatorFactory; -import io.druid.segment.QueryableIndex; +import io.druid.query.aggregation.aggregation.ToLowerCaseAggregatorFactory; +import io.druid.segment.data.ByteBufferWriter; +import io.druid.segment.data.CompressedLongsSupplierSerializer; +import io.druid.segment.data.ConciseCompressedIndexedInts; +import io.druid.segment.data.GenericIndexed; +import io.druid.segment.data.GenericIndexedWriter; +import io.druid.segment.data.IOPeon; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedInts; +import io.druid.segment.data.IndexedIterable; +import io.druid.segment.data.IndexedRTree; +import io.druid.segment.data.TmpFileIOPeon; +import io.druid.segment.data.VSizeIndexedWriter; +import io.druid.segment.incremental.IncrementalIndex; +import io.druid.segment.incremental.IncrementalIndexAdapter; +import io.druid.segment.serde.ComplexMetricColumnSerializer; +import io.druid.segment.serde.ComplexMetricSerde; +import io.druid.segment.serde.ComplexMetrics; import it.uniroma3.mat.extendedset.intset.ConciseSet; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import org.apache.commons.io.FileUtils; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexableAdapter.java b/processing/src/main/java/io/druid/segment/IndexableAdapter.java similarity index 88% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/IndexableAdapter.java rename to processing/src/main/java/io/druid/segment/IndexableAdapter.java index 2b0f51b1325..a9c6f07f7a9 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/IndexableAdapter.java +++ b/processing/src/main/java/io/druid/segment/IndexableAdapter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; -import io.druid.data.Indexed; -import io.druid.data.IndexedInts; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedInts; import org.joda.time.Interval; /** diff --git a/server/src/main/java/com/metamx/druid/index/v1/IndexedIntsOffset.java b/processing/src/main/java/io/druid/segment/IndexedIntsOffset.java similarity index 89% rename from server/src/main/java/com/metamx/druid/index/v1/IndexedIntsOffset.java rename to processing/src/main/java/io/druid/segment/IndexedIntsOffset.java index e55c581567b..1a4b9e8868d 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/IndexedIntsOffset.java +++ b/processing/src/main/java/io/druid/segment/IndexedIntsOffset.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; -import com.metamx.druid.index.v1.processing.Offset; -import io.druid.data.IndexedInts; +import io.druid.segment.data.IndexedInts; +import io.druid.segment.data.Offset; /** */ diff --git a/processing/src/main/java/io/druid/segment/MMappedIndex.java b/processing/src/main/java/io/druid/segment/MMappedIndex.java new file mode 100644 index 00000000000..5f422ac1a84 --- /dev/null +++ b/processing/src/main/java/io/druid/segment/MMappedIndex.java @@ -0,0 +1,178 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.segment; + +import com.google.common.collect.Maps; +import com.metamx.collections.spatial.ImmutableRTree; +import com.metamx.common.io.smoosh.SmooshedFileMapper; +import com.metamx.common.logger.Logger; +import io.druid.segment.data.CompressedLongsIndexedSupplier; +import io.druid.segment.data.GenericIndexed; +import io.druid.segment.data.IndexedLongs; +import io.druid.segment.data.VSizeIndexed; +import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; +import org.joda.time.Interval; + +import java.io.IOException; +import java.util.Map; + +/** + */ +public class MMappedIndex +{ + private static final Logger log = new Logger(MMappedIndex.class); + private static final ImmutableConciseSet emptySet = new ImmutableConciseSet(); + + final GenericIndexed availableDimensions; + final GenericIndexed availableMetrics; + final Interval dataInterval; + final CompressedLongsIndexedSupplier timestamps; + final Map metrics; + final Map> dimValueLookups; + final Map dimColumns; + final Map> invertedIndexes; + final Map spatialIndexes; + final SmooshedFileMapper fileMapper; + + private final Map metricIndexes = Maps.newHashMap(); + + public MMappedIndex( + GenericIndexed availableDimensions, + GenericIndexed availableMetrics, + Interval dataInterval, + CompressedLongsIndexedSupplier timestamps, + Map metrics, + Map> dimValueLookups, + Map dimColumns, + Map> invertedIndexes, + Map spatialIndexes, + SmooshedFileMapper fileMapper + ) + { + this.availableDimensions = availableDimensions; + this.availableMetrics = availableMetrics; + this.dataInterval = dataInterval; + this.timestamps = timestamps; + this.metrics = metrics; + this.dimValueLookups = dimValueLookups; + this.dimColumns = dimColumns; + this.invertedIndexes = invertedIndexes; + this.spatialIndexes = spatialIndexes; + this.fileMapper = fileMapper; + + for (int i = 0; i < availableMetrics.size(); i++) { + metricIndexes.put(availableMetrics.get(i), i); + } + } + + public CompressedLongsIndexedSupplier getTimestamps() + { + return timestamps; + } + + public GenericIndexed getAvailableDimensions() + { + return availableDimensions; + } + + public GenericIndexed getAvailableMetrics() + { + return availableMetrics; + } + + public Map getMetrics() + { + return metrics; + } + + public Integer getMetricIndex(String metricName) + { + return metricIndexes.get(metricName); + } + + public Interval getDataInterval() + { + return dataInterval; + } + + public IndexedLongs getReadOnlyTimestamps() + { + return timestamps.get(); + } + + public MetricHolder getMetricHolder(String metric) + { + final MetricHolder retVal = metrics.get(metric); + + if (retVal == null) { + return null; + } + + return retVal; + } + + public GenericIndexed getDimValueLookup(String dimension) + { + return dimValueLookups.get(dimension); + } + + public VSizeIndexed getDimColumn(String dimension) + { + return dimColumns.get(dimension); + } + + public Map> getInvertedIndexes() + { + return invertedIndexes; + } + + public Map getSpatialIndexes() + { + return spatialIndexes; + } + + public ImmutableConciseSet getInvertedIndex(String dimension, String value) + { + final GenericIndexed lookup = dimValueLookups.get(dimension); + if (lookup == null) { + return emptySet; + } + + int indexOf = lookup.indexOf(value); + if (indexOf < 0) { + return emptySet; + } + + ImmutableConciseSet retVal = invertedIndexes.get(dimension).get(indexOf); + return (retVal == null) ? emptySet : retVal; + } + + public SmooshedFileMapper getFileMapper() + { + return fileMapper; + } + + public void close() throws IOException + { + if (fileMapper != null) { + fileMapper.close(); + } + } +} diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/MMappedIndexAdapter.java b/processing/src/main/java/io/druid/segment/MMappedIndexAdapter.java similarity index 94% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/MMappedIndexAdapter.java rename to processing/src/main/java/io/druid/segment/MMappedIndexAdapter.java index fffc26fee0f..0db39fb9261 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/MMappedIndexAdapter.java +++ b/processing/src/main/java/io/druid/segment/MMappedIndexAdapter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,15 +17,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.collect.Maps; import com.google.common.io.Closeables; -import com.metamx.druid.kv.ConciseCompressedIndexedInts; -import io.druid.data.Indexed; -import io.druid.data.IndexedFloats; -import io.druid.data.IndexedInts; -import io.druid.data.IndexedLongs; +import io.druid.segment.data.ConciseCompressedIndexedInts; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedFloats; +import io.druid.segment.data.IndexedInts; +import io.druid.segment.data.IndexedLongs; import org.joda.time.Interval; import java.util.Iterator; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/MetricColumnSerializer.java b/processing/src/main/java/io/druid/segment/MetricColumnSerializer.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/MetricColumnSerializer.java rename to processing/src/main/java/io/druid/segment/MetricColumnSerializer.java index 2452f820b25..e55b8e38bc6 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/MetricColumnSerializer.java +++ b/processing/src/main/java/io/druid/segment/MetricColumnSerializer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import java.io.IOException; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/MetricHolder.java b/processing/src/main/java/io/druid/segment/MetricHolder.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/MetricHolder.java rename to processing/src/main/java/io/druid/segment/MetricHolder.java index 5196af561ce..11a25cc0c7e 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/MetricHolder.java +++ b/processing/src/main/java/io/druid/segment/MetricHolder.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.io.ByteStreams; import com.google.common.io.Closeables; @@ -25,14 +25,16 @@ import com.google.common.io.InputSupplier; import com.google.common.io.OutputSupplier; import com.metamx.common.IAE; import com.metamx.common.ISE; -import com.metamx.druid.index.v1.serde.ComplexMetricSerde; -import com.metamx.druid.index.v1.serde.ComplexMetrics; -import com.metamx.druid.kv.GenericIndexed; -import com.metamx.druid.kv.GenericIndexedWriter; -import com.metamx.druid.kv.ObjectStrategy; import com.metamx.druid.utils.SerializerUtils; -import io.druid.data.Indexed; -import io.druid.data.IndexedFloats; +import io.druid.segment.data.CompressedFloatsIndexedSupplier; +import io.druid.segment.data.CompressedFloatsSupplierSerializer; +import io.druid.segment.data.GenericIndexed; +import io.druid.segment.data.GenericIndexedWriter; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedFloats; +import io.druid.segment.data.ObjectStrategy; +import io.druid.segment.serde.ComplexMetricSerde; +import io.druid.segment.serde.ComplexMetrics; import java.io.IOException; import java.io.InputStream; diff --git a/segment/src/main/java/io/druid/segment/MetricSelectorFactory.java b/processing/src/main/java/io/druid/segment/MetricSelectorFactory.java similarity index 97% rename from segment/src/main/java/io/druid/segment/MetricSelectorFactory.java rename to processing/src/main/java/io/druid/segment/MetricSelectorFactory.java index d8f743eabd9..68472e134ab 100644 --- a/segment/src/main/java/io/druid/segment/MetricSelectorFactory.java +++ b/processing/src/main/java/io/druid/segment/MetricSelectorFactory.java @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment;/** +package io.druid.segment; + +/** * Factory class for MetricSelectors */ public interface MetricSelectorFactory diff --git a/segment/src/main/java/io/druid/segment/ObjectMetricSelector.java b/processing/src/main/java/io/druid/segment/ObjectMetricSelector.java similarity index 92% rename from segment/src/main/java/io/druid/segment/ObjectMetricSelector.java rename to processing/src/main/java/io/druid/segment/ObjectMetricSelector.java index 63941227d19..52b93f086ea 100644 --- a/segment/src/main/java/io/druid/segment/ObjectMetricSelector.java +++ b/processing/src/main/java/io/druid/segment/ObjectMetricSelector.java @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment;public interface ObjectMetricSelector +package io.druid.segment; + +public interface ObjectMetricSelector { public Class classOfObject(); public T get(); diff --git a/segment/src/main/java/io/druid/segment/QueryableIndex.java b/processing/src/main/java/io/druid/segment/QueryableIndex.java similarity index 95% rename from segment/src/main/java/io/druid/segment/QueryableIndex.java rename to processing/src/main/java/io/druid/segment/QueryableIndex.java index d82960fa570..7dc1dcbe5d4 100644 --- a/segment/src/main/java/io/druid/segment/QueryableIndex.java +++ b/processing/src/main/java/io/druid/segment/QueryableIndex.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment;import io.druid.data.Indexed; +package io.druid.segment;import io.druid.segment.data.Indexed; import org.joda.time.Interval; import java.io.IOException; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/QueryableIndexIndexableAdapter.java b/processing/src/main/java/io/druid/segment/QueryableIndexIndexableAdapter.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/QueryableIndexIndexableAdapter.java rename to processing/src/main/java/io/druid/segment/QueryableIndexIndexableAdapter.java index 2a346774315..efe09b51f55 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/QueryableIndexIndexableAdapter.java +++ b/processing/src/main/java/io/druid/segment/QueryableIndexIndexableAdapter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -25,20 +25,19 @@ import com.google.common.collect.Sets; import com.google.common.io.Closeables; import com.metamx.common.ISE; import com.metamx.common.logger.Logger; -import com.metamx.druid.kv.ArrayBasedIndexedInts; -import com.metamx.druid.kv.ConciseCompressedIndexedInts; -import com.metamx.druid.kv.EmptyIndexedInts; -import com.metamx.druid.kv.IndexedIterable; -import com.metamx.druid.kv.ListIndexed; -import io.druid.data.Indexed; -import io.druid.data.IndexedInts; -import io.druid.segment.QueryableIndex; import io.druid.segment.column.BitmapIndex; import io.druid.segment.column.Column; import io.druid.segment.column.ComplexColumn; import io.druid.segment.column.DictionaryEncodedColumn; import io.druid.segment.column.GenericColumn; import io.druid.segment.column.ValueType; +import io.druid.segment.data.ArrayBasedIndexedInts; +import io.druid.segment.data.ConciseCompressedIndexedInts; +import io.druid.segment.data.EmptyIndexedInts; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedInts; +import io.druid.segment.data.IndexedIterable; +import io.druid.segment.data.ListIndexed; import org.joda.time.Interval; import java.io.Closeable; diff --git a/server/src/main/java/com/metamx/druid/index/QueryableIndexSegment.java b/processing/src/main/java/io/druid/segment/QueryableIndexSegment.java similarity index 86% rename from server/src/main/java/com/metamx/druid/index/QueryableIndexSegment.java rename to processing/src/main/java/io/druid/segment/QueryableIndexSegment.java index 1f3945c2965..c2a7ee18aa6 100644 --- a/server/src/main/java/com/metamx/druid/index/QueryableIndexSegment.java +++ b/processing/src/main/java/io/druid/segment/QueryableIndexSegment.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index; +package io.druid.segment; -import com.metamx.druid.index.v1.QueryableIndexStorageAdapter; -import io.druid.segment.QueryableIndex; -import io.druid.segment.Segment; -import io.druid.segment.StorageAdapter; import org.joda.time.Interval; import java.io.IOException; diff --git a/server/src/main/java/com/metamx/druid/index/v1/QueryableIndexStorageAdapter.java b/processing/src/main/java/io/druid/segment/QueryableIndexStorageAdapter.java similarity index 98% rename from server/src/main/java/com/metamx/druid/index/v1/QueryableIndexStorageAdapter.java rename to processing/src/main/java/io/druid/segment/QueryableIndexStorageAdapter.java index 817ac8a9dec..cb06b7ab49f 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/QueryableIndexStorageAdapter.java +++ b/processing/src/main/java/io/druid/segment/QueryableIndexStorageAdapter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.base.Function; import com.google.common.base.Functions; @@ -27,27 +27,18 @@ import com.google.common.io.Closeables; import com.metamx.common.collect.MoreIterators; import com.metamx.common.guava.FunctionalIterable; import com.metamx.common.guava.FunctionalIterator; -import com.metamx.druid.index.v1.processing.Offset; -import com.metamx.druid.kv.SingleIndexedInts; -import io.druid.data.Indexed; -import io.druid.data.IndexedInts; import io.druid.granularity.QueryGranularity; import io.druid.query.filter.Filter; -import io.druid.segment.Capabilities; -import io.druid.segment.ColumnSelector; -import io.druid.segment.ComplexMetricSelector; -import io.druid.segment.Cursor; -import io.druid.segment.DimensionSelector; -import io.druid.segment.FloatMetricSelector; -import io.druid.segment.ObjectMetricSelector; -import io.druid.segment.QueryableIndex; -import io.druid.segment.StorageAdapter; import io.druid.segment.column.Column; import io.druid.segment.column.ColumnCapabilities; import io.druid.segment.column.ComplexColumn; import io.druid.segment.column.DictionaryEncodedColumn; import io.druid.segment.column.GenericColumn; import io.druid.segment.column.ValueType; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedInts; +import io.druid.segment.data.Offset; +import io.druid.segment.data.SingleIndexedInts; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/server/src/main/java/com/metamx/druid/index/ReferenceCountingSegment.java b/processing/src/main/java/io/druid/segment/ReferenceCountingSegment.java similarity index 95% rename from server/src/main/java/com/metamx/druid/index/ReferenceCountingSegment.java rename to processing/src/main/java/io/druid/segment/ReferenceCountingSegment.java index ed4e732182b..3ed246e4edf 100644 --- a/server/src/main/java/com/metamx/druid/index/ReferenceCountingSegment.java +++ b/processing/src/main/java/io/druid/segment/ReferenceCountingSegment.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index; +package io.druid.segment; import com.metamx.emitter.EmittingLogger; -import io.druid.segment.QueryableIndex; -import io.druid.segment.Segment; -import io.druid.segment.StorageAdapter; import org.joda.time.Interval; import java.io.Closeable; diff --git a/server/src/main/java/com/metamx/druid/index/ReferenceCountingSequence.java b/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java similarity index 95% rename from server/src/main/java/com/metamx/druid/index/ReferenceCountingSequence.java rename to processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java index ca7066ececb..2f51e4ddc10 100644 --- a/server/src/main/java/com/metamx/druid/index/ReferenceCountingSequence.java +++ b/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index; +package io.druid.segment; import com.metamx.common.guava.ResourceClosingYielder; import com.metamx.common.guava.Sequence; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/Rowboat.java b/processing/src/main/java/io/druid/segment/Rowboat.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/Rowboat.java rename to processing/src/main/java/io/druid/segment/Rowboat.java index b4615a4ef93..f6367ffcd61 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/Rowboat.java +++ b/processing/src/main/java/io/druid/segment/Rowboat.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.collect.Maps; import com.google.common.collect.Sets; diff --git a/server/src/main/java/com/metamx/druid/index/v1/RowboatFilteringIndexAdapter.java b/processing/src/main/java/io/druid/segment/RowboatFilteringIndexAdapter.java similarity index 93% rename from server/src/main/java/com/metamx/druid/index/v1/RowboatFilteringIndexAdapter.java rename to processing/src/main/java/io/druid/segment/RowboatFilteringIndexAdapter.java index 3fa346f341b..7cfa6c9c217 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/RowboatFilteringIndexAdapter.java +++ b/processing/src/main/java/io/druid/segment/RowboatFilteringIndexAdapter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -import io.druid.data.Indexed; -import io.druid.data.IndexedInts; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedInts; import org.joda.time.Interval; /** diff --git a/segment/src/main/java/io/druid/segment/Segment.java b/processing/src/main/java/io/druid/segment/Segment.java similarity index 94% rename from segment/src/main/java/io/druid/segment/Segment.java rename to processing/src/main/java/io/druid/segment/Segment.java index d72fac930a9..78c34541ebc 100644 --- a/segment/src/main/java/io/druid/segment/Segment.java +++ b/processing/src/main/java/io/druid/segment/Segment.java @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment;import org.joda.time.Interval; +package io.druid.segment; + +import org.joda.time.Interval; import java.io.Closeable; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/SimpleQueryableIndex.java b/processing/src/main/java/io/druid/segment/SimpleQueryableIndex.java similarity index 94% rename from indexing-common/src/main/java/com/metamx/druid/index/SimpleQueryableIndex.java rename to processing/src/main/java/io/druid/segment/SimpleQueryableIndex.java index 98ef7afd409..2e3bc85958f 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/SimpleQueryableIndex.java +++ b/processing/src/main/java/io/druid/segment/SimpleQueryableIndex.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index; +package io.druid.segment; import com.metamx.common.io.smoosh.SmooshedFileMapper; -import io.druid.data.Indexed; -import io.druid.segment.QueryableIndex; import io.druid.segment.column.Column; +import io.druid.segment.data.Indexed; import org.joda.time.Interval; import java.io.IOException; diff --git a/segment/src/main/java/io/druid/segment/StorageAdapter.java b/processing/src/main/java/io/druid/segment/StorageAdapter.java similarity index 95% rename from segment/src/main/java/io/druid/segment/StorageAdapter.java rename to processing/src/main/java/io/druid/segment/StorageAdapter.java index cfd463b9e3b..ef6ed7c6bd6 100644 --- a/segment/src/main/java/io/druid/segment/StorageAdapter.java +++ b/processing/src/main/java/io/druid/segment/StorageAdapter.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.segment;import io.druid.data.Indexed; +package io.druid.segment;import io.druid.segment.data.Indexed; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/AbstractColumn.java b/processing/src/main/java/io/druid/segment/column/AbstractColumn.java similarity index 77% rename from indexing-common/src/main/java/com/metamx/druid/index/column/AbstractColumn.java rename to processing/src/main/java/io/druid/segment/column/AbstractColumn.java index 6929bc8c428..b43f5119c3e 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/AbstractColumn.java +++ b/processing/src/main/java/io/druid/segment/column/AbstractColumn.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,16 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; - -import io.druid.segment.column.BitmapIndex; -import io.druid.segment.column.Column; -import io.druid.segment.column.ColumnCapabilities; -import io.druid.segment.column.ComplexColumn; -import io.druid.segment.column.DictionaryEncodedColumn; -import io.druid.segment.column.GenericColumn; -import io.druid.segment.column.RunLengthColumn; -import io.druid.segment.column.SpatialIndex; +package io.druid.segment.column; /** */ diff --git a/segment/src/main/java/io/druid/segment/column/BitmapIndex.java b/processing/src/main/java/io/druid/segment/column/BitmapIndex.java similarity index 100% rename from segment/src/main/java/io/druid/segment/column/BitmapIndex.java rename to processing/src/main/java/io/druid/segment/column/BitmapIndex.java diff --git a/segment/src/main/java/io/druid/segment/column/Column.java b/processing/src/main/java/io/druid/segment/column/Column.java similarity index 100% rename from segment/src/main/java/io/druid/segment/column/Column.java rename to processing/src/main/java/io/druid/segment/column/Column.java diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/ColumnBuilder.java b/processing/src/main/java/io/druid/segment/column/ColumnBuilder.java similarity index 87% rename from indexing-common/src/main/java/com/metamx/druid/index/column/ColumnBuilder.java rename to processing/src/main/java/io/druid/segment/column/ColumnBuilder.java index 3dc3e865cbc..ba8c329b3ac 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/ColumnBuilder.java +++ b/processing/src/main/java/io/druid/segment/column/ColumnBuilder.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,18 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; import com.google.common.base.Preconditions; import com.google.common.base.Supplier; -import io.druid.segment.column.BitmapIndex; -import io.druid.segment.column.Column; -import io.druid.segment.column.ComplexColumn; -import io.druid.segment.column.DictionaryEncodedColumn; -import io.druid.segment.column.GenericColumn; -import io.druid.segment.column.RunLengthColumn; -import io.druid.segment.column.SpatialIndex; -import io.druid.segment.column.ValueType; /** */ diff --git a/segment/src/main/java/io/druid/segment/column/ColumnCapabilities.java b/processing/src/main/java/io/druid/segment/column/ColumnCapabilities.java similarity index 100% rename from segment/src/main/java/io/druid/segment/column/ColumnCapabilities.java rename to processing/src/main/java/io/druid/segment/column/ColumnCapabilities.java diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/ColumnCapabilitiesImpl.java b/processing/src/main/java/io/druid/segment/column/ColumnCapabilitiesImpl.java similarity index 93% rename from indexing-common/src/main/java/com/metamx/druid/index/column/ColumnCapabilitiesImpl.java rename to processing/src/main/java/io/druid/segment/column/ColumnCapabilitiesImpl.java index fce82246ce2..f7b09d698c1 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/ColumnCapabilitiesImpl.java +++ b/processing/src/main/java/io/druid/segment/column/ColumnCapabilitiesImpl.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; import com.fasterxml.jackson.annotation.JsonProperty; -import io.druid.segment.column.ColumnCapabilities; -import io.druid.segment.column.ValueType; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/ColumnDescriptor.java b/processing/src/main/java/io/druid/segment/column/ColumnDescriptor.java similarity index 94% rename from indexing-common/src/main/java/com/metamx/druid/index/column/ColumnDescriptor.java rename to processing/src/main/java/io/druid/segment/column/ColumnDescriptor.java index 8324a930488..e352d1d161e 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/ColumnDescriptor.java +++ b/processing/src/main/java/io/druid/segment/column/ColumnDescriptor.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,16 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.metamx.common.IAE; -import com.metamx.druid.index.serde.ColumnPartSerde; -import io.druid.segment.column.Column; -import io.druid.segment.column.ValueType; +import io.druid.segment.serde.ColumnPartSerde; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/segment/src/main/java/io/druid/segment/column/ComplexColumn.java b/processing/src/main/java/io/druid/segment/column/ComplexColumn.java similarity index 100% rename from segment/src/main/java/io/druid/segment/column/ComplexColumn.java rename to processing/src/main/java/io/druid/segment/column/ComplexColumn.java diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/ComplexColumnImpl.java b/processing/src/main/java/io/druid/segment/column/ComplexColumnImpl.java similarity index 84% rename from indexing-common/src/main/java/com/metamx/druid/index/column/ComplexColumnImpl.java rename to processing/src/main/java/io/druid/segment/column/ComplexColumnImpl.java index caccdd20787..98f80288151 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/ComplexColumnImpl.java +++ b/processing/src/main/java/io/druid/segment/column/ComplexColumnImpl.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; -import io.druid.data.Indexed; -import io.druid.segment.column.ColumnCapabilities; -import io.druid.segment.column.ComplexColumn; -import io.druid.segment.column.ValueType; +import io.druid.segment.data.Indexed; /** */ diff --git a/segment/src/main/java/io/druid/segment/column/DictionaryEncodedColumn.java b/processing/src/main/java/io/druid/segment/column/DictionaryEncodedColumn.java similarity index 96% rename from segment/src/main/java/io/druid/segment/column/DictionaryEncodedColumn.java rename to processing/src/main/java/io/druid/segment/column/DictionaryEncodedColumn.java index 6bf4c22a106..4925df0f62d 100644 --- a/segment/src/main/java/io/druid/segment/column/DictionaryEncodedColumn.java +++ b/processing/src/main/java/io/druid/segment/column/DictionaryEncodedColumn.java @@ -19,7 +19,7 @@ package io.druid.segment.column; -import io.druid.data.IndexedInts; +import io.druid.segment.data.IndexedInts; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/FloatColumn.java b/processing/src/main/java/io/druid/segment/column/FloatColumn.java similarity index 82% rename from indexing-common/src/main/java/com/metamx/druid/index/column/FloatColumn.java rename to processing/src/main/java/io/druid/segment/column/FloatColumn.java index fa2f759eea8..ee72160274f 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/FloatColumn.java +++ b/processing/src/main/java/io/druid/segment/column/FloatColumn.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; -import com.metamx.druid.index.v1.CompressedFloatsIndexedSupplier; -import io.druid.segment.column.ColumnCapabilities; -import io.druid.segment.column.GenericColumn; -import io.druid.segment.column.ValueType; +import io.druid.segment.data.CompressedFloatsIndexedSupplier; /** */ diff --git a/segment/src/main/java/io/druid/segment/column/GenericColumn.java b/processing/src/main/java/io/druid/segment/column/GenericColumn.java similarity index 91% rename from segment/src/main/java/io/druid/segment/column/GenericColumn.java rename to processing/src/main/java/io/druid/segment/column/GenericColumn.java index f66fbd3c45b..8afa8624599 100644 --- a/segment/src/main/java/io/druid/segment/column/GenericColumn.java +++ b/processing/src/main/java/io/druid/segment/column/GenericColumn.java @@ -19,9 +19,9 @@ package io.druid.segment.column; -import io.druid.data.Indexed; -import io.druid.data.IndexedFloats; -import io.druid.data.IndexedLongs; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedFloats; +import io.druid.segment.data.IndexedLongs; import java.io.Closeable; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/IndexedComplexColumn.java b/processing/src/main/java/io/druid/segment/column/IndexedComplexColumn.java similarity index 89% rename from indexing-common/src/main/java/com/metamx/druid/index/column/IndexedComplexColumn.java rename to processing/src/main/java/io/druid/segment/column/IndexedComplexColumn.java index 241ca019a48..a48f2f2659c 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/IndexedComplexColumn.java +++ b/processing/src/main/java/io/druid/segment/column/IndexedComplexColumn.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; -import io.druid.data.Indexed; -import io.druid.segment.column.ComplexColumn; +import io.druid.segment.data.Indexed; import java.io.IOException; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/IndexedFloatsGenericColumn.java b/processing/src/main/java/io/druid/segment/column/IndexedFloatsGenericColumn.java similarity index 88% rename from indexing-common/src/main/java/com/metamx/druid/index/column/IndexedFloatsGenericColumn.java rename to processing/src/main/java/io/druid/segment/column/IndexedFloatsGenericColumn.java index 20e13d5b652..8aa260e4e53 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/IndexedFloatsGenericColumn.java +++ b/processing/src/main/java/io/druid/segment/column/IndexedFloatsGenericColumn.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; -import io.druid.data.Indexed; -import io.druid.data.IndexedFloats; -import io.druid.data.IndexedLongs; -import io.druid.segment.column.GenericColumn; -import io.druid.segment.column.ValueType; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedFloats; +import io.druid.segment.data.IndexedLongs; import java.io.IOException; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/IndexedLongsGenericColumn.java b/processing/src/main/java/io/druid/segment/column/IndexedLongsGenericColumn.java similarity index 88% rename from indexing-common/src/main/java/com/metamx/druid/index/column/IndexedLongsGenericColumn.java rename to processing/src/main/java/io/druid/segment/column/IndexedLongsGenericColumn.java index ee9767c98ad..368e7b11ebe 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/IndexedLongsGenericColumn.java +++ b/processing/src/main/java/io/druid/segment/column/IndexedLongsGenericColumn.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; -import io.druid.data.Indexed; -import io.druid.data.IndexedFloats; -import io.druid.data.IndexedLongs; -import io.druid.segment.column.GenericColumn; -import io.druid.segment.column.ValueType; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedFloats; +import io.druid.segment.data.IndexedLongs; import java.io.IOException; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/LongColumn.java b/processing/src/main/java/io/druid/segment/column/LongColumn.java similarity index 82% rename from indexing-common/src/main/java/com/metamx/druid/index/column/LongColumn.java rename to processing/src/main/java/io/druid/segment/column/LongColumn.java index 6bbfb87cfe4..7923c0c303c 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/LongColumn.java +++ b/processing/src/main/java/io/druid/segment/column/LongColumn.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; -import com.metamx.druid.index.v1.CompressedLongsIndexedSupplier; -import io.druid.segment.column.ColumnCapabilities; -import io.druid.segment.column.GenericColumn; -import io.druid.segment.column.ValueType; +import io.druid.segment.data.CompressedLongsIndexedSupplier; /** */ diff --git a/segment/src/main/java/io/druid/segment/column/RunLengthColumn.java b/processing/src/main/java/io/druid/segment/column/RunLengthColumn.java similarity index 100% rename from segment/src/main/java/io/druid/segment/column/RunLengthColumn.java rename to processing/src/main/java/io/druid/segment/column/RunLengthColumn.java diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/SimpleColumn.java b/processing/src/main/java/io/druid/segment/column/SimpleColumn.java similarity index 86% rename from indexing-common/src/main/java/com/metamx/druid/index/column/SimpleColumn.java rename to processing/src/main/java/io/druid/segment/column/SimpleColumn.java index 72a6dce582d..597069a3b93 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/SimpleColumn.java +++ b/processing/src/main/java/io/druid/segment/column/SimpleColumn.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,18 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; import com.google.common.base.Supplier; import com.google.common.io.Closeables; -import io.druid.segment.column.BitmapIndex; -import io.druid.segment.column.Column; -import io.druid.segment.column.ColumnCapabilities; -import io.druid.segment.column.ComplexColumn; -import io.druid.segment.column.DictionaryEncodedColumn; -import io.druid.segment.column.GenericColumn; -import io.druid.segment.column.RunLengthColumn; -import io.druid.segment.column.SpatialIndex; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/index/column/SimpleDictionaryEncodedColumn.java b/processing/src/main/java/io/druid/segment/column/SimpleDictionaryEncodedColumn.java similarity index 86% rename from indexing-common/src/main/java/com/metamx/druid/index/column/SimpleDictionaryEncodedColumn.java rename to processing/src/main/java/io/druid/segment/column/SimpleDictionaryEncodedColumn.java index 71133d618c4..5e3bb3d0b9f 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/column/SimpleDictionaryEncodedColumn.java +++ b/processing/src/main/java/io/druid/segment/column/SimpleDictionaryEncodedColumn.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.column; +package io.druid.segment.column; -import com.metamx.druid.kv.GenericIndexed; -import com.metamx.druid.kv.VSizeIndexed; -import com.metamx.druid.kv.VSizeIndexedInts; -import io.druid.data.IndexedInts; -import io.druid.segment.column.DictionaryEncodedColumn; +import io.druid.segment.data.GenericIndexed; +import io.druid.segment.data.IndexedInts; +import io.druid.segment.data.VSizeIndexed; +import io.druid.segment.data.VSizeIndexedInts; /** */ diff --git a/segment/src/main/java/io/druid/segment/column/SpatialIndex.java b/processing/src/main/java/io/druid/segment/column/SpatialIndex.java similarity index 99% rename from segment/src/main/java/io/druid/segment/column/SpatialIndex.java rename to processing/src/main/java/io/druid/segment/column/SpatialIndex.java index 822e878d659..115a4a341c2 100644 --- a/segment/src/main/java/io/druid/segment/column/SpatialIndex.java +++ b/processing/src/main/java/io/druid/segment/column/SpatialIndex.java @@ -16,6 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + package io.druid.segment.column; import com.metamx.collections.spatial.ImmutableRTree; diff --git a/segment/src/main/java/io/druid/segment/column/ValueType.java b/processing/src/main/java/io/druid/segment/column/ValueType.java similarity index 100% rename from segment/src/main/java/io/druid/segment/column/ValueType.java rename to processing/src/main/java/io/druid/segment/column/ValueType.java diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/ArrayBasedIndexedInts.java b/processing/src/main/java/io/druid/segment/data/ArrayBasedIndexedInts.java similarity index 91% rename from indexing-common/src/main/java/com/metamx/druid/kv/ArrayBasedIndexedInts.java rename to processing/src/main/java/io/druid/segment/data/ArrayBasedIndexedInts.java index db3a1a7dd37..6616ec859ed 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/ArrayBasedIndexedInts.java +++ b/processing/src/main/java/io/druid/segment/data/ArrayBasedIndexedInts.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; - -import io.druid.data.IndexedInts; +package io.druid.segment.data; import java.util.Iterator; diff --git a/server/src/main/java/com/metamx/druid/index/v1/processing/ArrayBasedOffset.java b/processing/src/main/java/io/druid/segment/data/ArrayBasedOffset.java similarity index 94% rename from server/src/main/java/com/metamx/druid/index/v1/processing/ArrayBasedOffset.java rename to processing/src/main/java/io/druid/segment/data/ArrayBasedOffset.java index 42ac85ed869..d1f1fd42829 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/processing/ArrayBasedOffset.java +++ b/processing/src/main/java/io/druid/segment/data/ArrayBasedOffset.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.processing; +package io.druid.segment.data; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/ArrayIndexed.java b/processing/src/main/java/io/druid/segment/data/ArrayIndexed.java similarity index 93% rename from indexing-common/src/main/java/com/metamx/druid/kv/ArrayIndexed.java rename to processing/src/main/java/io/druid/segment/data/ArrayIndexed.java index d008e53a2a3..eda5a70e824 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/ArrayIndexed.java +++ b/processing/src/main/java/io/druid/segment/data/ArrayIndexed.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; - -import io.druid.data.Indexed; +package io.druid.segment.data; import java.util.Arrays; import java.util.Iterator; diff --git a/processing/src/main/java/io/druid/segment/data/ByteBufferSerializer.java b/processing/src/main/java/io/druid/segment/data/ByteBufferSerializer.java new file mode 100644 index 00000000000..0145c339f1d --- /dev/null +++ b/processing/src/main/java/io/druid/segment/data/ByteBufferSerializer.java @@ -0,0 +1,49 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.segment.data; + +import com.google.common.primitives.Ints; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.WritableByteChannel; + +/** + */ +public class ByteBufferSerializer +{ + public static T read(ByteBuffer buffer, ObjectStrategy strategy) + { + int size = buffer.getInt(); + ByteBuffer bufferToUse = buffer.asReadOnlyBuffer(); + bufferToUse.limit(bufferToUse.position() + size); + buffer.position(bufferToUse.limit()); + + return strategy.fromByteBuffer(bufferToUse, size); + } + + public static void writeToChannel(T obj, ObjectStrategy strategy, WritableByteChannel channel) + throws IOException + { + byte[] toWrite = strategy.toBytes(obj); + channel.write(ByteBuffer.allocate(Ints.BYTES).putInt(0, toWrite.length)); + channel.write(ByteBuffer.wrap(toWrite)); + } +} diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/ByteBufferWriter.java b/processing/src/main/java/io/druid/segment/data/ByteBufferWriter.java similarity index 74% rename from indexing-common/src/main/java/com/metamx/druid/kv/ByteBufferWriter.java rename to processing/src/main/java/io/druid/segment/data/ByteBufferWriter.java index 0b384b3a852..91897402f80 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/ByteBufferWriter.java +++ b/processing/src/main/java/io/druid/segment/data/ByteBufferWriter.java @@ -1,4 +1,23 @@ -package com.metamx.druid.kv; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.segment.data; import com.google.common.base.Function; import com.google.common.base.Preconditions; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatBufferObjectStrategy.java b/processing/src/main/java/io/druid/segment/data/CompressedFloatBufferObjectStrategy.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatBufferObjectStrategy.java rename to processing/src/main/java/io/druid/segment/data/CompressedFloatBufferObjectStrategy.java index 6aa2355dc15..7a9906cd364 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatBufferObjectStrategy.java +++ b/processing/src/main/java/io/druid/segment/data/CompressedFloatBufferObjectStrategy.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.collect.Ordering; import com.google.common.primitives.Floats; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplier.java b/processing/src/main/java/io/druid/segment/data/CompressedFloatsIndexedSupplier.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplier.java rename to processing/src/main/java/io/druid/segment/data/CompressedFloatsIndexedSupplier.java index 5f561620222..b21418e4048 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplier.java +++ b/processing/src/main/java/io/druid/segment/data/CompressedFloatsIndexedSupplier.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.base.Preconditions; import com.google.common.base.Supplier; @@ -27,8 +27,6 @@ import com.google.common.primitives.Ints; import com.metamx.common.IAE; import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidResourceHolder; -import com.metamx.druid.kv.GenericIndexed; -import io.druid.data.IndexedFloats; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializer.java b/processing/src/main/java/io/druid/segment/data/CompressedFloatsSupplierSerializer.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializer.java rename to processing/src/main/java/io/druid/segment/data/CompressedFloatsSupplierSerializer.java index 441ea2d0519..16b816e1df4 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializer.java +++ b/processing/src/main/java/io/druid/segment/data/CompressedFloatsSupplierSerializer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.io.ByteStreams; import com.google.common.io.Closeables; @@ -25,8 +25,6 @@ import com.google.common.io.OutputSupplier; import com.google.common.primitives.Ints; import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidResourceHolder; -import com.metamx.druid.kv.GenericIndexedWriter; -import com.metamx.druid.kv.IOPeon; import java.io.IOException; import java.io.OutputStream; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedLongBufferObjectStrategy.java b/processing/src/main/java/io/druid/segment/data/CompressedLongBufferObjectStrategy.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedLongBufferObjectStrategy.java rename to processing/src/main/java/io/druid/segment/data/CompressedLongBufferObjectStrategy.java index 0fed227d5a3..823c86a0516 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedLongBufferObjectStrategy.java +++ b/processing/src/main/java/io/druid/segment/data/CompressedLongBufferObjectStrategy.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.collect.Ordering; import com.google.common.primitives.Longs; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplier.java b/processing/src/main/java/io/druid/segment/data/CompressedLongsIndexedSupplier.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplier.java rename to processing/src/main/java/io/druid/segment/data/CompressedLongsIndexedSupplier.java index 6ec7fdc2ac1..153d10d29f9 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplier.java +++ b/processing/src/main/java/io/druid/segment/data/CompressedLongsIndexedSupplier.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.base.Preconditions; import com.google.common.base.Supplier; @@ -27,8 +27,6 @@ import com.google.common.primitives.Longs; import com.metamx.common.IAE; import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidResourceHolder; -import com.metamx.druid.kv.GenericIndexed; -import io.druid.data.IndexedLongs; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializer.java b/processing/src/main/java/io/druid/segment/data/CompressedLongsSupplierSerializer.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializer.java rename to processing/src/main/java/io/druid/segment/data/CompressedLongsSupplierSerializer.java index 3358e209db0..742332a7413 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializer.java +++ b/processing/src/main/java/io/druid/segment/data/CompressedLongsSupplierSerializer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.io.ByteStreams; import com.google.common.io.Closeables; @@ -26,8 +26,6 @@ import com.google.common.primitives.Ints; import com.google.common.primitives.Longs; import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidResourceHolder; -import com.metamx.druid.kv.GenericIndexedWriter; -import com.metamx.druid.kv.IOPeon; import java.io.IOException; import java.io.OutputStream; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedObjectStrategy.java b/processing/src/main/java/io/druid/segment/data/CompressedObjectStrategy.java similarity index 96% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedObjectStrategy.java rename to processing/src/main/java/io/druid/segment/data/CompressedObjectStrategy.java index 7733ec7fb2f..fa69034fb43 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/CompressedObjectStrategy.java +++ b/processing/src/main/java/io/druid/segment/data/CompressedObjectStrategy.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,15 +17,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.base.Throwables; import com.google.common.io.Closeables; import com.metamx.druid.collect.ResourceHolder; -import com.metamx.druid.kv.ObjectStrategy; import com.ning.compress.lzf.ChunkEncoder; import com.ning.compress.lzf.LZFChunk; import com.ning.compress.lzf.LZFDecoder; +import io.druid.segment.CompressedPools; import java.io.IOException; import java.nio.Buffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/ConciseCompressedIndexedInts.java b/processing/src/main/java/io/druid/segment/data/ConciseCompressedIndexedInts.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/kv/ConciseCompressedIndexedInts.java rename to processing/src/main/java/io/druid/segment/data/ConciseCompressedIndexedInts.java index 02b78854a5d..e81e9389a32 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/ConciseCompressedIndexedInts.java +++ b/processing/src/main/java/io/druid/segment/data/ConciseCompressedIndexedInts.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.collect.Ordering; -import io.druid.data.IndexedInts; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import it.uniroma3.mat.extendedset.intset.IntSet; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/EmptyIndexedInts.java b/processing/src/main/java/io/druid/segment/data/EmptyIndexedInts.java similarity index 91% rename from indexing-common/src/main/java/com/metamx/druid/kv/EmptyIndexedInts.java rename to processing/src/main/java/io/druid/segment/data/EmptyIndexedInts.java index dcdf68dbdd0..fa0b09cc8e5 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/EmptyIndexedInts.java +++ b/processing/src/main/java/io/druid/segment/data/EmptyIndexedInts.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.collect.ImmutableList; -import io.druid.data.IndexedInts; import java.util.Iterator; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/GenericIndexed.java b/processing/src/main/java/io/druid/segment/data/GenericIndexed.java similarity index 98% rename from indexing-common/src/main/java/com/metamx/druid/kv/GenericIndexed.java rename to processing/src/main/java/io/druid/segment/data/GenericIndexed.java index 52e087d741e..1ae8ec8ea01 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/GenericIndexed.java +++ b/processing/src/main/java/io/druid/segment/data/GenericIndexed.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,14 +17,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; 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 io.druid.data.Indexed; import java.io.ByteArrayOutputStream; import java.io.Closeable; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/GenericIndexedWriter.java b/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java similarity index 98% rename from indexing-common/src/main/java/com/metamx/druid/kv/GenericIndexedWriter.java rename to processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java index dd970ee403e..bd6258b2a52 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/GenericIndexedWriter.java +++ b/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.base.Function; import com.google.common.base.Preconditions; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/IOPeon.java b/processing/src/main/java/io/druid/segment/data/IOPeon.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/kv/IOPeon.java rename to processing/src/main/java/io/druid/segment/data/IOPeon.java index c57be9d1bb9..baac06ca3f8 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/IOPeon.java +++ b/processing/src/main/java/io/druid/segment/data/IOPeon.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import java.io.IOException; import java.io.InputStream; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedFloats.java b/processing/src/main/java/io/druid/segment/data/InMemoryCompressedFloats.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedFloats.java rename to processing/src/main/java/io/druid/segment/data/InMemoryCompressedFloats.java index 4557c5bda6d..15420d7c900 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedFloats.java +++ b/processing/src/main/java/io/druid/segment/data/InMemoryCompressedFloats.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.base.Function; import com.google.common.collect.Iterables; @@ -25,8 +25,6 @@ import com.google.common.collect.Lists; import com.google.common.io.Closeables; import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidResourceHolder; -import com.metamx.druid.kv.GenericIndexed; -import io.druid.data.IndexedFloats; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedLongs.java b/processing/src/main/java/io/druid/segment/data/InMemoryCompressedLongs.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedLongs.java rename to processing/src/main/java/io/druid/segment/data/InMemoryCompressedLongs.java index 811de5118df..de62d7b2de0 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/InMemoryCompressedLongs.java +++ b/processing/src/main/java/io/druid/segment/data/InMemoryCompressedLongs.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.base.Function; import com.google.common.collect.Iterables; @@ -25,8 +25,6 @@ import com.google.common.collect.Lists; import com.google.common.io.Closeables; import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidResourceHolder; -import com.metamx.druid.kv.GenericIndexed; -import io.druid.data.IndexedLongs; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/segment/src/main/java/io/druid/data/Indexed.java b/processing/src/main/java/io/druid/segment/data/Indexed.java similarity index 96% rename from segment/src/main/java/io/druid/data/Indexed.java rename to processing/src/main/java/io/druid/segment/data/Indexed.java index 447fcf4a407..f8def0481b7 100644 --- a/segment/src/main/java/io/druid/data/Indexed.java +++ b/processing/src/main/java/io/druid/segment/data/Indexed.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.data; +package io.druid.segment.data; /** * @param diff --git a/segment/src/main/java/io/druid/data/IndexedFloats.java b/processing/src/main/java/io/druid/segment/data/IndexedFloats.java similarity index 97% rename from segment/src/main/java/io/druid/data/IndexedFloats.java rename to processing/src/main/java/io/druid/segment/data/IndexedFloats.java index 78a1a02016e..cc01524f86f 100644 --- a/segment/src/main/java/io/druid/data/IndexedFloats.java +++ b/processing/src/main/java/io/druid/segment/data/IndexedFloats.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.data; +package io.druid.segment.data; import java.io.Closeable; diff --git a/segment/src/main/java/io/druid/data/IndexedInts.java b/processing/src/main/java/io/druid/segment/data/IndexedInts.java similarity index 96% rename from segment/src/main/java/io/druid/data/IndexedInts.java rename to processing/src/main/java/io/druid/segment/data/IndexedInts.java index 85bb8aa8b18..de0f213fb4b 100644 --- a/segment/src/main/java/io/druid/data/IndexedInts.java +++ b/processing/src/main/java/io/druid/segment/data/IndexedInts.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.data; +package io.druid.segment.data; /** * Get a int an index (array or list lookup abstraction without boxing). diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/IndexedIntsIterator.java b/processing/src/main/java/io/druid/segment/data/IndexedIntsIterator.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/kv/IndexedIntsIterator.java rename to processing/src/main/java/io/druid/segment/data/IndexedIntsIterator.java index 4b72d0dc7f2..6b5a40b2818 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/IndexedIntsIterator.java +++ b/processing/src/main/java/io/druid/segment/data/IndexedIntsIterator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; -import io.druid.data.IndexedInts; import java.util.Iterator; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/IndexedIterable.java b/processing/src/main/java/io/druid/segment/data/IndexedIterable.java similarity index 94% rename from indexing-common/src/main/java/com/metamx/druid/kv/IndexedIterable.java rename to processing/src/main/java/io/druid/segment/data/IndexedIterable.java index 07b349f528c..f8d331e0deb 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/IndexedIterable.java +++ b/processing/src/main/java/io/druid/segment/data/IndexedIterable.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; - -import io.druid.data.Indexed; +package io.druid.segment.data; import java.util.Iterator; import java.util.NoSuchElementException; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/IndexedList.java b/processing/src/main/java/io/druid/segment/data/IndexedList.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/kv/IndexedList.java rename to processing/src/main/java/io/druid/segment/data/IndexedList.java index 544d64f7d68..8839231231a 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/IndexedList.java +++ b/processing/src/main/java/io/druid/segment/data/IndexedList.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; - -import io.druid.data.Indexed; +package io.druid.segment.data; import java.util.AbstractList; diff --git a/segment/src/main/java/io/druid/data/IndexedLongs.java b/processing/src/main/java/io/druid/segment/data/IndexedLongs.java similarity index 97% rename from segment/src/main/java/io/druid/data/IndexedLongs.java rename to processing/src/main/java/io/druid/segment/data/IndexedLongs.java index d42d2d166af..eabd9be5a82 100644 --- a/segment/src/main/java/io/druid/data/IndexedLongs.java +++ b/processing/src/main/java/io/druid/segment/data/IndexedLongs.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package io.druid.data; +package io.druid.segment.data; import java.io.Closeable; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/IndexedRTree.java b/processing/src/main/java/io/druid/segment/data/IndexedRTree.java similarity index 68% rename from indexing-common/src/main/java/com/metamx/druid/kv/IndexedRTree.java rename to processing/src/main/java/io/druid/segment/data/IndexedRTree.java index 8c8e3c46d50..b5cb07388fd 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/IndexedRTree.java +++ b/processing/src/main/java/io/druid/segment/data/IndexedRTree.java @@ -1,4 +1,23 @@ -package com.metamx.druid.kv; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.segment.data; import com.google.common.collect.Ordering; import com.metamx.collections.spatial.ImmutableRTree; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/Indexedids.java b/processing/src/main/java/io/druid/segment/data/Indexedids.java similarity index 90% rename from indexing-common/src/main/java/com/metamx/druid/kv/Indexedids.java rename to processing/src/main/java/io/druid/segment/data/Indexedids.java index 4a87a0eb42c..9ced3b72c4e 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/Indexedids.java +++ b/processing/src/main/java/io/druid/segment/data/Indexedids.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; - -import io.druid.data.IndexedInts; +package io.druid.segment.data; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/IntBufferIndexedInts.java b/processing/src/main/java/io/druid/segment/data/IntBufferIndexedInts.java similarity index 96% rename from indexing-common/src/main/java/com/metamx/druid/kv/IntBufferIndexedInts.java rename to processing/src/main/java/io/druid/segment/data/IntBufferIndexedInts.java index d59b642b56d..ebe7b01ae80 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/IntBufferIndexedInts.java +++ b/processing/src/main/java/io/druid/segment/data/IntBufferIndexedInts.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.collect.Ordering; import com.google.common.primitives.Ints; import com.metamx.druid.IntList; -import io.druid.data.IndexedInts; import java.nio.ByteBuffer; import java.nio.IntBuffer; diff --git a/server/src/main/java/com/metamx/druid/index/v1/processing/IntersectingOffset.java b/processing/src/main/java/io/druid/segment/data/IntersectingOffset.java similarity index 95% rename from server/src/main/java/com/metamx/druid/index/v1/processing/IntersectingOffset.java rename to processing/src/main/java/io/druid/segment/data/IntersectingOffset.java index 25cacff2093..0f5a7f7b885 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/processing/IntersectingOffset.java +++ b/processing/src/main/java/io/druid/segment/data/IntersectingOffset.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.processing; +package io.druid.segment.data; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/ListIndexed.java b/processing/src/main/java/io/druid/segment/data/ListIndexed.java similarity index 93% rename from indexing-common/src/main/java/com/metamx/druid/kv/ListIndexed.java rename to processing/src/main/java/io/druid/segment/data/ListIndexed.java index c5b52f54b0d..b58a9ed516c 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/ListIndexed.java +++ b/processing/src/main/java/io/druid/segment/data/ListIndexed.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; - -import io.druid.data.Indexed; +package io.druid.segment.data; import java.util.Iterator; import java.util.List; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/ObjectStrategy.java b/processing/src/main/java/io/druid/segment/data/ObjectStrategy.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/kv/ObjectStrategy.java rename to processing/src/main/java/io/druid/segment/data/ObjectStrategy.java index 57c7a9426a7..7e2753523ba 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/ObjectStrategy.java +++ b/processing/src/main/java/io/druid/segment/data/ObjectStrategy.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import java.nio.ByteBuffer; import java.util.Comparator; diff --git a/server/src/main/java/com/metamx/druid/index/v1/processing/Offset.java b/processing/src/main/java/io/druid/segment/data/Offset.java similarity index 92% rename from server/src/main/java/com/metamx/druid/index/v1/processing/Offset.java rename to processing/src/main/java/io/druid/segment/data/Offset.java index 17d0a2ebace..db178f04f30 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/processing/Offset.java +++ b/processing/src/main/java/io/druid/segment/data/Offset.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.processing; +package io.druid.segment.data; /** * The "mutable" version of a ReadableOffset. Introduces "increment()" and "withinBounds()" methods, which are diff --git a/server/src/main/java/com/metamx/druid/index/v1/processing/ReadableOffset.java b/processing/src/main/java/io/druid/segment/data/ReadableOffset.java similarity index 92% rename from server/src/main/java/com/metamx/druid/index/v1/processing/ReadableOffset.java rename to processing/src/main/java/io/druid/segment/data/ReadableOffset.java index aea02d16fb6..f55a10c4342 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/processing/ReadableOffset.java +++ b/processing/src/main/java/io/druid/segment/data/ReadableOffset.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.processing; +package io.druid.segment.data; /** * A ReadableOffset is an object that provides an integer offset, ostensibly as an index into an array. diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/DimensionColumn.java b/processing/src/main/java/io/druid/segment/data/SingleIndexedInts.java similarity index 57% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/DimensionColumn.java rename to processing/src/main/java/io/druid/segment/data/SingleIndexedInts.java index f2975600d23..796f7ef655d 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/DimensionColumn.java +++ b/processing/src/main/java/io/druid/segment/data/SingleIndexedInts.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,36 +17,37 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; + +import com.google.common.collect.Iterators; + +import java.util.Iterator; /** - */ -public class DimensionColumn +*/ +public class SingleIndexedInts implements IndexedInts { - final int[][] dimensionLookups; - final int[] dimensionValues; + private final int value; - public DimensionColumn( - int[][] dimensionLookups, - int[] dimensionValues - ) - { - this.dimensionLookups = dimensionLookups; - this.dimensionValues = dimensionValues; + public SingleIndexedInts(int value) { + this.value = value; } - public int[] getDimValues(int rowId) + @Override + public int size() { - return dimensionLookups[dimensionValues[rowId]]; + return 1; } - public int[][] getDimensionExpansions() + @Override + public int get(int index) { - return dimensionLookups; + return value; } - public int[] getDimensionRowValues() + @Override + public Iterator iterator() { - return dimensionValues; + return Iterators.singletonIterator(value); } } diff --git a/server/src/main/java/com/metamx/druid/index/v1/processing/StartLimitedOffset.java b/processing/src/main/java/io/druid/segment/data/StartLimitedOffset.java similarity index 94% rename from server/src/main/java/com/metamx/druid/index/v1/processing/StartLimitedOffset.java rename to processing/src/main/java/io/druid/segment/data/StartLimitedOffset.java index 0bb84122334..dd4d34585c5 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/processing/StartLimitedOffset.java +++ b/processing/src/main/java/io/druid/segment/data/StartLimitedOffset.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.processing; +package io.druid.segment.data; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/TmpFileIOPeon.java b/processing/src/main/java/io/druid/segment/data/TmpFileIOPeon.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/kv/TmpFileIOPeon.java rename to processing/src/main/java/io/druid/segment/data/TmpFileIOPeon.java index 9af7e0b0337..a60ed66838c 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/TmpFileIOPeon.java +++ b/processing/src/main/java/io/druid/segment/data/TmpFileIOPeon.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.collect.Maps; diff --git a/server/src/main/java/com/metamx/druid/index/v1/processing/UnioningOffset.java b/processing/src/main/java/io/druid/segment/data/UnioningOffset.java similarity index 97% rename from server/src/main/java/com/metamx/druid/index/v1/processing/UnioningOffset.java rename to processing/src/main/java/io/druid/segment/data/UnioningOffset.java index 263aa665ff9..a12256519c6 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/processing/UnioningOffset.java +++ b/processing/src/main/java/io/druid/segment/data/UnioningOffset.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.processing; +package io.druid.segment.data; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/VSizeIndexed.java b/processing/src/main/java/io/druid/segment/data/VSizeIndexed.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/kv/VSizeIndexed.java rename to processing/src/main/java/io/druid/segment/data/VSizeIndexed.java index 8a9f3620549..8c1f481b2d1 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/VSizeIndexed.java +++ b/processing/src/main/java/io/druid/segment/data/VSizeIndexed.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,18 +17,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.primitives.Ints; import com.metamx.common.IAE; import com.metamx.common.ISE; -import io.druid.data.Indexed; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.WritableByteChannel; -import java.util.Arrays; import java.util.Iterator; /** @@ -37,11 +35,6 @@ public class VSizeIndexed implements Indexed { private static final byte version = 0x1; - public static VSizeIndexed fromArray(VSizeIndexedInts[] objects) - { - return fromIterable(Arrays.asList(objects)); - } - public static VSizeIndexed fromIterable(Iterable objectsIterable) { Iterator objects = objectsIterable.iterator(); diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/VSizeIndexedInts.java b/processing/src/main/java/io/druid/segment/data/VSizeIndexedInts.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/kv/VSizeIndexedInts.java rename to processing/src/main/java/io/druid/segment/data/VSizeIndexedInts.java index 02d7e2a5d75..a2c106ff309 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/VSizeIndexedInts.java +++ b/processing/src/main/java/io/druid/segment/data/VSizeIndexedInts.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.primitives.Ints; import com.metamx.common.IAE; -import io.druid.data.IndexedInts; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/kv/VSizeIndexedWriter.java b/processing/src/main/java/io/druid/segment/data/VSizeIndexedWriter.java similarity index 98% rename from indexing-common/src/main/java/com/metamx/druid/kv/VSizeIndexedWriter.java rename to processing/src/main/java/io/druid/segment/data/VSizeIndexedWriter.java index c50ea15ad53..87fcc127155 100644 --- a/indexing-common/src/main/java/com/metamx/druid/kv/VSizeIndexedWriter.java +++ b/processing/src/main/java/io/druid/segment/data/VSizeIndexedWriter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.base.Function; import com.google.common.base.Preconditions; diff --git a/server/src/main/java/com/metamx/druid/index/brita/AndFilter.java b/processing/src/main/java/io/druid/segment/filter/AndFilter.java similarity index 96% rename from server/src/main/java/com/metamx/druid/index/brita/AndFilter.java rename to processing/src/main/java/io/druid/segment/filter/AndFilter.java index d5acb100f05..70b374459db 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/AndFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/AndFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import com.google.common.collect.Lists; import io.druid.query.filter.BitmapIndexSelector; diff --git a/server/src/main/java/com/metamx/druid/index/brita/BooleanValueMatcher.java b/processing/src/main/java/io/druid/segment/filter/BooleanValueMatcher.java similarity index 92% rename from server/src/main/java/com/metamx/druid/index/brita/BooleanValueMatcher.java rename to processing/src/main/java/io/druid/segment/filter/BooleanValueMatcher.java index fe99271d0a6..c60a72befff 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/BooleanValueMatcher.java +++ b/processing/src/main/java/io/druid/segment/filter/BooleanValueMatcher.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import io.druid.query.filter.ValueMatcher; diff --git a/server/src/main/java/com/metamx/druid/index/brita/DimensionPredicateFilter.java b/processing/src/main/java/io/druid/segment/filter/DimensionPredicateFilter.java similarity index 95% rename from server/src/main/java/com/metamx/druid/index/brita/DimensionPredicateFilter.java rename to processing/src/main/java/io/druid/segment/filter/DimensionPredicateFilter.java index 87e40e2a715..b3f06b949a3 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/DimensionPredicateFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/DimensionPredicateFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,16 +17,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import com.google.common.base.Function; import com.google.common.base.Predicate; import com.metamx.common.guava.FunctionalIterable; -import io.druid.data.Indexed; import io.druid.query.filter.BitmapIndexSelector; import io.druid.query.filter.Filter; import io.druid.query.filter.ValueMatcher; import io.druid.query.filter.ValueMatcherFactory; +import io.druid.segment.data.Indexed; 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/processing/src/main/java/io/druid/segment/filter/ExtractionFilter.java similarity index 94% rename from server/src/main/java/com/metamx/druid/index/brita/ExtractionFilter.java rename to processing/src/main/java/io/druid/segment/filter/ExtractionFilter.java index 85711900dbe..62a92ca193a 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/ExtractionFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/ExtractionFilter.java @@ -17,15 +17,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import com.google.common.collect.Lists; -import com.metamx.druid.query.extraction.DimExtractionFn; -import io.druid.data.Indexed; +import io.druid.query.extraction.DimExtractionFn; import io.druid.query.filter.BitmapIndexSelector; import io.druid.query.filter.Filter; import io.druid.query.filter.ValueMatcher; import io.druid.query.filter.ValueMatcherFactory; +import io.druid.segment.data.Indexed; 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/processing/src/main/java/io/druid/segment/filter/Filters.java similarity index 84% rename from server/src/main/java/com/metamx/druid/index/brita/Filters.java rename to processing/src/main/java/io/druid/segment/filter/Filters.java index 1c3f0785301..21c4722d1fd 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/Filters.java +++ b/processing/src/main/java/io/druid/segment/filter/Filters.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,21 +17,21 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import com.google.common.base.Function; import com.google.common.collect.Lists; -import com.metamx.druid.query.filter.AndDimFilter; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.query.filter.ExtractionDimFilter; -import com.metamx.druid.query.filter.JavaScriptDimFilter; -import com.metamx.druid.query.filter.NotDimFilter; -import com.metamx.druid.query.filter.OrDimFilter; -import com.metamx.druid.query.filter.RegexDimFilter; -import com.metamx.druid.query.filter.SearchQueryDimFilter; -import com.metamx.druid.query.filter.SelectorDimFilter; -import com.metamx.druid.query.filter.SpatialDimFilter; +import io.druid.query.filter.AndDimFilter; +import io.druid.query.filter.DimFilter; +import io.druid.query.filter.ExtractionDimFilter; import io.druid.query.filter.Filter; +import io.druid.query.filter.JavaScriptDimFilter; +import io.druid.query.filter.NotDimFilter; +import io.druid.query.filter.OrDimFilter; +import io.druid.query.filter.RegexDimFilter; +import io.druid.query.filter.SearchQueryDimFilter; +import io.druid.query.filter.SelectorDimFilter; +import io.druid.query.filter.SpatialDimFilter; import javax.annotation.Nullable; import java.util.List; diff --git a/server/src/main/java/com/metamx/druid/index/brita/JavaScriptFilter.java b/processing/src/main/java/io/druid/segment/filter/JavaScriptFilter.java similarity index 81% rename from server/src/main/java/com/metamx/druid/index/brita/JavaScriptFilter.java rename to processing/src/main/java/io/druid/segment/filter/JavaScriptFilter.java index 1288b35bfa9..743a07421cb 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/JavaScriptFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/JavaScriptFilter.java @@ -1,4 +1,23 @@ -package com.metamx.druid.index.brita; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.segment.filter; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; diff --git a/server/src/main/java/com/metamx/druid/index/brita/NotFilter.java b/processing/src/main/java/io/druid/segment/filter/NotFilter.java similarity index 95% rename from server/src/main/java/com/metamx/druid/index/brita/NotFilter.java rename to processing/src/main/java/io/druid/segment/filter/NotFilter.java index 39f5f9d5f4e..d517613f978 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/NotFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/NotFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import io.druid.query.filter.BitmapIndexSelector; import io.druid.query.filter.Filter; diff --git a/server/src/main/java/com/metamx/druid/index/brita/OrFilter.java b/processing/src/main/java/io/druid/segment/filter/OrFilter.java similarity index 96% rename from server/src/main/java/com/metamx/druid/index/brita/OrFilter.java rename to processing/src/main/java/io/druid/segment/filter/OrFilter.java index 31a861258b4..8476066a933 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/OrFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/OrFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import com.google.common.collect.Lists; import io.druid.query.filter.BitmapIndexSelector; diff --git a/server/src/main/java/com/metamx/druid/index/brita/RegexFilter.java b/processing/src/main/java/io/druid/segment/filter/RegexFilter.java similarity index 91% rename from server/src/main/java/com/metamx/druid/index/brita/RegexFilter.java rename to processing/src/main/java/io/druid/segment/filter/RegexFilter.java index b8880f4289e..05b5e70fad6 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/RegexFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/RegexFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import com.google.common.base.Predicate; -import javax.annotation.Nullable; import java.util.regex.Pattern; /** diff --git a/server/src/main/java/com/metamx/druid/index/brita/SearchQueryFilter.java b/processing/src/main/java/io/druid/segment/filter/SearchQueryFilter.java similarity index 91% rename from server/src/main/java/com/metamx/druid/index/brita/SearchQueryFilter.java rename to processing/src/main/java/io/druid/segment/filter/SearchQueryFilter.java index a94a518dc61..0f80683187e 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/SearchQueryFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/SearchQueryFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Predicate; -import com.metamx.druid.query.search.SearchQuerySpec; +import io.druid.query.search.search.SearchQuerySpec; import javax.annotation.Nullable; diff --git a/server/src/main/java/com/metamx/druid/index/brita/SelectorFilter.java b/processing/src/main/java/io/druid/segment/filter/SelectorFilter.java similarity index 94% rename from server/src/main/java/com/metamx/druid/index/brita/SelectorFilter.java rename to processing/src/main/java/io/druid/segment/filter/SelectorFilter.java index 13b0cdd6c07..f57d040a1c0 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/SelectorFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/SelectorFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.brita; +package io.druid.segment.filter; import io.druid.query.filter.BitmapIndexSelector; import io.druid.query.filter.Filter; diff --git a/server/src/main/java/com/metamx/druid/index/brita/SpatialFilter.java b/processing/src/main/java/io/druid/segment/filter/SpatialFilter.java similarity index 95% rename from server/src/main/java/com/metamx/druid/index/brita/SpatialFilter.java rename to processing/src/main/java/io/druid/segment/filter/SpatialFilter.java index bfe74c0e329..538b133be57 100644 --- a/server/src/main/java/com/metamx/druid/index/brita/SpatialFilter.java +++ b/processing/src/main/java/io/druid/segment/filter/SpatialFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -16,7 +16,7 @@ * 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.index.brita; +package io.druid.segment.filter; import com.metamx.collections.spatial.search.Bound; import io.druid.query.filter.BitmapIndexSelector; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndex.java similarity index 98% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java rename to processing/src/main/java/io/druid/segment/incremental/IncrementalIndex.java index f910eab0483..ffe02cd8716 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java +++ b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndex.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.incremental; import com.google.common.base.Function; import com.google.common.base.Joiner; @@ -33,9 +33,6 @@ import com.google.common.primitives.Longs; import com.metamx.common.IAE; import com.metamx.common.ISE; import com.metamx.common.logger.Logger; -import com.metamx.druid.index.v1.serde.ComplexMetricExtractor; -import com.metamx.druid.index.v1.serde.ComplexMetricSerde; -import com.metamx.druid.index.v1.serde.ComplexMetrics; import com.metamx.druid.input.InputRow; import com.metamx.druid.input.MapBasedRow; import com.metamx.druid.input.Row; @@ -47,6 +44,9 @@ import io.druid.segment.ComplexMetricSelector; import io.druid.segment.FloatMetricSelector; import io.druid.segment.MetricSelectorFactory; import io.druid.segment.ObjectMetricSelector; +import io.druid.segment.serde.ComplexMetricExtractor; +import io.druid.segment.serde.ComplexMetricSerde; +import io.druid.segment.serde.ComplexMetrics; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndexAdapter.java b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexAdapter.java similarity index 95% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndexAdapter.java rename to processing/src/main/java/io/druid/segment/incremental/IncrementalIndexAdapter.java index 9968484f386..4ebea50e24d 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndexAdapter.java +++ b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexAdapter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,18 +17,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.incremental; import com.google.common.base.Function; import com.google.common.collect.Maps; import com.metamx.common.guava.FunctionalIterable; import com.metamx.common.logger.Logger; -import com.metamx.druid.kv.EmptyIndexedInts; -import com.metamx.druid.kv.IndexedIterable; -import com.metamx.druid.kv.ListIndexed; -import io.druid.data.Indexed; -import io.druid.data.IndexedInts; import io.druid.query.aggregation.Aggregator; +import io.druid.segment.IndexableAdapter; +import io.druid.segment.Rowboat; +import io.druid.segment.data.EmptyIndexedInts; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedInts; +import io.druid.segment.data.IndexedIterable; +import io.druid.segment.data.ListIndexed; import it.uniroma3.mat.extendedset.intset.ConciseSet; import it.uniroma3.mat.extendedset.intset.IntSet; import org.joda.time.Interval; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndexSchema.java b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexSchema.java similarity index 77% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndexSchema.java rename to processing/src/main/java/io/druid/segment/incremental/IncrementalIndexSchema.java index 54d94ac74a2..5bd0250c90f 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndexSchema.java +++ b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexSchema.java @@ -1,4 +1,23 @@ -package com.metamx.druid.index.v1; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.segment.incremental; import com.google.common.base.Function; import com.google.common.collect.Iterables; diff --git a/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexStorageAdapter.java b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java similarity index 98% rename from server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexStorageAdapter.java rename to processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java index 80a734fe8ea..8e2935a7d4b 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/IncrementalIndexStorageAdapter.java +++ b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.incremental; import com.google.common.base.Function; import com.google.common.base.Predicate; @@ -27,12 +27,6 @@ import com.google.common.collect.Iterators; import com.google.common.collect.Lists; import com.metamx.collections.spatial.search.Bound; import com.metamx.common.guava.FunctionalIterator; -import com.metamx.druid.index.brita.BooleanValueMatcher; -import com.metamx.druid.index.v1.serde.ComplexMetricSerde; -import com.metamx.druid.index.v1.serde.ComplexMetrics; -import com.metamx.druid.kv.ListIndexed; -import io.druid.data.Indexed; -import io.druid.data.IndexedInts; import io.druid.granularity.QueryGranularity; import io.druid.query.aggregation.Aggregator; import io.druid.query.filter.Filter; @@ -45,6 +39,12 @@ import io.druid.segment.DimensionSelector; import io.druid.segment.FloatMetricSelector; import io.druid.segment.ObjectMetricSelector; import io.druid.segment.StorageAdapter; +import io.druid.segment.data.Indexed; +import io.druid.segment.data.IndexedInts; +import io.druid.segment.data.ListIndexed; +import io.druid.segment.filter.BooleanValueMatcher; +import io.druid.segment.serde.ComplexMetricSerde; +import io.druid.segment.serde.ComplexMetrics; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionRowFormatter.java b/processing/src/main/java/io/druid/segment/incremental/SpatialDimensionRowFormatter.java similarity index 98% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionRowFormatter.java rename to processing/src/main/java/io/druid/segment/incremental/SpatialDimensionRowFormatter.java index 22c0c5c7edf..0eca207f8fe 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionRowFormatter.java +++ b/processing/src/main/java/io/druid/segment/incremental/SpatialDimensionRowFormatter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.incremental; import com.google.common.base.Function; import com.google.common.base.Joiner; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionSchema.java b/processing/src/main/java/io/druid/segment/incremental/SpatialDimensionSchema.java similarity index 51% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionSchema.java rename to processing/src/main/java/io/druid/segment/incremental/SpatialDimensionSchema.java index 311626e5bc0..6ef1e788c6c 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionSchema.java +++ b/processing/src/main/java/io/druid/segment/incremental/SpatialDimensionSchema.java @@ -1,4 +1,23 @@ -package com.metamx.druid.index.v1; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.segment.incremental; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/BitmapIndexColumnPartSupplier.java b/processing/src/main/java/io/druid/segment/serde/BitmapIndexColumnPartSupplier.java similarity index 94% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/BitmapIndexColumnPartSupplier.java rename to processing/src/main/java/io/druid/segment/serde/BitmapIndexColumnPartSupplier.java index f5ada9c15fb..d36e6a684e1 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/BitmapIndexColumnPartSupplier.java +++ b/processing/src/main/java/io/druid/segment/serde/BitmapIndexColumnPartSupplier.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.google.common.base.Supplier; -import com.metamx.druid.kv.GenericIndexed; import io.druid.segment.column.BitmapIndex; +import io.druid.segment.data.GenericIndexed; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; /** diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/ColumnPartSerde.java b/processing/src/main/java/io/druid/segment/serde/ColumnPartSerde.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/ColumnPartSerde.java rename to processing/src/main/java/io/druid/segment/serde/ColumnPartSerde.java index 556fab5ea4d..c22685ddc65 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/ColumnPartSerde.java +++ b/processing/src/main/java/io/druid/segment/serde/ColumnPartSerde.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.metamx.druid.index.column.ColumnBuilder; +import io.druid.segment.column.ColumnBuilder; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/ComplexColumnPartSerde.java b/processing/src/main/java/io/druid/segment/serde/ComplexColumnPartSerde.java similarity index 87% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/ComplexColumnPartSerde.java rename to processing/src/main/java/io/druid/segment/serde/ComplexColumnPartSerde.java index 03e13cfe371..080978e77ab 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/ComplexColumnPartSerde.java +++ b/processing/src/main/java/io/druid/segment/serde/ComplexColumnPartSerde.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,14 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.index.column.ColumnBuilder; -import com.metamx.druid.index.v1.serde.ComplexMetricSerde; -import com.metamx.druid.index.v1.serde.ComplexMetrics; -import com.metamx.druid.kv.GenericIndexed; +import io.druid.segment.column.ColumnBuilder; +import io.druid.segment.data.GenericIndexed; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/ComplexColumnPartSupplier.java b/processing/src/main/java/io/druid/segment/serde/ComplexColumnPartSupplier.java similarity index 87% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/ComplexColumnPartSupplier.java rename to processing/src/main/java/io/druid/segment/serde/ComplexColumnPartSupplier.java index 092a3820a7b..7251e557ab4 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/ComplexColumnPartSupplier.java +++ b/processing/src/main/java/io/druid/segment/serde/ComplexColumnPartSupplier.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.google.common.base.Supplier; -import com.metamx.druid.index.column.IndexedComplexColumn; -import com.metamx.druid.kv.GenericIndexed; import io.druid.segment.column.ComplexColumn; +import io.druid.segment.column.IndexedComplexColumn; +import io.druid.segment.data.GenericIndexed; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/ComplexMetricColumnSerializer.java b/processing/src/main/java/io/druid/segment/serde/ComplexMetricColumnSerializer.java similarity index 87% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/ComplexMetricColumnSerializer.java rename to processing/src/main/java/io/druid/segment/serde/ComplexMetricColumnSerializer.java index 55032f54da0..dd5e5939bea 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/ComplexMetricColumnSerializer.java +++ b/processing/src/main/java/io/druid/segment/serde/ComplexMetricColumnSerializer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.serde; import com.google.common.io.Files; -import com.metamx.druid.index.v1.serde.ComplexMetricSerde; -import com.metamx.druid.kv.GenericIndexedWriter; -import com.metamx.druid.kv.IOPeon; +import io.druid.segment.IndexIO; +import io.druid.segment.MetricColumnSerializer; +import io.druid.segment.MetricHolder; +import io.druid.segment.data.GenericIndexedWriter; +import io.druid.segment.data.IOPeon; import java.io.File; import java.io.IOException; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricExtractor.java b/processing/src/main/java/io/druid/segment/serde/ComplexMetricExtractor.java similarity index 91% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricExtractor.java rename to processing/src/main/java/io/druid/segment/serde/ComplexMetricExtractor.java index b2c5545db73..03b54bb9f8c 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricExtractor.java +++ b/processing/src/main/java/io/druid/segment/serde/ComplexMetricExtractor.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.serde; +package io.druid.segment.serde; import com.metamx.druid.input.InputRow; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricSerde.java b/processing/src/main/java/io/druid/segment/serde/ComplexMetricSerde.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricSerde.java rename to processing/src/main/java/io/druid/segment/serde/ComplexMetricSerde.java index eb39ece5a70..2ac3b309f62 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetricSerde.java +++ b/processing/src/main/java/io/druid/segment/serde/ComplexMetricSerde.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.serde; +package io.druid.segment.serde; import com.google.common.base.Function; -import com.metamx.druid.index.column.ColumnBuilder; -import com.metamx.druid.index.serde.ColumnPartSerde; -import com.metamx.druid.kv.ObjectStrategy; +import io.druid.segment.column.ColumnBuilder; +import io.druid.segment.data.ObjectStrategy; import java.nio.ByteBuffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetrics.java b/processing/src/main/java/io/druid/segment/serde/ComplexMetrics.java similarity index 93% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetrics.java rename to processing/src/main/java/io/druid/segment/serde/ComplexMetrics.java index 33093f8f825..ae7cee1679a 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/serde/ComplexMetrics.java +++ b/processing/src/main/java/io/druid/segment/serde/ComplexMetrics.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.serde; +package io.druid.segment.serde; import com.google.common.collect.Maps; import com.metamx.common.ISE; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/DictionaryEncodedColumnPartSerde.java b/processing/src/main/java/io/druid/segment/serde/DictionaryEncodedColumnPartSerde.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/DictionaryEncodedColumnPartSerde.java rename to processing/src/main/java/io/druid/segment/serde/DictionaryEncodedColumnPartSerde.java index b8fa919a35f..391bc62ffdb 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/DictionaryEncodedColumnPartSerde.java +++ b/processing/src/main/java/io/druid/segment/serde/DictionaryEncodedColumnPartSerde.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,21 +17,21 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.primitives.Ints; import com.metamx.collections.spatial.ImmutableRTree; import com.metamx.common.IAE; -import com.metamx.druid.index.column.ColumnBuilder; -import com.metamx.druid.kv.ByteBufferSerializer; -import com.metamx.druid.kv.ConciseCompressedIndexedInts; -import com.metamx.druid.kv.GenericIndexed; -import com.metamx.druid.kv.IndexedRTree; -import com.metamx.druid.kv.VSizeIndexed; -import com.metamx.druid.kv.VSizeIndexedInts; +import io.druid.segment.column.ColumnBuilder; import io.druid.segment.column.ValueType; +import io.druid.segment.data.ByteBufferSerializer; +import io.druid.segment.data.ConciseCompressedIndexedInts; +import io.druid.segment.data.GenericIndexed; +import io.druid.segment.data.IndexedRTree; +import io.druid.segment.data.VSizeIndexed; +import io.druid.segment.data.VSizeIndexedInts; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import java.io.IOException; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/DictionaryEncodedColumnSupplier.java b/processing/src/main/java/io/druid/segment/serde/DictionaryEncodedColumnSupplier.java similarity index 84% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/DictionaryEncodedColumnSupplier.java rename to processing/src/main/java/io/druid/segment/serde/DictionaryEncodedColumnSupplier.java index c1a3cc0f077..d2a5ee82a85 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/DictionaryEncodedColumnSupplier.java +++ b/processing/src/main/java/io/druid/segment/serde/DictionaryEncodedColumnSupplier.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,14 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.google.common.base.Supplier; -import com.metamx.druid.index.column.SimpleDictionaryEncodedColumn; -import com.metamx.druid.kv.GenericIndexed; -import com.metamx.druid.kv.VSizeIndexed; -import com.metamx.druid.kv.VSizeIndexedInts; import io.druid.segment.column.DictionaryEncodedColumn; +import io.druid.segment.column.SimpleDictionaryEncodedColumn; +import io.druid.segment.data.GenericIndexed; +import io.druid.segment.data.VSizeIndexed; +import io.druid.segment.data.VSizeIndexedInts; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/FloatGenericColumnPartSerde.java b/processing/src/main/java/io/druid/segment/serde/FloatGenericColumnPartSerde.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/FloatGenericColumnPartSerde.java rename to processing/src/main/java/io/druid/segment/serde/FloatGenericColumnPartSerde.java index b18a06c21d1..0a0951af793 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/FloatGenericColumnPartSerde.java +++ b/processing/src/main/java/io/druid/segment/serde/FloatGenericColumnPartSerde.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.index.column.ColumnBuilder; -import com.metamx.druid.index.v1.CompressedFloatsIndexedSupplier; +import io.druid.segment.column.ColumnBuilder; import io.druid.segment.column.ValueType; +import io.druid.segment.data.CompressedFloatsIndexedSupplier; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/FloatGenericColumnSupplier.java b/processing/src/main/java/io/druid/segment/serde/FloatGenericColumnSupplier.java similarity index 86% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/FloatGenericColumnSupplier.java rename to processing/src/main/java/io/druid/segment/serde/FloatGenericColumnSupplier.java index 3cfad0184f1..41d7c17fcdb 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/FloatGenericColumnSupplier.java +++ b/processing/src/main/java/io/druid/segment/serde/FloatGenericColumnSupplier.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.google.common.base.Supplier; -import com.metamx.druid.index.column.IndexedFloatsGenericColumn; -import com.metamx.druid.index.v1.CompressedFloatsIndexedSupplier; import io.druid.segment.column.GenericColumn; +import io.druid.segment.column.IndexedFloatsGenericColumn; +import io.druid.segment.data.CompressedFloatsIndexedSupplier; import java.nio.ByteOrder; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/LongGenericColumnPartSerde.java b/processing/src/main/java/io/druid/segment/serde/LongGenericColumnPartSerde.java similarity index 92% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/LongGenericColumnPartSerde.java rename to processing/src/main/java/io/druid/segment/serde/LongGenericColumnPartSerde.java index 32e0703dacc..92e25b17e79 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/LongGenericColumnPartSerde.java +++ b/processing/src/main/java/io/druid/segment/serde/LongGenericColumnPartSerde.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.index.column.ColumnBuilder; -import com.metamx.druid.index.v1.CompressedLongsIndexedSupplier; +import io.druid.segment.column.ColumnBuilder; import io.druid.segment.column.ValueType; +import io.druid.segment.data.CompressedLongsIndexedSupplier; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/LongGenericColumnSupplier.java b/processing/src/main/java/io/druid/segment/serde/LongGenericColumnSupplier.java similarity index 85% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/LongGenericColumnSupplier.java rename to processing/src/main/java/io/druid/segment/serde/LongGenericColumnSupplier.java index 3c1401a18a6..edc8483efb3 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/LongGenericColumnSupplier.java +++ b/processing/src/main/java/io/druid/segment/serde/LongGenericColumnSupplier.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.serde; +package io.druid.segment.serde; import com.google.common.base.Supplier; -import com.metamx.druid.index.column.IndexedLongsGenericColumn; -import com.metamx.druid.index.v1.CompressedLongsIndexedSupplier; import io.druid.segment.column.GenericColumn; +import io.druid.segment.column.IndexedLongsGenericColumn; +import io.druid.segment.data.CompressedLongsIndexedSupplier; /** */ diff --git a/indexing-common/src/main/java/com/metamx/druid/index/v1/serde/Registererer.java b/processing/src/main/java/io/druid/segment/serde/Registererer.java similarity index 94% rename from indexing-common/src/main/java/com/metamx/druid/index/v1/serde/Registererer.java rename to processing/src/main/java/io/druid/segment/serde/Registererer.java index 8a18b7033cb..6c1fdcceb91 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/v1/serde/Registererer.java +++ b/processing/src/main/java/io/druid/segment/serde/Registererer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1.serde; +package io.druid.segment.serde; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/client/src/main/java/com/metamx/druid/RegisteringNode.java b/processing/src/main/java/io/druid/segment/serde/Registererers.java similarity index 89% rename from client/src/main/java/com/metamx/druid/RegisteringNode.java rename to processing/src/main/java/io/druid/segment/serde/Registererers.java index a0abbf2ecad..e56e42605f2 100644 --- a/client/src/main/java/com/metamx/druid/RegisteringNode.java +++ b/processing/src/main/java/io/druid/segment/serde/Registererers.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,14 +17,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.segment.serde; import com.fasterxml.jackson.databind.ObjectMapper; -import com.metamx.druid.index.v1.serde.Registererer; /** */ -public class RegisteringNode +public class Registererers { public static void registerHandlers(Iterable registererers, Iterable mappers) { diff --git a/indexing-common/src/main/java/com/metamx/druid/index/serde/SpatialIndexColumnPartSupplier.java b/processing/src/main/java/io/druid/segment/serde/SpatialIndexColumnPartSupplier.java similarity index 94% rename from indexing-common/src/main/java/com/metamx/druid/index/serde/SpatialIndexColumnPartSupplier.java rename to processing/src/main/java/io/druid/segment/serde/SpatialIndexColumnPartSupplier.java index ced6fcf65fa..48014bc8bb6 100644 --- a/indexing-common/src/main/java/com/metamx/druid/index/serde/SpatialIndexColumnPartSupplier.java +++ b/processing/src/main/java/io/druid/segment/serde/SpatialIndexColumnPartSupplier.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -16,7 +16,7 @@ * 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.index.serde; +package io.druid.segment.serde; import com.google.common.base.Supplier; import com.metamx.collections.spatial.ImmutableRTree; diff --git a/client/src/test/java/com/metamx/druid/CombiningIterableTest.java b/processing/src/test/java/io/druid/collections/CombiningIterableTest.java similarity index 88% rename from client/src/test/java/com/metamx/druid/CombiningIterableTest.java rename to processing/src/test/java/io/druid/collections/CombiningIterableTest.java index 94650467656..da839f1c249 100644 --- a/client/src/test/java/com/metamx/druid/CombiningIterableTest.java +++ b/processing/src/test/java/io/druid/collections/CombiningIterableTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.collections; import com.metamx.common.guava.nary.BinaryFn; -import com.metamx.druid.result.Result; +import com.metamx.druid.CombiningIterable; +import io.druid.query.Result; import org.joda.time.DateTime; import org.junit.Assert; import org.junit.Test; @@ -69,7 +70,10 @@ public class CombiningIterableTest return arg1; } - return new Result(arg1.getTimestamp(), ((Long) arg1.getValue()).longValue() + ((Long) arg2.getValue()).longValue()); + return new Result( + arg1.getTimestamp(), + ((Long) arg1.getValue()).longValue() + ((Long) arg2.getValue()).longValue() + ); } } ); diff --git a/indexing-common/src/test/java/com/metamx/druid/indexer/data/InputRowParserSerdeTest.java b/processing/src/test/java/io/druid/data/input/InputRowParserSerdeTest.java similarity index 97% rename from indexing-common/src/test/java/com/metamx/druid/indexer/data/InputRowParserSerdeTest.java rename to processing/src/test/java/io/druid/data/input/InputRowParserSerdeTest.java index 00c08750f77..264b9bcd4e7 100644 --- a/indexing-common/src/test/java/com/metamx/druid/indexer/data/InputRowParserSerdeTest.java +++ b/processing/src/test/java/io/druid/data/input/InputRowParserSerdeTest.java @@ -17,15 +17,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.indexer.data; +package io.druid.data.input; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Charsets; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.metamx.druid.index.v1.SpatialDimensionSchema; import com.metamx.druid.input.InputRow; import com.metamx.druid.jackson.DefaultObjectMapper; +import io.druid.segment.incremental.SpatialDimensionSchema; import junit.framework.Assert; import org.joda.time.DateTime; import org.junit.Test; diff --git a/indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoBufInputRowParserTest.java b/processing/src/test/java/io/druid/data/input/ProtoBufInputRowParserTest.java similarity index 69% rename from indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoBufInputRowParserTest.java rename to processing/src/test/java/io/druid/data/input/ProtoBufInputRowParserTest.java index fd402c56b41..92c337a0832 100644 --- a/indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoBufInputRowParserTest.java +++ b/processing/src/test/java/io/druid/data/input/ProtoBufInputRowParserTest.java @@ -1,4 +1,23 @@ -package com.metamx.druid.indexer.data; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.data.input; import com.metamx.druid.input.InputRow; import org.joda.time.DateTime; @@ -9,7 +28,6 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.List; -import static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ONE; import static org.junit.Assert.assertEquals; public class ProtoBufInputRowParserTest { @@ -42,7 +60,7 @@ public class ProtoBufInputRowParserTest { DateTime dateTime = new DateTime(2012, 07, 12, 9, 30); ProtoTestEventWrapper.ProtoTestEvent event = ProtoTestEventWrapper.ProtoTestEvent.newBuilder() .setDescription("description") - .setEventType(CATEGORY_ONE) + .setEventType(ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ONE) .setId(4711L) .setIsValid(true) .setSomeOtherId(4712) @@ -64,7 +82,7 @@ public class ProtoBufInputRowParserTest { assertDimensionEquals(row, "isValid", "true"); assertDimensionEquals(row, "someOtherId", "4712"); assertDimensionEquals(row, "description", "description"); - assertDimensionEquals(row, "eventType", CATEGORY_ONE.name()); + assertDimensionEquals(row, "eventType", ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ONE.name()); assertEquals(47.11F, row.getFloatMetric("someFloatColumn"), 0.0); diff --git a/indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoTestEventWrapper.java b/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java similarity index 86% rename from indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoTestEventWrapper.java rename to processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java index 9c86246398a..965859fecfc 100644 --- a/indexing-common/src/test/java/com/metamx/druid/indexer/data/ProtoTestEventWrapper.java +++ b/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java @@ -1,7 +1,28 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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. + */ + // Generated by the protocol buffer compiler. DO NOT EDIT! // source: ProtoTest.proto -package com.metamx.druid.indexer.data; +package io.druid.data.input; + +import com.google.protobuf.AbstractMessage; public final class ProtoTestEventWrapper { private ProtoTestEventWrapper() {} @@ -13,7 +34,7 @@ public final class ProtoTestEventWrapper { // required .prototest.ProtoTestEvent.EventCategory eventType = 1; boolean hasEventType(); - com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory getEventType(); + ProtoTestEventWrapper.ProtoTestEvent.EventCategory getEventType(); // required uint64 id = 2; boolean hasId(); @@ -67,12 +88,12 @@ public final class ProtoTestEventWrapper { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.metamx.druid.indexer.data.ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_descriptor; + return ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.metamx.druid.indexer.data.ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_fieldAccessorTable; + return ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_fieldAccessorTable; } public enum EventCategory @@ -120,7 +141,7 @@ public final class ProtoTestEventWrapper { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.getDescriptor().getEnumTypes().get(0); + return ProtoTestEventWrapper.ProtoTestEvent.getDescriptor().getEnumTypes().get(0); } private static final EventCategory[] VALUES = { @@ -150,11 +171,11 @@ public final class ProtoTestEventWrapper { private int bitField0_; // required .prototest.ProtoTestEvent.EventCategory eventType = 1; public static final int EVENTTYPE_FIELD_NUMBER = 1; - private com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory eventType_; + private ProtoTestEventWrapper.ProtoTestEvent.EventCategory eventType_; public boolean hasEventType() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory getEventType() { + public ProtoTestEventWrapper.ProtoTestEvent.EventCategory getEventType() { return eventType_; } @@ -283,7 +304,7 @@ public final class ProtoTestEventWrapper { } private void initFields() { - eventType_ = com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ZERO; + eventType_ = ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ZERO; id_ = 0L; timestamp_ = ""; someOtherId_ = 0; @@ -401,41 +422,41 @@ public final class ProtoTestEventWrapper { return super.writeReplace(); } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseFrom( + public static ProtoTestEventWrapper.ProtoTestEvent parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return newBuilder().mergeFrom(data).buildParsed(); } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseFrom( + public static ProtoTestEventWrapper.ProtoTestEvent parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return newBuilder().mergeFrom(data, extensionRegistry) .buildParsed(); } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseFrom(byte[] data) + public static ProtoTestEventWrapper.ProtoTestEvent parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return newBuilder().mergeFrom(data).buildParsed(); } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseFrom( + public static ProtoTestEventWrapper.ProtoTestEvent parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return newBuilder().mergeFrom(data, extensionRegistry) .buildParsed(); } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseFrom(java.io.InputStream input) + public static ProtoTestEventWrapper.ProtoTestEvent parseFrom(java.io.InputStream input) throws java.io.IOException { return newBuilder().mergeFrom(input).buildParsed(); } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseFrom( + public static ProtoTestEventWrapper.ProtoTestEvent parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseDelimitedFrom(java.io.InputStream input) + public static ProtoTestEventWrapper.ProtoTestEvent parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { Builder builder = newBuilder(); if (builder.mergeDelimitedFrom(input)) { @@ -444,7 +465,7 @@ public final class ProtoTestEventWrapper { return null; } } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseDelimitedFrom( + public static ProtoTestEventWrapper.ProtoTestEvent parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -455,12 +476,12 @@ public final class ProtoTestEventWrapper { return null; } } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseFrom( + public static ProtoTestEventWrapper.ProtoTestEvent parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return newBuilder().mergeFrom(input).buildParsed(); } - public static com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent parseFrom( + public static ProtoTestEventWrapper.ProtoTestEvent parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -470,7 +491,7 @@ public final class ProtoTestEventWrapper { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent prototype) { + public static Builder newBuilder(ProtoTestEventWrapper.ProtoTestEvent prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -483,18 +504,18 @@ public final class ProtoTestEventWrapper { } public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder - implements com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEventOrBuilder { + implements ProtoTestEventWrapper.ProtoTestEventOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.metamx.druid.indexer.data.ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_descriptor; + return ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.metamx.druid.indexer.data.ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_fieldAccessorTable; + return ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_fieldAccessorTable; } - // Construct using com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.newBuilder() + // Construct using io.druid.data.input.ProtoTestEventWrapper.ProtoTestEvent.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -513,7 +534,7 @@ public final class ProtoTestEventWrapper { public Builder clear() { super.clear(); - eventType_ = com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ZERO; + eventType_ = ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ZERO; bitField0_ = (bitField0_ & ~0x00000001); id_ = 0L; bitField0_ = (bitField0_ & ~0x00000002); @@ -540,33 +561,34 @@ public final class ProtoTestEventWrapper { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.getDescriptor(); + return ProtoTestEventWrapper.ProtoTestEvent.getDescriptor(); } - public com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent getDefaultInstanceForType() { - return com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.getDefaultInstance(); + public ProtoTestEventWrapper.ProtoTestEvent getDefaultInstanceForType() { + return ProtoTestEventWrapper.ProtoTestEvent.getDefaultInstance(); } - public com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent build() { - com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent result = buildPartial(); + public ProtoTestEventWrapper.ProtoTestEvent build() { + ProtoTestEventWrapper.ProtoTestEvent result = buildPartial(); if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + throw AbstractMessage.Builder.newUninitializedMessageException(result); } return result; } - private com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent buildParsed() + private ProtoTestEventWrapper.ProtoTestEvent buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { - com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent result = buildPartial(); + ProtoTestEventWrapper.ProtoTestEvent result = buildPartial(); if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); + throw AbstractMessage.Builder.newUninitializedMessageException( + result + ).asInvalidProtocolBufferException(); } return result; } - public com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent buildPartial() { - com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent result = new com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent(this); + public ProtoTestEventWrapper.ProtoTestEvent buildPartial() { + ProtoTestEventWrapper.ProtoTestEvent result = new ProtoTestEventWrapper.ProtoTestEvent(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -611,16 +633,16 @@ public final class ProtoTestEventWrapper { } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent) { - return mergeFrom((com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent)other); + if (other instanceof ProtoTestEventWrapper.ProtoTestEvent) { + return mergeFrom((ProtoTestEventWrapper.ProtoTestEvent)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent other) { - if (other == com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoTestEventWrapper.ProtoTestEvent other) { + if (other == ProtoTestEventWrapper.ProtoTestEvent.getDefaultInstance()) return this; if (other.hasEventType()) { setEventType(other.getEventType()); } @@ -693,7 +715,7 @@ public final class ProtoTestEventWrapper { } case 8: { int rawValue = input.readEnum(); - com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory value = com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.valueOf(rawValue); + ProtoTestEventWrapper.ProtoTestEvent.EventCategory value = ProtoTestEventWrapper.ProtoTestEvent.EventCategory.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(1, rawValue); } else { @@ -749,14 +771,14 @@ public final class ProtoTestEventWrapper { private int bitField0_; // required .prototest.ProtoTestEvent.EventCategory eventType = 1; - private com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory eventType_ = com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ZERO; + private ProtoTestEventWrapper.ProtoTestEvent.EventCategory eventType_ = ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ZERO; public boolean hasEventType() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory getEventType() { + public ProtoTestEventWrapper.ProtoTestEvent.EventCategory getEventType() { return eventType_; } - public Builder setEventType(com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory value) { + public Builder setEventType(ProtoTestEventWrapper.ProtoTestEvent.EventCategory value) { if (value == null) { throw new NullPointerException(); } @@ -767,7 +789,7 @@ public final class ProtoTestEventWrapper { } public Builder clearEventType() { bitField0_ = (bitField0_ & ~0x00000001); - eventType_ = com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ZERO; + eventType_ = ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ZERO; onChanged(); return this; } @@ -1017,8 +1039,8 @@ public final class ProtoTestEventWrapper { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_prototest_ProtoTestEvent_descriptor, new java.lang.String[] { "EventType", "Id", "Timestamp", "SomeOtherId", "IsValid", "Description", "SomeFloatColumn", "SomeIntColumn", "SomeLongColumn", }, - com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.class, - com.metamx.druid.indexer.data.ProtoTestEventWrapper.ProtoTestEvent.Builder.class); + ProtoTestEventWrapper.ProtoTestEvent.class, + ProtoTestEventWrapper.ProtoTestEvent.Builder.class); return null; } }; diff --git a/client/src/test/java/com/metamx/druid/query/PrioritizedExecutorServiceTest.java b/processing/src/test/java/io/druid/query/PrioritizedExecutorServiceTest.java similarity index 97% rename from client/src/test/java/com/metamx/druid/query/PrioritizedExecutorServiceTest.java rename to processing/src/test/java/io/druid/query/PrioritizedExecutorServiceTest.java index b6ce2a9ee1c..0209fafa5ec 100644 --- a/client/src/test/java/com/metamx/druid/query/PrioritizedExecutorServiceTest.java +++ b/processing/src/test/java/io/druid/query/PrioritizedExecutorServiceTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; import com.google.common.collect.ImmutableList; import com.metamx.common.concurrent.ExecutorServiceConfig; diff --git a/client/src/test/java/com/metamx/druid/query/QueriesTest.java b/processing/src/test/java/io/druid/query/QueriesTest.java similarity index 94% rename from client/src/test/java/com/metamx/druid/query/QueriesTest.java rename to processing/src/test/java/io/druid/query/QueriesTest.java index d447d6c475a..4b0f195bf9c 100644 --- a/client/src/test/java/com/metamx/druid/query/QueriesTest.java +++ b/processing/src/test/java/io/druid/query/QueriesTest.java @@ -17,15 +17,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query; -import com.metamx.druid.aggregation.CountAggregatorFactory; -import com.metamx.druid.aggregation.DoubleSumAggregatorFactory; -import com.metamx.druid.aggregation.post.ArithmeticPostAggregator; -import com.metamx.druid.aggregation.post.ConstantPostAggregator; -import com.metamx.druid.aggregation.post.FieldAccessPostAggregator; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.aggregation.aggregation.CountAggregatorFactory; +import io.druid.query.aggregation.aggregation.DoubleSumAggregatorFactory; +import io.druid.query.aggregation.aggregation.post.ArithmeticPostAggregator; +import io.druid.query.aggregation.aggregation.post.ConstantPostAggregator; +import io.druid.query.aggregation.aggregation.post.FieldAccessPostAggregator; import junit.framework.Assert; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java b/processing/src/test/java/io/druid/query/ResultGranularTimestampComparatorTest.java similarity index 96% rename from client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java rename to processing/src/test/java/io/druid/query/ResultGranularTimestampComparatorTest.java index ad43fd1a31a..02665b7491d 100644 --- a/client/src/test/java/com/metamx/druid/ResultGranularTimestampComparatorTest.java +++ b/processing/src/test/java/io/druid/query/ResultGranularTimestampComparatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.query; -import com.metamx.druid.result.Result; import io.druid.granularity.QueryGranularity; import org.joda.time.DateTime; import org.junit.Assert; diff --git a/client/src/test/java/com/metamx/druid/query/extraction/PartialDimExtractionFnTest.java b/processing/src/test/java/io/druid/query/extraction/extraction/PartialDimExtractionFnTest.java similarity index 92% rename from client/src/test/java/com/metamx/druid/query/extraction/PartialDimExtractionFnTest.java rename to processing/src/test/java/io/druid/query/extraction/extraction/PartialDimExtractionFnTest.java index ed6e369a1bf..8c9cb6b093a 100644 --- a/client/src/test/java/com/metamx/druid/query/extraction/PartialDimExtractionFnTest.java +++ b/processing/src/test/java/io/druid/query/extraction/extraction/PartialDimExtractionFnTest.java @@ -17,9 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.extraction; +package io.druid.query.extraction.extraction; import com.google.common.collect.Sets; +import io.druid.query.extraction.DimExtractionFn; +import io.druid.query.extraction.PartialDimExtractionFn; import org.junit.Assert; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/query/extraction/RegexDimExtractionFnTest.java b/processing/src/test/java/io/druid/query/extraction/extraction/RegexDimExtractionFnTest.java similarity index 95% rename from client/src/test/java/com/metamx/druid/query/extraction/RegexDimExtractionFnTest.java rename to processing/src/test/java/io/druid/query/extraction/extraction/RegexDimExtractionFnTest.java index 790f0c5adc1..43f90a1ac01 100644 --- a/client/src/test/java/com/metamx/druid/query/extraction/RegexDimExtractionFnTest.java +++ b/processing/src/test/java/io/druid/query/extraction/extraction/RegexDimExtractionFnTest.java @@ -17,9 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.extraction; +package io.druid.query.extraction.extraction; import com.google.common.collect.Sets; +import io.druid.query.extraction.DimExtractionFn; +import io.druid.query.extraction.RegexDimExtractionFn; import org.junit.Assert; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFnTest.java b/processing/src/test/java/io/druid/query/extraction/extraction/SearchQuerySpecDimExtractionFnTest.java similarity index 87% rename from client/src/test/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFnTest.java rename to processing/src/test/java/io/druid/query/extraction/extraction/SearchQuerySpecDimExtractionFnTest.java index ab825199e6b..30104f523a9 100644 --- a/client/src/test/java/com/metamx/druid/query/extraction/SearchQuerySpecDimExtractionFnTest.java +++ b/processing/src/test/java/io/druid/query/extraction/extraction/SearchQuerySpecDimExtractionFnTest.java @@ -17,11 +17,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.extraction; +package io.druid.query.extraction.extraction; import com.google.common.collect.Sets; -import com.metamx.druid.query.search.FragmentSearchQuerySpec; -import com.metamx.druid.query.search.SearchQuerySpec; +import io.druid.query.extraction.DimExtractionFn; +import io.druid.query.extraction.SearchQuerySpecDimExtractionFn; +import io.druid.query.search.search.FragmentSearchQuerySpec; +import io.druid.query.search.search.SearchQuerySpec; import org.junit.Assert; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/query/extraction/TimeDimExtractionFnTest.java b/processing/src/test/java/io/druid/query/extraction/extraction/TimeDimExtractionFnTest.java similarity index 93% rename from client/src/test/java/com/metamx/druid/query/extraction/TimeDimExtractionFnTest.java rename to processing/src/test/java/io/druid/query/extraction/extraction/TimeDimExtractionFnTest.java index 56d3213c633..1ac839a7e4c 100644 --- a/client/src/test/java/com/metamx/druid/query/extraction/TimeDimExtractionFnTest.java +++ b/processing/src/test/java/io/druid/query/extraction/extraction/TimeDimExtractionFnTest.java @@ -17,9 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.extraction; +package io.druid.query.extraction.extraction; import com.google.common.collect.Sets; +import io.druid.query.extraction.DimExtractionFn; +import io.druid.query.extraction.TimeDimExtractionFn; import org.junit.Assert; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/query/group/having/HavingSpecTest.java b/processing/src/test/java/io/druid/query/groupby/having/HavingSpecTest.java similarity index 88% rename from client/src/test/java/com/metamx/druid/query/group/having/HavingSpecTest.java rename to processing/src/test/java/io/druid/query/groupby/having/HavingSpecTest.java index 28c91878e57..f62e9185ff3 100644 --- a/client/src/test/java/com/metamx/druid/query/group/having/HavingSpecTest.java +++ b/processing/src/test/java/io/druid/query/groupby/having/HavingSpecTest.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.having; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.having; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; diff --git a/client/src/test/java/com/metamx/druid/query/group/orderby/TopNSorterTest.java b/processing/src/test/java/io/druid/query/groupby/orderby/TopNSorterTest.java similarity index 73% rename from client/src/test/java/com/metamx/druid/query/group/orderby/TopNSorterTest.java rename to processing/src/test/java/io/druid/query/groupby/orderby/TopNSorterTest.java index 872155e5049..7e2eeb051bf 100644 --- a/client/src/test/java/com/metamx/druid/query/group/orderby/TopNSorterTest.java +++ b/processing/src/test/java/io/druid/query/groupby/orderby/TopNSorterTest.java @@ -1,4 +1,23 @@ -package com.metamx.druid.query.group.orderby; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.query.groupby.orderby; import com.google.common.base.Splitter; import com.google.common.collect.Lists; diff --git a/client/src/test/java/com/metamx/druid/query/search/LexicographicSearchSortSpecTest.java b/processing/src/test/java/io/druid/query/search/LexicographicSearchSortSpecTest.java similarity index 84% rename from client/src/test/java/com/metamx/druid/query/search/LexicographicSearchSortSpecTest.java rename to processing/src/test/java/io/druid/query/search/LexicographicSearchSortSpecTest.java index 46c8a7537ff..0ec86b46343 100644 --- a/client/src/test/java/com/metamx/druid/query/search/LexicographicSearchSortSpecTest.java +++ b/processing/src/test/java/io/druid/query/search/LexicographicSearchSortSpecTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,8 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search; +import io.druid.query.search.search.LexicographicSearchSortSpec; +import io.druid.query.search.search.SearchHit; +import io.druid.query.search.search.SearchSortSpec; import org.junit.Assert; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/SearchBinaryFnTest.java b/processing/src/test/java/io/druid/query/search/SearchBinaryFnTest.java similarity index 96% rename from client/src/test/java/com/metamx/druid/SearchBinaryFnTest.java rename to processing/src/test/java/io/druid/query/search/SearchBinaryFnTest.java index 3f9aaa4cbaf..9f277bb267b 100644 --- a/client/src/test/java/com/metamx/druid/SearchBinaryFnTest.java +++ b/processing/src/test/java/io/druid/query/search/SearchBinaryFnTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,15 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.query.search; 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 io.druid.granularity.QueryGranularity; +import io.druid.query.Result; +import io.druid.query.search.search.LexicographicSearchSortSpec; +import io.druid.query.search.search.SearchHit; +import io.druid.query.search.search.StrlenSearchSortSpec; import junit.framework.Assert; import org.joda.time.DateTime; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/query/search/StrlenSearchSortSpecTest.java b/processing/src/test/java/io/druid/query/search/StrlenSearchSortSpecTest.java similarity index 84% rename from client/src/test/java/com/metamx/druid/query/search/StrlenSearchSortSpecTest.java rename to processing/src/test/java/io/druid/query/search/StrlenSearchSortSpecTest.java index 36eaba1330d..dcdf9074b8a 100644 --- a/client/src/test/java/com/metamx/druid/query/search/StrlenSearchSortSpecTest.java +++ b/processing/src/test/java/io/druid/query/search/StrlenSearchSortSpecTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,8 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.search; +package io.druid.query.search; +import io.druid.query.search.search.SearchHit; +import io.druid.query.search.search.SearchSortSpec; +import io.druid.query.search.search.StrlenSearchSortSpec; import org.junit.Assert; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/query/QuerySegmentSpecTest.java b/processing/src/test/java/io/druid/query/spec/QuerySegmentSpecTest.java similarity index 93% rename from client/src/test/java/com/metamx/druid/query/QuerySegmentSpecTest.java rename to processing/src/test/java/io/druid/query/spec/QuerySegmentSpecTest.java index 7e6c8e06894..277ecd8e45b 100644 --- a/client/src/test/java/com/metamx/druid/query/QuerySegmentSpecTest.java +++ b/processing/src/test/java/io/druid/query/spec/QuerySegmentSpecTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,17 +17,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query; +package io.druid.query.spec; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.metamx.druid.jackson.DefaultObjectMapper; import io.druid.query.SegmentDescriptor; -import io.druid.query.spec.LegacySegmentSpec; -import io.druid.query.spec.MultipleIntervalSegmentSpec; -import io.druid.query.spec.MultipleSpecificSegmentSpec; -import io.druid.query.spec.QuerySegmentSpec; import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChestTest.java b/processing/src/test/java/io/druid/query/timeboundary/TimeBoundaryQueryQueryToolChestTest.java similarity index 95% rename from client/src/test/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChestTest.java rename to processing/src/test/java/io/druid/query/timeboundary/TimeBoundaryQueryQueryToolChestTest.java index 2a80bab2309..ccf7459fbb8 100644 --- a/client/src/test/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryQueryToolChestTest.java +++ b/processing/src/test/java/io/druid/query/timeboundary/TimeBoundaryQueryQueryToolChestTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.query.timeboundary; +package io.druid.query.timeboundary; -import io.druid.segment.LogicalSegment; +import com.metamx.druid.LogicalSegment; import junit.framework.Assert; import org.joda.time.Interval; import org.junit.Test; diff --git a/client/src/test/java/com/metamx/druid/TimeseriesBinaryFnTest.java b/processing/src/test/java/io/druid/query/timeseries/TimeseriesBinaryFnTest.java similarity index 93% rename from client/src/test/java/com/metamx/druid/TimeseriesBinaryFnTest.java rename to processing/src/test/java/io/druid/query/timeseries/TimeseriesBinaryFnTest.java index 4d4364c7523..cdc797a7e5a 100644 --- a/client/src/test/java/com/metamx/druid/TimeseriesBinaryFnTest.java +++ b/processing/src/test/java/io/druid/query/timeseries/TimeseriesBinaryFnTest.java @@ -17,20 +17,19 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid; +package io.druid.query.timeseries; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; -import com.metamx.druid.aggregation.CountAggregatorFactory; -import com.metamx.druid.aggregation.LongSumAggregatorFactory; -import com.metamx.druid.aggregation.post.ArithmeticPostAggregator; -import com.metamx.druid.aggregation.post.ConstantPostAggregator; -import com.metamx.druid.aggregation.post.FieldAccessPostAggregator; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import io.druid.granularity.QueryGranularity; +import io.druid.query.Result; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.aggregation.aggregation.CountAggregatorFactory; +import io.druid.query.aggregation.aggregation.LongSumAggregatorFactory; +import io.druid.query.aggregation.aggregation.post.ArithmeticPostAggregator; +import io.druid.query.aggregation.aggregation.post.ConstantPostAggregator; +import io.druid.query.aggregation.aggregation.post.FieldAccessPostAggregator; import junit.framework.Assert; import org.joda.time.DateTime; import org.junit.Test; diff --git a/indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplierTest.java b/processing/src/test/java/io/druid/segment/data/CompressedFloatsIndexedSupplierTest.java similarity index 98% rename from indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplierTest.java rename to processing/src/test/java/io/druid/segment/data/CompressedFloatsIndexedSupplierTest.java index cf49cb1c61f..d9cf4c5b6ab 100644 --- a/indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsIndexedSupplierTest.java +++ b/processing/src/test/java/io/druid/segment/data/CompressedFloatsIndexedSupplierTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.io.Closeables; import com.google.common.primitives.Floats; -import io.druid.data.IndexedFloats; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializerTest.java b/processing/src/test/java/io/druid/segment/data/CompressedFloatsSupplierSerializerTest.java similarity index 93% rename from indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializerTest.java rename to processing/src/test/java/io/druid/segment/data/CompressedFloatsSupplierSerializerTest.java index f59a8958d35..c19adad7786 100644 --- a/indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedFloatsSupplierSerializerTest.java +++ b/processing/src/test/java/io/druid/segment/data/CompressedFloatsSupplierSerializerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.io.OutputSupplier; import com.metamx.druid.collect.ResourceHolder; -import com.metamx.druid.kv.GenericIndexedWriter; -import io.druid.data.IndexedFloats; import org.junit.Assert; import org.junit.Test; diff --git a/indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplierTest.java b/processing/src/test/java/io/druid/segment/data/CompressedLongsIndexedSupplierTest.java similarity index 98% rename from indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplierTest.java rename to processing/src/test/java/io/druid/segment/data/CompressedLongsIndexedSupplierTest.java index 36e847f78bd..873d3b3d423 100644 --- a/indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsIndexedSupplierTest.java +++ b/processing/src/test/java/io/druid/segment/data/CompressedLongsIndexedSupplierTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.io.Closeables; import com.google.common.primitives.Longs; -import io.druid.data.IndexedLongs; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializerTest.java b/processing/src/test/java/io/druid/segment/data/CompressedLongsSupplierSerializerTest.java similarity index 93% rename from indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializerTest.java rename to processing/src/test/java/io/druid/segment/data/CompressedLongsSupplierSerializerTest.java index d2988459c4b..23ed9053be4 100644 --- a/indexing-common/src/test/java/com/metamx/druid/index/v1/CompressedLongsSupplierSerializerTest.java +++ b/processing/src/test/java/io/druid/segment/data/CompressedLongsSupplierSerializerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,12 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.io.OutputSupplier; import com.metamx.druid.collect.ResourceHolder; -import com.metamx.druid.kv.GenericIndexedWriter; -import io.druid.data.IndexedLongs; import org.junit.Assert; import org.junit.Test; diff --git a/indexing-common/src/test/java/com/metamx/druid/kv/GenericIndexedTest.java b/processing/src/test/java/io/druid/segment/data/GenericIndexedTest.java similarity index 97% rename from indexing-common/src/test/java/com/metamx/druid/kv/GenericIndexedTest.java rename to processing/src/test/java/io/druid/segment/data/GenericIndexedTest.java index 9b126feaf65..61d64eb1d9a 100644 --- a/indexing-common/src/test/java/com/metamx/druid/kv/GenericIndexedTest.java +++ b/processing/src/test/java/io/druid/segment/data/GenericIndexedTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.collect.Maps; -import io.druid.data.Indexed; import org.junit.Assert; import org.junit.Test; diff --git a/indexing-common/src/test/java/com/metamx/druid/index/v1/IOPeonForTesting.java b/processing/src/test/java/io/druid/segment/data/IOPeonForTesting.java similarity index 94% rename from indexing-common/src/test/java/com/metamx/druid/index/v1/IOPeonForTesting.java rename to processing/src/test/java/io/druid/segment/data/IOPeonForTesting.java index 6229d222e83..132c13a23b4 100644 --- a/indexing-common/src/test/java/com/metamx/druid/index/v1/IOPeonForTesting.java +++ b/processing/src/test/java/io/druid/segment/data/IOPeonForTesting.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.collect.Maps; -import com.metamx.druid.kv.IOPeon; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/indexing-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedFloatsTest.java b/processing/src/test/java/io/druid/segment/data/InMemoryCompressedFloatsTest.java similarity index 95% rename from indexing-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedFloatsTest.java rename to processing/src/test/java/io/druid/segment/data/InMemoryCompressedFloatsTest.java index 1b3d64bb384..18c2b8d75d3 100644 --- a/indexing-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedFloatsTest.java +++ b/processing/src/test/java/io/druid/segment/data/InMemoryCompressedFloatsTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; -import io.druid.data.IndexedFloats; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/indexing-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedLongsTest.java b/processing/src/test/java/io/druid/segment/data/InMemoryCompressedLongsTest.java similarity index 95% rename from indexing-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedLongsTest.java rename to processing/src/test/java/io/druid/segment/data/InMemoryCompressedLongsTest.java index 103253809f1..1c8199ccc29 100644 --- a/indexing-common/src/test/java/com/metamx/druid/index/v1/InMemoryCompressedLongsTest.java +++ b/processing/src/test/java/io/druid/segment/data/InMemoryCompressedLongsTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; -import io.druid.data.IndexedLongs; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/indexing-common/src/test/java/com/metamx/druid/index/v1/IncrementalIndexTest.java b/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java similarity index 95% rename from indexing-common/src/test/java/com/metamx/druid/index/v1/IncrementalIndexTest.java rename to processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java index 410c4c6b751..e70d3c2a880 100644 --- a/indexing-common/src/test/java/com/metamx/druid/index/v1/IncrementalIndexTest.java +++ b/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.index.v1; +package io.druid.segment.data; import com.google.common.collect.ImmutableMap; import com.metamx.druid.input.MapBasedInputRow; import com.metamx.druid.input.Row; import io.druid.granularity.QueryGranularity; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.segment.incremental.IncrementalIndex; import junit.framework.Assert; import org.junit.Test; diff --git a/indexing-common/src/test/java/com/metamx/druid/kv/IndexedIntsTest.java b/processing/src/test/java/io/druid/segment/data/IndexedIntsTest.java similarity index 94% rename from indexing-common/src/test/java/com/metamx/druid/kv/IndexedIntsTest.java rename to processing/src/test/java/io/druid/segment/data/IndexedIntsTest.java index a130ea15d3e..629cf72b722 100644 --- a/indexing-common/src/test/java/com/metamx/druid/kv/IndexedIntsTest.java +++ b/processing/src/test/java/io/druid/segment/data/IndexedIntsTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; -import io.druid.data.IndexedInts; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/indexing-common/src/test/java/com/metamx/druid/kv/VSizeIndexedIntsTest.java b/processing/src/test/java/io/druid/segment/data/VSizeIndexedIntsTest.java similarity index 96% rename from indexing-common/src/test/java/com/metamx/druid/kv/VSizeIndexedIntsTest.java rename to processing/src/test/java/io/druid/segment/data/VSizeIndexedIntsTest.java index d953958116b..543cd956b42 100644 --- a/indexing-common/src/test/java/com/metamx/druid/kv/VSizeIndexedIntsTest.java +++ b/processing/src/test/java/io/druid/segment/data/VSizeIndexedIntsTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import org.junit.Assert; import org.junit.Test; diff --git a/indexing-common/src/test/java/com/metamx/druid/kv/VSizeIndexedTest.java b/processing/src/test/java/io/druid/segment/data/VSizeIndexedTest.java similarity index 95% rename from indexing-common/src/test/java/com/metamx/druid/kv/VSizeIndexedTest.java rename to processing/src/test/java/io/druid/segment/data/VSizeIndexedTest.java index 631ec03869f..4d2f1a95710 100644 --- a/indexing-common/src/test/java/com/metamx/druid/kv/VSizeIndexedTest.java +++ b/processing/src/test/java/io/druid/segment/data/VSizeIndexedTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.kv; +package io.druid.segment.data; import com.google.common.base.Function; import com.google.common.collect.Iterables; @@ -27,7 +27,6 @@ import org.junit.Test; import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import java.nio.channels.Channels; -import java.nio.channels.WritableByteChannel; import java.util.Arrays; import java.util.List; diff --git a/indexing-common/src/test/resources/ProtoTest.proto b/processing/src/test/resources/ProtoTest.proto similarity index 100% rename from indexing-common/src/test/resources/ProtoTest.proto rename to processing/src/test/resources/ProtoTest.proto diff --git a/indexing-common/src/test/resources/druid.sample.tsv b/processing/src/test/resources/druid.sample.tsv similarity index 100% rename from indexing-common/src/test/resources/druid.sample.tsv rename to processing/src/test/resources/druid.sample.tsv diff --git a/indexing-common/src/test/resources/druid.sample.tsv.bottom b/processing/src/test/resources/druid.sample.tsv.bottom similarity index 100% rename from indexing-common/src/test/resources/druid.sample.tsv.bottom rename to processing/src/test/resources/druid.sample.tsv.bottom diff --git a/indexing-common/src/test/resources/druid.sample.tsv.top b/processing/src/test/resources/druid.sample.tsv.top similarity index 100% rename from indexing-common/src/test/resources/druid.sample.tsv.top rename to processing/src/test/resources/druid.sample.tsv.top diff --git a/indexing-common/src/test/resources/prototest.desc b/processing/src/test/resources/prototest.desc similarity index 100% rename from indexing-common/src/test/resources/prototest.desc rename to processing/src/test/resources/prototest.desc diff --git a/realtime/pom.xml b/realtime/pom.xml index d97e2da4d9c..950ae5bf83c 100644 --- a/realtime/pom.xml +++ b/realtime/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 com.metamx.druid druid-server @@ -34,12 +35,7 @@ com.metamx.druid - druid-client - ${project.parent.version} - - - com.metamx.druid - druid-segment + druid-processing ${project.parent.version} @@ -199,7 +195,30 @@ astyanax 1.0.1 - + + org.antlr + antlr4-runtime + + + com.google.code.simple-spring-memcached + spymemcached + + + net.jpountz.lz4 + lz4 + + + org.eclipse.jetty + jetty-server + + + org.eclipse.jetty + jetty-servlet + + + org.eclipse.jetty + jetty-servlets + @@ -214,14 +233,7 @@ com.metamx.druid - druid-indexing-common - ${project.parent.version} - test-jar - test - - - com.metamx.druid - druid-client + druid-processing ${project.parent.version} test-jar test @@ -231,6 +243,11 @@ curator-test test + + com.google.caliper + caliper + test + @@ -247,6 +264,17 @@ + + org.antlr + antlr4-maven-plugin + + + + antlr4 + + + + diff --git a/client/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 b/server/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 similarity index 92% rename from client/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 rename to server/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 index c8c6d0effb1..316bcce2af7 100644 --- a/client/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 +++ b/server/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 @@ -3,25 +3,25 @@ grammar DruidSQL; @header { import com.google.common.base.Joiner; import com.google.common.collect.Lists; -import com.metamx.druid.aggregation.CountAggregatorFactory; -import com.metamx.druid.aggregation.DoubleSumAggregatorFactory; -import com.metamx.druid.aggregation.MaxAggregatorFactory; -import com.metamx.druid.aggregation.MinAggregatorFactory; -import com.metamx.druid.aggregation.post.ArithmeticPostAggregator; -import com.metamx.druid.aggregation.post.ConstantPostAggregator; -import com.metamx.druid.aggregation.post.FieldAccessPostAggregator; -import io.druid.query.aggregation.PostAggregator; -import com.metamx.druid.query.dimension.DefaultDimensionSpec; -import com.metamx.druid.query.dimension.DimensionSpec; -import com.metamx.druid.query.filter.AndDimFilter; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.query.filter.NotDimFilter; -import com.metamx.druid.query.filter.OrDimFilter; -import com.metamx.druid.query.filter.RegexDimFilter; -import com.metamx.druid.query.filter.SelectorDimFilter; +import io.druid.query.aggregation.aggregation.CountAggregatorFactory; +import io.druid.query.aggregation.aggregation.DoubleSumAggregatorFactory; +import io.druid.query.aggregation.aggregation.MaxAggregatorFactory; +import io.druid.query.aggregation.aggregation.MinAggregatorFactory; +import io.druid.query.aggregation.aggregation.post.ArithmeticPostAggregator; +import io.druid.query.aggregation.aggregation.post.ConstantPostAggregator; +import io.druid.query.aggregation.aggregation.post.FieldAccessPostAggregator; import io.druid.granularity.PeriodGranularity; import io.druid.granularity.QueryGranularity; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.query.aggregation.PostAggregator; +import io.druid.query.dimension.DefaultDimensionSpec; +import io.druid.query.dimension.DimensionSpec; +import io.druid.query.filter.AndDimFilter; +import io.druid.query.filter.DimFilter; +import io.druid.query.filter.NotDimFilter; +import io.druid.query.filter.OrDimFilter; +import io.druid.query.filter.RegexDimFilter; +import io.druid.query.filter.SelectorDimFilter; import org.antlr.v4.runtime.NoViableAltException; import org.antlr.v4.runtime.Parser; import org.antlr.v4.runtime.ParserRuleContext; diff --git a/server/src/main/java/com/metamx/druid/SearchResultBuilder.java b/server/src/main/java/com/metamx/druid/SearchResultBuilder.java index 21614d2e036..dfd37885f61 100644 --- a/server/src/main/java/com/metamx/druid/SearchResultBuilder.java +++ b/server/src/main/java/com/metamx/druid/SearchResultBuilder.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,9 +20,9 @@ package com.metamx.druid; 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 io.druid.query.Result; +import io.druid.query.search.SearchResultValue; +import io.druid.query.search.search.SearchHit; import org.joda.time.DateTime; /** diff --git a/server/src/main/java/com/metamx/druid/TimeseriesResultBuilder.java b/server/src/main/java/com/metamx/druid/TimeseriesResultBuilder.java index 79440aa1ed7..f67c1d3973c 100644 --- a/server/src/main/java/com/metamx/druid/TimeseriesResultBuilder.java +++ b/server/src/main/java/com/metamx/druid/TimeseriesResultBuilder.java @@ -19,10 +19,10 @@ package com.metamx.druid; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; +import io.druid.query.Result; import io.druid.query.aggregation.Aggregator; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.timeseries.TimeseriesResultValue; import org.joda.time.DateTime; import java.util.HashMap; diff --git a/server/src/main/java/com/metamx/druid/client/indexing/IndexingServiceSelector.java b/server/src/main/java/com/metamx/druid/client/indexing/IndexingServiceSelector.java index 6f686832cb6..15620c31db3 100644 --- a/server/src/main/java/com/metamx/druid/client/indexing/IndexingServiceSelector.java +++ b/server/src/main/java/com/metamx/druid/client/indexing/IndexingServiceSelector.java @@ -1,11 +1,31 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.client.indexing; import com.google.inject.Inject; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.selector.DiscoverySelector; -import com.metamx.druid.client.selector.Server; +import io.druid.client.indexing.IndexingService; +import io.druid.client.selector.DiscoverySelector; +import io.druid.client.selector.Server; import org.apache.curator.x.discovery.ServiceInstance; import org.apache.curator.x.discovery.ServiceProvider; diff --git a/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeHandler.java b/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeHandler.java index bc88027bbb8..640abfba82b 100644 --- a/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeHandler.java +++ b/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeHandler.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,7 +19,7 @@ package com.metamx.druid.coordination; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; /** */ 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 596d49428f6..2649dd0492a 100644 --- a/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeRequest.java +++ b/server/src/main/java/com/metamx/druid/coordination/DataSegmentChangeRequest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,7 +21,6 @@ package com.metamx.druid.coordination; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.metamx.druid.client.DataSegment; /** */ 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 05d4121c039..b115db25ffa 100644 --- a/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestDrop.java +++ b/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestDrop.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,7 +22,7 @@ package com.metamx.druid.coordination; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; /** */ 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 64bb64fc3ed..4582689560f 100644 --- a/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestLoad.java +++ b/server/src/main/java/com/metamx/druid/coordination/SegmentChangeRequestLoad.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,7 +22,7 @@ package com.metamx.druid.coordination; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; /** */ 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 234688c647d..4ea95e757f8 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ServerManager.java +++ b/server/src/main/java/com/metamx/druid/coordination/ServerManager.java @@ -27,32 +27,32 @@ import com.metamx.common.ISE; import com.metamx.common.guava.FunctionalIterable; import com.metamx.druid.TimelineObjectHolder; import com.metamx.druid.VersionedIntervalTimeline; -import com.metamx.druid.client.DataSegment; import com.metamx.druid.collect.CountingMap; -import com.metamx.druid.guice.annotations.Processing; -import com.metamx.druid.index.ReferenceCountingSegment; import com.metamx.druid.loading.SegmentLoader; import com.metamx.druid.loading.SegmentLoadingException; import com.metamx.druid.partition.PartitionChunk; import com.metamx.druid.partition.PartitionHolder; -import com.metamx.druid.query.BySegmentQueryRunner; -import com.metamx.druid.query.FinalizeResultsQueryRunner; -import com.metamx.druid.query.MetricsEmittingQueryRunner; -import com.metamx.druid.query.NoopQueryRunner; import com.metamx.druid.query.QueryRunnerFactoryConglomerate; import com.metamx.druid.query.ReferenceCountingSegmentQueryRunner; -import com.metamx.druid.query.segment.QuerySegmentWalker; -import com.metamx.druid.query.segment.SpecificSegmentQueryRunner; -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 io.druid.client.DataSegment; +import io.druid.guice.guice.annotations.Processing; +import io.druid.query.BySegmentQueryRunner; +import io.druid.query.FinalizeResultsQueryRunner; +import io.druid.query.MetricsEmittingQueryRunner; +import io.druid.query.NoopQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; +import io.druid.query.QuerySegmentWalker; import io.druid.query.QueryToolChest; import io.druid.query.SegmentDescriptor; import io.druid.query.spec.QuerySegmentSpec; +import io.druid.query.spec.SpecificSegmentQueryRunner; +import io.druid.query.spec.SpecificSegmentSpec; +import io.druid.segment.ReferenceCountingSegment; import io.druid.segment.Segment; import org.joda.time.Interval; 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 fef63f11547..941a7e72aed 100644 --- a/server/src/main/java/com/metamx/druid/coordination/ZkCoordinator.java +++ b/server/src/main/java/com/metamx/druid/coordination/ZkCoordinator.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -26,11 +26,13 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.google.inject.Inject; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.initialization.ZkPathsConfig; import com.metamx.druid.loading.SegmentLoaderConfig; import com.metamx.druid.loading.SegmentLoadingException; import com.metamx.emitter.EmittingLogger; +import io.druid.client.DataSegment; +import io.druid.server.coordination.DataSegmentAnnouncer; +import io.druid.server.coordination.DruidServerMetadata; +import io.druid.server.initialization.initialization.ZkPathsConfig; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.cache.ChildData; import org.apache.curator.framework.recipes.cache.PathChildrenCache; diff --git a/server/src/main/java/com/metamx/druid/db/DatabaseRuleManager.java b/server/src/main/java/com/metamx/druid/db/DatabaseRuleManager.java index 334d629e2ad..03242062563 100644 --- a/server/src/main/java/com/metamx/druid/db/DatabaseRuleManager.java +++ b/server/src/main/java/com/metamx/druid/db/DatabaseRuleManager.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -32,10 +32,10 @@ import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.common.logger.Logger; import com.metamx.druid.concurrent.Execs; -import com.metamx.druid.guice.ManageLifecycle; -import com.metamx.druid.guice.annotations.Json; import com.metamx.druid.master.rules.PeriodLoadRule; import com.metamx.druid.master.rules.Rule; +import io.druid.guice.guice.ManageLifecycle; +import io.druid.guice.guice.annotations.Json; import org.joda.time.DateTime; import org.joda.time.Duration; import org.joda.time.Period; 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 06ef0dbccf3..5eeeaf320a6 100644 --- a/server/src/main/java/com/metamx/druid/db/DatabaseSegmentManager.java +++ b/server/src/main/java/com/metamx/druid/db/DatabaseSegmentManager.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -32,11 +32,11 @@ 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 com.metamx.druid.concurrent.Execs; -import com.metamx.druid.guice.ManageLifecycle; import com.metamx.druid.partition.PartitionChunk; +import io.druid.client.DataSegment; +import io.druid.client.DruidDataSource; +import io.druid.guice.guice.ManageLifecycle; import org.joda.time.DateTime; import org.joda.time.Duration; import org.joda.time.Interval; diff --git a/server/src/main/java/com/metamx/druid/guice/annotations/Processing.java b/server/src/main/java/com/metamx/druid/guice/annotations/Processing.java deleted file mode 100644 index f3279d2af90..00000000000 --- a/server/src/main/java/com/metamx/druid/guice/annotations/Processing.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.metamx.druid.guice.annotations; - -import com.google.inject.BindingAnnotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - */ -@BindingAnnotation -@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Processing -{ -} diff --git a/server/src/main/java/com/metamx/druid/loading/DataSegmentKiller.java b/server/src/main/java/com/metamx/druid/loading/DataSegmentKiller.java index 85483eaa505..e2360155fdc 100644 --- a/server/src/main/java/com/metamx/druid/loading/DataSegmentKiller.java +++ b/server/src/main/java/com/metamx/druid/loading/DataSegmentKiller.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,7 +19,7 @@ package com.metamx.druid.loading; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; /** */ diff --git a/server/src/main/java/com/metamx/druid/loading/DataSegmentPuller.java b/server/src/main/java/com/metamx/druid/loading/DataSegmentPuller.java index 306d7f449af..4325561e943 100644 --- a/server/src/main/java/com/metamx/druid/loading/DataSegmentPuller.java +++ b/server/src/main/java/com/metamx/druid/loading/DataSegmentPuller.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,7 +19,7 @@ package com.metamx.druid.loading; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.io.File; diff --git a/server/src/main/java/com/metamx/druid/loading/DataSegmentPusher.java b/server/src/main/java/com/metamx/druid/loading/DataSegmentPusher.java index 5369480d6b9..4d877477a4f 100644 --- a/server/src/main/java/com/metamx/druid/loading/DataSegmentPusher.java +++ b/server/src/main/java/com/metamx/druid/loading/DataSegmentPusher.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,7 +19,7 @@ package com.metamx.druid.loading; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.io.File; import java.io.IOException; diff --git a/server/src/main/java/com/metamx/druid/loading/DataSegmentPusherUtil.java b/server/src/main/java/com/metamx/druid/loading/DataSegmentPusherUtil.java index c71832d9f63..643d2762a01 100644 --- a/server/src/main/java/com/metamx/druid/loading/DataSegmentPusherUtil.java +++ b/server/src/main/java/com/metamx/druid/loading/DataSegmentPusherUtil.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,7 +20,7 @@ package com.metamx.druid.loading; import com.google.common.base.Joiner; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import org.joda.time.format.ISODateTimeFormat; /** diff --git a/server/src/main/java/com/metamx/druid/loading/DelegatingSegmentLoader.java b/server/src/main/java/com/metamx/druid/loading/DelegatingSegmentLoader.java index cced8f28add..91ed6ec0a3f 100644 --- a/server/src/main/java/com/metamx/druid/loading/DelegatingSegmentLoader.java +++ b/server/src/main/java/com/metamx/druid/loading/DelegatingSegmentLoader.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,7 +20,7 @@ package com.metamx.druid.loading; import com.metamx.common.MapUtils; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import io.druid.segment.Segment; import java.util.Map; diff --git a/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPuller.java b/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPuller.java index 0e25a2de792..f79cc2a6213 100644 --- a/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPuller.java +++ b/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPuller.java @@ -1,9 +1,28 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.loading; import com.google.common.io.Closeables; import com.google.inject.Inject; -import com.metamx.druid.client.DataSegment; import com.metamx.druid.utils.CompressionUtils; +import io.druid.client.DataSegment; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FileSystem; diff --git a/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusher.java b/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusher.java index e68a93f5282..e97e1327755 100644 --- a/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusher.java +++ b/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusher.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -26,9 +26,9 @@ import com.google.common.io.Closeables; import com.google.common.io.OutputSupplier; import com.google.inject.Inject; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.utils.CompressionUtils; +import io.druid.client.DataSegment; +import io.druid.segment.IndexIO; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; diff --git a/server/src/main/java/com/metamx/druid/loading/LocalDataSegmentPuller.java b/server/src/main/java/com/metamx/druid/loading/LocalDataSegmentPuller.java index 8cdb8e0a7a2..8378d932b1a 100644 --- a/server/src/main/java/com/metamx/druid/loading/LocalDataSegmentPuller.java +++ b/server/src/main/java/com/metamx/druid/loading/LocalDataSegmentPuller.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,8 +22,8 @@ package com.metamx.druid.loading; import com.google.common.io.Files; import com.metamx.common.MapUtils; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; import com.metamx.druid.utils.CompressionUtils; +import io.druid.client.DataSegment; import java.io.File; import java.io.IOException; diff --git a/server/src/main/java/com/metamx/druid/loading/LocalDataSegmentPusher.java b/server/src/main/java/com/metamx/druid/loading/LocalDataSegmentPusher.java index ed4ab5472c9..0d191c48f17 100644 --- a/server/src/main/java/com/metamx/druid/loading/LocalDataSegmentPusher.java +++ b/server/src/main/java/com/metamx/druid/loading/LocalDataSegmentPusher.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -25,9 +25,9 @@ import com.google.common.io.ByteStreams; import com.google.common.io.Files; import com.google.inject.Inject; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.utils.CompressionUtils; +import io.druid.client.DataSegment; +import io.druid.segment.IndexIO; import java.io.File; import java.io.IOException; diff --git a/server/src/main/java/com/metamx/druid/loading/MMappedQueryableIndexFactory.java b/server/src/main/java/com/metamx/druid/loading/MMappedQueryableIndexFactory.java index 8b530ea061f..3480a96d47a 100644 --- a/server/src/main/java/com/metamx/druid/loading/MMappedQueryableIndexFactory.java +++ b/server/src/main/java/com/metamx/druid/loading/MMappedQueryableIndexFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,7 +20,7 @@ package com.metamx.druid.loading; import com.metamx.common.logger.Logger; -import com.metamx.druid.index.v1.IndexIO; +import io.druid.segment.IndexIO; import io.druid.segment.QueryableIndex; import org.apache.commons.io.FileUtils; @@ -37,25 +37,6 @@ public class MMappedQueryableIndexFactory implements QueryableIndexFactory public QueryableIndex factorize(File parentDir) throws SegmentLoadingException { try { - if (! IndexIO.canBeMapped(parentDir)) { - File canBeMappedDir = new File(parentDir, "forTheMapping"); - if (canBeMappedDir.exists()) { - FileUtils.deleteDirectory(canBeMappedDir); - } - canBeMappedDir.mkdirs(); - - IndexIO.storeLatest(IndexIO.readIndex(parentDir), canBeMappedDir); - if (! IndexIO.canBeMapped(canBeMappedDir)) { - throw new SegmentLoadingException("WTF!? newly written file[%s] cannot be mapped!?", canBeMappedDir); - } - for (File file : canBeMappedDir.listFiles()) { - if (! file.renameTo(new File(parentDir, file.getName()))) { - throw new SegmentLoadingException("Couldn't rename[%s] to [%s]", canBeMappedDir, parentDir); - } - } - FileUtils.deleteDirectory(canBeMappedDir); - } - return IndexIO.loadIndex(parentDir); } catch (IOException e) { diff --git a/server/src/main/java/com/metamx/druid/loading/OmniSegmentLoader.java b/server/src/main/java/com/metamx/druid/loading/OmniSegmentLoader.java index 421676a108d..fe44c8895f0 100644 --- a/server/src/main/java/com/metamx/druid/loading/OmniSegmentLoader.java +++ b/server/src/main/java/com/metamx/druid/loading/OmniSegmentLoader.java @@ -1,3 +1,22 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.loading; import com.google.common.base.Preconditions; @@ -9,9 +28,9 @@ import com.metamx.common.IAE; import com.metamx.common.ISE; import com.metamx.common.MapUtils; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.QueryableIndexSegment; +import io.druid.client.DataSegment; import io.druid.segment.QueryableIndex; +import io.druid.segment.QueryableIndexSegment; import io.druid.segment.Segment; import org.apache.commons.io.FileUtils; diff --git a/server/src/main/java/com/metamx/druid/loading/S3DataSegmentKiller.java b/server/src/main/java/com/metamx/druid/loading/S3DataSegmentKiller.java index 63b815a7e85..01c3c50b9d4 100644 --- a/server/src/main/java/com/metamx/druid/loading/S3DataSegmentKiller.java +++ b/server/src/main/java/com/metamx/druid/loading/S3DataSegmentKiller.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,7 +22,7 @@ package com.metamx.druid.loading; import com.google.inject.Inject; import com.metamx.common.MapUtils; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import org.jets3t.service.ServiceException; import org.jets3t.service.impl.rest.httpclient.RestS3Service; diff --git a/server/src/main/java/com/metamx/druid/loading/S3DataSegmentPuller.java b/server/src/main/java/com/metamx/druid/loading/S3DataSegmentPuller.java index c6a82ffa3ff..eb3d5200112 100644 --- a/server/src/main/java/com/metamx/druid/loading/S3DataSegmentPuller.java +++ b/server/src/main/java/com/metamx/druid/loading/S3DataSegmentPuller.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -27,9 +27,9 @@ import com.google.inject.Inject; import com.metamx.common.ISE; 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.utils.CompressionUtils; +import io.druid.client.DataSegment; +import io.druid.storage.s3.S3Utils; import org.apache.commons.io.FileUtils; import org.jets3t.service.ServiceException; import org.jets3t.service.impl.rest.httpclient.RestS3Service; diff --git a/server/src/main/java/com/metamx/druid/loading/S3DataSegmentPusher.java b/server/src/main/java/com/metamx/druid/loading/S3DataSegmentPusher.java index a5e76bf7283..78d1ad2b515 100644 --- a/server/src/main/java/com/metamx/druid/loading/S3DataSegmentPusher.java +++ b/server/src/main/java/com/metamx/druid/loading/S3DataSegmentPusher.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -26,11 +26,11 @@ import com.google.common.collect.ImmutableMap; import com.google.common.io.ByteStreams; import com.google.common.io.Files; import com.google.inject.Inject; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.common.s3.S3Utils; -import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.utils.CompressionUtils; import com.metamx.emitter.EmittingLogger; +import io.druid.client.DataSegment; +import io.druid.segment.IndexIO; +import io.druid.storage.s3.S3Utils; import org.jets3t.service.ServiceException; import org.jets3t.service.acl.gs.GSAccessControlList; import org.jets3t.service.impl.rest.httpclient.RestS3Service; diff --git a/server/src/main/java/com/metamx/druid/loading/SegmentLoader.java b/server/src/main/java/com/metamx/druid/loading/SegmentLoader.java index 3a303ab9076..0402a964b3c 100644 --- a/server/src/main/java/com/metamx/druid/loading/SegmentLoader.java +++ b/server/src/main/java/com/metamx/druid/loading/SegmentLoader.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,7 +19,7 @@ package com.metamx.druid.loading; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import io.druid.segment.Segment; /** diff --git a/server/src/main/java/com/metamx/druid/loading/SingleSegmentLoader.java b/server/src/main/java/com/metamx/druid/loading/SingleSegmentLoader.java index 31be1e8ef57..36955406461 100644 --- a/server/src/main/java/com/metamx/druid/loading/SingleSegmentLoader.java +++ b/server/src/main/java/com/metamx/druid/loading/SingleSegmentLoader.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -27,9 +27,9 @@ import com.google.inject.Inject; import com.metamx.common.IAE; import com.metamx.common.ISE; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.QueryableIndexSegment; +import io.druid.client.DataSegment; import io.druid.segment.QueryableIndex; +import io.druid.segment.QueryableIndexSegment; import io.druid.segment.Segment; import org.apache.commons.io.FileUtils; diff --git a/server/src/main/java/com/metamx/druid/loading/cassandra/CassandraDataSegmentPuller.java b/server/src/main/java/com/metamx/druid/loading/cassandra/CassandraDataSegmentPuller.java index a11c9e2ec2f..74bffc1d757 100644 --- a/server/src/main/java/com/metamx/druid/loading/cassandra/CassandraDataSegmentPuller.java +++ b/server/src/main/java/com/metamx/druid/loading/cassandra/CassandraDataSegmentPuller.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -23,7 +23,6 @@ import com.google.common.io.Files; import com.google.inject.Inject; import com.metamx.common.ISE; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; import com.metamx.druid.loading.DataSegmentPuller; import com.metamx.druid.loading.SegmentLoadingException; import com.metamx.druid.utils.CompressionUtils; @@ -32,6 +31,7 @@ import com.netflix.astyanax.connectionpool.exceptions.ConnectionException; import com.netflix.astyanax.model.ColumnList; import com.netflix.astyanax.recipes.storage.ChunkedStorage; import com.netflix.astyanax.recipes.storage.ObjectMetadata; +import io.druid.client.DataSegment; import org.apache.commons.io.FileUtils; import java.io.File; diff --git a/server/src/main/java/com/metamx/druid/loading/cassandra/CassandraDataSegmentPusher.java b/server/src/main/java/com/metamx/druid/loading/cassandra/CassandraDataSegmentPusher.java index 63483075db9..dfe925d97f3 100644 --- a/server/src/main/java/com/metamx/druid/loading/cassandra/CassandraDataSegmentPusher.java +++ b/server/src/main/java/com/metamx/druid/loading/cassandra/CassandraDataSegmentPusher.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -24,13 +24,13 @@ import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; import com.google.inject.Inject; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.loading.DataSegmentPusher; import com.metamx.druid.loading.DataSegmentPusherUtil; import com.metamx.druid.utils.CompressionUtils; import com.netflix.astyanax.MutationBatch; import com.netflix.astyanax.recipes.storage.ChunkedStorage; +import io.druid.client.DataSegment; +import io.druid.segment.IndexIO; import java.io.File; import java.io.FileInputStream; diff --git a/server/src/main/java/com/metamx/druid/master/BalancerSegmentHolder.java b/server/src/main/java/com/metamx/druid/master/BalancerSegmentHolder.java index 7d62968e4b9..25375ed8ca6 100644 --- a/server/src/main/java/com/metamx/druid/master/BalancerSegmentHolder.java +++ b/server/src/main/java/com/metamx/druid/master/BalancerSegmentHolder.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,8 +19,8 @@ package com.metamx.druid.master; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; /** */ diff --git a/server/src/main/java/com/metamx/druid/master/BalancerStrategy.java b/server/src/main/java/com/metamx/druid/master/BalancerStrategy.java index 84944114b49..715f7f271be 100644 --- a/server/src/main/java/com/metamx/druid/master/BalancerStrategy.java +++ b/server/src/main/java/com/metamx/druid/master/BalancerStrategy.java @@ -1,25 +1,25 @@ /* -* 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. -*/ + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.master; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.util.List; diff --git a/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java b/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java index 8c31261d5bb..460fe1b3184 100644 --- a/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java +++ b/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java @@ -1,27 +1,27 @@ /* -* 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. -*/ + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.master; import com.metamx.common.Pair; -import com.metamx.druid.client.DataSegment; import com.metamx.emitter.EmittingLogger; +import io.druid.client.DataSegment; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/server/src/main/java/com/metamx/druid/master/DruidCluster.java b/server/src/main/java/com/metamx/druid/master/DruidCluster.java index d7ef284ede0..e96750f4315 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidCluster.java +++ b/server/src/main/java/com/metamx/druid/master/DruidCluster.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,7 +22,7 @@ package com.metamx.druid.master; import com.google.common.collect.Maps; import com.google.common.collect.MinMaxPriorityQueue; import com.google.common.collect.Ordering; -import com.metamx.druid.client.DruidServer; +import io.druid.client.DruidServer; import java.util.Map; 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 aaf94eb3ed5..8a60ba00760 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMaster.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMaster.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -37,21 +37,21 @@ import com.metamx.common.guava.Comparators; import com.metamx.common.guava.FunctionalIterable; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidDataSource; -import com.metamx.druid.client.DruidServer; -import com.metamx.druid.client.ServerInventoryView; -import com.metamx.druid.client.indexing.IndexingServiceClient; import com.metamx.druid.concurrent.Execs; import com.metamx.druid.config.JacksonConfigManager; import com.metamx.druid.db.DatabaseRuleManager; import com.metamx.druid.db.DatabaseSegmentManager; -import com.metamx.druid.guice.ManageLifecycle; -import com.metamx.druid.index.v1.IndexIO; -import com.metamx.druid.initialization.ZkPathsConfig; import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; +import io.druid.client.DataSegment; +import io.druid.client.DruidDataSource; +import io.druid.client.DruidServer; +import io.druid.client.ServerInventoryView; +import io.druid.client.indexing.IndexingServiceClient; +import io.druid.guice.guice.ManageLifecycle; +import io.druid.segment.IndexIO; +import io.druid.server.initialization.initialization.ZkPathsConfig; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.leader.LeaderLatch; import org.apache.curator.framework.recipes.leader.LeaderLatchListener; 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 bb547bae8d8..ae4604c8274 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java @@ -1,21 +1,21 @@ /* -* 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. -*/ + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.master; @@ -23,9 +23,9 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.MinMaxPriorityQueue; import com.metamx.common.guava.Comparators; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; import com.metamx.emitter.EmittingLogger; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; import org.joda.time.DateTime; import java.util.Comparator; diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterCleanup.java b/server/src/main/java/com/metamx/druid/master/DruidMasterCleanup.java index 6ba31a77249..72d011afbe8 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterCleanup.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterCleanup.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -25,9 +25,9 @@ import com.metamx.common.guava.Comparators; 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 com.metamx.druid.client.DruidServer; +import io.druid.client.DataSegment; +import io.druid.client.DruidDataSource; +import io.druid.client.DruidServer; import java.util.Map; import java.util.Set; 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 1b226933a52..5b2a3a5486d 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterLogger.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterLogger.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,12 +22,12 @@ package com.metamx.druid.master; import com.google.common.collect.Maps; import com.google.common.collect.MinMaxPriorityQueue; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidDataSource; -import com.metamx.druid.client.DruidServer; import com.metamx.druid.collect.CountingMap; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; +import io.druid.client.DataSegment; +import io.druid.client.DruidDataSource; +import io.druid.client.DruidServer; import java.util.Map; import java.util.Set; diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterRuleRunner.java b/server/src/main/java/com/metamx/druid/master/DruidMasterRuleRunner.java index 04a3ce55da6..cff13183cfd 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterRuleRunner.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterRuleRunner.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,10 +19,10 @@ package com.metamx.druid.master; -import com.metamx.druid.client.DataSegment; import com.metamx.druid.db.DatabaseRuleManager; import com.metamx.druid.master.rules.Rule; import com.metamx.emitter.EmittingLogger; +import io.druid.client.DataSegment; import org.joda.time.DateTime; import java.util.List; 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 0dfe9afca4f..15a7d605b00 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,10 +22,10 @@ package com.metamx.druid.master; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.metamx.common.guava.Comparators; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidDataSource; import com.metamx.druid.db.DatabaseRuleManager; import com.metamx.emitter.service.ServiceEmitter; +import io.druid.client.DataSegment; +import io.druid.client.DruidDataSource; import org.joda.time.DateTime; import java.util.Collection; 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..835e0979a7b 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentInfoLoader.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentInfoLoader.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,7 +20,7 @@ package com.metamx.druid.master; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.util.Set; 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 d178cf1a8ad..90fe682a8c0 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -34,10 +34,10 @@ import com.metamx.common.guava.FunctionalIterable; 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.indexing.IndexingServiceClient; import com.metamx.druid.partition.PartitionChunk; -import com.metamx.druid.shard.NoneShardSpec; +import io.druid.client.DataSegment; +import io.druid.client.indexing.IndexingServiceClient; +import io.druid.server.shard.shard.NoneShardSpec; import org.joda.time.DateTime; import org.joda.time.Interval; 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 2b5c96cb187..b681f749b2a 100644 --- a/server/src/main/java/com/metamx/druid/master/LoadQueuePeon.java +++ b/server/src/main/java/com/metamx/druid/master/LoadQueuePeon.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -25,12 +25,12 @@ import com.google.common.collect.Collections2; import com.google.common.collect.Lists; import com.metamx.common.ISE; import com.metamx.common.guava.Comparators; -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.druid.coordination.SegmentChangeRequestNoop; import com.metamx.emitter.EmittingLogger; +import io.druid.client.DataSegment; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.api.CuratorWatcher; import org.apache.curator.utils.ZKPaths; diff --git a/server/src/main/java/com/metamx/druid/master/RandomBalancerStrategy.java b/server/src/main/java/com/metamx/druid/master/RandomBalancerStrategy.java index d953b69b3db..b2ab0af8739 100644 --- a/server/src/main/java/com/metamx/druid/master/RandomBalancerStrategy.java +++ b/server/src/main/java/com/metamx/druid/master/RandomBalancerStrategy.java @@ -1,25 +1,25 @@ /* -* 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. -*/ + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.master; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.util.List; import java.util.Random; diff --git a/server/src/main/java/com/metamx/druid/master/ReservoirSegmentSampler.java b/server/src/main/java/com/metamx/druid/master/ReservoirSegmentSampler.java index 4db994b821a..0019c9e9f9d 100644 --- a/server/src/main/java/com/metamx/druid/master/ReservoirSegmentSampler.java +++ b/server/src/main/java/com/metamx/druid/master/ReservoirSegmentSampler.java @@ -1,25 +1,25 @@ /* -* 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. -*/ + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.master; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.util.List; import java.util.Random; diff --git a/server/src/main/java/com/metamx/druid/master/SegmentReplicantLookup.java b/server/src/main/java/com/metamx/druid/master/SegmentReplicantLookup.java index 560787247f5..de8ce5e310f 100644 --- a/server/src/main/java/com/metamx/druid/master/SegmentReplicantLookup.java +++ b/server/src/main/java/com/metamx/druid/master/SegmentReplicantLookup.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -23,8 +23,8 @@ import com.google.common.collect.HashBasedTable; import com.google.common.collect.Maps; import com.google.common.collect.MinMaxPriorityQueue; import com.google.common.collect.Table; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; import java.util.Map; diff --git a/server/src/main/java/com/metamx/druid/master/ServerHolder.java b/server/src/main/java/com/metamx/druid/master/ServerHolder.java index 5fba424f429..e362b0fe8e3 100644 --- a/server/src/main/java/com/metamx/druid/master/ServerHolder.java +++ b/server/src/main/java/com/metamx/druid/master/ServerHolder.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,8 +20,8 @@ package com.metamx.druid.master; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; /** */ diff --git a/server/src/main/java/com/metamx/druid/master/rules/DropRule.java b/server/src/main/java/com/metamx/druid/master/rules/DropRule.java index 5806031d7c6..218204462e7 100644 --- a/server/src/main/java/com/metamx/druid/master/rules/DropRule.java +++ b/server/src/main/java/com/metamx/druid/master/rules/DropRule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,10 +19,10 @@ package com.metamx.druid.master.rules; -import com.metamx.druid.client.DataSegment; import com.metamx.druid.master.DruidMaster; import com.metamx.druid.master.DruidMasterRuntimeParams; import com.metamx.druid.master.MasterStats; +import io.druid.client.DataSegment; /** * DropRules indicate when segments should be completely removed from the cluster. diff --git a/server/src/main/java/com/metamx/druid/master/rules/IntervalDropRule.java b/server/src/main/java/com/metamx/druid/master/rules/IntervalDropRule.java index 1363c88b9da..367d9953e51 100644 --- a/server/src/main/java/com/metamx/druid/master/rules/IntervalDropRule.java +++ b/server/src/main/java/com/metamx/druid/master/rules/IntervalDropRule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,8 +21,7 @@ package com.metamx.druid.master.rules; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.client.DataSegment; - +import io.druid.client.DataSegment; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/server/src/main/java/com/metamx/druid/master/rules/IntervalLoadRule.java b/server/src/main/java/com/metamx/druid/master/rules/IntervalLoadRule.java index 0cfe603e2b1..07b7009cf74 100644 --- a/server/src/main/java/com/metamx/druid/master/rules/IntervalLoadRule.java +++ b/server/src/main/java/com/metamx/druid/master/rules/IntervalLoadRule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,8 +22,7 @@ package com.metamx.druid.master.rules; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; - +import io.druid.client.DataSegment; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/server/src/main/java/com/metamx/druid/master/rules/LoadRule.java b/server/src/main/java/com/metamx/druid/master/rules/LoadRule.java index b133af1799e..0216e6a638b 100644 --- a/server/src/main/java/com/metamx/druid/master/rules/LoadRule.java +++ b/server/src/main/java/com/metamx/druid/master/rules/LoadRule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,7 +21,6 @@ package com.metamx.druid.master.rules; import com.google.common.collect.Lists; import com.google.common.collect.MinMaxPriorityQueue; -import com.metamx.druid.client.DataSegment; import com.metamx.druid.master.BalancerStrategy; import com.metamx.druid.master.DruidMaster; import com.metamx.druid.master.DruidMasterRuntimeParams; @@ -30,6 +29,7 @@ import com.metamx.druid.master.MasterStats; import com.metamx.druid.master.ReplicationThrottler; import com.metamx.druid.master.ServerHolder; import com.metamx.emitter.EmittingLogger; +import io.druid.client.DataSegment; import org.joda.time.DateTime; import java.util.ArrayList; diff --git a/server/src/main/java/com/metamx/druid/master/rules/PeriodDropRule.java b/server/src/main/java/com/metamx/druid/master/rules/PeriodDropRule.java index 5fa6affcf9e..61d926fdbe9 100644 --- a/server/src/main/java/com/metamx/druid/master/rules/PeriodDropRule.java +++ b/server/src/main/java/com/metamx/druid/master/rules/PeriodDropRule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,8 +21,7 @@ package com.metamx.druid.master.rules; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.client.DataSegment; - +import io.druid.client.DataSegment; import org.joda.time.DateTime; import org.joda.time.Interval; import org.joda.time.Period; diff --git a/server/src/main/java/com/metamx/druid/master/rules/PeriodLoadRule.java b/server/src/main/java/com/metamx/druid/master/rules/PeriodLoadRule.java index 632b6acbc67..9ffc81fbaf5 100644 --- a/server/src/main/java/com/metamx/druid/master/rules/PeriodLoadRule.java +++ b/server/src/main/java/com/metamx/druid/master/rules/PeriodLoadRule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,8 +22,7 @@ package com.metamx.druid.master.rules; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; - +import io.druid.client.DataSegment; import org.joda.time.DateTime; import org.joda.time.Interval; import org.joda.time.Period; diff --git a/server/src/main/java/com/metamx/druid/master/rules/Rule.java b/server/src/main/java/com/metamx/druid/master/rules/Rule.java index 82e710cfbfa..55b9adb9be2 100644 --- a/server/src/main/java/com/metamx/druid/master/rules/Rule.java +++ b/server/src/main/java/com/metamx/druid/master/rules/Rule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,10 +21,10 @@ package com.metamx.druid.master.rules; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.metamx.druid.client.DataSegment; import com.metamx.druid.master.DruidMaster; import com.metamx.druid.master.DruidMasterRuntimeParams; import com.metamx.druid.master.MasterStats; +import io.druid.client.DataSegment; import org.joda.time.DateTime; /** diff --git a/server/src/main/java/com/metamx/druid/master/rules/SizeDropRule.java b/server/src/main/java/com/metamx/druid/master/rules/SizeDropRule.java index 0bd9f94cd00..3fd474bb395 100644 --- a/server/src/main/java/com/metamx/druid/master/rules/SizeDropRule.java +++ b/server/src/main/java/com/metamx/druid/master/rules/SizeDropRule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,7 +22,7 @@ package com.metamx.druid.master.rules; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Range; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import org.joda.time.DateTime; /** diff --git a/server/src/main/java/com/metamx/druid/master/rules/SizeLoadRule.java b/server/src/main/java/com/metamx/druid/master/rules/SizeLoadRule.java index 421432ec6b9..e864eca3114 100644 --- a/server/src/main/java/com/metamx/druid/master/rules/SizeLoadRule.java +++ b/server/src/main/java/com/metamx/druid/master/rules/SizeLoadRule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,7 +22,7 @@ package com.metamx.druid.master.rules; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Range; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import org.joda.time.DateTime; /** diff --git a/server/src/main/java/com/metamx/druid/metrics/MetricsModule.java b/server/src/main/java/com/metamx/druid/metrics/MetricsModule.java index bb0063872ac..99f567e46ff 100644 --- a/server/src/main/java/com/metamx/druid/metrics/MetricsModule.java +++ b/server/src/main/java/com/metamx/druid/metrics/MetricsModule.java @@ -1,3 +1,22 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.metrics; import com.google.common.base.Preconditions; @@ -12,13 +31,13 @@ import com.google.inject.Provides; import com.google.inject.name.Names; import com.metamx.common.logger.Logger; import com.metamx.druid.concurrent.Execs; -import com.metamx.druid.guice.JsonConfigProvider; -import com.metamx.druid.guice.JsonConfigurator; -import com.metamx.druid.guice.LazySingleton; -import com.metamx.druid.guice.ManageLifecycle; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.metrics.Monitor; import com.metamx.metrics.MonitorScheduler; +import io.druid.guice.guice.JsonConfigProvider; +import io.druid.guice.guice.JsonConfigurator; +import io.druid.guice.guice.LazySingleton; +import io.druid.guice.guice.ManageLifecycle; import java.util.List; import java.util.Properties; 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 72e24f40a32..20f2c913860 100644 --- a/server/src/main/java/com/metamx/druid/metrics/ServerMonitor.java +++ b/server/src/main/java/com/metamx/druid/metrics/ServerMonitor.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,11 +20,11 @@ package com.metamx.druid.metrics; import com.google.inject.Inject; -import com.metamx.druid.client.DruidServerConfig; import com.metamx.druid.coordination.ServerManager; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; import com.metamx.metrics.AbstractMonitor; +import io.druid.client.DruidServerConfig; import java.util.Map; diff --git a/server/src/main/java/com/metamx/druid/query/QueryRunnerHelper.java b/server/src/main/java/com/metamx/druid/query/QueryRunnerHelper.java index 513fbd31756..688e9339262 100644 --- a/server/src/main/java/com/metamx/druid/query/QueryRunnerHelper.java +++ b/server/src/main/java/com/metamx/druid/query/QueryRunnerHelper.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -23,8 +23,8 @@ import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.metamx.common.guava.FunctionalIterable; import com.metamx.common.logger.Logger; -import com.metamx.druid.result.Result; import io.druid.granularity.QueryGranularity; +import io.druid.query.Result; import io.druid.query.aggregation.Aggregator; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.filter.Filter; diff --git a/server/src/main/java/com/metamx/druid/query/ReferenceCountingSegmentQueryRunner.java b/server/src/main/java/com/metamx/druid/query/ReferenceCountingSegmentQueryRunner.java index 6d6b68acd07..438fbe5f1aa 100644 --- a/server/src/main/java/com/metamx/druid/query/ReferenceCountingSegmentQueryRunner.java +++ b/server/src/main/java/com/metamx/druid/query/ReferenceCountingSegmentQueryRunner.java @@ -1,12 +1,31 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.query; import com.google.common.io.Closeables; import com.metamx.common.guava.ResourceClosingSequence; import com.metamx.common.guava.Sequence; -import com.metamx.druid.index.ReferenceCountingSegment; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; +import io.druid.segment.ReferenceCountingSegment; import java.io.Closeable; diff --git a/server/src/main/java/com/metamx/druid/query/group/GroupByQueryEngine.java b/server/src/main/java/com/metamx/druid/query/group/GroupByQueryEngine.java index bf77b1a4ec9..feec009ccdd 100644 --- a/server/src/main/java/com/metamx/druid/query/group/GroupByQueryEngine.java +++ b/server/src/main/java/com/metamx/druid/query/group/GroupByQueryEngine.java @@ -37,17 +37,19 @@ import com.metamx.common.guava.Sequences; import com.metamx.common.parsers.CloseableIterator; import com.metamx.druid.collect.ResourceHolder; import com.metamx.druid.collect.StupidPool; -import com.metamx.druid.guice.annotations.Global; -import com.metamx.druid.index.brita.Filters; import com.metamx.druid.input.MapBasedRow; import com.metamx.druid.input.Row; -import com.metamx.druid.query.dimension.DimensionSpec; +import io.druid.guice.guice.annotations.Global; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.BufferAggregator; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.dimension.DimensionSpec; +import io.druid.query.groupby.GroupByQuery; +import io.druid.query.groupby.GroupByQueryConfig; import io.druid.segment.Cursor; import io.druid.segment.DimensionSelector; import io.druid.segment.StorageAdapter; +import io.druid.segment.filter.Filters; import org.joda.time.DateTime; import org.joda.time.Interval; 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 23de48bb9bc..f525c2b6631 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 @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -30,12 +30,15 @@ import com.metamx.common.guava.ExecutorExecutingSequence; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.druid.input.Row; -import com.metamx.druid.query.ChainedExecutionQueryRunner; -import com.metamx.druid.query.ConcatQueryRunner; +import io.druid.query.ChainedExecutionQueryRunner; +import io.druid.query.ConcatQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; import io.druid.query.QueryToolChest; +import io.druid.query.groupby.GroupByQuery; +import io.druid.query.groupby.GroupByQueryConfig; +import io.druid.query.groupby.GroupByQueryQueryToolChest; import io.druid.segment.Segment; import io.druid.segment.StorageAdapter; diff --git a/server/src/main/java/com/metamx/druid/query/metadata/SegmentAnalyzer.java b/server/src/main/java/com/metamx/druid/query/metadata/SegmentAnalyzer.java index 8839a985278..e84eebf22c1 100644 --- a/server/src/main/java/com/metamx/druid/query/metadata/SegmentAnalyzer.java +++ b/server/src/main/java/com/metamx/druid/query/metadata/SegmentAnalyzer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -25,14 +25,15 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.google.common.primitives.Longs; import com.metamx.common.logger.Logger; -import com.metamx.druid.index.v1.serde.ComplexMetricSerde; -import com.metamx.druid.index.v1.serde.ComplexMetrics; +import io.druid.query.metadata.metadata.ColumnAnalysis; import io.druid.segment.QueryableIndex; import io.druid.segment.column.BitmapIndex; import io.druid.segment.column.Column; import io.druid.segment.column.ColumnCapabilities; import io.druid.segment.column.ComplexColumn; import io.druid.segment.column.ValueType; +import io.druid.segment.serde.ComplexMetricSerde; +import io.druid.segment.serde.ComplexMetrics; import java.util.Map; @@ -105,7 +106,7 @@ public class SegmentAnalyzer return ColumnAnalysis.error("multi_value"); } - return new ColumnAnalysis(capabilities.getType(), column.getLength() * numBytes, null, null); + return new ColumnAnalysis(capabilities.getType().name(), column.getLength() * numBytes, null, null); } public ColumnAnalysis analyzeStringColumn(Column column) @@ -125,7 +126,7 @@ public class SegmentAnalyzer } } - return new ColumnAnalysis(capabilities.getType(), size, cardinality, null); + return new ColumnAnalysis(capabilities.getType().name(), size, cardinality, null); } return ColumnAnalysis.error("string_no_bitmap"); @@ -153,6 +154,6 @@ public class SegmentAnalyzer size += inputSizeFn.apply(complexColumn.getRowValue(i)); } - return new ColumnAnalysis(capabilities.getType(), size, null, null); + return new ColumnAnalysis(capabilities.getType().name(), size, null, null); } } diff --git a/server/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryRunnerFactory.java b/server/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryRunnerFactory.java index dc6f6b7c89b..5b87c9bf3ee 100644 --- a/server/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryRunnerFactory.java +++ b/server/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryRunnerFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -25,11 +25,16 @@ import com.google.common.collect.Maps; import com.metamx.common.guava.ExecutorExecutingSequence; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; -import com.metamx.druid.query.ConcatQueryRunner; +import io.druid.query.ConcatQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; import io.druid.query.QueryToolChest; +import io.druid.query.metadata.SegmentMetadataQueryQueryToolChest; +import io.druid.query.metadata.metadata.ColumnAnalysis; +import io.druid.query.metadata.metadata.ColumnIncluderator; +import io.druid.query.metadata.metadata.SegmentAnalysis; +import io.druid.query.metadata.metadata.SegmentMetadataQuery; import io.druid.segment.QueryableIndex; import io.druid.segment.Segment; diff --git a/server/src/main/java/com/metamx/druid/query/search/SearchQueryRunner.java b/server/src/main/java/com/metamx/druid/query/search/SearchQueryRunner.java index 2e25720122f..ae0e17e7628 100644 --- a/server/src/main/java/com/metamx/druid/query/search/SearchQueryRunner.java +++ b/server/src/main/java/com/metamx/druid/query/search/SearchQueryRunner.java @@ -1,3 +1,22 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.query.search; import com.google.common.base.Strings; @@ -9,16 +28,17 @@ import com.metamx.common.ISE; import com.metamx.common.guava.FunctionalIterable; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; -import com.metamx.druid.index.brita.Filters; -import com.metamx.druid.index.v1.ColumnSelectorBitmapIndexSelector; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.SearchResultValue; import com.metamx.emitter.EmittingLogger; -import io.druid.data.IndexedInts; import io.druid.granularity.QueryGranularity; import io.druid.query.Query; import io.druid.query.QueryRunner; +import io.druid.query.Result; import io.druid.query.filter.Filter; +import io.druid.query.search.SearchResultValue; +import io.druid.query.search.search.SearchHit; +import io.druid.query.search.search.SearchQuery; +import io.druid.query.search.search.SearchQuerySpec; +import io.druid.segment.ColumnSelectorBitmapIndexSelector; import io.druid.segment.Cursor; import io.druid.segment.DimensionSelector; import io.druid.segment.QueryableIndex; @@ -26,6 +46,8 @@ import io.druid.segment.Segment; import io.druid.segment.StorageAdapter; import io.druid.segment.column.BitmapIndex; import io.druid.segment.column.Column; +import io.druid.segment.data.IndexedInts; +import io.druid.segment.filter.Filters; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import java.util.List; 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 9df93768f2c..c9e43bbf7fd 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 @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,12 +20,14 @@ package com.metamx.druid.query.search; import com.google.inject.Inject; -import com.metamx.druid.query.ChainedExecutionQueryRunner; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.SearchResultValue; +import io.druid.query.ChainedExecutionQueryRunner; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; import io.druid.query.QueryToolChest; +import io.druid.query.Result; +import io.druid.query.search.SearchQueryQueryToolChest; +import io.druid.query.search.SearchResultValue; +import io.druid.query.search.search.SearchQuery; import io.druid.segment.Segment; import java.util.concurrent.ExecutorService; 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 9742380e4fd..a9a8df88ec1 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 @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,13 +22,15 @@ package com.metamx.druid.query.timeboundary; import com.metamx.common.ISE; import com.metamx.common.guava.BaseSequence; import com.metamx.common.guava.Sequence; -import com.metamx.druid.query.ChainedExecutionQueryRunner; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeBoundaryResultValue; +import io.druid.query.ChainedExecutionQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; import io.druid.query.QueryToolChest; +import io.druid.query.Result; +import io.druid.query.timeboundary.TimeBoundaryQuery; +import io.druid.query.timeboundary.TimeBoundaryQueryQueryToolChest; +import io.druid.query.timeboundary.TimeBoundaryResultValue; import io.druid.segment.Segment; import io.druid.segment.StorageAdapter; diff --git a/server/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryEngine.java b/server/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryEngine.java index 83e4b53f954..e80a687a538 100644 --- a/server/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryEngine.java +++ b/server/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryEngine.java @@ -23,15 +23,16 @@ import com.google.common.base.Function; import com.metamx.common.guava.BaseSequence; import com.metamx.common.guava.Sequence; import com.metamx.druid.TimeseriesResultBuilder; -import com.metamx.druid.index.brita.Filters; import com.metamx.druid.query.QueryRunnerHelper; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; +import io.druid.query.Result; import io.druid.query.aggregation.Aggregator; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.timeseries.TimeseriesQuery; +import io.druid.query.timeseries.TimeseriesResultValue; import io.druid.segment.Cursor; import io.druid.segment.StorageAdapter; +import io.druid.segment.filter.Filters; import java.util.Iterator; import java.util.List; diff --git a/server/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerFactory.java b/server/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerFactory.java index 7ddc4947625..082dba2a2c3 100644 --- a/server/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerFactory.java +++ b/server/src/main/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,13 +21,15 @@ package com.metamx.druid.query.timeseries; import com.metamx.common.ISE; import com.metamx.common.guava.Sequence; -import com.metamx.druid.query.ChainedExecutionQueryRunner; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; +import io.druid.query.ChainedExecutionQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; import io.druid.query.QueryToolChest; +import io.druid.query.Result; +import io.druid.query.timeseries.TimeseriesQuery; +import io.druid.query.timeseries.TimeseriesQueryQueryToolChest; +import io.druid.query.timeseries.TimeseriesResultValue; import io.druid.segment.Segment; import io.druid.segment.StorageAdapter; diff --git a/server/src/main/java/com/metamx/druid/utils/DruidSetup.java b/server/src/main/java/com/metamx/druid/utils/DruidSetup.java index ef5185ac703..8d8360b9c67 100644 --- a/server/src/main/java/com/metamx/druid/utils/DruidSetup.java +++ b/server/src/main/java/com/metamx/druid/utils/DruidSetup.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -24,7 +24,7 @@ import com.google.common.base.Throwables; import com.google.common.collect.Sets; import com.google.common.io.Closeables; import com.metamx.common.config.Config; -import com.metamx.druid.initialization.ZkPathsConfig; +import io.druid.server.initialization.initialization.ZkPathsConfig; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.RetryOneTime; diff --git a/client/src/main/java/com/metamx/druid/client/BatchServerInventoryView.java b/server/src/main/java/io/druid/client/BatchServerInventoryView.java similarity index 94% rename from client/src/main/java/com/metamx/druid/client/BatchServerInventoryView.java rename to server/src/main/java/io/druid/client/BatchServerInventoryView.java index f5410536926..77253faebb6 100644 --- a/client/src/main/java/com/metamx/druid/client/BatchServerInventoryView.java +++ b/server/src/main/java/io/druid/client/BatchServerInventoryView.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -25,9 +25,9 @@ import com.google.common.collect.MapMaker; import com.google.common.collect.Sets; import com.google.inject.Inject; import com.metamx.common.ISE; -import com.metamx.druid.guice.ManageLifecycle; -import com.metamx.druid.initialization.ZkPathsConfig; import com.metamx.emitter.EmittingLogger; +import io.druid.guice.guice.ManageLifecycle; +import io.druid.server.initialization.initialization.ZkPathsConfig; import org.apache.curator.framework.CuratorFramework; import java.util.Set; diff --git a/server/src/main/java/io/druid/client/BatchServerInventoryViewProvider.java b/server/src/main/java/io/druid/client/BatchServerInventoryViewProvider.java new file mode 100644 index 00000000000..1bd0163dca8 --- /dev/null +++ b/server/src/main/java/io/druid/client/BatchServerInventoryViewProvider.java @@ -0,0 +1,50 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client; + +import com.fasterxml.jackson.annotation.JacksonInject; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.druid.server.initialization.initialization.ZkPathsConfig; +import org.apache.curator.framework.CuratorFramework; + +import javax.validation.constraints.NotNull; + +/** + */ +public class BatchServerInventoryViewProvider implements ServerInventoryViewProvider +{ + @JacksonInject + @NotNull + private ZkPathsConfig zkPaths = null; + + @JacksonInject + @NotNull + private CuratorFramework curator = null; + + @JacksonInject + @NotNull + private ObjectMapper jsonMapper = null; + + @Override + public ServerInventoryView get() + { + return new BatchServerInventoryView(zkPaths, curator, jsonMapper); + } +} diff --git a/client/src/main/java/com/metamx/druid/client/BrokerServerView.java b/server/src/main/java/io/druid/client/BrokerServerView.java similarity index 96% rename from client/src/main/java/com/metamx/druid/client/BrokerServerView.java rename to server/src/main/java/io/druid/client/BrokerServerView.java index 1e4ed76f23b..cee1168bd33 100644 --- a/client/src/main/java/com/metamx/druid/client/BrokerServerView.java +++ b/server/src/main/java/io/druid/client/BrokerServerView.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Maps; @@ -25,14 +25,14 @@ import com.google.common.collect.Ordering; import com.google.inject.Inject; import com.metamx.common.logger.Logger; import com.metamx.druid.VersionedIntervalTimeline; -import com.metamx.druid.client.selector.QueryableDruidServer; -import com.metamx.druid.client.selector.ServerSelector; import com.metamx.druid.concurrent.Execs; -import com.metamx.druid.guice.annotations.Client; import com.metamx.druid.partition.PartitionChunk; -import com.metamx.druid.query.QueryToolChestWarehouse; import com.metamx.http.client.HttpClient; +import io.druid.client.selector.QueryableDruidServer; +import io.druid.client.selector.ServerSelector; +import io.druid.guice.guice.annotations.Client; import io.druid.query.QueryRunner; +import io.druid.query.QueryToolChestWarehouse; import java.util.Iterator; import java.util.Map; diff --git a/client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java b/server/src/main/java/io/druid/client/CachingClusteredClient.java similarity index 97% rename from client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java rename to server/src/main/java/io/druid/client/CachingClusteredClient.java index 6c985cf1ab6..a921ccaee02 100644 --- a/client/src/main/java/com/metamx/druid/client/CachingClusteredClient.java +++ b/server/src/main/java/io/druid/client/CachingClusteredClient.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -40,18 +40,18 @@ import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.druid.TimelineObjectHolder; import com.metamx.druid.VersionedIntervalTimeline; -import com.metamx.druid.client.cache.Cache; -import com.metamx.druid.client.selector.QueryableDruidServer; -import com.metamx.druid.client.selector.ServerSelector; import com.metamx.druid.partition.PartitionChunk; -import com.metamx.druid.query.QueryToolChestWarehouse; -import com.metamx.druid.result.BySegmentResultValueClass; -import com.metamx.druid.result.Result; import com.metamx.emitter.EmittingLogger; +import io.druid.client.cache.Cache; +import io.druid.client.selector.QueryableDruidServer; +import io.druid.client.selector.ServerSelector; +import io.druid.query.BySegmentResultValueClass; import io.druid.query.CacheStrategy; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryToolChest; +import io.druid.query.QueryToolChestWarehouse; +import io.druid.query.Result; import io.druid.query.SegmentDescriptor; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.MetricManipulationFn; diff --git a/client/src/main/java/com/metamx/druid/client/DataSegment.java b/server/src/main/java/io/druid/client/DataSegment.java similarity index 98% rename from client/src/main/java/com/metamx/druid/client/DataSegment.java rename to server/src/main/java/io/druid/client/DataSegment.java index 3d048e430e4..f6549d8de58 100644 --- a/client/src/main/java/com/metamx/druid/client/DataSegment.java +++ b/server/src/main/java/io/druid/client/DataSegment.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -31,9 +31,9 @@ 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.shard.NoneShardSpec; -import com.metamx.druid.shard.ShardSpec; import io.druid.query.SegmentDescriptor; +import io.druid.server.shard.shard.NoneShardSpec; +import io.druid.server.shard.shard.ShardSpec; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/client/src/main/java/com/metamx/druid/client/DirectDruidClient.java b/server/src/main/java/io/druid/client/DirectDruidClient.java similarity index 96% rename from client/src/main/java/com/metamx/druid/client/DirectDruidClient.java rename to server/src/main/java/io/druid/client/DirectDruidClient.java index 5f82a8bf5be..80844ccbeda 100644 --- a/client/src/main/java/com/metamx/druid/client/DirectDruidClient.java +++ b/server/src/main/java/io/druid/client/DirectDruidClient.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; @@ -35,16 +35,16 @@ import com.metamx.common.guava.BaseSequence; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.common.logger.Logger; -import com.metamx.druid.query.QueryToolChestWarehouse; -import com.metamx.druid.result.BySegmentResultValueClass; -import com.metamx.druid.result.Result; 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 io.druid.query.BySegmentResultValueClass; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryToolChest; +import io.druid.query.QueryToolChestWarehouse; +import io.druid.query.Result; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.MetricManipulationFn; import org.jboss.netty.handler.codec.http.HttpChunk; @@ -199,14 +199,16 @@ public class DirectDruidClient implements QueryRunner if (!isBySegment) { retVal = Sequences.map( retVal, - toolChest.makeMetricManipulatorFn(query, new MetricManipulationFn() + toolChest.makeMetricManipulatorFn( + query, new MetricManipulationFn() { @Override public Object manipulate(AggregatorFactory factory, Object object) { return factory.deserialize(object); } - }) + } + ) ); } diff --git a/client/src/main/java/com/metamx/druid/client/DruidDataSource.java b/server/src/main/java/io/druid/client/DruidDataSource.java similarity index 97% rename from client/src/main/java/com/metamx/druid/client/DruidDataSource.java rename to server/src/main/java/io/druid/client/DruidDataSource.java index ebe566052f8..330fef388a9 100644 --- a/client/src/main/java/com/metamx/druid/client/DruidDataSource.java +++ b/server/src/main/java/io/druid/client/DruidDataSource.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Maps; diff --git a/client/src/main/java/com/metamx/druid/client/DruidServer.java b/server/src/main/java/io/druid/client/DruidServer.java similarity index 97% rename from client/src/main/java/com/metamx/druid/client/DruidServer.java rename to server/src/main/java/io/druid/client/DruidServer.java index 937119b3d46..99e98b14b29 100644 --- a/client/src/main/java/com/metamx/druid/client/DruidServer.java +++ b/server/src/main/java/io/druid/client/DruidServer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,14 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; import com.metamx.common.logger.Logger; -import com.metamx.druid.coordination.DruidServerMetadata; -import com.metamx.druid.initialization.DruidNode; +import io.druid.server.DruidNode; +import io.druid.server.coordination.DruidServerMetadata; import java.util.Collections; import java.util.Map; diff --git a/client/src/main/java/com/metamx/druid/client/DruidServerConfig.java b/server/src/main/java/io/druid/client/DruidServerConfig.java similarity index 93% rename from client/src/main/java/com/metamx/druid/client/DruidServerConfig.java rename to server/src/main/java/io/druid/client/DruidServerConfig.java index 6a57a38b20f..14cfaee290a 100644 --- a/client/src/main/java/com/metamx/druid/client/DruidServerConfig.java +++ b/server/src/main/java/io/druid/client/DruidServerConfig.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/server/src/main/java/io/druid/client/InventoryView.java b/server/src/main/java/io/druid/client/InventoryView.java new file mode 100644 index 00000000000..d955ea21c42 --- /dev/null +++ b/server/src/main/java/io/druid/client/InventoryView.java @@ -0,0 +1,28 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client; + +/** + */ +public interface InventoryView +{ + public DruidServer getInventoryValue(String string); + public Iterable getInventory(); +} diff --git a/client/src/main/java/com/metamx/druid/client/ServerInventoryView.java b/server/src/main/java/io/druid/client/ServerInventoryView.java similarity index 97% rename from client/src/main/java/com/metamx/druid/client/ServerInventoryView.java rename to server/src/main/java/io/druid/client/ServerInventoryView.java index 32cade52c1d..ebc3c8b8ab0 100644 --- a/client/src/main/java/com/metamx/druid/client/ServerInventoryView.java +++ b/server/src/main/java/io/druid/client/ServerInventoryView.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; @@ -28,10 +28,10 @@ import com.google.common.collect.MapMaker; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.druid.concurrent.Execs; -import com.metamx.druid.curator.inventory.CuratorInventoryManager; -import com.metamx.druid.curator.inventory.CuratorInventoryManagerStrategy; -import com.metamx.druid.curator.inventory.InventoryManagerConfig; import com.metamx.emitter.EmittingLogger; +import io.druid.curator.inventory.CuratorInventoryManager; +import io.druid.curator.inventory.CuratorInventoryManagerStrategy; +import io.druid.curator.inventory.InventoryManagerConfig; import org.apache.curator.framework.CuratorFramework; import java.io.IOException; diff --git a/client/src/main/java/com/metamx/druid/client/ServerInventoryViewConfig.java b/server/src/main/java/io/druid/client/ServerInventoryViewConfig.java similarity index 93% rename from client/src/main/java/com/metamx/druid/client/ServerInventoryViewConfig.java rename to server/src/main/java/io/druid/client/ServerInventoryViewConfig.java index 6130a96a66c..0e96cec5e34 100644 --- a/client/src/main/java/com/metamx/druid/client/ServerInventoryViewConfig.java +++ b/server/src/main/java/io/druid/client/ServerInventoryViewConfig.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import org.skife.config.Config; import org.skife.config.Default; diff --git a/server/src/main/java/io/druid/client/ServerInventoryViewProvider.java b/server/src/main/java/io/druid/client/ServerInventoryViewProvider.java new file mode 100644 index 00000000000..fa48fba4661 --- /dev/null +++ b/server/src/main/java/io/druid/client/ServerInventoryViewProvider.java @@ -0,0 +1,35 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.inject.Provider; + +/** + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = SingleServerInventoryProvider.class) +@JsonSubTypes(value = { + @JsonSubTypes.Type(name = "legacy", value = SingleServerInventoryProvider.class), + @JsonSubTypes.Type(name = "batch", value = BatchServerInventoryViewProvider.class) +}) +public interface ServerInventoryViewProvider extends Provider +{ +} diff --git a/client/src/main/java/com/metamx/druid/client/ServerView.java b/server/src/main/java/io/druid/client/ServerView.java similarity index 98% rename from client/src/main/java/com/metamx/druid/client/ServerView.java rename to server/src/main/java/io/druid/client/ServerView.java index 61afd6d1222..843070f1b0f 100644 --- a/client/src/main/java/com/metamx/druid/client/ServerView.java +++ b/server/src/main/java/io/druid/client/ServerView.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import java.util.concurrent.Executor; diff --git a/server/src/main/java/io/druid/client/SingleServerInventoryProvider.java b/server/src/main/java/io/druid/client/SingleServerInventoryProvider.java new file mode 100644 index 00000000000..74ec48c9bd6 --- /dev/null +++ b/server/src/main/java/io/druid/client/SingleServerInventoryProvider.java @@ -0,0 +1,50 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client; + +import com.fasterxml.jackson.annotation.JacksonInject; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.druid.server.initialization.initialization.ZkPathsConfig; +import org.apache.curator.framework.CuratorFramework; + +import javax.validation.constraints.NotNull; + +/** + */ +public class SingleServerInventoryProvider implements ServerInventoryViewProvider +{ + @JacksonInject + @NotNull + private ZkPathsConfig zkPaths = null; + + @JacksonInject + @NotNull + private CuratorFramework curator = null; + + @JacksonInject + @NotNull + private ObjectMapper jsonMapper = null; + + @Override + public ServerInventoryView get() + { + return new SingleServerInventoryView(zkPaths, curator, jsonMapper); + } +} diff --git a/client/src/main/java/com/metamx/druid/client/SingleServerInventoryView.java b/server/src/main/java/io/druid/client/SingleServerInventoryView.java similarity index 91% rename from client/src/main/java/com/metamx/druid/client/SingleServerInventoryView.java rename to server/src/main/java/io/druid/client/SingleServerInventoryView.java index 1c04800887f..5f95c52f1c1 100644 --- a/client/src/main/java/com/metamx/druid/client/SingleServerInventoryView.java +++ b/server/src/main/java/io/druid/client/SingleServerInventoryView.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,14 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.inject.Inject; -import com.metamx.druid.guice.ManageLifecycle; -import com.metamx.druid.initialization.ZkPathsConfig; import com.metamx.emitter.EmittingLogger; +import io.druid.guice.guice.ManageLifecycle; +import io.druid.server.initialization.initialization.ZkPathsConfig; import org.apache.curator.framework.CuratorFramework; /** diff --git a/client/src/main/java/com/metamx/druid/client/TimelineServerView.java b/server/src/main/java/io/druid/client/TimelineServerView.java similarity index 88% rename from client/src/main/java/com/metamx/druid/client/TimelineServerView.java rename to server/src/main/java/io/druid/client/TimelineServerView.java index adbf863a6b5..29b3164a4f2 100644 --- a/client/src/main/java/com/metamx/druid/client/TimelineServerView.java +++ b/server/src/main/java/io/druid/client/TimelineServerView.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.metamx.druid.VersionedIntervalTimeline; -import com.metamx.druid.client.selector.ServerSelector; +import io.druid.client.selector.ServerSelector; import io.druid.query.QueryRunner; /** diff --git a/client/src/main/java/com/metamx/druid/client/cache/ByteCountingLRUMap.java b/server/src/main/java/io/druid/client/cache/ByteCountingLRUMap.java similarity index 96% rename from client/src/main/java/com/metamx/druid/client/cache/ByteCountingLRUMap.java rename to server/src/main/java/io/druid/client/cache/ByteCountingLRUMap.java index 59a60f060e5..b351dfc6837 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/ByteCountingLRUMap.java +++ b/server/src/main/java/io/druid/client/cache/ByteCountingLRUMap.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import com.metamx.common.logger.Logger; diff --git a/client/src/main/java/com/metamx/druid/client/cache/Cache.java b/server/src/main/java/io/druid/client/cache/Cache.java similarity index 96% rename from client/src/main/java/com/metamx/druid/client/cache/Cache.java rename to server/src/main/java/io/druid/client/cache/Cache.java index 6e9463deb56..6ed875edb0b 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/Cache.java +++ b/server/src/main/java/io/druid/client/cache/Cache.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import com.google.common.base.Charsets; import com.google.common.base.Preconditions; diff --git a/client/src/main/java/com/metamx/druid/client/cache/CacheMonitor.java b/server/src/main/java/io/druid/client/cache/CacheMonitor.java similarity index 97% rename from client/src/main/java/com/metamx/druid/client/cache/CacheMonitor.java rename to server/src/main/java/io/druid/client/cache/CacheMonitor.java index ce9ac5e27d2..baa4920e60f 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/CacheMonitor.java +++ b/server/src/main/java/io/druid/client/cache/CacheMonitor.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import com.google.inject.Inject; import com.metamx.emitter.service.ServiceEmitter; diff --git a/server/src/main/java/io/druid/client/cache/CacheProvider.java b/server/src/main/java/io/druid/client/cache/CacheProvider.java new file mode 100644 index 00000000000..87597dba1c7 --- /dev/null +++ b/server/src/main/java/io/druid/client/cache/CacheProvider.java @@ -0,0 +1,33 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client.cache; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.inject.Provider; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = LocalCacheProvider.class) +@JsonSubTypes(value = { + @JsonSubTypes.Type(name = "local", value = LocalCacheProvider.class), + @JsonSubTypes.Type(name = "memcached", value = MemcachedCacheProvider.class) +}) +public interface CacheProvider extends Provider +{ +} diff --git a/client/src/main/java/com/metamx/druid/client/cache/CacheSerde.java b/server/src/main/java/io/druid/client/cache/CacheSerde.java similarity index 91% rename from client/src/main/java/com/metamx/druid/client/cache/CacheSerde.java rename to server/src/main/java/io/druid/client/cache/CacheSerde.java index e7e60fcc096..16dbce6ad6d 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/CacheSerde.java +++ b/server/src/main/java/io/druid/client/cache/CacheSerde.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; /** */ diff --git a/client/src/main/java/com/metamx/druid/client/cache/CacheStats.java b/server/src/main/java/io/druid/client/cache/CacheStats.java similarity index 96% rename from client/src/main/java/com/metamx/druid/client/cache/CacheStats.java rename to server/src/main/java/io/druid/client/cache/CacheStats.java index 33f0a145082..ea917649154 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/CacheStats.java +++ b/server/src/main/java/io/druid/client/cache/CacheStats.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; /** */ diff --git a/client/src/main/java/com/metamx/druid/client/cache/LZ4Transcoder.java b/server/src/main/java/io/druid/client/cache/LZ4Transcoder.java similarity index 96% rename from client/src/main/java/com/metamx/druid/client/cache/LZ4Transcoder.java rename to server/src/main/java/io/druid/client/cache/LZ4Transcoder.java index 4728430b4e7..7427c2b3db5 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/LZ4Transcoder.java +++ b/server/src/main/java/io/druid/client/cache/LZ4Transcoder.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2013 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import com.google.common.primitives.Ints; import net.jpountz.lz4.LZ4Compressor; diff --git a/client/src/main/java/com/metamx/druid/client/cache/LocalCacheProvider.java b/server/src/main/java/io/druid/client/cache/LocalCacheProvider.java similarity index 93% rename from client/src/main/java/com/metamx/druid/client/cache/LocalCacheProvider.java rename to server/src/main/java/io/druid/client/cache/LocalCacheProvider.java index 1457ec928e6..4f78457b5b9 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/LocalCacheProvider.java +++ b/server/src/main/java/io/druid/client/cache/LocalCacheProvider.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/client/cache/MapCache.java b/server/src/main/java/io/druid/client/cache/MapCache.java similarity index 97% rename from client/src/main/java/com/metamx/druid/client/cache/MapCache.java rename to server/src/main/java/io/druid/client/cache/MapCache.java index 0480776cfde..743ca26463d 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/MapCache.java +++ b/server/src/main/java/io/druid/client/cache/MapCache.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import com.google.common.collect.Maps; import com.google.common.primitives.Ints; diff --git a/client/src/main/java/com/metamx/druid/client/cache/MemcachedCache.java b/server/src/main/java/io/druid/client/cache/MemcachedCache.java similarity index 99% rename from client/src/main/java/com/metamx/druid/client/cache/MemcachedCache.java rename to server/src/main/java/io/druid/client/cache/MemcachedCache.java index befac85326e..155c75e3f86 100644 --- a/client/src/main/java/com/metamx/druid/client/cache/MemcachedCache.java +++ b/server/src/main/java/io/druid/client/cache/MemcachedCache.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import com.google.common.base.Function; import com.google.common.base.Preconditions; diff --git a/server/src/main/java/io/druid/client/cache/MemcachedCacheConfig.java b/server/src/main/java/io/druid/client/cache/MemcachedCacheConfig.java new file mode 100644 index 00000000000..2cc06cf3637 --- /dev/null +++ b/server/src/main/java/io/druid/client/cache/MemcachedCacheConfig.java @@ -0,0 +1,68 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client.cache; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import javax.validation.constraints.NotNull; + +public class MemcachedCacheConfig +{ + @JsonProperty + private int expiration = 2592000; // What is this number? + + @JsonProperty + private int timeout = 500; + + @JsonProperty + @NotNull + private String hosts; + + @JsonProperty + private int maxObjectSize = 50 * 1024 * 1024; + + @JsonProperty + private String memcachedPrefix = "druid"; + + public int getExpiration() + { + return expiration; + } + + public int getTimeout() + { + return timeout; + } + + public String getHosts() + { + return hosts; + } + + public int getMaxObjectSize() + { + return maxObjectSize; + } + + public String getMemcachedPrefix() + { + return memcachedPrefix; + } +} diff --git a/server/src/main/java/io/druid/client/cache/MemcachedCacheProvider.java b/server/src/main/java/io/druid/client/cache/MemcachedCacheProvider.java new file mode 100644 index 00000000000..afdab26dd09 --- /dev/null +++ b/server/src/main/java/io/druid/client/cache/MemcachedCacheProvider.java @@ -0,0 +1,29 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client.cache; + +public class MemcachedCacheProvider extends MemcachedCacheConfig implements CacheProvider +{ + @Override + public Cache get() + { + return MemcachedCache.create(this); + } +} diff --git a/client/src/main/java/com/metamx/druid/client/indexing/ClientAppendQuery.java b/server/src/main/java/io/druid/client/indexing/ClientAppendQuery.java similarity index 92% rename from client/src/main/java/com/metamx/druid/client/indexing/ClientAppendQuery.java rename to server/src/main/java/io/druid/client/indexing/ClientAppendQuery.java index 6e9a2eb4163..45641518166 100644 --- a/client/src/main/java/com/metamx/druid/client/indexing/ClientAppendQuery.java +++ b/server/src/main/java/io/druid/client/indexing/ClientAppendQuery.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.indexing; +package io.druid.client.indexing; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/client/indexing/ClientConversionQuery.java b/server/src/main/java/io/druid/client/indexing/ClientConversionQuery.java similarity index 51% rename from client/src/main/java/com/metamx/druid/client/indexing/ClientConversionQuery.java rename to server/src/main/java/io/druid/client/indexing/ClientConversionQuery.java index c0b96bb80b4..4f67c0e7bc6 100644 --- a/client/src/main/java/com/metamx/druid/client/indexing/ClientConversionQuery.java +++ b/server/src/main/java/io/druid/client/indexing/ClientConversionQuery.java @@ -1,7 +1,26 @@ -package com.metamx.druid.client.indexing; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client.indexing; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import org.joda.time.Interval; /** diff --git a/client/src/main/java/com/metamx/druid/client/indexing/ClientKillQuery.java b/server/src/main/java/io/druid/client/indexing/ClientKillQuery.java similarity index 94% rename from client/src/main/java/com/metamx/druid/client/indexing/ClientKillQuery.java rename to server/src/main/java/io/druid/client/indexing/ClientKillQuery.java index 3ae8dffb225..6f280cef7fa 100644 --- a/client/src/main/java/com/metamx/druid/client/indexing/ClientKillQuery.java +++ b/server/src/main/java/io/druid/client/indexing/ClientKillQuery.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.indexing; +package io.druid.client.indexing; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/client/indexing/ClientMergeQuery.java b/server/src/main/java/io/druid/client/indexing/ClientMergeQuery.java similarity index 93% rename from client/src/main/java/com/metamx/druid/client/indexing/ClientMergeQuery.java rename to server/src/main/java/io/druid/client/indexing/ClientMergeQuery.java index 493e9588f5a..cb5a89599e7 100644 --- a/client/src/main/java/com/metamx/druid/client/indexing/ClientMergeQuery.java +++ b/server/src/main/java/io/druid/client/indexing/ClientMergeQuery.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.indexing; +package io.druid.client.indexing; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import io.druid.query.aggregation.AggregatorFactory; import java.util.List; diff --git a/server/src/main/java/io/druid/client/indexing/IndexingService.java b/server/src/main/java/io/druid/client/indexing/IndexingService.java new file mode 100644 index 00000000000..e79bab7fbee --- /dev/null +++ b/server/src/main/java/io/druid/client/indexing/IndexingService.java @@ -0,0 +1,36 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client.indexing; + +import com.google.inject.BindingAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + */ +@BindingAnnotation +@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface IndexingService +{ +} diff --git a/client/src/main/java/com/metamx/druid/client/indexing/IndexingServiceClient.java b/server/src/main/java/io/druid/client/indexing/IndexingServiceClient.java similarity index 92% rename from client/src/main/java/com/metamx/druid/client/indexing/IndexingServiceClient.java rename to server/src/main/java/io/druid/client/indexing/IndexingServiceClient.java index e3de082f7fc..2d3a622edae 100644 --- a/client/src/main/java/com/metamx/druid/client/indexing/IndexingServiceClient.java +++ b/server/src/main/java/io/druid/client/indexing/IndexingServiceClient.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,19 +17,19 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.indexing; +package io.druid.client.indexing; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Throwables; import com.google.inject.Inject; import com.metamx.common.IAE; import com.metamx.common.ISE; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.selector.DiscoverySelector; -import com.metamx.druid.client.selector.Server; -import com.metamx.druid.guice.annotations.Global; import com.metamx.http.client.HttpClient; import com.metamx.http.client.response.InputStreamResponseHandler; +import io.druid.client.DataSegment; +import io.druid.client.selector.DiscoverySelector; +import io.druid.client.selector.Server; +import io.druid.guice.guice.annotations.Global; import org.joda.time.Interval; import java.io.InputStream; diff --git a/server/src/main/java/io/druid/client/selector/DiscoverySelector.java b/server/src/main/java/io/druid/client/selector/DiscoverySelector.java new file mode 100644 index 00000000000..d878d7ed921 --- /dev/null +++ b/server/src/main/java/io/druid/client/selector/DiscoverySelector.java @@ -0,0 +1,27 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client.selector; + +/** + */ +public interface DiscoverySelector +{ + public T pick(); +} diff --git a/client/src/main/java/com/metamx/druid/client/selector/QueryableDruidServer.java b/server/src/main/java/io/druid/client/selector/QueryableDruidServer.java similarity index 86% rename from client/src/main/java/com/metamx/druid/client/selector/QueryableDruidServer.java rename to server/src/main/java/io/druid/client/selector/QueryableDruidServer.java index 2528facb8d8..8f4f7f48e82 100644 --- a/client/src/main/java/com/metamx/druid/client/selector/QueryableDruidServer.java +++ b/server/src/main/java/io/druid/client/selector/QueryableDruidServer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,10 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.selector; +package io.druid.client.selector; -import com.metamx.druid.client.DirectDruidClient; -import com.metamx.druid.client.DruidServer; +import io.druid.client.DirectDruidClient; +import io.druid.client.DruidServer; /** */ diff --git a/server/src/main/java/io/druid/client/selector/Server.java b/server/src/main/java/io/druid/client/selector/Server.java new file mode 100644 index 00000000000..664d621136e --- /dev/null +++ b/server/src/main/java/io/druid/client/selector/Server.java @@ -0,0 +1,29 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client.selector; + +/** + */ +public interface Server +{ + public String getScheme(); + public String getHost(); + public int getPort(); +} diff --git a/client/src/main/java/com/metamx/druid/client/selector/ServerSelector.java b/server/src/main/java/io/druid/client/selector/ServerSelector.java similarity index 94% rename from client/src/main/java/com/metamx/druid/client/selector/ServerSelector.java rename to server/src/main/java/io/druid/client/selector/ServerSelector.java index d4876e5680f..53ec1727267 100644 --- a/client/src/main/java/com/metamx/druid/client/selector/ServerSelector.java +++ b/server/src/main/java/io/druid/client/selector/ServerSelector.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.selector; +package io.druid.client.selector; import com.google.common.collect.Sets; import com.google.common.primitives.Ints; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.util.Collections; import java.util.Comparator; diff --git a/client/src/main/java/com/metamx/druid/curator/CuratorConfig.java b/server/src/main/java/io/druid/curator/CuratorConfig.java similarity index 93% rename from client/src/main/java/com/metamx/druid/curator/CuratorConfig.java rename to server/src/main/java/io/druid/curator/CuratorConfig.java index 2f396e02824..7ac0247b342 100644 --- a/client/src/main/java/com/metamx/druid/curator/CuratorConfig.java +++ b/server/src/main/java/io/druid/curator/CuratorConfig.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.curator; +package io.druid.curator; import org.skife.config.Config; import org.skife.config.Default; diff --git a/client/src/main/java/com/metamx/druid/curator/CuratorModule.java b/server/src/main/java/io/druid/curator/CuratorModule.java similarity index 63% rename from client/src/main/java/com/metamx/druid/curator/CuratorModule.java rename to server/src/main/java/io/druid/curator/CuratorModule.java index ee7e59e0e65..89fef96830d 100644 --- a/client/src/main/java/com/metamx/druid/curator/CuratorModule.java +++ b/server/src/main/java/io/druid/curator/CuratorModule.java @@ -1,12 +1,31 @@ -package com.metamx.druid.curator; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.curator; import com.google.inject.Binder; import com.google.inject.Module; import com.google.inject.Provides; import com.metamx.common.lifecycle.Lifecycle; import com.metamx.common.logger.Logger; -import com.metamx.druid.guice.ConfigProvider; -import com.metamx.druid.guice.LazySingleton; +import io.druid.guice.guice.ConfigProvider; +import io.druid.guice.guice.LazySingleton; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.BoundedExponentialBackoffRetry; diff --git a/client/src/main/java/com/metamx/druid/curator/PotentiallyGzippedCompressionProvider.java b/server/src/main/java/io/druid/curator/PotentiallyGzippedCompressionProvider.java similarity index 93% rename from client/src/main/java/com/metamx/druid/curator/PotentiallyGzippedCompressionProvider.java rename to server/src/main/java/io/druid/curator/PotentiallyGzippedCompressionProvider.java index abddd9574fc..c2fda7139be 100644 --- a/client/src/main/java/com/metamx/druid/curator/PotentiallyGzippedCompressionProvider.java +++ b/server/src/main/java/io/druid/curator/PotentiallyGzippedCompressionProvider.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,13 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.curator; +package io.druid.curator; import org.apache.curator.framework.api.CompressionProvider; import org.apache.curator.framework.imps.GzipCompressionProvider; import java.io.IOException; -import java.util.zip.ZipException; /** */ diff --git a/client/src/main/java/com/metamx/druid/curator/ShutdownNowIgnoringExecutorService.java b/server/src/main/java/io/druid/curator/ShutdownNowIgnoringExecutorService.java similarity index 74% rename from client/src/main/java/com/metamx/druid/curator/ShutdownNowIgnoringExecutorService.java rename to server/src/main/java/io/druid/curator/ShutdownNowIgnoringExecutorService.java index b4a8128f6d9..7ac77fcc5ea 100644 --- a/client/src/main/java/com/metamx/druid/curator/ShutdownNowIgnoringExecutorService.java +++ b/server/src/main/java/io/druid/curator/ShutdownNowIgnoringExecutorService.java @@ -1,4 +1,23 @@ -package com.metamx.druid.curator; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.curator; import com.google.common.collect.ImmutableList; diff --git a/client/src/main/java/com/metamx/druid/curator/announcement/Announcer.java b/server/src/main/java/io/druid/curator/announcement/Announcer.java similarity index 97% rename from client/src/main/java/com/metamx/druid/curator/announcement/Announcer.java rename to server/src/main/java/io/druid/curator/announcement/Announcer.java index abb96b76f68..8b017c41a24 100644 --- a/client/src/main/java/com/metamx/druid/curator/announcement/Announcer.java +++ b/server/src/main/java/io/druid/curator/announcement/Announcer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.curator.announcement; +package io.druid.curator.announcement; import com.google.common.base.Throwables; import com.google.common.collect.Lists; @@ -30,9 +30,9 @@ import com.metamx.common.Pair; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.common.logger.Logger; -import com.metamx.druid.curator.ShutdownNowIgnoringExecutorService; -import com.metamx.druid.curator.cache.PathChildrenCacheFactory; -import com.metamx.druid.curator.cache.SimplePathChildrenCacheFactory; +import io.druid.curator.ShutdownNowIgnoringExecutorService; +import io.druid.curator.cache.PathChildrenCacheFactory; +import io.druid.curator.cache.SimplePathChildrenCacheFactory; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.cache.ChildData; import org.apache.curator.framework.recipes.cache.PathChildrenCache; diff --git a/client/src/main/java/com/metamx/druid/curator/cache/PathChildrenCacheFactory.java b/server/src/main/java/io/druid/curator/cache/PathChildrenCacheFactory.java similarity index 92% rename from client/src/main/java/com/metamx/druid/curator/cache/PathChildrenCacheFactory.java rename to server/src/main/java/io/druid/curator/cache/PathChildrenCacheFactory.java index 37335d8aa88..d722ba0ba5d 100644 --- a/client/src/main/java/com/metamx/druid/curator/cache/PathChildrenCacheFactory.java +++ b/server/src/main/java/io/druid/curator/cache/PathChildrenCacheFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.curator.cache; +package io.druid.curator.cache; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.cache.PathChildrenCache; diff --git a/client/src/main/java/com/metamx/druid/curator/cache/SimplePathChildrenCacheFactory.java b/server/src/main/java/io/druid/curator/cache/SimplePathChildrenCacheFactory.java similarity index 96% rename from client/src/main/java/com/metamx/druid/curator/cache/SimplePathChildrenCacheFactory.java rename to server/src/main/java/io/druid/curator/cache/SimplePathChildrenCacheFactory.java index fb7a3044ee4..ef0d3c50b9b 100644 --- a/client/src/main/java/com/metamx/druid/curator/cache/SimplePathChildrenCacheFactory.java +++ b/server/src/main/java/io/druid/curator/cache/SimplePathChildrenCacheFactory.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.curator.cache; +package io.druid.curator.cache; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.cache.PathChildrenCache; diff --git a/client/src/main/java/com/metamx/druid/curator/discovery/CuratorServiceAnnouncer.java b/server/src/main/java/io/druid/curator/discovery/CuratorServiceAnnouncer.java similarity index 75% rename from client/src/main/java/com/metamx/druid/curator/discovery/CuratorServiceAnnouncer.java rename to server/src/main/java/io/druid/curator/discovery/CuratorServiceAnnouncer.java index dc277d927c6..633b987a88a 100644 --- a/client/src/main/java/com/metamx/druid/curator/discovery/CuratorServiceAnnouncer.java +++ b/server/src/main/java/io/druid/curator/discovery/CuratorServiceAnnouncer.java @@ -1,10 +1,29 @@ -package com.metamx.druid.curator.discovery; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.curator.discovery; import com.google.common.base.Throwables; import com.google.common.collect.Maps; import com.google.inject.Inject; -import com.metamx.druid.initialization.DruidNode; import com.metamx.emitter.EmittingLogger; +import io.druid.server.DruidNode; import org.apache.curator.x.discovery.ServiceDiscovery; import org.apache.curator.x.discovery.ServiceInstance; diff --git a/client/src/main/java/com/metamx/druid/curator/discovery/DiscoveryModule.java b/server/src/main/java/io/druid/curator/discovery/DiscoveryModule.java similarity index 86% rename from client/src/main/java/com/metamx/druid/curator/discovery/DiscoveryModule.java rename to server/src/main/java/io/druid/curator/discovery/DiscoveryModule.java index 9b6bc20af6b..595ae977572 100644 --- a/client/src/main/java/com/metamx/druid/curator/discovery/DiscoveryModule.java +++ b/server/src/main/java/io/druid/curator/discovery/DiscoveryModule.java @@ -1,4 +1,23 @@ -package com.metamx.druid.curator.discovery; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.curator.discovery; import com.google.common.base.Function; import com.google.common.base.Preconditions; @@ -14,10 +33,10 @@ import com.google.inject.TypeLiteral; import com.google.inject.name.Named; import com.google.inject.name.Names; import com.metamx.common.lifecycle.Lifecycle; -import com.metamx.druid.guice.JsonConfigProvider; -import com.metamx.druid.guice.LazySingleton; -import com.metamx.druid.initialization.CuratorDiscoveryConfig; -import com.metamx.druid.initialization.DruidNode; +import io.druid.guice.guice.JsonConfigProvider; +import io.druid.guice.guice.LazySingleton; +import io.druid.server.DruidNode; +import io.druid.server.initialization.initialization.CuratorDiscoveryConfig; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.x.discovery.ServiceDiscovery; import org.apache.curator.x.discovery.ServiceDiscoveryBuilder; diff --git a/server/src/main/java/io/druid/curator/discovery/NoopServiceAnnouncer.java b/server/src/main/java/io/druid/curator/discovery/NoopServiceAnnouncer.java new file mode 100644 index 00000000000..672b900d5bf --- /dev/null +++ b/server/src/main/java/io/druid/curator/discovery/NoopServiceAnnouncer.java @@ -0,0 +1,40 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.curator.discovery; + +import io.druid.server.DruidNode; + +/** + * Does nothing. + */ +public class NoopServiceAnnouncer implements ServiceAnnouncer +{ + @Override + public void announce(DruidNode node) + { + + } + + @Override + public void unannounce(DruidNode node) + { + + } +} diff --git a/server/src/main/java/io/druid/curator/discovery/ServiceAnnouncer.java b/server/src/main/java/io/druid/curator/discovery/ServiceAnnouncer.java new file mode 100644 index 00000000000..46da8f5b0ff --- /dev/null +++ b/server/src/main/java/io/druid/curator/discovery/ServiceAnnouncer.java @@ -0,0 +1,33 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.curator.discovery; + +import io.druid.server.DruidNode; + +/** + * Announces our ability to serve a particular function. Multiple users may announce the same service, in which + * case they are treated as interchangeable instances of that service. + */ +public interface ServiceAnnouncer +{ + public void announce(DruidNode node); + + public void unannounce(DruidNode node); +} diff --git a/client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManager.java b/server/src/main/java/io/druid/curator/inventory/CuratorInventoryManager.java similarity index 97% rename from client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManager.java rename to server/src/main/java/io/druid/curator/inventory/CuratorInventoryManager.java index 7c35ad12618..dcff14024e3 100644 --- a/client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManager.java +++ b/server/src/main/java/io/druid/curator/inventory/CuratorInventoryManager.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.curator.inventory; +package io.druid.curator.inventory; import com.google.common.base.Function; import com.google.common.collect.Iterables; @@ -26,9 +26,9 @@ import com.google.common.collect.MapMaker; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.common.logger.Logger; -import com.metamx.druid.curator.ShutdownNowIgnoringExecutorService; -import com.metamx.druid.curator.cache.PathChildrenCacheFactory; -import com.metamx.druid.curator.cache.SimplePathChildrenCacheFactory; +import io.druid.curator.ShutdownNowIgnoringExecutorService; +import io.druid.curator.cache.PathChildrenCacheFactory; +import io.druid.curator.cache.SimplePathChildrenCacheFactory; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.cache.ChildData; import org.apache.curator.framework.recipes.cache.PathChildrenCache; diff --git a/client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManagerStrategy.java b/server/src/main/java/io/druid/curator/inventory/CuratorInventoryManagerStrategy.java similarity index 94% rename from client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManagerStrategy.java rename to server/src/main/java/io/druid/curator/inventory/CuratorInventoryManagerStrategy.java index 8cab619e16f..785e35534df 100644 --- a/client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManagerStrategy.java +++ b/server/src/main/java/io/druid/curator/inventory/CuratorInventoryManagerStrategy.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.curator.inventory; +package io.druid.curator.inventory; /** */ diff --git a/client/src/main/java/com/metamx/druid/curator/inventory/InventoryManagerConfig.java b/server/src/main/java/io/druid/curator/inventory/InventoryManagerConfig.java similarity index 95% rename from client/src/main/java/com/metamx/druid/curator/inventory/InventoryManagerConfig.java rename to server/src/main/java/io/druid/curator/inventory/InventoryManagerConfig.java index 418c402ff83..78158b713be 100644 --- a/client/src/main/java/com/metamx/druid/curator/inventory/InventoryManagerConfig.java +++ b/server/src/main/java/io/druid/curator/inventory/InventoryManagerConfig.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.curator.inventory; +package io.druid.curator.inventory; /** */ diff --git a/server/src/main/java/com/metamx/druid/guice/AWSModule.java b/server/src/main/java/io/druid/guice/guice/AWSModule.java similarity index 96% rename from server/src/main/java/com/metamx/druid/guice/AWSModule.java rename to server/src/main/java/io/druid/guice/guice/AWSModule.java index 63e005475be..62030a7c15b 100644 --- a/server/src/main/java/com/metamx/druid/guice/AWSModule.java +++ b/server/src/main/java/io/druid/guice/guice/AWSModule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; diff --git a/server/src/main/java/io/druid/guice/guice/AnnouncerModule.java b/server/src/main/java/io/druid/guice/guice/AnnouncerModule.java new file mode 100644 index 00000000000..fc5c4159d09 --- /dev/null +++ b/server/src/main/java/io/druid/guice/guice/AnnouncerModule.java @@ -0,0 +1,54 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; + +import com.google.inject.Binder; +import com.google.inject.Module; +import com.google.inject.Provides; +import com.metamx.druid.concurrent.Execs; +import io.druid.curator.announcement.Announcer; +import io.druid.server.coordination.BatchDataSegmentAnnouncer; +import io.druid.server.coordination.DataSegmentAnnouncer; +import io.druid.server.coordination.DataSegmentAnnouncerProvider; +import io.druid.server.coordination.SingleDataSegmentAnnouncer; +import io.druid.server.initialization.initialization.BatchDataSegmentAnnouncerConfig; +import org.apache.curator.framework.CuratorFramework; + +/** + */ +public class AnnouncerModule implements Module +{ + @Override + public void configure(Binder binder) + { + JsonConfigProvider.bind(binder, "druid.announcer", BatchDataSegmentAnnouncerConfig.class); + JsonConfigProvider.bind(binder, "druid.announcer", DataSegmentAnnouncerProvider.class); + binder.bind(DataSegmentAnnouncer.class).toProvider(DataSegmentAnnouncerProvider.class); + binder.bind(BatchDataSegmentAnnouncer.class).in(ManageLifecycleLast.class); + binder.bind(SingleDataSegmentAnnouncer.class).in(ManageLifecycleLast.class); + } + + @Provides + @ManageLifecycle + public Announcer getAnnouncer(CuratorFramework curator) + { + return new Announcer(curator, Execs.singleThreaded("Announcer-%s")); + } +} diff --git a/server/src/main/java/io/druid/guice/guice/BrokerModule.java b/server/src/main/java/io/druid/guice/guice/BrokerModule.java new file mode 100644 index 00000000000..acb0bd2325f --- /dev/null +++ b/server/src/main/java/io/druid/guice/guice/BrokerModule.java @@ -0,0 +1,47 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; + +import com.google.inject.Binder; +import com.google.inject.Module; +import io.druid.client.BrokerServerView; +import io.druid.client.CachingClusteredClient; +import io.druid.client.TimelineServerView; +import io.druid.client.cache.Cache; +import io.druid.client.cache.CacheProvider; +import io.druid.query.MapQueryToolChestWarehouse; +import io.druid.query.QueryToolChestWarehouse; + +/** + */ +public class BrokerModule implements Module +{ + @Override + public void configure(Binder binder) + { + binder.bind(QueryToolChestWarehouse.class).to(MapQueryToolChestWarehouse.class); + + binder.bind(CachingClusteredClient.class).in(LazySingleton.class); + binder.bind(TimelineServerView.class).to(BrokerServerView.class).in(LazySingleton.class); + + binder.bind(Cache.class).toProvider(CacheProvider.class).in(ManageLifecycle.class); + JsonConfigProvider.bind(binder, "druid.broker.cache", CacheProvider.class); + } +} diff --git a/server/src/main/java/com/metamx/druid/guice/CassandraDataSegmentPusherProvider.java b/server/src/main/java/io/druid/guice/guice/CassandraDataSegmentPusherProvider.java similarity index 94% rename from server/src/main/java/com/metamx/druid/guice/CassandraDataSegmentPusherProvider.java rename to server/src/main/java/io/druid/guice/guice/CassandraDataSegmentPusherProvider.java index 6d28aff0f87..97a0fde64c1 100644 --- a/server/src/main/java/com/metamx/druid/guice/CassandraDataSegmentPusherProvider.java +++ b/server/src/main/java/io/druid/guice/guice/CassandraDataSegmentPusherProvider.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.fasterxml.jackson.annotation.JacksonInject; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/server/src/main/java/com/metamx/druid/guice/CoordinatorModule.java b/server/src/main/java/io/druid/guice/guice/CoordinatorModule.java similarity index 64% rename from server/src/main/java/com/metamx/druid/guice/CoordinatorModule.java rename to server/src/main/java/io/druid/guice/guice/CoordinatorModule.java index 8ae217714ca..fb800c68bcd 100644 --- a/server/src/main/java/com/metamx/druid/guice/CoordinatorModule.java +++ b/server/src/main/java/io/druid/guice/guice/CoordinatorModule.java @@ -1,25 +1,44 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.inject.Binder; import com.google.inject.Module; import com.google.inject.Provides; import com.metamx.common.concurrent.ScheduledExecutorFactory; -import com.metamx.druid.client.ServerInventoryViewConfig; -import com.metamx.druid.client.indexing.IndexingServiceClient; import com.metamx.druid.db.DatabaseRuleManager; import com.metamx.druid.db.DatabaseRuleManagerConfig; import com.metamx.druid.db.DatabaseRuleManagerProvider; import com.metamx.druid.db.DatabaseSegmentManager; import com.metamx.druid.db.DatabaseSegmentManagerConfig; import com.metamx.druid.db.DatabaseSegmentManagerProvider; -import com.metamx.druid.http.MasterRedirectInfo; -import com.metamx.druid.http.RedirectFilter; -import com.metamx.druid.http.RedirectInfo; -import com.metamx.druid.http.RedirectServlet; import com.metamx.druid.master.DruidMaster; import com.metamx.druid.master.DruidMasterConfig; import com.metamx.druid.master.LoadQueueTaskMaster; +import io.druid.client.ServerInventoryViewConfig; +import io.druid.client.indexing.IndexingServiceClient; +import io.druid.server.http.MasterRedirectInfo; +import io.druid.server.http.RedirectFilter; +import io.druid.server.http.RedirectInfo; +import io.druid.server.http.RedirectServlet; import org.apache.curator.framework.CuratorFramework; /** diff --git a/server/src/main/java/com/metamx/druid/guice/DataSegmentPullerModule.java b/server/src/main/java/io/druid/guice/guice/DataSegmentPullerModule.java similarity index 97% rename from server/src/main/java/com/metamx/druid/guice/DataSegmentPullerModule.java rename to server/src/main/java/io/druid/guice/guice/DataSegmentPullerModule.java index 25a21ff3af2..ec167922f94 100644 --- a/server/src/main/java/com/metamx/druid/guice/DataSegmentPullerModule.java +++ b/server/src/main/java/io/druid/guice/guice/DataSegmentPullerModule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.inject.Binder; import com.google.inject.Module; diff --git a/server/src/main/java/com/metamx/druid/guice/DataSegmentPusherModule.java b/server/src/main/java/io/druid/guice/guice/DataSegmentPusherModule.java similarity index 54% rename from server/src/main/java/com/metamx/druid/guice/DataSegmentPusherModule.java rename to server/src/main/java/io/druid/guice/guice/DataSegmentPusherModule.java index bb95cb45273..42de20929bd 100644 --- a/server/src/main/java/com/metamx/druid/guice/DataSegmentPusherModule.java +++ b/server/src/main/java/io/druid/guice/guice/DataSegmentPusherModule.java @@ -1,10 +1,28 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.google.inject.Binder; import com.google.inject.Module; import com.metamx.druid.loading.DataSegmentPusher; import com.metamx.druid.loading.HdfsDataSegmentPusherConfig; -import com.metamx.druid.loading.LocalDataSegmentPusherConfig; import com.metamx.druid.loading.S3DataSegmentPusherConfig; import com.metamx.druid.loading.cassandra.CassandraDataSegmentConfig; import org.apache.hadoop.conf.Configuration; diff --git a/server/src/main/java/com/metamx/druid/guice/DataSegmentPusherProvider.java b/server/src/main/java/io/druid/guice/guice/DataSegmentPusherProvider.java similarity index 94% rename from server/src/main/java/com/metamx/druid/guice/DataSegmentPusherProvider.java rename to server/src/main/java/io/druid/guice/guice/DataSegmentPusherProvider.java index f69c413663e..12e7b396b02 100644 --- a/server/src/main/java/com/metamx/druid/guice/DataSegmentPusherProvider.java +++ b/server/src/main/java/io/druid/guice/guice/DataSegmentPusherProvider.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/server/src/main/java/com/metamx/druid/guice/DruidProcessingModule.java b/server/src/main/java/io/druid/guice/guice/DruidProcessingModule.java similarity index 95% rename from server/src/main/java/com/metamx/druid/guice/DruidProcessingModule.java rename to server/src/main/java/io/druid/guice/guice/DruidProcessingModule.java index 27a8d069829..ae859ef58d1 100644 --- a/server/src/main/java/com/metamx/druid/guice/DruidProcessingModule.java +++ b/server/src/main/java/io/druid/guice/guice/DruidProcessingModule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.common.base.Supplier; import com.google.common.collect.ImmutableMap; @@ -30,11 +30,11 @@ import com.metamx.common.logger.Logger; import com.metamx.druid.DruidProcessingConfig; import com.metamx.druid.collect.StupidPool; import com.metamx.druid.concurrent.Execs; -import com.metamx.druid.guice.annotations.Global; -import com.metamx.druid.guice.annotations.Processing; -import com.metamx.druid.query.MetricsEmittingExecutorService; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; +import io.druid.guice.guice.annotations.Global; +import io.druid.guice.guice.annotations.Processing; +import io.druid.query.MetricsEmittingExecutorService; import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; diff --git a/server/src/main/java/com/metamx/druid/guice/HdfsDataSegmentPusherProvider.java b/server/src/main/java/io/druid/guice/guice/HdfsDataSegmentPusherProvider.java similarity index 95% rename from server/src/main/java/com/metamx/druid/guice/HdfsDataSegmentPusherProvider.java rename to server/src/main/java/io/druid/guice/guice/HdfsDataSegmentPusherProvider.java index 837b41ce1e1..c0fca1d2fbf 100644 --- a/server/src/main/java/com/metamx/druid/guice/HdfsDataSegmentPusherProvider.java +++ b/server/src/main/java/io/druid/guice/guice/HdfsDataSegmentPusherProvider.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.fasterxml.jackson.annotation.JacksonInject; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/server/src/main/java/com/metamx/druid/guice/HistoricalModule.java b/server/src/main/java/io/druid/guice/guice/HistoricalModule.java similarity index 94% rename from server/src/main/java/com/metamx/druid/guice/HistoricalModule.java rename to server/src/main/java/io/druid/guice/guice/HistoricalModule.java index 56526a5f286..1ba3a239dc3 100644 --- a/server/src/main/java/com/metamx/druid/guice/HistoricalModule.java +++ b/server/src/main/java/io/druid/guice/guice/HistoricalModule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.inject.Binder; import com.google.inject.Module; diff --git a/server/src/main/java/com/metamx/druid/guice/HttpClientModule.java b/server/src/main/java/io/druid/guice/guice/HttpClientModule.java similarity index 83% rename from server/src/main/java/com/metamx/druid/guice/HttpClientModule.java rename to server/src/main/java/io/druid/guice/guice/HttpClientModule.java index 28e4dce5f15..14c224a44cd 100644 --- a/server/src/main/java/com/metamx/druid/guice/HttpClientModule.java +++ b/server/src/main/java/io/druid/guice/guice/HttpClientModule.java @@ -1,4 +1,23 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Supplier; @@ -11,10 +30,10 @@ import com.google.inject.Module; import com.google.inject.Provider; import com.google.inject.TypeLiteral; import com.metamx.common.lifecycle.Lifecycle; -import com.metamx.druid.guice.annotations.Global; import com.metamx.http.client.HttpClient; import com.metamx.http.client.HttpClientConfig; import com.metamx.http.client.HttpClientInit; +import io.druid.guice.guice.annotations.Global; import org.joda.time.Duration; import org.joda.time.Period; diff --git a/server/src/main/java/com/metamx/druid/guice/IndexingServiceDiscoveryModule.java b/server/src/main/java/io/druid/guice/guice/IndexingServiceDiscoveryModule.java similarity index 92% rename from server/src/main/java/com/metamx/druid/guice/IndexingServiceDiscoveryModule.java rename to server/src/main/java/io/druid/guice/guice/IndexingServiceDiscoveryModule.java index e39c43dd878..a59d0839999 100644 --- a/server/src/main/java/com/metamx/druid/guice/IndexingServiceDiscoveryModule.java +++ b/server/src/main/java/io/druid/guice/guice/IndexingServiceDiscoveryModule.java @@ -17,17 +17,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.inject.Binder; import com.google.inject.Module; import com.google.inject.Provides; import com.google.inject.TypeLiteral; -import com.metamx.druid.client.indexing.IndexingService; import com.metamx.druid.client.indexing.IndexingServiceSelector; import com.metamx.druid.client.indexing.IndexingServiceSelectorConfig; -import com.metamx.druid.client.selector.DiscoverySelector; -import com.metamx.druid.client.selector.Server; +import io.druid.client.indexing.IndexingService; +import io.druid.client.selector.DiscoverySelector; +import io.druid.client.selector.Server; import org.apache.curator.x.discovery.ServiceDiscovery; import org.apache.curator.x.discovery.ServiceInstance; import org.apache.curator.x.discovery.ServiceProvider; diff --git a/server/src/main/java/com/metamx/druid/guice/LocalDataSegmentPusherProvider.java b/server/src/main/java/io/druid/guice/guice/LocalDataSegmentPusherProvider.java similarity index 94% rename from server/src/main/java/com/metamx/druid/guice/LocalDataSegmentPusherProvider.java rename to server/src/main/java/io/druid/guice/guice/LocalDataSegmentPusherProvider.java index 7a51b7264e1..84350024083 100644 --- a/server/src/main/java/com/metamx/druid/guice/LocalDataSegmentPusherProvider.java +++ b/server/src/main/java/io/druid/guice/guice/LocalDataSegmentPusherProvider.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.fasterxml.jackson.annotation.JacksonInject; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/server/src/main/java/com/metamx/druid/guice/QueryRunnerFactoryModule.java b/server/src/main/java/io/druid/guice/guice/QueryRunnerFactoryModule.java similarity index 57% rename from server/src/main/java/com/metamx/druid/guice/QueryRunnerFactoryModule.java rename to server/src/main/java/io/druid/guice/guice/QueryRunnerFactoryModule.java index 6abcb9a9414..78a2c76f850 100644 --- a/server/src/main/java/com/metamx/druid/guice/QueryRunnerFactoryModule.java +++ b/server/src/main/java/io/druid/guice/guice/QueryRunnerFactoryModule.java @@ -1,22 +1,42 @@ -package com.metamx.druid.guice; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; import com.google.common.collect.ImmutableMap; import com.google.inject.Binder; +import com.google.inject.TypeLiteral; import com.google.inject.multibindings.MapBinder; -import com.metamx.druid.query.group.GroupByQuery; import com.metamx.druid.query.group.GroupByQueryEngine; import com.metamx.druid.query.group.GroupByQueryRunnerFactory; -import com.metamx.druid.query.metadata.SegmentMetadataQuery; import com.metamx.druid.query.metadata.SegmentMetadataQueryRunnerFactory; -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 com.metamx.druid.query.timeseries.TimeseriesQuery; import com.metamx.druid.query.timeseries.TimeseriesQueryRunnerFactory; -import io.druid.initialization.Binders; +import io.druid.guice.QueryToolChestModule; import io.druid.query.Query; import io.druid.query.QueryRunnerFactory; +import io.druid.query.groupby.GroupByQuery; +import io.druid.query.metadata.metadata.SegmentMetadataQuery; +import io.druid.query.search.search.SearchQuery; +import io.druid.query.timeboundary.TimeBoundaryQuery; +import io.druid.query.timeseries.TimeseriesQuery; import java.util.Map; @@ -39,7 +59,9 @@ public class QueryRunnerFactoryModule extends QueryToolChestModule super.configure(binder); - final MapBinder, QueryRunnerFactory> queryFactoryBinder = Binders.queryFactoryBinder(binder); + final MapBinder, QueryRunnerFactory> queryFactoryBinder = MapBinder.newMapBinder( + binder, new TypeLiteral>(){}, TypeLiteral.get(QueryRunnerFactory.class) + ); for (Map.Entry, Class> entry : mappings.entrySet()) { queryFactoryBinder.addBinding(entry.getKey()).to(entry.getValue()); diff --git a/client/src/main/java/com/metamx/druid/guice/QueryableModule.java b/server/src/main/java/io/druid/guice/guice/QueryableModule.java similarity index 84% rename from client/src/main/java/com/metamx/druid/guice/QueryableModule.java rename to server/src/main/java/io/druid/guice/guice/QueryableModule.java index d131c600aab..b0a83701a4d 100644 --- a/client/src/main/java/com/metamx/druid/guice/QueryableModule.java +++ b/server/src/main/java/io/druid/guice/guice/QueryableModule.java @@ -17,18 +17,18 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.module.SimpleModule; import com.google.inject.Binder; -import com.metamx.druid.http.QueryServlet; -import com.metamx.druid.http.log.EmittingRequestLoggerProvider; -import com.metamx.druid.http.log.FileRequestLoggerProvider; -import com.metamx.druid.http.log.RequestLogger; -import com.metamx.druid.http.log.RequestLoggerProvider; -import com.metamx.druid.query.segment.QuerySegmentWalker; import io.druid.initialization.DruidModule; +import io.druid.query.QuerySegmentWalker; +import io.druid.server.QueryServlet; +import io.druid.server.log.EmittingRequestLoggerProvider; +import io.druid.server.log.FileRequestLoggerProvider; +import io.druid.server.log.RequestLogger; +import io.druid.server.log.RequestLoggerProvider; import java.util.Arrays; import java.util.List; diff --git a/server/src/main/java/com/metamx/druid/guice/S3DataSegmentPusherProvider.java b/server/src/main/java/io/druid/guice/guice/S3DataSegmentPusherProvider.java similarity index 95% rename from server/src/main/java/com/metamx/druid/guice/S3DataSegmentPusherProvider.java rename to server/src/main/java/io/druid/guice/guice/S3DataSegmentPusherProvider.java index b86fecfdf7a..19b03ef3855 100644 --- a/server/src/main/java/com/metamx/druid/guice/S3DataSegmentPusherProvider.java +++ b/server/src/main/java/io/druid/guice/guice/S3DataSegmentPusherProvider.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.fasterxml.jackson.annotation.JacksonInject; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/server/src/main/java/com/metamx/druid/guice/ServerModule.java b/server/src/main/java/io/druid/guice/guice/ServerModule.java similarity index 86% rename from server/src/main/java/com/metamx/druid/guice/ServerModule.java rename to server/src/main/java/io/druid/guice/guice/ServerModule.java index 400f4ad040b..3b217f1269e 100644 --- a/server/src/main/java/com/metamx/druid/guice/ServerModule.java +++ b/server/src/main/java/io/druid/guice/guice/ServerModule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.inject.Binder; import com.google.inject.Module; @@ -25,9 +25,9 @@ import com.google.inject.Provides; import com.metamx.common.concurrent.ScheduledExecutorFactory; import com.metamx.common.concurrent.ScheduledExecutors; import com.metamx.common.lifecycle.Lifecycle; -import com.metamx.druid.guice.annotations.Self; -import com.metamx.druid.initialization.DruidNode; -import com.metamx.druid.initialization.ZkPathsConfig; +import io.druid.guice.guice.annotations.Self; +import io.druid.server.DruidNode; +import io.druid.server.initialization.initialization.ZkPathsConfig; /** */ diff --git a/server/src/main/java/io/druid/guice/guice/ServerViewModule.java b/server/src/main/java/io/druid/guice/guice/ServerViewModule.java new file mode 100644 index 00000000000..f6a439d2782 --- /dev/null +++ b/server/src/main/java/io/druid/guice/guice/ServerViewModule.java @@ -0,0 +1,41 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice; + +import com.google.inject.Binder; +import com.google.inject.Module; +import io.druid.client.InventoryView; +import io.druid.client.ServerInventoryView; +import io.druid.client.ServerInventoryViewProvider; +import io.druid.client.ServerView; + +/** + */ +public class ServerViewModule implements Module +{ + @Override + public void configure(Binder binder) + { + JsonConfigProvider.bind(binder, "druid.announcer", ServerInventoryViewProvider.class); + binder.bind(InventoryView.class).to(ServerInventoryView.class); + binder.bind(ServerView.class).to(ServerInventoryView.class); + binder.bind(ServerInventoryView.class).toProvider(ServerInventoryViewProvider.class).in(ManageLifecycle.class); + } +} diff --git a/server/src/main/java/com/metamx/druid/guice/StorageNodeModule.java b/server/src/main/java/io/druid/guice/guice/StorageNodeModule.java similarity index 88% rename from server/src/main/java/com/metamx/druid/guice/StorageNodeModule.java rename to server/src/main/java/io/druid/guice/guice/StorageNodeModule.java index 33b7688afe7..b5e17a9c673 100644 --- a/server/src/main/java/com/metamx/druid/guice/StorageNodeModule.java +++ b/server/src/main/java/io/druid/guice/guice/StorageNodeModule.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,20 +17,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.guice; +package io.druid.guice.guice; import com.google.inject.Binder; import com.google.inject.Module; import com.google.inject.Provides; -import com.metamx.druid.client.DruidServerConfig; -import com.metamx.druid.coordination.DruidServerMetadata; -import com.metamx.druid.guice.annotations.Self; -import com.metamx.druid.initialization.DruidNode; import com.metamx.druid.loading.MMappedQueryableIndexFactory; import com.metamx.druid.loading.QueryableIndexFactory; import com.metamx.druid.loading.SegmentLoaderConfig; import com.metamx.druid.query.DefaultQueryRunnerFactoryConglomerate; import com.metamx.druid.query.QueryRunnerFactoryConglomerate; +import io.druid.client.DruidServerConfig; +import io.druid.guice.guice.annotations.Self; +import io.druid.server.DruidNode; +import io.druid.server.coordination.DruidServerMetadata; /** */ diff --git a/server/src/main/java/io/druid/guice/guice/annotations/Client.java b/server/src/main/java/io/druid/guice/guice/annotations/Client.java new file mode 100644 index 00000000000..34617592e44 --- /dev/null +++ b/server/src/main/java/io/druid/guice/guice/annotations/Client.java @@ -0,0 +1,36 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice.annotations; + +import com.google.inject.BindingAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + */ +@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@BindingAnnotation +public @interface Client +{ +} diff --git a/server/src/main/java/io/druid/guice/guice/annotations/Processing.java b/server/src/main/java/io/druid/guice/guice/annotations/Processing.java new file mode 100644 index 00000000000..33117be1083 --- /dev/null +++ b/server/src/main/java/io/druid/guice/guice/annotations/Processing.java @@ -0,0 +1,36 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.guice.guice.annotations; + +import com.google.inject.BindingAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + */ +@BindingAnnotation +@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface Processing +{ +} diff --git a/client/src/main/java/com/metamx/druid/http/ClientInfoResource.java b/server/src/main/java/io/druid/server/ClientInfoResource.java similarity index 94% rename from client/src/main/java/com/metamx/druid/http/ClientInfoResource.java rename to server/src/main/java/io/druid/server/ClientInfoResource.java index 8bcb8865e7c..6dfcf673a3e 100644 --- a/client/src/main/java/com/metamx/druid/http/ClientInfoResource.java +++ b/server/src/main/java/io/druid/server/ClientInfoResource.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,17 +17,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.inject.Inject; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidDataSource; -import com.metamx.druid.client.DruidServer; -import com.metamx.druid.client.InventoryView; +import io.druid.client.DataSegment; +import io.druid.client.DruidDataSource; +import io.druid.client.DruidServer; +import io.druid.client.InventoryView; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/client/src/main/java/com/metamx/druid/http/ClientQuerySegmentWalker.java b/server/src/main/java/io/druid/server/ClientQuerySegmentWalker.java similarity index 87% rename from client/src/main/java/com/metamx/druid/http/ClientQuerySegmentWalker.java rename to server/src/main/java/io/druid/server/ClientQuerySegmentWalker.java index 39c568fda04..76d9d1aa838 100644 --- a/client/src/main/java/com/metamx/druid/http/ClientQuerySegmentWalker.java +++ b/server/src/main/java/io/druid/server/ClientQuerySegmentWalker.java @@ -17,20 +17,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server; import com.google.common.base.Function; import com.google.inject.Inject; -import com.metamx.druid.client.CachingClusteredClient; -import com.metamx.druid.query.FinalizeResultsQueryRunner; -import com.metamx.druid.query.MetricsEmittingQueryRunner; -import com.metamx.druid.query.QueryToolChestWarehouse; -import com.metamx.druid.query.segment.QuerySegmentWalker; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceMetricEvent; +import io.druid.client.CachingClusteredClient; +import io.druid.query.FinalizeResultsQueryRunner; +import io.druid.query.MetricsEmittingQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; +import io.druid.query.QuerySegmentWalker; import io.druid.query.QueryToolChest; +import io.druid.query.QueryToolChestWarehouse; import io.druid.query.SegmentDescriptor; import org.joda.time.Interval; @@ -40,20 +40,20 @@ import javax.annotation.Nullable; */ public class ClientQuerySegmentWalker implements QuerySegmentWalker { - private final QueryToolChestWarehouse warehouse; private final ServiceEmitter emitter; private final CachingClusteredClient baseClient; + private final QueryToolChestWarehouse warehouse; @Inject public ClientQuerySegmentWalker( - QueryToolChestWarehouse warehouse, ServiceEmitter emitter, - CachingClusteredClient baseClient + CachingClusteredClient baseClient, + QueryToolChestWarehouse warehouse ) { - this.warehouse = warehouse; this.emitter = emitter; this.baseClient = baseClient; + this.warehouse = warehouse; } @Override diff --git a/client/src/main/java/com/metamx/druid/http/DirectClientQuerySegmentWalker.java b/server/src/main/java/io/druid/server/DirectClientQuerySegmentWalker.java similarity index 87% rename from client/src/main/java/com/metamx/druid/http/DirectClientQuerySegmentWalker.java rename to server/src/main/java/io/druid/server/DirectClientQuerySegmentWalker.java index f3c8c8956be..224f03691ea 100644 --- a/client/src/main/java/com/metamx/druid/http/DirectClientQuerySegmentWalker.java +++ b/server/src/main/java/io/druid/server/DirectClientQuerySegmentWalker.java @@ -17,14 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server; -import com.metamx.druid.client.DirectDruidClient; -import com.metamx.druid.query.FinalizeResultsQueryRunner; -import com.metamx.druid.query.QueryToolChestWarehouse; -import com.metamx.druid.query.segment.QuerySegmentWalker; +import io.druid.client.DirectDruidClient; +import io.druid.query.FinalizeResultsQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; +import io.druid.query.QuerySegmentWalker; +import io.druid.query.QueryToolChestWarehouse; import io.druid.query.SegmentDescriptor; import org.joda.time.Interval; diff --git a/client/src/main/java/com/metamx/druid/initialization/DruidNode.java b/server/src/main/java/io/druid/server/DruidNode.java similarity index 98% rename from client/src/main/java/com/metamx/druid/initialization/DruidNode.java rename to server/src/main/java/io/druid/server/DruidNode.java index 43f78ac0682..69fece2c685 100644 --- a/client/src/main/java/com/metamx/druid/initialization/DruidNode.java +++ b/server/src/main/java/io/druid/server/DruidNode.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/http/GuiceServletConfig.java b/server/src/main/java/io/druid/server/GuiceServletConfig.java similarity index 93% rename from client/src/main/java/com/metamx/druid/http/GuiceServletConfig.java rename to server/src/main/java/io/druid/server/GuiceServletConfig.java index fcfac0a66f8..b7a52a4eb6b 100644 --- a/client/src/main/java/com/metamx/druid/http/GuiceServletConfig.java +++ b/server/src/main/java/io/druid/server/GuiceServletConfig.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server; import com.google.inject.Injector; import com.google.inject.servlet.GuiceServletContextListener; diff --git a/client/src/main/java/com/metamx/druid/http/QueryServlet.java b/server/src/main/java/io/druid/server/QueryServlet.java similarity index 95% rename from client/src/main/java/com/metamx/druid/http/QueryServlet.java rename to server/src/main/java/io/druid/server/QueryServlet.java index 58fedde82af..d3e2d7e7522 100644 --- a/client/src/main/java/com/metamx/druid/http/QueryServlet.java +++ b/server/src/main/java/io/druid/server/QueryServlet.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; @@ -29,14 +29,14 @@ import com.google.inject.Inject; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.common.logger.Logger; -import com.metamx.druid.guice.annotations.Json; -import com.metamx.druid.guice.annotations.Smile; -import com.metamx.druid.http.log.RequestLogger; -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 io.druid.guice.guice.annotations.Json; +import io.druid.guice.guice.annotations.Smile; import io.druid.query.Query; +import io.druid.query.QuerySegmentWalker; +import io.druid.server.log.RequestLogger; import org.eclipse.jetty.server.Request; import org.joda.time.DateTime; diff --git a/client/src/main/java/com/metamx/druid/http/RequestLogLine.java b/server/src/main/java/io/druid/server/RequestLogLine.java similarity index 96% rename from client/src/main/java/com/metamx/druid/http/RequestLogLine.java rename to server/src/main/java/io/druid/server/RequestLogLine.java index faf403690ac..a52485ae279 100644 --- a/client/src/main/java/com/metamx/druid/http/RequestLogLine.java +++ b/server/src/main/java/io/druid/server/RequestLogLine.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/client/src/main/java/com/metamx/druid/http/StatusResource.java b/server/src/main/java/io/druid/server/StatusResource.java similarity index 96% rename from client/src/main/java/com/metamx/druid/http/StatusResource.java rename to server/src/main/java/io/druid/server/StatusResource.java index ebe2f0e855a..a2b30268d4d 100644 --- a/client/src/main/java/com/metamx/druid/http/StatusResource.java +++ b/server/src/main/java/io/druid/server/StatusResource.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2013 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/server/src/main/java/io/druid/server/ZkPathsModule.java b/server/src/main/java/io/druid/server/ZkPathsModule.java new file mode 100644 index 00000000000..34631221353 --- /dev/null +++ b/server/src/main/java/io/druid/server/ZkPathsModule.java @@ -0,0 +1,33 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server; + +import com.google.inject.Binder; +import com.google.inject.Module; + +/** + */ +public class ZkPathsModule implements Module +{ + @Override + public void configure(Binder binder) + { + } +} diff --git a/client/src/main/java/com/metamx/druid/coordination/AbstractDataSegmentAnnouncer.java b/server/src/main/java/io/druid/server/coordination/AbstractDataSegmentAnnouncer.java similarity index 92% rename from client/src/main/java/com/metamx/druid/coordination/AbstractDataSegmentAnnouncer.java rename to server/src/main/java/io/druid/server/coordination/AbstractDataSegmentAnnouncer.java index 1bb0b8114ee..f4bd5016430 100644 --- a/client/src/main/java/com/metamx/druid/coordination/AbstractDataSegmentAnnouncer.java +++ b/server/src/main/java/io/druid/server/coordination/AbstractDataSegmentAnnouncer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.coordination; +package io.druid.server.coordination; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -25,8 +25,8 @@ import com.google.common.base.Throwables; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.common.logger.Logger; -import com.metamx.druid.curator.announcement.Announcer; -import com.metamx.druid.initialization.ZkPathsConfig; +import io.druid.curator.announcement.Announcer; +import io.druid.server.initialization.initialization.ZkPathsConfig; import org.apache.curator.utils.ZKPaths; /** diff --git a/client/src/main/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncer.java b/server/src/main/java/io/druid/server/coordination/BatchDataSegmentAnnouncer.java similarity index 96% rename from client/src/main/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncer.java rename to server/src/main/java/io/druid/server/coordination/BatchDataSegmentAnnouncer.java index 5e454038c3a..efe693f39e0 100644 --- a/client/src/main/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncer.java +++ b/server/src/main/java/io/druid/server/coordination/BatchDataSegmentAnnouncer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.coordination; +package io.druid.server.coordination; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -27,10 +27,10 @@ import com.google.common.collect.Sets; import com.google.inject.Inject; import com.metamx.common.ISE; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.curator.announcement.Announcer; -import com.metamx.druid.initialization.BatchDataSegmentAnnouncerConfig; -import com.metamx.druid.initialization.ZkPathsConfig; +import io.druid.client.DataSegment; +import io.druid.curator.announcement.Announcer; +import io.druid.server.initialization.initialization.BatchDataSegmentAnnouncerConfig; +import io.druid.server.initialization.initialization.ZkPathsConfig; import org.apache.curator.utils.ZKPaths; import org.joda.time.DateTime; diff --git a/server/src/main/java/io/druid/server/coordination/BatchDataSegmentAnnouncerProvider.java b/server/src/main/java/io/druid/server/coordination/BatchDataSegmentAnnouncerProvider.java new file mode 100644 index 00000000000..e51de3a245c --- /dev/null +++ b/server/src/main/java/io/druid/server/coordination/BatchDataSegmentAnnouncerProvider.java @@ -0,0 +1,39 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.coordination; + +import com.fasterxml.jackson.annotation.JacksonInject; + +import javax.validation.constraints.NotNull; + +/** + */ +public class BatchDataSegmentAnnouncerProvider implements DataSegmentAnnouncerProvider +{ + @JacksonInject + @NotNull + private BatchDataSegmentAnnouncer batchAnnouncer = null; + + @Override + public DataSegmentAnnouncer get() + { + return batchAnnouncer; + } +} diff --git a/client/src/main/java/com/metamx/druid/coordination/DataSegmentAnnouncer.java b/server/src/main/java/io/druid/server/coordination/DataSegmentAnnouncer.java similarity index 89% rename from client/src/main/java/com/metamx/druid/coordination/DataSegmentAnnouncer.java rename to server/src/main/java/io/druid/server/coordination/DataSegmentAnnouncer.java index 71eaaa37276..b9872ead48d 100644 --- a/client/src/main/java/com/metamx/druid/coordination/DataSegmentAnnouncer.java +++ b/server/src/main/java/io/druid/server/coordination/DataSegmentAnnouncer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.coordination; +package io.druid.server.coordination; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.io.IOException; diff --git a/server/src/main/java/io/druid/server/coordination/DataSegmentAnnouncerProvider.java b/server/src/main/java/io/druid/server/coordination/DataSegmentAnnouncerProvider.java new file mode 100644 index 00000000000..eeed92b045a --- /dev/null +++ b/server/src/main/java/io/druid/server/coordination/DataSegmentAnnouncerProvider.java @@ -0,0 +1,35 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.coordination; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.inject.Provider; + +/** + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = LegacyDataSegmentAnnouncerProvider.class) +@JsonSubTypes(value = { + @JsonSubTypes.Type(name = "legacy", value = LegacyDataSegmentAnnouncerProvider.class), + @JsonSubTypes.Type(name = "batch", value = BatchDataSegmentAnnouncerProvider.class) +}) +public interface DataSegmentAnnouncerProvider extends Provider +{ +} diff --git a/client/src/main/java/com/metamx/druid/coordination/DruidServerMetadata.java b/server/src/main/java/io/druid/server/coordination/DruidServerMetadata.java similarity index 95% rename from client/src/main/java/com/metamx/druid/coordination/DruidServerMetadata.java rename to server/src/main/java/io/druid/server/coordination/DruidServerMetadata.java index ce38bd6b0a0..ecb7f33b2ea 100644 --- a/client/src/main/java/com/metamx/druid/coordination/DruidServerMetadata.java +++ b/server/src/main/java/io/druid/server/coordination/DruidServerMetadata.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.coordination; +package io.druid.server.coordination; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/server/src/main/java/io/druid/server/coordination/LegacyDataSegmentAnnouncerProvider.java b/server/src/main/java/io/druid/server/coordination/LegacyDataSegmentAnnouncerProvider.java new file mode 100644 index 00000000000..f5a5dc40545 --- /dev/null +++ b/server/src/main/java/io/druid/server/coordination/LegacyDataSegmentAnnouncerProvider.java @@ -0,0 +1,46 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.coordination; + +import com.fasterxml.jackson.annotation.JacksonInject; + +import javax.validation.constraints.NotNull; +import java.util.Arrays; + +/** + */ +public class LegacyDataSegmentAnnouncerProvider implements DataSegmentAnnouncerProvider +{ + @JacksonInject + @NotNull + private SingleDataSegmentAnnouncer singleAnnouncer = null; + + @JacksonInject + @NotNull + private BatchDataSegmentAnnouncer batchAnnouncer = null; + + @Override + public DataSegmentAnnouncer get() + { + return new MultipleDataSegmentAnnouncerDataSegmentAnnouncer( + Arrays.asList(singleAnnouncer, batchAnnouncer) + ); + } +} diff --git a/client/src/main/java/com/metamx/druid/coordination/MultipleDataSegmentAnnouncerDataSegmentAnnouncer.java b/server/src/main/java/io/druid/server/coordination/MultipleDataSegmentAnnouncerDataSegmentAnnouncer.java similarity index 94% rename from client/src/main/java/com/metamx/druid/coordination/MultipleDataSegmentAnnouncerDataSegmentAnnouncer.java rename to server/src/main/java/io/druid/server/coordination/MultipleDataSegmentAnnouncerDataSegmentAnnouncer.java index 8bdc14e7d95..7595eb5095d 100644 --- a/client/src/main/java/com/metamx/druid/coordination/MultipleDataSegmentAnnouncerDataSegmentAnnouncer.java +++ b/server/src/main/java/io/druid/server/coordination/MultipleDataSegmentAnnouncerDataSegmentAnnouncer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.coordination; +package io.druid.server.coordination; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.io.IOException; diff --git a/client/src/main/java/com/metamx/druid/coordination/SingleDataSegmentAnnouncer.java b/server/src/main/java/io/druid/server/coordination/SingleDataSegmentAnnouncer.java similarity index 91% rename from client/src/main/java/com/metamx/druid/coordination/SingleDataSegmentAnnouncer.java rename to server/src/main/java/io/druid/server/coordination/SingleDataSegmentAnnouncer.java index 20e617a8e32..225ae22b20c 100644 --- a/client/src/main/java/com/metamx/druid/coordination/SingleDataSegmentAnnouncer.java +++ b/server/src/main/java/io/druid/server/coordination/SingleDataSegmentAnnouncer.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,14 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.coordination; +package io.druid.server.coordination; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.inject.Inject; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.curator.announcement.Announcer; -import com.metamx.druid.initialization.ZkPathsConfig; +import io.druid.client.DataSegment; +import io.druid.curator.announcement.Announcer; +import io.druid.server.initialization.initialization.ZkPathsConfig; import org.apache.curator.utils.ZKPaths; import java.io.IOException; diff --git a/server/src/main/java/com/metamx/druid/http/InfoResource.java b/server/src/main/java/io/druid/server/http/InfoResource.java similarity index 98% rename from server/src/main/java/com/metamx/druid/http/InfoResource.java rename to server/src/main/java/io/druid/server/http/InfoResource.java index 03017425bd8..2eaed9527e5 100644 --- a/server/src/main/java/com/metamx/druid/http/InfoResource.java +++ b/server/src/main/java/io/druid/server/http/InfoResource.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server.http; import com.google.common.base.Function; import com.google.common.collect.Collections2; @@ -27,15 +27,15 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.inject.Inject; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidDataSource; -import com.metamx.druid.client.DruidServer; -import com.metamx.druid.client.InventoryView; -import com.metamx.druid.client.indexing.IndexingServiceClient; import com.metamx.druid.db.DatabaseRuleManager; import com.metamx.druid.db.DatabaseSegmentManager; import com.metamx.druid.master.DruidMaster; import com.metamx.druid.master.rules.Rule; +import io.druid.client.DataSegment; +import io.druid.client.DruidDataSource; +import io.druid.client.DruidServer; +import io.druid.client.InventoryView; +import io.druid.client.indexing.IndexingServiceClient; import org.joda.time.Interval; import javax.annotation.Nullable; diff --git a/server/src/main/java/com/metamx/druid/http/MasterMain.java b/server/src/main/java/io/druid/server/http/MasterMain.java similarity index 100% rename from server/src/main/java/com/metamx/druid/http/MasterMain.java rename to server/src/main/java/io/druid/server/http/MasterMain.java diff --git a/server/src/main/java/com/metamx/druid/http/MasterRedirectInfo.java b/server/src/main/java/io/druid/server/http/MasterRedirectInfo.java similarity index 52% rename from server/src/main/java/com/metamx/druid/http/MasterRedirectInfo.java rename to server/src/main/java/io/druid/server/http/MasterRedirectInfo.java index f3c263682df..b239112abae 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterRedirectInfo.java +++ b/server/src/main/java/io/druid/server/http/MasterRedirectInfo.java @@ -1,4 +1,23 @@ -package com.metamx.druid.http; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.http; import com.google.common.base.Throwables; import com.google.inject.Inject; diff --git a/server/src/main/java/com/metamx/druid/http/MasterResource.java b/server/src/main/java/io/druid/server/http/MasterResource.java similarity index 97% rename from server/src/main/java/com/metamx/druid/http/MasterResource.java rename to server/src/main/java/io/druid/server/http/MasterResource.java index 5934fdd5f6e..385a3394220 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterResource.java +++ b/server/src/main/java/io/druid/server/http/MasterResource.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server.http; import com.google.inject.Inject; import com.metamx.druid.master.DruidMaster; diff --git a/server/src/main/java/com/metamx/druid/http/MasterSegmentSettingsResource.java b/server/src/main/java/io/druid/server/http/MasterSegmentSettingsResource.java similarity index 61% rename from server/src/main/java/com/metamx/druid/http/MasterSegmentSettingsResource.java rename to server/src/main/java/io/druid/server/http/MasterSegmentSettingsResource.java index ea14c587f78..0205dfaaff4 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterSegmentSettingsResource.java +++ b/server/src/main/java/io/druid/server/http/MasterSegmentSettingsResource.java @@ -1,22 +1,22 @@ /* -* 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; + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.http; import com.metamx.druid.config.JacksonConfigManager; import com.metamx.druid.master.MasterSegmentSettings; diff --git a/server/src/main/java/com/metamx/druid/http/RedirectFilter.java b/server/src/main/java/io/druid/server/http/RedirectFilter.java similarity index 96% rename from server/src/main/java/com/metamx/druid/http/RedirectFilter.java rename to server/src/main/java/io/druid/server/http/RedirectFilter.java index 1535e90ff71..671a2cb207e 100644 --- a/server/src/main/java/com/metamx/druid/http/RedirectFilter.java +++ b/server/src/main/java/io/druid/server/http/RedirectFilter.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server.http; import com.google.inject.Inject; import com.metamx.common.logger.Logger; diff --git a/server/src/main/java/com/metamx/druid/http/RedirectInfo.java b/server/src/main/java/io/druid/server/http/RedirectInfo.java similarity index 91% rename from server/src/main/java/com/metamx/druid/http/RedirectInfo.java rename to server/src/main/java/io/druid/server/http/RedirectInfo.java index d14839710fc..3efea33a146 100644 --- a/server/src/main/java/com/metamx/druid/http/RedirectInfo.java +++ b/server/src/main/java/io/druid/server/http/RedirectInfo.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server.http; import java.net.URL; diff --git a/server/src/main/java/com/metamx/druid/http/RedirectServlet.java b/server/src/main/java/io/druid/server/http/RedirectServlet.java similarity index 96% rename from server/src/main/java/com/metamx/druid/http/RedirectServlet.java rename to server/src/main/java/io/druid/server/http/RedirectServlet.java index 7b4ad2aec53..2226fed3d83 100644 --- a/server/src/main/java/com/metamx/druid/http/RedirectServlet.java +++ b/server/src/main/java/io/druid/server/http/RedirectServlet.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server.http; import com.google.inject.Inject; import com.metamx.common.logger.Logger; diff --git a/server/src/main/java/com/metamx/druid/http/SegmentToDrop.java b/server/src/main/java/io/druid/server/http/SegmentToDrop.java similarity index 94% rename from server/src/main/java/com/metamx/druid/http/SegmentToDrop.java rename to server/src/main/java/io/druid/server/http/SegmentToDrop.java index 44e9d4a0d33..e3fa092e610 100644 --- a/server/src/main/java/com/metamx/druid/http/SegmentToDrop.java +++ b/server/src/main/java/io/druid/server/http/SegmentToDrop.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server.http; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/server/src/main/java/com/metamx/druid/http/SegmentToMove.java b/server/src/main/java/io/druid/server/http/SegmentToMove.java similarity index 94% rename from server/src/main/java/com/metamx/druid/http/SegmentToMove.java rename to server/src/main/java/io/druid/server/http/SegmentToMove.java index 85a6ab7227f..159afa0cda2 100644 --- a/server/src/main/java/com/metamx/druid/http/SegmentToMove.java +++ b/server/src/main/java/io/druid/server/http/SegmentToMove.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http; +package io.druid.server.http; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/server/src/main/java/io/druid/server/initialization/initialization/BatchDataSegmentAnnouncerConfig.java b/server/src/main/java/io/druid/server/initialization/initialization/BatchDataSegmentAnnouncerConfig.java new file mode 100644 index 00000000000..079cb92e5bc --- /dev/null +++ b/server/src/main/java/io/druid/server/initialization/initialization/BatchDataSegmentAnnouncerConfig.java @@ -0,0 +1,49 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.initialization.initialization; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; + +/** + */ +public class BatchDataSegmentAnnouncerConfig +{ + @JsonProperty + @Min(1) + private int segmentsPerNode = 50; + + @JsonProperty + @Max(1024 * 1024) + @Min(1024) + private long maxBytesPerNode = 512 * 1024; + + public int getSegmentsPerNode() + { + return segmentsPerNode; + } + + public long getMaxBytesPerNode() + { + return maxBytesPerNode; + } +} diff --git a/client/src/main/java/com/metamx/druid/initialization/ConfigModule.java b/server/src/main/java/io/druid/server/initialization/initialization/ConfigModule.java similarity index 91% rename from client/src/main/java/com/metamx/druid/initialization/ConfigModule.java rename to server/src/main/java/io/druid/server/initialization/initialization/ConfigModule.java index 5d1245c23c2..0f696fb5261 100644 --- a/client/src/main/java/com/metamx/druid/initialization/ConfigModule.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/ConfigModule.java @@ -17,14 +17,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import com.google.inject.Binder; import com.google.inject.Module; import com.google.inject.Provides; import com.metamx.common.config.Config; -import com.metamx.druid.guice.JsonConfigurator; -import com.metamx.druid.guice.LazySingleton; +import io.druid.guice.guice.JsonConfigurator; +import io.druid.guice.guice.LazySingleton; import org.skife.config.ConfigurationObjectFactory; import javax.validation.Validation; diff --git a/client/src/main/java/com/metamx/druid/initialization/CuratorDiscoveryConfig.java b/server/src/main/java/io/druid/server/initialization/initialization/CuratorDiscoveryConfig.java similarity index 90% rename from client/src/main/java/com/metamx/druid/initialization/CuratorDiscoveryConfig.java rename to server/src/main/java/io/druid/server/initialization/initialization/CuratorDiscoveryConfig.java index 4fc6c28360e..55ead420ff7 100644 --- a/client/src/main/java/com/metamx/druid/initialization/CuratorDiscoveryConfig.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/CuratorDiscoveryConfig.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/initialization/EmitterModule.java b/server/src/main/java/io/druid/server/initialization/initialization/EmitterModule.java similarity index 94% rename from client/src/main/java/com/metamx/druid/initialization/EmitterModule.java rename to server/src/main/java/io/druid/server/initialization/initialization/EmitterModule.java index 889b440bf80..5573b4653cc 100644 --- a/client/src/main/java/com/metamx/druid/initialization/EmitterModule.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/EmitterModule.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import com.google.common.base.Supplier; import com.google.common.collect.Lists; @@ -33,12 +33,13 @@ import com.google.inject.name.Named; import com.google.inject.name.Names; import com.metamx.common.ISE; import com.metamx.common.logger.Logger; -import com.metamx.druid.guice.LazySingleton; -import com.metamx.druid.guice.ManageLifecycle; -import com.metamx.druid.guice.annotations.Self; import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.core.Emitter; import com.metamx.emitter.service.ServiceEmitter; +import io.druid.guice.guice.LazySingleton; +import io.druid.guice.guice.ManageLifecycle; +import io.druid.guice.guice.annotations.Self; +import io.druid.server.DruidNode; import java.lang.annotation.Annotation; import java.util.List; diff --git a/client/src/main/java/com/metamx/druid/initialization/HttpEmitterConfig.java b/server/src/main/java/io/druid/server/initialization/initialization/HttpEmitterConfig.java similarity index 95% rename from client/src/main/java/com/metamx/druid/initialization/HttpEmitterConfig.java rename to server/src/main/java/io/druid/server/initialization/initialization/HttpEmitterConfig.java index 2a9467b3961..97c36874afd 100644 --- a/client/src/main/java/com/metamx/druid/initialization/HttpEmitterConfig.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/HttpEmitterConfig.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import com.fasterxml.jackson.annotation.JsonProperty; import org.joda.time.Period; diff --git a/client/src/main/java/com/metamx/druid/initialization/HttpEmitterModule.java b/server/src/main/java/io/druid/server/initialization/initialization/HttpEmitterModule.java similarity index 92% rename from client/src/main/java/com/metamx/druid/initialization/HttpEmitterModule.java rename to server/src/main/java/io/druid/server/initialization/initialization/HttpEmitterModule.java index 7c2c9f2ca69..cf6478a1397 100644 --- a/client/src/main/java/com/metamx/druid/initialization/HttpEmitterModule.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/HttpEmitterModule.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import com.google.common.base.Supplier; import com.google.inject.Binder; @@ -26,13 +26,13 @@ import com.google.inject.Provides; import com.google.inject.name.Named; import com.google.inject.util.Providers; import com.metamx.common.lifecycle.Lifecycle; -import com.metamx.druid.guice.JsonConfigProvider; -import com.metamx.druid.guice.LazySingleton; -import com.metamx.druid.guice.ManageLifecycle; import com.metamx.emitter.core.Emitter; import com.metamx.emitter.core.HttpPostEmitter; import com.metamx.http.client.HttpClientConfig; import com.metamx.http.client.HttpClientInit; +import io.druid.guice.guice.JsonConfigProvider; +import io.druid.guice.guice.LazySingleton; +import io.druid.guice.guice.ManageLifecycle; import javax.annotation.Nullable; import javax.net.ssl.SSLContext; diff --git a/client/src/main/java/com/metamx/druid/initialization/Initialization.java b/server/src/main/java/io/druid/server/initialization/initialization/Initialization.java similarity index 93% rename from client/src/main/java/com/metamx/druid/initialization/Initialization.java rename to server/src/main/java/io/druid/server/initialization/initialization/Initialization.java index a310c9c8184..dc3ea672d2a 100644 --- a/client/src/main/java/com/metamx/druid/initialization/Initialization.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/Initialization.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Function; @@ -28,11 +28,11 @@ import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.Module; import com.metamx.common.ISE; -import com.metamx.druid.guice.DruidGuiceExtensions; -import com.metamx.druid.guice.DruidSecondaryModule; -import com.metamx.druid.guice.annotations.Json; -import com.metamx.druid.guice.annotations.Smile; import com.metamx.druid.jackson.JacksonModule; +import io.druid.guice.guice.DruidGuiceExtensions; +import io.druid.guice.guice.DruidSecondaryModule; +import io.druid.guice.guice.annotations.Json; +import io.druid.guice.guice.annotations.Smile; import io.druid.initialization.DruidModule; import javax.annotation.Nullable; diff --git a/server/src/main/java/io/druid/server/initialization/initialization/JettyServerInitializer.java b/server/src/main/java/io/druid/server/initialization/initialization/JettyServerInitializer.java new file mode 100644 index 00000000000..b16e73001e8 --- /dev/null +++ b/server/src/main/java/io/druid/server/initialization/initialization/JettyServerInitializer.java @@ -0,0 +1,30 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.initialization.initialization; + +import com.google.inject.Injector; +import org.eclipse.jetty.server.Server; + +/** + */ +public interface JettyServerInitializer +{ + public void initialize(Server server, Injector injector); +} diff --git a/client/src/main/java/com/metamx/druid/initialization/JettyServerModule.java b/server/src/main/java/io/druid/server/initialization/initialization/JettyServerModule.java similarity index 82% rename from client/src/main/java/com/metamx/druid/initialization/JettyServerModule.java rename to server/src/main/java/io/druid/server/initialization/initialization/JettyServerModule.java index cf7da29b23e..c31aa7f5489 100644 --- a/client/src/main/java/com/metamx/druid/initialization/JettyServerModule.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/JettyServerModule.java @@ -1,4 +1,23 @@ -package com.metamx.druid.initialization; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.initialization.initialization; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableSet; @@ -18,14 +37,15 @@ import com.google.inject.name.Named; import com.google.inject.name.Names; import com.metamx.common.lifecycle.Lifecycle; import com.metamx.common.logger.Logger; -import com.metamx.druid.guice.JsonConfigProvider; -import com.metamx.druid.guice.LazySingleton; -import com.metamx.druid.guice.annotations.Self; import com.sun.jersey.api.core.DefaultResourceConfig; import com.sun.jersey.api.core.ResourceConfig; import com.sun.jersey.guice.JerseyServletModule; import com.sun.jersey.guice.spi.container.servlet.GuiceContainer; import com.sun.jersey.spi.container.servlet.WebConfig; +import io.druid.guice.guice.JsonConfigProvider; +import io.druid.guice.guice.LazySingleton; +import io.druid.guice.guice.annotations.Self; +import io.druid.server.DruidNode; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.nio.SelectChannelConnector; diff --git a/client/src/main/java/com/metamx/druid/initialization/LogEmitterModule.java b/server/src/main/java/io/druid/server/initialization/initialization/LogEmitterModule.java similarity index 91% rename from client/src/main/java/com/metamx/druid/initialization/LogEmitterModule.java rename to server/src/main/java/io/druid/server/initialization/initialization/LogEmitterModule.java index 5e9b7bd71a7..ea1fa615384 100644 --- a/client/src/main/java/com/metamx/druid/initialization/LogEmitterModule.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/LogEmitterModule.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Supplier; @@ -25,11 +25,11 @@ import com.google.inject.Binder; import com.google.inject.Module; import com.google.inject.Provides; import com.google.inject.name.Named; -import com.metamx.druid.guice.JsonConfigProvider; -import com.metamx.druid.guice.ManageLifecycle; import com.metamx.emitter.core.Emitter; import com.metamx.emitter.core.LoggingEmitter; import com.metamx.emitter.core.LoggingEmitterConfig; +import io.druid.guice.guice.JsonConfigProvider; +import io.druid.guice.guice.ManageLifecycle; /** */ diff --git a/client/src/main/java/com/metamx/druid/initialization/PropertiesModule.java b/server/src/main/java/io/druid/server/initialization/initialization/PropertiesModule.java similarity index 97% rename from client/src/main/java/com/metamx/druid/initialization/PropertiesModule.java rename to server/src/main/java/io/druid/server/initialization/initialization/PropertiesModule.java index b9ae29c2d90..a82708ee0b9 100644 --- a/client/src/main/java/com/metamx/druid/initialization/PropertiesModule.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/PropertiesModule.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import com.google.common.base.Throwables; import com.google.common.io.Closeables; diff --git a/client/src/main/java/com/metamx/druid/initialization/ServerConfig.java b/server/src/main/java/io/druid/server/initialization/initialization/ServerConfig.java similarity index 92% rename from client/src/main/java/com/metamx/druid/initialization/ServerConfig.java rename to server/src/main/java/io/druid/server/initialization/initialization/ServerConfig.java index 5610e476437..8894161fc33 100644 --- a/client/src/main/java/com/metamx/druid/initialization/ServerConfig.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/ServerConfig.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import com.fasterxml.jackson.annotation.JsonProperty; import org.joda.time.Period; diff --git a/client/src/main/java/com/metamx/druid/initialization/ZkPathsConfig.java b/server/src/main/java/io/druid/server/initialization/initialization/ZkPathsConfig.java similarity index 95% rename from client/src/main/java/com/metamx/druid/initialization/ZkPathsConfig.java rename to server/src/main/java/io/druid/server/initialization/initialization/ZkPathsConfig.java index 6f484c1bc63..4f0c7aeea9e 100644 --- a/client/src/main/java/com/metamx/druid/initialization/ZkPathsConfig.java +++ b/server/src/main/java/io/druid/server/initialization/initialization/ZkPathsConfig.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.initialization; +package io.druid.server.initialization.initialization; import org.apache.curator.utils.ZKPaths; import org.skife.config.Config; diff --git a/client/src/main/java/com/metamx/druid/http/log/EmittingRequestLogger.java b/server/src/main/java/io/druid/server/log/EmittingRequestLogger.java similarity index 96% rename from client/src/main/java/com/metamx/druid/http/log/EmittingRequestLogger.java rename to server/src/main/java/io/druid/server/log/EmittingRequestLogger.java index c551542374f..70df84450a6 100644 --- a/client/src/main/java/com/metamx/druid/http/log/EmittingRequestLogger.java +++ b/server/src/main/java/io/druid/server/log/EmittingRequestLogger.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2013 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,16 +17,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http.log; +package io.druid.server.log; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; import com.google.common.collect.ImmutableMap; -import com.metamx.druid.http.RequestLogLine; import com.metamx.emitter.core.Event; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceEventBuilder; import io.druid.query.Query; +import io.druid.server.RequestLogLine; import org.joda.time.DateTime; import java.util.Map; diff --git a/server/src/main/java/io/druid/server/log/EmittingRequestLoggerProvider.java b/server/src/main/java/io/druid/server/log/EmittingRequestLoggerProvider.java new file mode 100644 index 00000000000..5509b7c38be --- /dev/null +++ b/server/src/main/java/io/druid/server/log/EmittingRequestLoggerProvider.java @@ -0,0 +1,55 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.log; + +import com.fasterxml.jackson.annotation.JacksonInject; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.google.inject.Inject; +import com.google.inject.Injector; +import com.metamx.emitter.service.ServiceEmitter; + +import javax.validation.constraints.NotNull; + +/** + */ +@JsonTypeName("emitter") +public class EmittingRequestLoggerProvider implements RequestLoggerProvider +{ + @JsonProperty + @NotNull + private String feed = null; + + @JacksonInject + @NotNull + private ServiceEmitter emitter = null; + + @Inject + public void injectMe(Injector injector) + { + System.out.println("YAYAYAYAYAYA!!!"); + } + + @Override + public RequestLogger get() + { + return new EmittingRequestLogger(emitter, feed); + } +} diff --git a/client/src/main/java/com/metamx/druid/http/log/FileRequestLogger.java b/server/src/main/java/io/druid/server/log/FileRequestLogger.java similarity index 96% rename from client/src/main/java/com/metamx/druid/http/log/FileRequestLogger.java rename to server/src/main/java/io/druid/server/log/FileRequestLogger.java index 0891edbd713..ba450ce9c5f 100644 --- a/client/src/main/java/com/metamx/druid/http/log/FileRequestLogger.java +++ b/server/src/main/java/io/druid/server/log/FileRequestLogger.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http.log; +package io.druid.server.log; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Throwables; @@ -25,7 +25,7 @@ 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 com.metamx.druid.http.RequestLogLine; +import io.druid.server.RequestLogLine; import org.joda.time.DateTime; import org.joda.time.Duration; import org.joda.time.MutableDateTime; diff --git a/server/src/main/java/io/druid/server/log/FileRequestLoggerProvider.java b/server/src/main/java/io/druid/server/log/FileRequestLoggerProvider.java new file mode 100644 index 00000000000..c1b67d509ad --- /dev/null +++ b/server/src/main/java/io/druid/server/log/FileRequestLoggerProvider.java @@ -0,0 +1,56 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.log; + +import com.fasterxml.jackson.annotation.JacksonInject; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.metamx.common.concurrent.ScheduledExecutorFactory; +import io.druid.guice.guice.annotations.Json; + +import javax.validation.constraints.NotNull; +import java.io.File; + +/** + */ +@JsonTypeName("file") +public class FileRequestLoggerProvider implements RequestLoggerProvider +{ + @JsonProperty + @NotNull + private File dir = null; + + @JacksonInject + @NotNull + private ScheduledExecutorFactory factory = null; + + + @JacksonInject + @NotNull + @Json + private ObjectMapper jsonMapper = null; + + @Override + public RequestLogger get() + { + return new FileRequestLogger(jsonMapper, factory.create(1, "RequestLogger-%s"), dir); + } +} diff --git a/server/src/main/java/io/druid/server/log/NoopRequestLogger.java b/server/src/main/java/io/druid/server/log/NoopRequestLogger.java new file mode 100644 index 00000000000..1088a13032a --- /dev/null +++ b/server/src/main/java/io/druid/server/log/NoopRequestLogger.java @@ -0,0 +1,33 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.log; + +import io.druid.server.RequestLogLine; + +/** + */ +public class NoopRequestLogger implements RequestLogger +{ + @Override + public void log(RequestLogLine requestLogLine) throws Exception + { + // This is a no op! + } +} diff --git a/server/src/main/java/io/druid/server/log/NoopRequestLoggerProvider.java b/server/src/main/java/io/druid/server/log/NoopRequestLoggerProvider.java new file mode 100644 index 00000000000..86d41241ab2 --- /dev/null +++ b/server/src/main/java/io/druid/server/log/NoopRequestLoggerProvider.java @@ -0,0 +1,31 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.log; + +/** + */ +public class NoopRequestLoggerProvider implements RequestLoggerProvider +{ + @Override + public RequestLogger get() + { + return new NoopRequestLogger(); + } +} diff --git a/client/src/main/java/com/metamx/druid/http/log/RequestLogger.java b/server/src/main/java/io/druid/server/log/RequestLogger.java similarity index 87% rename from client/src/main/java/com/metamx/druid/http/log/RequestLogger.java rename to server/src/main/java/io/druid/server/log/RequestLogger.java index ff3b0e84401..2d4c938252b 100644 --- a/client/src/main/java/com/metamx/druid/http/log/RequestLogger.java +++ b/server/src/main/java/io/druid/server/log/RequestLogger.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,9 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.http.log; +package io.druid.server.log; -import com.metamx.druid.http.RequestLogLine; +import io.druid.server.RequestLogLine; /** */ diff --git a/server/src/main/java/io/druid/server/log/RequestLoggerProvider.java b/server/src/main/java/io/druid/server/log/RequestLoggerProvider.java new file mode 100644 index 00000000000..236c2452034 --- /dev/null +++ b/server/src/main/java/io/druid/server/log/RequestLoggerProvider.java @@ -0,0 +1,32 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.log; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.inject.Provider; + +/** + * A Marker interface for things that can provide a RequestLogger. This can be combined with jackson polymorphic serde + * to provide new RequestLogger implementations as plugins. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = NoopRequestLoggerProvider.class) +public interface RequestLoggerProvider extends Provider +{ +} diff --git a/client/src/main/java/com/metamx/druid/shard/LinearShardSpec.java b/server/src/main/java/io/druid/server/shard/shard/LinearShardSpec.java similarity index 54% rename from client/src/main/java/com/metamx/druid/shard/LinearShardSpec.java rename to server/src/main/java/io/druid/server/shard/shard/LinearShardSpec.java index 4eb9c963672..5de078c369a 100644 --- a/client/src/main/java/com/metamx/druid/shard/LinearShardSpec.java +++ b/server/src/main/java/io/druid/server/shard/shard/LinearShardSpec.java @@ -1,4 +1,23 @@ -package com.metamx.druid.shard; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.server.shard.shard; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/client/src/main/java/com/metamx/druid/shard/NoneShardSpec.java b/server/src/main/java/io/druid/server/shard/shard/NoneShardSpec.java similarity index 94% rename from client/src/main/java/com/metamx/druid/shard/NoneShardSpec.java rename to server/src/main/java/io/druid/server/shard/shard/NoneShardSpec.java index 940f2f5c600..f0dea959b1a 100644 --- a/client/src/main/java/com/metamx/druid/shard/NoneShardSpec.java +++ b/server/src/main/java/io/druid/server/shard/shard/NoneShardSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.shard; +package io.druid.server.shard.shard; import com.metamx.druid.input.InputRow; import com.metamx.druid.partition.PartitionChunk; diff --git a/client/src/main/java/com/metamx/druid/shard/NumberedShardSpec.java b/server/src/main/java/io/druid/server/shard/shard/NumberedShardSpec.java similarity index 96% rename from client/src/main/java/com/metamx/druid/shard/NumberedShardSpec.java rename to server/src/main/java/io/druid/server/shard/shard/NumberedShardSpec.java index 325446cb25b..999afaf1f91 100644 --- a/client/src/main/java/com/metamx/druid/shard/NumberedShardSpec.java +++ b/server/src/main/java/io/druid/server/shard/shard/NumberedShardSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.shard; +package io.druid.server.shard.shard; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/client/src/main/java/com/metamx/druid/shard/ShardSpec.java b/server/src/main/java/io/druid/server/shard/shard/ShardSpec.java similarity index 95% rename from client/src/main/java/com/metamx/druid/shard/ShardSpec.java rename to server/src/main/java/io/druid/server/shard/shard/ShardSpec.java index b5b778283b5..ce3655b8287 100644 --- a/client/src/main/java/com/metamx/druid/shard/ShardSpec.java +++ b/server/src/main/java/io/druid/server/shard/shard/ShardSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.shard; +package io.druid.server.shard.shard; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/client/src/main/java/com/metamx/druid/shard/SingleDimensionShardSpec.java b/server/src/main/java/io/druid/server/shard/shard/SingleDimensionShardSpec.java similarity index 97% rename from client/src/main/java/com/metamx/druid/shard/SingleDimensionShardSpec.java rename to server/src/main/java/io/druid/server/shard/shard/SingleDimensionShardSpec.java index 98ff7f2eae1..dfe7b15ab43 100644 --- a/client/src/main/java/com/metamx/druid/shard/SingleDimensionShardSpec.java +++ b/server/src/main/java/io/druid/server/shard/shard/SingleDimensionShardSpec.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.shard; +package io.druid.server.shard.shard; import com.fasterxml.jackson.annotation.JsonProperty; import com.metamx.druid.input.InputRow; diff --git a/client/src/main/java/com/metamx/druid/sql/SQLRunner.java b/server/src/main/java/io/druid/server/sql/SQLRunner.java similarity index 97% rename from client/src/main/java/com/metamx/druid/sql/SQLRunner.java rename to server/src/main/java/io/druid/server/sql/SQLRunner.java index c2c01574f0c..dcd399ae1af 100644 --- a/client/src/main/java/com/metamx/druid/sql/SQLRunner.java +++ b/server/src/main/java/io/druid/server/sql/SQLRunner.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.sql; +package io.druid.server.sql; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -27,17 +27,17 @@ import com.google.common.base.Joiner; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.io.Closeables; -import com.metamx.druid.Druids; import com.metamx.druid.input.Row; import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.query.dimension.DimensionSpec; -import com.metamx.druid.query.group.GroupByQuery; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import com.metamx.druid.sql.antlr4.DruidSQLLexer; import com.metamx.druid.sql.antlr4.DruidSQLParser; +import io.druid.query.Druids; import io.druid.query.Query; +import io.druid.query.Result; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.query.dimension.DimensionSpec; +import io.druid.query.groupby.GroupByQuery; +import io.druid.query.timeseries.TimeseriesResultValue; import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.CommonTokenStream; diff --git a/indexing-common/src/main/java/com/metamx/druid/common/s3/S3Utils.java b/server/src/main/java/io/druid/storage/s3/S3Utils.java similarity index 97% rename from indexing-common/src/main/java/com/metamx/druid/common/s3/S3Utils.java rename to server/src/main/java/io/druid/storage/s3/S3Utils.java index 84ce35df947..044b3fa76c9 100644 --- a/indexing-common/src/main/java/com/metamx/druid/common/s3/S3Utils.java +++ b/server/src/main/java/io/druid/storage/s3/S3Utils.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.common.s3; +package io.druid.storage.s3; import com.google.common.base.Throwables; import com.metamx.common.logger.Logger; diff --git a/server/src/test/java/com/metamx/druid/TestHelper.java b/server/src/test/java/com/metamx/druid/TestHelper.java index 8a15a73f724..7ad40f59ed7 100644 --- a/server/src/test/java/com/metamx/druid/TestHelper.java +++ b/server/src/test/java/com/metamx/druid/TestHelper.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,7 +22,7 @@ package com.metamx.druid; 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 io.druid.query.Result; import org.junit.Assert; import java.util.Iterator; 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 92026a533e6..59e0fd0b117 100644 --- a/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestDropTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestDropTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,11 +22,10 @@ package com.metamx.druid.coordination; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.shard.NoneShardSpec; - +import io.druid.client.DataSegment; +import io.druid.segment.IndexIO; +import io.druid.server.shard.shard.NoneShardSpec; import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; 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 62688974180..246fd66301a 100644 --- a/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestLoadTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/SegmentChangeRequestLoadTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,11 +22,10 @@ package com.metamx.druid.coordination; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.shard.NoneShardSpec; - +import io.druid.client.DataSegment; +import io.druid.segment.IndexIO; +import io.druid.server.shard.shard.NoneShardSpec; import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; 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 d375ea370b0..9635109bdd9 100644 --- a/server/src/test/java/com/metamx/druid/coordination/ServerManagerTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/ServerManagerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -35,31 +35,31 @@ import com.metamx.common.guava.Sequences; import com.metamx.common.guava.Yielder; import com.metamx.common.guava.YieldingAccumulator; import com.metamx.common.guava.YieldingSequenceBase; -import com.metamx.druid.Druids; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.ReferenceCountingSegment; -import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.loading.SegmentLoader; import com.metamx.druid.loading.SegmentLoadingException; import com.metamx.druid.metrics.NoopServiceEmitter; -import com.metamx.druid.query.ConcatQueryRunner; -import com.metamx.druid.query.NoopQueryRunner; import com.metamx.druid.query.QueryRunnerFactoryConglomerate; -import com.metamx.druid.query.search.SearchQuery; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.SearchResultValue; -import com.metamx.druid.shard.NoneShardSpec; import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceMetricEvent; +import io.druid.client.DataSegment; import io.druid.granularity.QueryGranularity; +import io.druid.query.ConcatQueryRunner; +import io.druid.query.Druids; +import io.druid.query.NoopQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; import io.druid.query.QueryToolChest; +import io.druid.query.Result; import io.druid.query.aggregation.MetricManipulationFn; +import io.druid.query.search.SearchResultValue; +import io.druid.query.search.search.SearchQuery; +import io.druid.segment.IndexIO; import io.druid.segment.QueryableIndex; +import io.druid.segment.ReferenceCountingSegment; import io.druid.segment.Segment; import io.druid.segment.StorageAdapter; +import io.druid.server.shard.shard.NoneShardSpec; import org.joda.time.Interval; import org.junit.Assert; import org.junit.Before; 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 f81b7cd91c7..ce269821d40 100644 --- a/server/src/test/java/com/metamx/druid/coordination/ZkCoordinatorTest.java +++ b/server/src/test/java/com/metamx/druid/coordination/ZkCoordinatorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -24,18 +24,21 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.util.concurrent.MoreExecutors; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.DataSegment; import com.metamx.druid.concurrent.Execs; -import com.metamx.druid.curator.CuratorTestBase; -import com.metamx.druid.curator.announcement.Announcer; -import com.metamx.druid.index.v1.IndexIO; -import com.metamx.druid.initialization.ZkPathsConfig; import com.metamx.druid.jackson.DefaultObjectMapper; import com.metamx.druid.loading.CacheTestSegmentLoader; import com.metamx.druid.loading.SegmentLoaderConfig; import com.metamx.druid.metrics.NoopServiceEmitter; import com.metamx.druid.query.NoopQueryRunnerFactoryConglomerate; -import com.metamx.druid.shard.NoneShardSpec; +import io.druid.client.DataSegment; +import io.druid.curator.CuratorTestBase; +import io.druid.curator.announcement.Announcer; +import io.druid.segment.IndexIO; +import io.druid.server.coordination.DataSegmentAnnouncer; +import io.druid.server.coordination.DruidServerMetadata; +import io.druid.server.coordination.SingleDataSegmentAnnouncer; +import io.druid.server.initialization.initialization.ZkPathsConfig; +import io.druid.server.shard.shard.NoneShardSpec; import org.joda.time.Interval; import org.junit.After; import org.junit.Assert; diff --git a/server/src/test/java/com/metamx/druid/index/ReferenceCountingSegmentTest.java b/server/src/test/java/com/metamx/druid/index/ReferenceCountingSegmentTest.java index dee1229e388..ff687a84348 100644 --- a/server/src/test/java/com/metamx/druid/index/ReferenceCountingSegmentTest.java +++ b/server/src/test/java/com/metamx/druid/index/ReferenceCountingSegmentTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,6 +21,7 @@ package com.metamx.druid.index; import com.google.common.base.Throwables; import io.druid.segment.QueryableIndex; +import io.druid.segment.ReferenceCountingSegment; import io.druid.segment.Segment; import io.druid.segment.StorageAdapter; import junit.framework.Assert; diff --git a/server/src/test/java/com/metamx/druid/index/brita/SpatialFilterBonusTest.java b/server/src/test/java/com/metamx/druid/index/brita/SpatialFilterBonusTest.java index d83321bb93c..d2a9b74cfad 100644 --- a/server/src/test/java/com/metamx/druid/index/brita/SpatialFilterBonusTest.java +++ b/server/src/test/java/com/metamx/druid/index/brita/SpatialFilterBonusTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -24,29 +24,29 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.metamx.collections.spatial.search.RadiusBound; import com.metamx.collections.spatial.search.RectangularBound; -import com.metamx.druid.Druids; import com.metamx.druid.TestHelper; -import com.metamx.druid.aggregation.CountAggregatorFactory; -import com.metamx.druid.aggregation.LongSumAggregatorFactory; -import com.metamx.druid.index.IncrementalIndexSegment; -import com.metamx.druid.index.QueryableIndexSegment; -import com.metamx.druid.index.v1.IncrementalIndex; -import com.metamx.druid.index.v1.IncrementalIndexSchema; -import com.metamx.druid.index.v1.IndexIO; -import com.metamx.druid.index.v1.IndexMerger; -import com.metamx.druid.index.v1.SpatialDimensionSchema; import com.metamx.druid.input.MapBasedInputRow; -import com.metamx.druid.query.FinalizeResultsQueryRunner; -import com.metamx.druid.query.filter.SpatialDimFilter; -import com.metamx.druid.query.timeseries.TimeseriesQuery; import com.metamx.druid.query.timeseries.TimeseriesQueryRunnerFactory; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import io.druid.granularity.QueryGranularity; +import io.druid.query.Druids; +import io.druid.query.FinalizeResultsQueryRunner; import io.druid.query.QueryRunner; +import io.druid.query.Result; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.query.aggregation.aggregation.CountAggregatorFactory; +import io.druid.query.aggregation.aggregation.LongSumAggregatorFactory; +import io.druid.query.filter.SpatialDimFilter; +import io.druid.query.timeseries.TimeseriesQuery; +import io.druid.query.timeseries.TimeseriesResultValue; +import io.druid.segment.IncrementalIndexSegment; +import io.druid.segment.IndexIO; +import io.druid.segment.IndexMerger; import io.druid.segment.QueryableIndex; +import io.druid.segment.QueryableIndexSegment; import io.druid.segment.Segment; +import io.druid.segment.incremental.IncrementalIndex; +import io.druid.segment.incremental.IncrementalIndexSchema; +import io.druid.segment.incremental.SpatialDimensionSchema; import org.joda.time.DateTime; import org.joda.time.Interval; import org.junit.Test; diff --git a/server/src/test/java/com/metamx/druid/index/brita/SpatialFilterTest.java b/server/src/test/java/com/metamx/druid/index/brita/SpatialFilterTest.java index dea44e0c44f..91915dff882 100644 --- a/server/src/test/java/com/metamx/druid/index/brita/SpatialFilterTest.java +++ b/server/src/test/java/com/metamx/druid/index/brita/SpatialFilterTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -24,29 +24,29 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.metamx.collections.spatial.search.RadiusBound; import com.metamx.collections.spatial.search.RectangularBound; -import com.metamx.druid.Druids; import com.metamx.druid.TestHelper; -import com.metamx.druid.aggregation.CountAggregatorFactory; -import com.metamx.druid.aggregation.LongSumAggregatorFactory; -import com.metamx.druid.index.IncrementalIndexSegment; -import com.metamx.druid.index.QueryableIndexSegment; -import com.metamx.druid.index.v1.IncrementalIndex; -import com.metamx.druid.index.v1.IncrementalIndexSchema; -import com.metamx.druid.index.v1.IndexIO; -import com.metamx.druid.index.v1.IndexMerger; -import com.metamx.druid.index.v1.SpatialDimensionSchema; import com.metamx.druid.input.MapBasedInputRow; -import com.metamx.druid.query.FinalizeResultsQueryRunner; -import com.metamx.druid.query.filter.SpatialDimFilter; -import com.metamx.druid.query.timeseries.TimeseriesQuery; import com.metamx.druid.query.timeseries.TimeseriesQueryRunnerFactory; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import io.druid.granularity.QueryGranularity; +import io.druid.query.Druids; +import io.druid.query.FinalizeResultsQueryRunner; import io.druid.query.QueryRunner; +import io.druid.query.Result; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.query.aggregation.aggregation.CountAggregatorFactory; +import io.druid.query.aggregation.aggregation.LongSumAggregatorFactory; +import io.druid.query.filter.SpatialDimFilter; +import io.druid.query.timeseries.TimeseriesQuery; +import io.druid.query.timeseries.TimeseriesResultValue; +import io.druid.segment.IncrementalIndexSegment; +import io.druid.segment.IndexIO; +import io.druid.segment.IndexMerger; import io.druid.segment.QueryableIndex; +import io.druid.segment.QueryableIndexSegment; import io.druid.segment.Segment; +import io.druid.segment.incremental.IncrementalIndex; +import io.druid.segment.incremental.IncrementalIndexSchema; +import io.druid.segment.incremental.SpatialDimensionSchema; import org.joda.time.DateTime; import org.joda.time.Interval; import org.junit.Test; 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..0452bf3be91 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 @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,7 +19,8 @@ package com.metamx.druid.index.v1; -import com.metamx.druid.index.v1.processing.Offset; +import io.druid.segment.ConciseOffset; +import io.druid.segment.data.Offset; import it.uniroma3.mat.extendedset.intset.ConciseSet; import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet; import org.junit.Assert; 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 6bbfd6fbbba..ea412309df6 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 @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -23,7 +23,12 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import io.druid.granularity.QueryGranularity; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.segment.IndexIO; +import io.druid.segment.IndexMerger; +import io.druid.segment.IndexableAdapter; import io.druid.segment.QueryableIndex; +import io.druid.segment.incremental.IncrementalIndex; +import io.druid.segment.incremental.IncrementalIndexAdapter; import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; diff --git a/server/src/test/java/com/metamx/druid/index/v1/IndexMergerTest.java b/server/src/test/java/com/metamx/druid/index/v1/IndexMergerTest.java index e5f3182a12c..f2fa2849ffd 100644 --- a/server/src/test/java/com/metamx/druid/index/v1/IndexMergerTest.java +++ b/server/src/test/java/com/metamx/druid/index/v1/IndexMergerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -26,7 +26,11 @@ import com.google.common.io.Files; import com.metamx.druid.input.MapBasedInputRow; import io.druid.granularity.QueryGranularity; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.segment.IndexIO; +import io.druid.segment.IndexMerger; import io.druid.segment.QueryableIndex; +import io.druid.segment.data.IncrementalIndexTest; +import io.druid.segment.incremental.IncrementalIndex; import junit.framework.Assert; import org.apache.commons.io.FileUtils; import org.junit.Test; diff --git a/server/src/test/java/com/metamx/druid/index/v1/TestIndex.java b/server/src/test/java/com/metamx/druid/index/v1/TestIndex.java index 3f82a58c491..dc4878a6912 100644 --- a/server/src/test/java/com/metamx/druid/index/v1/TestIndex.java +++ b/server/src/test/java/com/metamx/druid/index/v1/TestIndex.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -25,13 +25,16 @@ import com.google.common.io.CharStreams; import com.google.common.io.InputSupplier; import com.google.common.io.LineProcessor; import com.metamx.common.logger.Logger; -import com.metamx.druid.aggregation.DoubleSumAggregatorFactory; -import com.metamx.druid.indexer.data.DelimitedDataSpec; -import com.metamx.druid.indexer.data.StringInputRowParser; -import com.metamx.druid.indexer.data.TimestampSpec; +import io.druid.data.input.DelimitedDataSpec; +import io.druid.data.input.StringInputRowParser; +import io.druid.data.input.TimestampSpec; import io.druid.granularity.QueryGranularity; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.query.aggregation.aggregation.DoubleSumAggregatorFactory; +import io.druid.segment.IndexIO; +import io.druid.segment.IndexMerger; import io.druid.segment.QueryableIndex; +import io.druid.segment.incremental.IncrementalIndex; import org.joda.time.DateTime; import org.joda.time.Interval; 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 3d5d5100b84..0001c610ab3 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 @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,6 +20,9 @@ package com.metamx.druid.index.v1.processing; import com.google.common.collect.Lists; +import io.druid.segment.data.ArrayBasedOffset; +import io.druid.segment.data.IntersectingOffset; +import io.druid.segment.data.Offset; import org.junit.Assert; import org.junit.Test; 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 f470e5ae37a..a3dc59aaab0 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 @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,6 +20,9 @@ package com.metamx.druid.index.v1.processing; import com.google.common.collect.Lists; +import io.druid.segment.data.ArrayBasedOffset; +import io.druid.segment.data.Offset; +import io.druid.segment.data.UnioningOffset; import org.junit.Assert; import org.junit.Test; diff --git a/server/src/test/java/com/metamx/druid/loading/CacheTestSegmentLoader.java b/server/src/test/java/com/metamx/druid/loading/CacheTestSegmentLoader.java index 0b80a7fc5b6..f429c36096f 100644 --- a/server/src/test/java/com/metamx/druid/loading/CacheTestSegmentLoader.java +++ b/server/src/test/java/com/metamx/druid/loading/CacheTestSegmentLoader.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,7 +20,7 @@ package com.metamx.druid.loading; import com.metamx.common.MapUtils; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import io.druid.segment.QueryableIndex; import io.druid.segment.Segment; import io.druid.segment.StorageAdapter; diff --git a/server/src/test/java/com/metamx/druid/loading/DataSegmentPusherUtilTest.java b/server/src/test/java/com/metamx/druid/loading/DataSegmentPusherUtilTest.java index 2337f882098..c05462d934d 100644 --- a/server/src/test/java/com/metamx/druid/loading/DataSegmentPusherUtilTest.java +++ b/server/src/test/java/com/metamx/druid/loading/DataSegmentPusherUtilTest.java @@ -1,9 +1,28 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.loading; import com.google.common.collect.ImmutableMap; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.index.v1.IndexIO; -import com.metamx.druid.shard.NoneShardSpec; +import io.druid.client.DataSegment; +import io.druid.segment.IndexIO; +import io.druid.server.shard.shard.NoneShardSpec; import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; diff --git a/server/src/test/java/com/metamx/druid/loading/SingleSegmentLoaderTest.java b/server/src/test/java/com/metamx/druid/loading/SingleSegmentLoaderTest.java index f82311609ac..62e82b6ad91 100644 --- a/server/src/test/java/com/metamx/druid/loading/SingleSegmentLoaderTest.java +++ b/server/src/test/java/com/metamx/druid/loading/SingleSegmentLoaderTest.java @@ -1,7 +1,26 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.loading; import com.google.common.collect.ImmutableMap; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import org.joda.time.Interval; import org.junit.Assert; 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 8513c157de3..45edbafc172 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java @@ -1,21 +1,21 @@ /* -* 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. -*/ + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.master; @@ -23,9 +23,9 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.MinMaxPriorityQueue; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; -import com.metamx.druid.shard.NoneShardSpec; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; +import io.druid.server.shard.shard.NoneShardSpec; import junit.framework.Assert; import org.easymock.EasyMock; import org.joda.time.DateTime; diff --git a/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTester.java b/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTester.java index 3b5865fb361..ea72386293c 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTester.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTester.java @@ -1,7 +1,26 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.master; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; public class DruidMasterBalancerTester extends DruidMasterBalancer { diff --git a/server/src/test/java/com/metamx/druid/master/DruidMasterRuleRunnerTest.java b/server/src/test/java/com/metamx/druid/master/DruidMasterRuleRunnerTest.java index 27dc46636ac..f91aa192c75 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterRuleRunnerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterRuleRunnerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -25,17 +25,17 @@ import com.google.common.collect.Maps; import com.google.common.collect.MinMaxPriorityQueue; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; import com.metamx.druid.db.DatabaseRuleManager; -import com.metamx.druid.index.v1.IndexIO; import com.metamx.druid.master.rules.IntervalDropRule; import com.metamx.druid.master.rules.IntervalLoadRule; import com.metamx.druid.master.rules.Rule; -import com.metamx.druid.shard.NoneShardSpec; import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceEmitter; import com.metamx.emitter.service.ServiceEventBuilder; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; +import io.druid.segment.IndexIO; +import io.druid.server.shard.shard.NoneShardSpec; import org.easymock.EasyMock; import org.joda.time.DateTime; import org.joda.time.Interval; 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 04caa13a8a4..e287d2f7aac 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -22,9 +22,9 @@ package com.metamx.druid.master; 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 com.metamx.druid.client.indexing.IndexingServiceClient; -import com.metamx.druid.shard.LinearShardSpec; +import io.druid.client.DataSegment; +import io.druid.client.indexing.IndexingServiceClient; +import io.druid.server.shard.shard.LinearShardSpec; import junit.framework.Assert; import org.joda.time.Interval; import org.junit.Test; 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 af8840d948e..51adf2bb686 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,13 +21,13 @@ package com.metamx.druid.master; import com.google.common.collect.MapMaker; import com.metamx.common.concurrent.ScheduledExecutorFactory; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; -import com.metamx.druid.client.SingleServerInventoryView; -import com.metamx.druid.curator.inventory.InventoryManagerConfig; import com.metamx.druid.db.DatabaseSegmentManager; -import com.metamx.druid.initialization.ZkPathsConfig; import com.metamx.druid.metrics.NoopServiceEmitter; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; +import io.druid.client.SingleServerInventoryView; +import io.druid.curator.inventory.InventoryManagerConfig; +import io.druid.server.initialization.initialization.ZkPathsConfig; import org.apache.curator.framework.CuratorFramework; import org.easymock.EasyMock; import org.joda.time.Duration; diff --git a/server/src/test/java/com/metamx/druid/master/LoadQueuePeonTester.java b/server/src/test/java/com/metamx/druid/master/LoadQueuePeonTester.java index 366cde87e1d..62b196aac6d 100644 --- a/server/src/test/java/com/metamx/druid/master/LoadQueuePeonTester.java +++ b/server/src/test/java/com/metamx/druid/master/LoadQueuePeonTester.java @@ -1,6 +1,25 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.master; -import com.metamx.druid.client.DataSegment; +import io.druid.client.DataSegment; import java.util.concurrent.ConcurrentSkipListSet; diff --git a/server/src/test/java/com/metamx/druid/master/ReservoirSegmentSamplerTest.java b/server/src/test/java/com/metamx/druid/master/ReservoirSegmentSamplerTest.java index 7b768e11172..33fafa72358 100644 --- a/server/src/test/java/com/metamx/druid/master/ReservoirSegmentSamplerTest.java +++ b/server/src/test/java/com/metamx/druid/master/ReservoirSegmentSamplerTest.java @@ -1,29 +1,29 @@ /* -* 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. -*/ + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.master; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; -import com.metamx.druid.shard.NoneShardSpec; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; +import io.druid.server.shard.shard.NoneShardSpec; import junit.framework.Assert; import org.easymock.EasyMock; import org.joda.time.DateTime; diff --git a/server/src/test/java/com/metamx/druid/master/rules/PeriodDropRuleTest.java b/server/src/test/java/com/metamx/druid/master/rules/PeriodDropRuleTest.java index c6bceb08e5e..b214721083c 100644 --- a/server/src/test/java/com/metamx/druid/master/rules/PeriodDropRuleTest.java +++ b/server/src/test/java/com/metamx/druid/master/rules/PeriodDropRuleTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,8 +19,8 @@ package com.metamx.druid.master.rules; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.shard.NoneShardSpec; +import io.druid.client.DataSegment; +import io.druid.server.shard.shard.NoneShardSpec; import org.joda.time.DateTime; import org.joda.time.Interval; import org.joda.time.Period; diff --git a/server/src/test/java/com/metamx/druid/master/rules/PeriodLoadRuleTest.java b/server/src/test/java/com/metamx/druid/master/rules/PeriodLoadRuleTest.java index 3944d96ecb9..c09e5be3e19 100644 --- a/server/src/test/java/com/metamx/druid/master/rules/PeriodLoadRuleTest.java +++ b/server/src/test/java/com/metamx/druid/master/rules/PeriodLoadRuleTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -19,8 +19,8 @@ package com.metamx.druid.master.rules; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.shard.NoneShardSpec; +import io.druid.client.DataSegment; +import io.druid.server.shard.shard.NoneShardSpec; import org.joda.time.DateTime; import org.joda.time.Interval; import org.joda.time.Period; diff --git a/server/src/test/java/com/metamx/druid/query/QueryRunnerTestHelper.java b/server/src/test/java/com/metamx/druid/query/QueryRunnerTestHelper.java index 8d46099a016..f24c7aa4d31 100644 --- a/server/src/test/java/com/metamx/druid/query/QueryRunnerTestHelper.java +++ b/server/src/test/java/com/metamx/druid/query/QueryRunnerTestHelper.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -20,25 +20,26 @@ package com.metamx.druid.query; import com.google.common.collect.Lists; -import com.metamx.druid.aggregation.CountAggregatorFactory; -import com.metamx.druid.aggregation.DoubleSumAggregatorFactory; -import com.metamx.druid.aggregation.LongSumAggregatorFactory; -import com.metamx.druid.aggregation.post.ArithmeticPostAggregator; -import com.metamx.druid.aggregation.post.ConstantPostAggregator; -import com.metamx.druid.aggregation.post.FieldAccessPostAggregator; -import com.metamx.druid.index.IncrementalIndexSegment; -import com.metamx.druid.index.QueryableIndexSegment; -import com.metamx.druid.index.v1.IncrementalIndex; import com.metamx.druid.index.v1.TestIndex; import io.druid.granularity.QueryGranularity; +import io.druid.query.FinalizeResultsQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.query.aggregation.aggregation.CountAggregatorFactory; +import io.druid.query.aggregation.aggregation.DoubleSumAggregatorFactory; +import io.druid.query.aggregation.aggregation.LongSumAggregatorFactory; +import io.druid.query.aggregation.aggregation.post.ArithmeticPostAggregator; +import io.druid.query.aggregation.aggregation.post.ConstantPostAggregator; +import io.druid.query.aggregation.aggregation.post.FieldAccessPostAggregator; import io.druid.query.spec.MultipleIntervalSegmentSpec; import io.druid.query.spec.QuerySegmentSpec; +import io.druid.segment.IncrementalIndexSegment; import io.druid.segment.QueryableIndex; +import io.druid.segment.QueryableIndexSegment; import io.druid.segment.Segment; +import io.druid.segment.incremental.IncrementalIndex; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/server/src/test/java/com/metamx/druid/query/group/GroupByQueryRunnerTest.java b/server/src/test/java/com/metamx/druid/query/group/GroupByQueryRunnerTest.java index d9a6fea2c49..fc1e93c8720 100644 --- a/server/src/test/java/com/metamx/druid/query/group/GroupByQueryRunnerTest.java +++ b/server/src/test/java/com/metamx/druid/query/group/GroupByQueryRunnerTest.java @@ -31,26 +31,29 @@ import com.google.common.collect.Ordering; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; import com.metamx.druid.TestHelper; -import com.metamx.druid.aggregation.DoubleSumAggregatorFactory; -import com.metamx.druid.aggregation.LongSumAggregatorFactory; import com.metamx.druid.collect.StupidPool; import com.metamx.druid.input.MapBasedRow; import com.metamx.druid.input.Row; import com.metamx.druid.query.QueryRunnerTestHelper; -import com.metamx.druid.query.dimension.DefaultDimensionSpec; -import com.metamx.druid.query.dimension.DimensionSpec; -import com.metamx.druid.query.filter.RegexDimFilter; -import com.metamx.druid.query.group.having.EqualToHavingSpec; -import com.metamx.druid.query.group.having.GreaterThanHavingSpec; -import com.metamx.druid.query.group.having.OrHavingSpec; -import com.metamx.druid.query.group.orderby.DefaultLimitSpec; -import com.metamx.druid.query.group.orderby.LimitSpec; -import com.metamx.druid.query.group.orderby.OrderByColumnSpec; import io.druid.granularity.PeriodGranularity; import io.druid.granularity.QueryGranularity; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.query.aggregation.aggregation.DoubleSumAggregatorFactory; +import io.druid.query.aggregation.aggregation.LongSumAggregatorFactory; +import io.druid.query.dimension.DefaultDimensionSpec; +import io.druid.query.dimension.DimensionSpec; +import io.druid.query.filter.RegexDimFilter; +import io.druid.query.groupby.GroupByQuery; +import io.druid.query.groupby.GroupByQueryConfig; +import io.druid.query.groupby.GroupByQueryQueryToolChest; +import io.druid.query.groupby.having.EqualToHavingSpec; +import io.druid.query.groupby.having.GreaterThanHavingSpec; +import io.druid.query.groupby.having.OrHavingSpec; +import io.druid.query.groupby.orderby.DefaultLimitSpec; +import io.druid.query.groupby.orderby.LimitSpec; +import io.druid.query.groupby.orderby.OrderByColumnSpec; import io.druid.query.spec.MultipleIntervalSegmentSpec; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/server/src/test/java/com/metamx/druid/query/group/GroupByTimeseriesQueryRunnerTest.java b/server/src/test/java/com/metamx/druid/query/group/GroupByTimeseriesQueryRunnerTest.java index b8fe4b60d72..6fc14793192 100644 --- a/server/src/test/java/com/metamx/druid/query/group/GroupByTimeseriesQueryRunnerTest.java +++ b/server/src/test/java/com/metamx/druid/query/group/GroupByTimeseriesQueryRunnerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -29,12 +29,15 @@ import com.metamx.druid.collect.StupidPool; import com.metamx.druid.input.MapBasedRow; import com.metamx.druid.input.Row; import com.metamx.druid.query.QueryRunnerTestHelper; -import com.metamx.druid.query.timeseries.TimeseriesQuery; import com.metamx.druid.query.timeseries.TimeseriesQueryRunnerTest; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import io.druid.query.Query; import io.druid.query.QueryRunner; +import io.druid.query.Result; +import io.druid.query.groupby.GroupByQuery; +import io.druid.query.groupby.GroupByQueryConfig; +import io.druid.query.groupby.GroupByQueryQueryToolChest; +import io.druid.query.timeseries.TimeseriesQuery; +import io.druid.query.timeseries.TimeseriesResultValue; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/server/src/test/java/com/metamx/druid/query/metadata/SegmentAnalyzerTest.java b/server/src/test/java/com/metamx/druid/query/metadata/SegmentAnalyzerTest.java index 94f64540149..2125f9e5b8e 100644 --- a/server/src/test/java/com/metamx/druid/query/metadata/SegmentAnalyzerTest.java +++ b/server/src/test/java/com/metamx/druid/query/metadata/SegmentAnalyzerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,13 +21,16 @@ package com.metamx.druid.query.metadata; import com.google.common.collect.Lists; import com.metamx.common.guava.Sequences; -import com.metamx.druid.index.IncrementalIndexSegment; -import com.metamx.druid.index.QueryableIndexSegment; import com.metamx.druid.index.v1.TestIndex; import com.metamx.druid.query.QueryRunnerTestHelper; -import com.metamx.druid.query.segment.QuerySegmentSpecs; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; +import io.druid.query.metadata.metadata.ColumnAnalysis; +import io.druid.query.metadata.metadata.SegmentAnalysis; +import io.druid.query.metadata.metadata.SegmentMetadataQuery; +import io.druid.query.spec.QuerySegmentSpecs; +import io.druid.segment.IncrementalIndexSegment; +import io.druid.segment.QueryableIndexSegment; import io.druid.segment.Segment; import io.druid.segment.column.ValueType; import junit.framework.Assert; diff --git a/server/src/test/java/com/metamx/druid/query/search/SearchQueryRunnerTest.java b/server/src/test/java/com/metamx/druid/query/search/SearchQueryRunnerTest.java index b0512978b77..11adc434cc1 100644 --- a/server/src/test/java/com/metamx/druid/query/search/SearchQueryRunnerTest.java +++ b/server/src/test/java/com/metamx/druid/query/search/SearchQueryRunnerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -24,12 +24,17 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.metamx.common.guava.Sequences; -import com.metamx.druid.Druids; import com.metamx.druid.query.QueryRunnerTestHelper; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.SearchResultValue; +import io.druid.query.Druids; import io.druid.query.QueryRunner; +import io.druid.query.Result; +import io.druid.query.filter.DimFilter; +import io.druid.query.search.SearchQueryQueryToolChest; +import io.druid.query.search.SearchResultValue; +import io.druid.query.search.search.FragmentSearchQuerySpec; +import io.druid.query.search.search.SearchHit; +import io.druid.query.search.search.SearchQuery; +import io.druid.query.search.search.SearchQueryConfig; import org.joda.time.DateTime; import org.junit.Assert; import org.junit.Test; diff --git a/server/src/test/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java b/server/src/test/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java index ed45fee9508..03813081630 100644 --- a/server/src/test/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java +++ b/server/src/test/java/com/metamx/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,11 +21,12 @@ package com.metamx.druid.query.timeboundary; import com.google.common.collect.Lists; import com.metamx.common.guava.Sequences; -import com.metamx.druid.Druids; import com.metamx.druid.query.QueryRunnerTestHelper; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeBoundaryResultValue; +import io.druid.query.Druids; import io.druid.query.QueryRunner; +import io.druid.query.Result; +import io.druid.query.timeboundary.TimeBoundaryQuery; +import io.druid.query.timeboundary.TimeBoundaryResultValue; import org.joda.time.DateTime; import org.junit.Assert; import org.junit.Test; diff --git a/server/src/test/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerBonusTest.java b/server/src/test/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerBonusTest.java index 5325212d2f3..8636580489c 100644 --- a/server/src/test/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerBonusTest.java +++ b/server/src/test/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerBonusTest.java @@ -1,23 +1,43 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.query.timeseries; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.metamx.common.guava.Sequences; -import com.metamx.druid.Druids; -import com.metamx.druid.aggregation.CountAggregatorFactory; -import com.metamx.druid.index.IncrementalIndexSegment; -import com.metamx.druid.index.v1.IncrementalIndex; import com.metamx.druid.input.MapBasedInputRow; -import com.metamx.druid.query.FinalizeResultsQueryRunner; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import io.druid.granularity.QueryGranularity; +import io.druid.query.Druids; +import io.druid.query.FinalizeResultsQueryRunner; import io.druid.query.Query; import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; +import io.druid.query.Result; import io.druid.query.aggregation.AggregatorFactory; +import io.druid.query.aggregation.aggregation.CountAggregatorFactory; +import io.druid.query.timeseries.TimeseriesQuery; +import io.druid.query.timeseries.TimeseriesResultValue; +import io.druid.segment.IncrementalIndexSegment; import io.druid.segment.Segment; +import io.druid.segment.incremental.IncrementalIndex; import junit.framework.Assert; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/server/src/test/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerTest.java b/server/src/test/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerTest.java index 71824e90729..ceea3d448ab 100644 --- a/server/src/test/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerTest.java +++ b/server/src/test/java/com/metamx/druid/query/timeseries/TimeseriesQueryRunnerTest.java @@ -22,23 +22,24 @@ package com.metamx.druid.query.timeseries; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.metamx.common.guava.Sequences; -import com.metamx.druid.Druids; import com.metamx.druid.TestHelper; -import com.metamx.druid.aggregation.LongSumAggregatorFactory; -import com.metamx.druid.aggregation.MaxAggregatorFactory; -import com.metamx.druid.aggregation.MinAggregatorFactory; import com.metamx.druid.query.QueryRunnerTestHelper; -import com.metamx.druid.query.filter.AndDimFilter; -import com.metamx.druid.query.filter.DimFilter; -import com.metamx.druid.query.filter.RegexDimFilter; -import com.metamx.druid.result.Result; -import com.metamx.druid.result.TimeseriesResultValue; import io.druid.granularity.PeriodGranularity; import io.druid.granularity.QueryGranularity; +import io.druid.query.Druids; import io.druid.query.QueryRunner; +import io.druid.query.Result; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.PostAggregator; +import io.druid.query.aggregation.aggregation.LongSumAggregatorFactory; +import io.druid.query.aggregation.aggregation.MaxAggregatorFactory; +import io.druid.query.aggregation.aggregation.MinAggregatorFactory; +import io.druid.query.filter.AndDimFilter; +import io.druid.query.filter.DimFilter; +import io.druid.query.filter.RegexDimFilter; import io.druid.query.spec.MultipleIntervalSegmentSpec; +import io.druid.query.timeseries.TimeseriesQuery; +import io.druid.query.timeseries.TimeseriesResultValue; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.Interval; diff --git a/server/src/test/java/com/metamx/druid/utils/DruidMasterBalancerProfiler.java b/server/src/test/java/com/metamx/druid/utils/DruidMasterBalancerProfiler.java index 482274c0b28..e85cea29e34 100644 --- a/server/src/test/java/com/metamx/druid/utils/DruidMasterBalancerProfiler.java +++ b/server/src/test/java/com/metamx/druid/utils/DruidMasterBalancerProfiler.java @@ -1,21 +1,21 @@ /* -* 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. -*/ + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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.utils; @@ -25,8 +25,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.MinMaxPriorityQueue; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DruidServer; import com.metamx.druid.db.DatabaseRuleManager; import com.metamx.druid.master.DruidCluster; import com.metamx.druid.master.DruidMaster; @@ -42,9 +40,11 @@ import com.metamx.druid.master.SegmentReplicantLookup; import com.metamx.druid.master.ServerHolder; import com.metamx.druid.master.rules.PeriodLoadRule; import com.metamx.druid.master.rules.Rule; -import com.metamx.druid.shard.NoneShardSpec; import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceEmitter; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; +import io.druid.server.shard.shard.NoneShardSpec; import org.easymock.EasyMock; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/client/src/test/java/com/metamx/druid/client/DataSegmentTest.java b/server/src/test/java/io/druid/client/DataSegmentTest.java similarity index 97% rename from client/src/test/java/com/metamx/druid/client/DataSegmentTest.java rename to server/src/test/java/io/druid/client/DataSegmentTest.java index 7532aeb1424..fe327f353f0 100644 --- a/client/src/test/java/com/metamx/druid/client/DataSegmentTest.java +++ b/server/src/test/java/io/druid/client/DataSegmentTest.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -25,10 +25,10 @@ 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.index.v1.IndexIO; import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.shard.NoneShardSpec; -import com.metamx.druid.shard.SingleDimensionShardSpec; +import io.druid.segment.IndexIO; +import io.druid.server.shard.shard.NoneShardSpec; +import io.druid.server.shard.shard.SingleDimensionShardSpec; import org.joda.time.DateTime; import org.joda.time.Interval; import org.junit.Assert; diff --git a/client/src/test/java/com/metamx/druid/client/cache/ByteCountingLRUMapTest.java b/server/src/test/java/io/druid/client/cache/ByteCountingLRUMapTest.java similarity index 96% rename from client/src/test/java/com/metamx/druid/client/cache/ByteCountingLRUMapTest.java rename to server/src/test/java/io/druid/client/cache/ByteCountingLRUMapTest.java index fac858d2192..5edf6a669e6 100644 --- a/client/src/test/java/com/metamx/druid/client/cache/ByteCountingLRUMapTest.java +++ b/server/src/test/java/io/druid/client/cache/ByteCountingLRUMapTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import org.junit.Assert; import org.junit.Before; diff --git a/client/src/test/java/com/metamx/druid/client/cache/MapCacheTest.java b/server/src/test/java/io/druid/client/cache/MapCacheTest.java similarity index 96% rename from client/src/test/java/com/metamx/druid/client/cache/MapCacheTest.java rename to server/src/test/java/io/druid/client/cache/MapCacheTest.java index 23a3bd1d641..fbff6f9fe2f 100644 --- a/client/src/test/java/com/metamx/druid/client/cache/MapCacheTest.java +++ b/server/src/test/java/io/druid/client/cache/MapCacheTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import com.google.common.primitives.Ints; import org.junit.Assert; diff --git a/client/src/test/java/com/metamx/druid/client/cache/MemcachedCacheBenchmark.java b/server/src/test/java/io/druid/client/cache/MemcachedCacheBenchmark.java similarity index 81% rename from client/src/test/java/com/metamx/druid/client/cache/MemcachedCacheBenchmark.java rename to server/src/test/java/io/druid/client/cache/MemcachedCacheBenchmark.java index c63e98e8988..7ef6047d9ac 100644 --- a/client/src/test/java/com/metamx/druid/client/cache/MemcachedCacheBenchmark.java +++ b/server/src/test/java/io/druid/client/cache/MemcachedCacheBenchmark.java @@ -1,4 +1,23 @@ -package com.metamx.druid.client.cache; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.client.cache; import com.google.caliper.Param; import com.google.caliper.Runner; diff --git a/client/src/test/java/com/metamx/druid/client/cache/MemcachedCacheTest.java b/server/src/test/java/io/druid/client/cache/MemcachedCacheTest.java similarity index 99% rename from client/src/test/java/com/metamx/druid/client/cache/MemcachedCacheTest.java rename to server/src/test/java/io/druid/client/cache/MemcachedCacheTest.java index 23ca0ea9693..55c85f967f0 100644 --- a/client/src/test/java/com/metamx/druid/client/cache/MemcachedCacheTest.java +++ b/server/src/test/java/io/druid/client/cache/MemcachedCacheTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.cache; +package io.druid.client.cache; import com.google.common.collect.Lists; import com.google.common.collect.Maps; diff --git a/client/src/test/java/com/metamx/druid/client/BatchServerInventoryViewTest.java b/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java similarity index 90% rename from client/src/test/java/com/metamx/druid/client/BatchServerInventoryViewTest.java rename to server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java index bb7bc307808..5b0b08b2c05 100644 --- a/client/src/test/java/com/metamx/druid/client/BatchServerInventoryViewTest.java +++ b/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client; +package io.druid.client.client; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Joiner; @@ -26,13 +26,16 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Sets; import com.google.common.util.concurrent.MoreExecutors; import com.metamx.common.ISE; -import com.metamx.druid.coordination.BatchDataSegmentAnnouncer; -import com.metamx.druid.coordination.DruidServerMetadata; -import com.metamx.druid.curator.PotentiallyGzippedCompressionProvider; -import com.metamx.druid.curator.announcement.Announcer; -import com.metamx.druid.initialization.BatchDataSegmentAnnouncerConfig; -import com.metamx.druid.initialization.ZkPathsConfig; import com.metamx.druid.jackson.DefaultObjectMapper; +import io.druid.client.BatchServerInventoryView; +import io.druid.client.DataSegment; +import io.druid.client.DruidServer; +import io.druid.curator.PotentiallyGzippedCompressionProvider; +import io.druid.curator.announcement.Announcer; +import io.druid.server.coordination.BatchDataSegmentAnnouncer; +import io.druid.server.coordination.DruidServerMetadata; +import io.druid.server.initialization.initialization.BatchDataSegmentAnnouncerConfig; +import io.druid.server.initialization.initialization.ZkPathsConfig; import junit.framework.Assert; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; diff --git a/client/src/test/java/com/metamx/druid/client/selector/ServerSelectorTest.java b/server/src/test/java/io/druid/client/selector/ServerSelectorTest.java similarity index 90% rename from client/src/test/java/com/metamx/druid/client/selector/ServerSelectorTest.java rename to server/src/test/java/io/druid/client/selector/ServerSelectorTest.java index 9009ec3d246..315f53690df 100644 --- a/client/src/test/java/com/metamx/druid/client/selector/ServerSelectorTest.java +++ b/server/src/test/java/io/druid/client/selector/ServerSelectorTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,22 +17,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.client.selector; +package io.druid.client.selector; import com.fasterxml.jackson.dataformat.smile.SmileFactory; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.util.concurrent.SettableFuture; -import com.metamx.druid.Druids; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.client.DirectDruidClient; import com.metamx.druid.jackson.DefaultObjectMapper; -import com.metamx.druid.query.ReflectionQueryToolChestWarehouse; -import com.metamx.druid.query.timeboundary.TimeBoundaryQuery; -import com.metamx.druid.shard.NoneShardSpec; import com.metamx.http.client.HttpClient; import com.metamx.http.client.Request; import com.metamx.http.client.RequestBuilder; +import io.druid.client.DataSegment; +import io.druid.client.DirectDruidClient; +import io.druid.query.Druids; +import io.druid.query.ReflectionQueryToolChestWarehouse; +import io.druid.query.timeboundary.TimeBoundaryQuery; +import io.druid.server.shard.shard.NoneShardSpec; import junit.framework.Assert; import org.easymock.EasyMock; import org.jboss.netty.handler.codec.http.HttpMethod; diff --git a/client/src/test/java/com/metamx/druid/curator/CuratorTestBase.java b/server/src/test/java/io/druid/curator/CuratorTestBase.java similarity index 54% rename from client/src/test/java/com/metamx/druid/curator/CuratorTestBase.java rename to server/src/test/java/io/druid/curator/CuratorTestBase.java index dcc0cfda60e..a850d756ea3 100644 --- a/client/src/test/java/com/metamx/druid/curator/CuratorTestBase.java +++ b/server/src/test/java/io/druid/curator/CuratorTestBase.java @@ -1,4 +1,23 @@ -package com.metamx.druid.curator; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.curator; import com.google.common.io.Closeables; import org.apache.curator.framework.CuratorFramework; diff --git a/client/src/test/java/com/metamx/druid/curator/announcement/AnnouncerTest.java b/server/src/test/java/io/druid/curator/announcement/AnnouncerTest.java similarity index 98% rename from client/src/test/java/com/metamx/druid/curator/announcement/AnnouncerTest.java rename to server/src/test/java/io/druid/curator/announcement/AnnouncerTest.java index c8c21cc52a6..9321385a711 100644 --- a/client/src/test/java/com/metamx/druid/curator/announcement/AnnouncerTest.java +++ b/server/src/test/java/io/druid/curator/announcement/AnnouncerTest.java @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.curator.announcement; +package io.druid.curator.announcement; import com.google.common.collect.Sets; import com.metamx.druid.concurrent.Execs; -import com.metamx.druid.curator.CuratorTestBase; +import io.druid.curator.CuratorTestBase; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.api.CuratorEventType; diff --git a/client/src/test/java/com/metamx/druid/curator/inventory/CuratorInventoryManagerTest.java b/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java similarity index 88% rename from client/src/test/java/com/metamx/druid/curator/inventory/CuratorInventoryManagerTest.java rename to server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java index da72db06048..548b1c7e5c9 100644 --- a/client/src/test/java/com/metamx/druid/curator/inventory/CuratorInventoryManagerTest.java +++ b/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java @@ -1,10 +1,28 @@ -package com.metamx.druid.curator.inventory; +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.curator.inventory; import com.google.common.collect.Iterables; import com.google.common.collect.Maps; import com.google.common.primitives.Ints; import com.metamx.druid.concurrent.Execs; -import com.metamx.druid.curator.CuratorTestBase; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.api.CuratorEventType; @@ -21,7 +39,7 @@ import java.util.concurrent.ExecutorService; /** */ -public class CuratorInventoryManagerTest extends CuratorTestBase +public class CuratorInventoryManagerTest extends io.druid.curator.CuratorTestBase { private ExecutorService exec; diff --git a/client/src/test/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncerTest.java b/server/src/test/java/io/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java similarity index 92% rename from client/src/test/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncerTest.java rename to server/src/test/java/io/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java index f8d7abed828..1ba6f13c15f 100644 --- a/client/src/test/java/com/metamx/druid/coordination/BatchDataSegmentAnnouncerTest.java +++ b/server/src/test/java/io/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.coordination; +package io.druid.server.coordination.coordination; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -25,12 +25,14 @@ import com.google.common.base.Joiner; import com.google.common.base.Throwables; import com.google.common.collect.Sets; import com.google.common.util.concurrent.MoreExecutors; -import com.metamx.druid.client.DataSegment; -import com.metamx.druid.curator.PotentiallyGzippedCompressionProvider; -import com.metamx.druid.curator.announcement.Announcer; -import com.metamx.druid.initialization.BatchDataSegmentAnnouncerConfig; -import com.metamx.druid.initialization.ZkPathsConfig; import com.metamx.druid.jackson.DefaultObjectMapper; +import io.druid.client.DataSegment; +import io.druid.curator.PotentiallyGzippedCompressionProvider; +import io.druid.curator.announcement.Announcer; +import io.druid.server.coordination.BatchDataSegmentAnnouncer; +import io.druid.server.coordination.DruidServerMetadata; +import io.druid.server.initialization.initialization.BatchDataSegmentAnnouncerConfig; +import io.druid.server.initialization.initialization.ZkPathsConfig; import junit.framework.Assert; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; diff --git a/client/src/test/java/com/metamx/druid/shard/NumberedShardSpecTest.java b/server/src/test/java/io/druid/server/shard/shard/NumberedShardSpecTest.java similarity index 97% rename from client/src/test/java/com/metamx/druid/shard/NumberedShardSpecTest.java rename to server/src/test/java/io/druid/server/shard/shard/NumberedShardSpecTest.java index 15a9c898922..1fc9d01bf87 100644 --- a/client/src/test/java/com/metamx/druid/shard/NumberedShardSpecTest.java +++ b/server/src/test/java/io/druid/server/shard/shard/NumberedShardSpecTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.shard; +package io.druid.server.shard.shard; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Function; diff --git a/client/src/test/java/com/metamx/druid/shard/SingleDimensionShardSpecTest.java b/server/src/test/java/io/druid/server/shard/shard/SingleDimensionShardSpecTest.java similarity index 97% rename from client/src/test/java/com/metamx/druid/shard/SingleDimensionShardSpecTest.java rename to server/src/test/java/io/druid/server/shard/shard/SingleDimensionShardSpecTest.java index 217b18d9be7..a5a9b79e89f 100644 --- a/client/src/test/java/com/metamx/druid/shard/SingleDimensionShardSpecTest.java +++ b/server/src/test/java/io/druid/server/shard/shard/SingleDimensionShardSpecTest.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package com.metamx.druid.shard; +package io.druid.server.shard.shard; import com.google.common.base.Function; import com.google.common.base.Preconditions; @@ -31,7 +31,6 @@ 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/services/src/main/java/io/druid/cli/CliBroker.java b/services/src/main/java/io/druid/cli/CliBroker.java index 14339320320..3c40c24f14b 100644 --- a/services/src/main/java/io/druid/cli/CliBroker.java +++ b/services/src/main/java/io/druid/cli/CliBroker.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,23 +21,23 @@ package io.druid.cli; import com.google.inject.Injector; import com.metamx.common.logger.Logger; -import com.metamx.druid.client.cache.CacheMonitor; -import com.metamx.druid.curator.CuratorModule; -import com.metamx.druid.guice.BrokerModule; -import com.metamx.druid.guice.HttpClientModule; -import com.metamx.druid.guice.LifecycleModule; -import com.metamx.druid.guice.QueryToolChestModule; -import com.metamx.druid.guice.QueryableModule; -import com.metamx.druid.guice.ServerModule; -import com.metamx.druid.guice.ServerViewModule; -import com.metamx.druid.guice.annotations.Client; -import com.metamx.druid.http.ClientQuerySegmentWalker; -import com.metamx.druid.http.StatusResource; -import com.metamx.druid.initialization.EmitterModule; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.JettyServerModule; import com.metamx.druid.metrics.MetricsModule; import io.airlift.command.Command; +import io.druid.client.cache.CacheMonitor; +import io.druid.curator.CuratorModule; +import io.druid.guice.QueryToolChestModule; +import io.druid.guice.guice.BrokerModule; +import io.druid.guice.guice.HttpClientModule; +import io.druid.guice.guice.LifecycleModule; +import io.druid.guice.guice.QueryableModule; +import io.druid.guice.guice.ServerModule; +import io.druid.guice.guice.ServerViewModule; +import io.druid.guice.guice.annotations.Client; +import io.druid.server.ClientQuerySegmentWalker; +import io.druid.server.StatusResource; +import io.druid.server.initialization.initialization.EmitterModule; +import io.druid.server.initialization.initialization.Initialization; +import io.druid.server.initialization.initialization.JettyServerModule; /** */ diff --git a/services/src/main/java/io/druid/cli/CliCoordinator.java b/services/src/main/java/io/druid/cli/CliCoordinator.java index f8466abf057..2231fe39517 100644 --- a/services/src/main/java/io/druid/cli/CliCoordinator.java +++ b/services/src/main/java/io/druid/cli/CliCoordinator.java @@ -1,30 +1,49 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.cli; import com.google.inject.Injector; import com.google.inject.servlet.GuiceFilter; import com.metamx.common.logger.Logger; -import com.metamx.druid.curator.CuratorModule; -import com.metamx.druid.curator.discovery.DiscoveryModule; -import com.metamx.druid.guice.CoordinatorModule; -import com.metamx.druid.guice.DbConnectorModule; -import com.metamx.druid.guice.HttpClientModule; -import com.metamx.druid.guice.IndexingServiceDiscoveryModule; -import com.metamx.druid.guice.JacksonConfigManagerModule; -import com.metamx.druid.guice.LifecycleModule; -import com.metamx.druid.guice.ServerModule; -import com.metamx.druid.guice.ServerViewModule; -import com.metamx.druid.guice.annotations.Self; -import com.metamx.druid.http.InfoResource; -import com.metamx.druid.http.MasterResource; -import com.metamx.druid.http.RedirectFilter; -import com.metamx.druid.http.StatusResource; -import com.metamx.druid.initialization.EmitterModule; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.JettyServerInitializer; -import com.metamx.druid.initialization.JettyServerModule; import com.metamx.druid.master.DruidMaster; import com.metamx.druid.metrics.MetricsModule; import io.airlift.command.Command; +import io.druid.curator.CuratorModule; +import io.druid.curator.discovery.DiscoveryModule; +import io.druid.guice.guice.CoordinatorModule; +import io.druid.guice.guice.DbConnectorModule; +import io.druid.guice.guice.HttpClientModule; +import io.druid.guice.guice.IndexingServiceDiscoveryModule; +import io.druid.guice.guice.JacksonConfigManagerModule; +import io.druid.guice.guice.LifecycleModule; +import io.druid.guice.guice.ServerModule; +import io.druid.guice.guice.ServerViewModule; +import io.druid.guice.guice.annotations.Self; +import io.druid.server.StatusResource; +import io.druid.server.http.InfoResource; +import io.druid.server.http.MasterResource; +import io.druid.server.http.RedirectFilter; +import io.druid.server.initialization.initialization.EmitterModule; +import io.druid.server.initialization.initialization.Initialization; +import io.druid.server.initialization.initialization.JettyServerInitializer; +import io.druid.server.initialization.initialization.JettyServerModule; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.DefaultHandler; diff --git a/services/src/main/java/io/druid/cli/CliHistorical.java b/services/src/main/java/io/druid/cli/CliHistorical.java index 2f8d521d5be..fef6ef57385 100644 --- a/services/src/main/java/io/druid/cli/CliHistorical.java +++ b/services/src/main/java/io/druid/cli/CliHistorical.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -23,25 +23,25 @@ import com.google.inject.Injector; import com.metamx.common.logger.Logger; import com.metamx.druid.coordination.ServerManager; import com.metamx.druid.coordination.ZkCoordinator; -import com.metamx.druid.curator.CuratorModule; -import com.metamx.druid.guice.AWSModule; -import com.metamx.druid.guice.AnnouncerModule; -import com.metamx.druid.guice.DataSegmentPullerModule; -import com.metamx.druid.guice.DruidProcessingModule; -import com.metamx.druid.guice.HistoricalModule; -import com.metamx.druid.guice.HttpClientModule; -import com.metamx.druid.guice.LifecycleModule; -import com.metamx.druid.guice.QueryRunnerFactoryModule; -import com.metamx.druid.guice.QueryableModule; -import com.metamx.druid.guice.ServerModule; -import com.metamx.druid.guice.StorageNodeModule; -import com.metamx.druid.http.StatusResource; -import com.metamx.druid.initialization.EmitterModule; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.JettyServerModule; import com.metamx.druid.metrics.MetricsModule; import com.metamx.druid.metrics.ServerMonitor; import io.airlift.command.Command; +import io.druid.curator.CuratorModule; +import io.druid.guice.guice.AWSModule; +import io.druid.guice.guice.AnnouncerModule; +import io.druid.guice.guice.DataSegmentPullerModule; +import io.druid.guice.guice.DruidProcessingModule; +import io.druid.guice.guice.HistoricalModule; +import io.druid.guice.guice.HttpClientModule; +import io.druid.guice.guice.LifecycleModule; +import io.druid.guice.guice.QueryRunnerFactoryModule; +import io.druid.guice.guice.QueryableModule; +import io.druid.guice.guice.ServerModule; +import io.druid.guice.guice.StorageNodeModule; +import io.druid.server.StatusResource; +import io.druid.server.initialization.initialization.EmitterModule; +import io.druid.server.initialization.initialization.Initialization; +import io.druid.server.initialization.initialization.JettyServerModule; /** */ diff --git a/services/src/main/java/io/druid/cli/CliMiddleManager.java b/services/src/main/java/io/druid/cli/CliMiddleManager.java index 513600f0b10..1c9cac9cffe 100644 --- a/services/src/main/java/io/druid/cli/CliMiddleManager.java +++ b/services/src/main/java/io/druid/cli/CliMiddleManager.java @@ -1,24 +1,43 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.cli; import com.google.inject.Injector; import com.google.inject.servlet.GuiceFilter; import com.metamx.common.logger.Logger; -import com.metamx.druid.curator.CuratorModule; -import com.metamx.druid.guice.AWSModule; -import com.metamx.druid.guice.HttpClientModule; -import com.metamx.druid.guice.LifecycleModule; -import com.metamx.druid.guice.MiddleManagerModule; -import com.metamx.druid.guice.ServerModule; -import com.metamx.druid.guice.TaskLogsModule; -import com.metamx.druid.http.StatusResource; import com.metamx.druid.indexing.worker.WorkerTaskMonitor; import com.metamx.druid.indexing.worker.http.WorkerResource; -import com.metamx.druid.initialization.EmitterModule; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.JettyServerInitializer; -import com.metamx.druid.initialization.JettyServerModule; import com.metamx.druid.metrics.MetricsModule; import io.airlift.command.Command; +import io.druid.curator.CuratorModule; +import io.druid.guice.guice.AWSModule; +import io.druid.guice.guice.HttpClientModule; +import io.druid.guice.guice.LifecycleModule; +import io.druid.guice.guice.MiddleManagerModule; +import io.druid.guice.guice.ServerModule; +import io.druid.guice.guice.TaskLogsModule; +import io.druid.server.StatusResource; +import io.druid.server.initialization.initialization.EmitterModule; +import io.druid.server.initialization.initialization.Initialization; +import io.druid.server.initialization.initialization.JettyServerInitializer; +import io.druid.server.initialization.initialization.JettyServerModule; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.DefaultHandler; diff --git a/services/src/main/java/io/druid/cli/CliOverlord.java b/services/src/main/java/io/druid/cli/CliOverlord.java index 46bc734138d..298e06edb4b 100644 --- a/services/src/main/java/io/druid/cli/CliOverlord.java +++ b/services/src/main/java/io/druid/cli/CliOverlord.java @@ -22,26 +22,26 @@ package io.druid.cli; import com.google.inject.Injector; import com.google.inject.servlet.GuiceFilter; import com.metamx.common.logger.Logger; -import com.metamx.druid.curator.CuratorModule; -import com.metamx.druid.curator.discovery.DiscoveryModule; -import com.metamx.druid.guice.AWSModule; -import com.metamx.druid.guice.DbConnectorModule; -import com.metamx.druid.guice.HttpClientModule; -import com.metamx.druid.guice.JacksonConfigManagerModule; -import com.metamx.druid.guice.LifecycleModule; -import com.metamx.druid.guice.OverlordModule; -import com.metamx.druid.guice.ServerModule; -import com.metamx.druid.guice.TaskLogsModule; -import com.metamx.druid.http.RedirectFilter; -import com.metamx.druid.http.StatusResource; import com.metamx.druid.indexing.coordinator.TaskMaster; import com.metamx.druid.indexing.coordinator.http.IndexerCoordinatorResource; -import com.metamx.druid.initialization.EmitterModule; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.JettyServerInitializer; -import com.metamx.druid.initialization.JettyServerModule; import com.metamx.druid.metrics.MetricsModule; import io.airlift.command.Command; +import io.druid.curator.CuratorModule; +import io.druid.curator.discovery.DiscoveryModule; +import io.druid.guice.guice.AWSModule; +import io.druid.guice.guice.DbConnectorModule; +import io.druid.guice.guice.HttpClientModule; +import io.druid.guice.guice.JacksonConfigManagerModule; +import io.druid.guice.guice.LifecycleModule; +import io.druid.guice.guice.OverlordModule; +import io.druid.guice.guice.ServerModule; +import io.druid.guice.guice.TaskLogsModule; +import io.druid.server.StatusResource; +import io.druid.server.http.RedirectFilter; +import io.druid.server.initialization.initialization.EmitterModule; +import io.druid.server.initialization.initialization.Initialization; +import io.druid.server.initialization.initialization.JettyServerInitializer; +import io.druid.server.initialization.initialization.JettyServerModule; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.DefaultHandler; diff --git a/services/src/main/java/io/druid/cli/CliPeon.java b/services/src/main/java/io/druid/cli/CliPeon.java index 167c019c075..d424dd5344e 100644 --- a/services/src/main/java/io/druid/cli/CliPeon.java +++ b/services/src/main/java/io/druid/cli/CliPeon.java @@ -23,34 +23,34 @@ import com.google.common.base.Throwables; import com.google.inject.Injector; import com.metamx.common.lifecycle.Lifecycle; import com.metamx.common.logger.Logger; -import com.metamx.druid.curator.CuratorModule; -import com.metamx.druid.curator.discovery.DiscoveryModule; -import com.metamx.druid.guice.AWSModule; -import com.metamx.druid.guice.AnnouncerModule; -import com.metamx.druid.guice.DataSegmentPusherModule; -import com.metamx.druid.guice.DruidProcessingModule; -import com.metamx.druid.guice.HttpClientModule; -import com.metamx.druid.guice.IndexingServiceDiscoveryModule; -import com.metamx.druid.guice.LifecycleModule; -import com.metamx.druid.guice.PeonModule; -import com.metamx.druid.guice.QueryRunnerFactoryModule; -import com.metamx.druid.guice.QueryableModule; -import com.metamx.druid.guice.ServerModule; -import com.metamx.druid.guice.ServerViewModule; -import com.metamx.druid.guice.StorageNodeModule; -import com.metamx.druid.http.StatusResource; import com.metamx.druid.indexing.coordinator.ThreadPoolTaskRunner; import com.metamx.druid.indexing.worker.executor.ChatHandlerResource; import com.metamx.druid.indexing.worker.executor.ExecutorLifecycle; import com.metamx.druid.indexing.worker.executor.ExecutorLifecycleConfig; -import com.metamx.druid.initialization.EmitterModule; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.JettyServerModule; import com.metamx.druid.log.LogLevelAdjuster; import com.metamx.druid.metrics.MetricsModule; import io.airlift.command.Arguments; import io.airlift.command.Command; import io.airlift.command.Option; +import io.druid.curator.CuratorModule; +import io.druid.curator.discovery.DiscoveryModule; +import io.druid.guice.guice.AWSModule; +import io.druid.guice.guice.AnnouncerModule; +import io.druid.guice.guice.DataSegmentPusherModule; +import io.druid.guice.guice.DruidProcessingModule; +import io.druid.guice.guice.HttpClientModule; +import io.druid.guice.guice.IndexingServiceDiscoveryModule; +import io.druid.guice.guice.LifecycleModule; +import io.druid.guice.guice.PeonModule; +import io.druid.guice.guice.QueryRunnerFactoryModule; +import io.druid.guice.guice.QueryableModule; +import io.druid.guice.guice.ServerModule; +import io.druid.guice.guice.ServerViewModule; +import io.druid.guice.guice.StorageNodeModule; +import io.druid.server.StatusResource; +import io.druid.server.initialization.initialization.EmitterModule; +import io.druid.server.initialization.initialization.Initialization; +import io.druid.server.initialization.initialization.JettyServerModule; import java.io.File; import java.util.List; diff --git a/services/src/main/java/io/druid/cli/CliRealtime.java b/services/src/main/java/io/druid/cli/CliRealtime.java index 080397a1a76..e5c5c7a6fe0 100644 --- a/services/src/main/java/io/druid/cli/CliRealtime.java +++ b/services/src/main/java/io/druid/cli/CliRealtime.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,27 +21,27 @@ package io.druid.cli; import com.google.inject.Injector; import com.metamx.common.logger.Logger; -import com.metamx.druid.curator.CuratorModule; -import com.metamx.druid.guice.AWSModule; -import com.metamx.druid.guice.AnnouncerModule; -import com.metamx.druid.guice.DataSegmentPusherModule; -import com.metamx.druid.guice.DbConnectorModule; -import com.metamx.druid.guice.DruidProcessingModule; -import com.metamx.druid.guice.HttpClientModule; -import com.metamx.druid.guice.LifecycleModule; -import com.metamx.druid.guice.QueryRunnerFactoryModule; -import com.metamx.druid.guice.QueryableModule; -import com.metamx.druid.guice.RealtimeModule; -import com.metamx.druid.guice.ServerModule; -import com.metamx.druid.guice.ServerViewModule; -import com.metamx.druid.guice.StorageNodeModule; -import com.metamx.druid.http.StatusResource; -import com.metamx.druid.initialization.EmitterModule; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.JettyServerModule; import com.metamx.druid.metrics.MetricsModule; import com.metamx.druid.realtime.RealtimeManager; import io.airlift.command.Command; +import io.druid.curator.CuratorModule; +import io.druid.guice.guice.AWSModule; +import io.druid.guice.guice.AnnouncerModule; +import io.druid.guice.guice.DataSegmentPusherModule; +import io.druid.guice.guice.DbConnectorModule; +import io.druid.guice.guice.DruidProcessingModule; +import io.druid.guice.guice.HttpClientModule; +import io.druid.guice.guice.LifecycleModule; +import io.druid.guice.guice.QueryRunnerFactoryModule; +import io.druid.guice.guice.QueryableModule; +import io.druid.guice.guice.RealtimeModule; +import io.druid.guice.guice.ServerModule; +import io.druid.guice.guice.ServerViewModule; +import io.druid.guice.guice.StorageNodeModule; +import io.druid.server.StatusResource; +import io.druid.server.initialization.initialization.EmitterModule; +import io.druid.server.initialization.initialization.Initialization; +import io.druid.server.initialization.initialization.JettyServerModule; /** */ diff --git a/services/src/main/java/io/druid/cli/CliRealtimeExample.java b/services/src/main/java/io/druid/cli/CliRealtimeExample.java index 1a6f9f97381..0796dda3b04 100644 --- a/services/src/main/java/io/druid/cli/CliRealtimeExample.java +++ b/services/src/main/java/io/druid/cli/CliRealtimeExample.java @@ -1,6 +1,6 @@ /* * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. + * Copyright (C) 2012, 2013 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 @@ -21,19 +21,19 @@ package io.druid.cli; import com.google.inject.Injector; import com.metamx.common.logger.Logger; -import com.metamx.druid.guice.DruidProcessingModule; -import com.metamx.druid.guice.LifecycleModule; -import com.metamx.druid.guice.QueryRunnerFactoryModule; -import com.metamx.druid.guice.QueryableModule; -import com.metamx.druid.guice.ServerModule; -import com.metamx.druid.guice.StorageNodeModule; -import com.metamx.druid.http.StatusResource; -import com.metamx.druid.initialization.EmitterModule; -import com.metamx.druid.initialization.Initialization; -import com.metamx.druid.initialization.JettyServerModule; import com.metamx.druid.realtime.RealtimeManager; import druid.examples.guice.RealtimeExampleModule; import io.airlift.command.Command; +import io.druid.guice.guice.DruidProcessingModule; +import io.druid.guice.guice.LifecycleModule; +import io.druid.guice.guice.QueryRunnerFactoryModule; +import io.druid.guice.guice.QueryableModule; +import io.druid.guice.guice.ServerModule; +import io.druid.guice.guice.StorageNodeModule; +import io.druid.server.StatusResource; +import io.druid.server.initialization.initialization.EmitterModule; +import io.druid.server.initialization.initialization.Initialization; +import io.druid.server.initialization.initialization.JettyServerModule; /** */ diff --git a/services/src/main/java/io/druid/cli/QueryJettyServerInitializer.java b/services/src/main/java/io/druid/cli/QueryJettyServerInitializer.java index 78ea25219e1..0e7fc170a1f 100644 --- a/services/src/main/java/io/druid/cli/QueryJettyServerInitializer.java +++ b/services/src/main/java/io/druid/cli/QueryJettyServerInitializer.java @@ -1,9 +1,28 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 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 io.druid.cli; import com.google.inject.Injector; import com.google.inject.servlet.GuiceFilter; -import com.metamx.druid.http.QueryServlet; -import com.metamx.druid.initialization.JettyServerInitializer; +import io.druid.server.QueryServlet; +import io.druid.server.initialization.initialization.JettyServerInitializer; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.DefaultHandler;