diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index 271da141b67..21352a20d3f 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -30,6 +30,7 @@ + diff --git a/extendedset/src/main/java/io/druid/extendedset/intset/AbstractIntSet.java b/extendedset/src/main/java/io/druid/extendedset/intset/AbstractIntSet.java index 48805215ee1..93066c918e7 100755 --- a/extendedset/src/main/java/io/druid/extendedset/intset/AbstractIntSet.java +++ b/extendedset/src/main/java/io/druid/extendedset/intset/AbstractIntSet.java @@ -612,10 +612,10 @@ public abstract class AbstractIntSet implements IntSet return 1; } - /* + /* * Compute the sum of binomial coefficients ranging from (size choose - * max) to (size choose min) using dynamic programming - */ + * max) to (size choose min) using dynamic programming + */ // trivial cases max = Math.min(size, max); diff --git a/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDataSegmentPusher.java b/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDataSegmentPusher.java index 790f655e73a..973de429755 100644 --- a/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDataSegmentPusher.java +++ b/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDataSegmentPusher.java @@ -44,19 +44,19 @@ import java.io.IOException; */ public class CassandraDataSegmentPusher extends CassandraStorage implements DataSegmentPusher { - private static final Logger log = new Logger(CassandraDataSegmentPusher.class); - private static final int CONCURRENCY = 10; - private static final Joiner JOINER = Joiner.on("/").skipNulls(); - private final ObjectMapper jsonMapper; + private static final Logger log = new Logger(CassandraDataSegmentPusher.class); + private static final int CONCURRENCY = 10; + private static final Joiner JOINER = Joiner.on("/").skipNulls(); + private final ObjectMapper jsonMapper; @Inject - public CassandraDataSegmentPusher( - CassandraDataSegmentConfig config, - ObjectMapper jsonMapper) - { - super(config); - this.jsonMapper=jsonMapper; - } + public CassandraDataSegmentPusher( + CassandraDataSegmentConfig config, + ObjectMapper jsonMapper) + { + super(config); + this.jsonMapper=jsonMapper; + } @Override public String getPathForHadoop() @@ -77,41 +77,41 @@ public class CassandraDataSegmentPusher extends CassandraStorage implements Data log.info("Writing [%s] to C*", indexFilesDir); String key = JOINER.join( config.getKeyspace().isEmpty() ? null : config.getKeyspace(), - DataSegmentPusherUtil.getStorageDir(segment) - ); + DataSegmentPusherUtil.getStorageDir(segment) + ); - // Create index - final File compressedIndexFile = File.createTempFile("druid", "index.zip"); - long indexSize = CompressionUtils.zip(indexFilesDir, compressedIndexFile); - log.info("Wrote compressed file [%s] to [%s]", compressedIndexFile.getAbsolutePath(), key); + // Create index + final File compressedIndexFile = File.createTempFile("druid", "index.zip"); + long indexSize = CompressionUtils.zip(indexFilesDir, compressedIndexFile); + log.info("Wrote compressed file [%s] to [%s]", compressedIndexFile.getAbsolutePath(), key); - int version = SegmentUtils.getVersionFromDir(indexFilesDir); + int version = SegmentUtils.getVersionFromDir(indexFilesDir); - try - { - long start = System.currentTimeMillis(); - ChunkedStorage.newWriter(indexStorage, key, new FileInputStream(compressedIndexFile)) - .withConcurrencyLevel(CONCURRENCY).call(); - byte[] json = jsonMapper.writeValueAsBytes(segment); - MutationBatch mutation = this.keyspace.prepareMutationBatch(); + try + { + long start = System.currentTimeMillis(); + ChunkedStorage.newWriter(indexStorage, key, new FileInputStream(compressedIndexFile)) + .withConcurrencyLevel(CONCURRENCY).call(); + byte[] json = jsonMapper.writeValueAsBytes(segment); + MutationBatch mutation = this.keyspace.prepareMutationBatch(); mutation.withRow(descriptorStorage, key) - .putColumn("lastmodified", System.currentTimeMillis(), null) - .putColumn("descriptor", json, null); + .putColumn("lastmodified", System.currentTimeMillis(), null) + .putColumn("descriptor", json, null); mutation.execute(); - log.info("Wrote index to C* in [%s] ms", System.currentTimeMillis() - start); - } catch (Exception e) - { - throw new IOException(e); - } + log.info("Wrote index to C* in [%s] ms", System.currentTimeMillis() - start); + } catch (Exception e) + { + throw new IOException(e); + } - segment = segment.withSize(indexSize) - .withLoadSpec( - ImmutableMap. of("type", "c*", "key", key) - ) - .withBinaryVersion(version); + segment = segment.withSize(indexSize) + .withLoadSpec( + ImmutableMap. of("type", "c*", "key", key) + ) + .withBinaryVersion(version); - log.info("Deleting zipped index File[%s]", compressedIndexFile); - compressedIndexFile.delete(); - return segment; - } + log.info("Deleting zipped index File[%s]", compressedIndexFile); + compressedIndexFile.delete(); + return segment; + } } diff --git a/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraStorage.java b/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraStorage.java index af8e5038536..24938117a59 100644 --- a/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraStorage.java +++ b/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraStorage.java @@ -41,32 +41,32 @@ import com.netflix.astyanax.thrift.ThriftFamilyFactory; */ public class CassandraStorage { - private static final String CLUSTER_NAME = "druid_cassandra_cluster"; - private static final String INDEX_TABLE_NAME = "index_storage"; - private static final String DESCRIPTOR_TABLE_NAME = "descriptor_storage"; + private static final String CLUSTER_NAME = "druid_cassandra_cluster"; + private static final String INDEX_TABLE_NAME = "index_storage"; + private static final String DESCRIPTOR_TABLE_NAME = "descriptor_storage"; - private AstyanaxContext astyanaxContext; - final Keyspace keyspace; - final ChunkedStorageProvider indexStorage; - final ColumnFamily descriptorStorage; - final CassandraDataSegmentConfig config; + private AstyanaxContext astyanaxContext; + final Keyspace keyspace; + final ChunkedStorageProvider indexStorage; + final ColumnFamily descriptorStorage; + final CassandraDataSegmentConfig config; - public CassandraStorage(CassandraDataSegmentConfig config) - { - this.astyanaxContext = new AstyanaxContext.Builder() - .forCluster(CLUSTER_NAME) - .forKeyspace(config.getKeyspace()) - .withAstyanaxConfiguration(new AstyanaxConfigurationImpl().setDiscoveryType(NodeDiscoveryType.NONE)) - .withConnectionPoolConfiguration( - new ConnectionPoolConfigurationImpl("MyConnectionPool").setMaxConnsPerHost(10) - .setSeeds(config.getHost())).withConnectionPoolMonitor(new CountingConnectionPoolMonitor()) - .buildKeyspace(ThriftFamilyFactory.getInstance()); - this.astyanaxContext.start(); - this.keyspace = this.astyanaxContext.getEntity(); - this.config = config; - indexStorage = new CassandraChunkedStorageProvider(keyspace, INDEX_TABLE_NAME); + public CassandraStorage(CassandraDataSegmentConfig config) + { + this.astyanaxContext = new AstyanaxContext.Builder() + .forCluster(CLUSTER_NAME) + .forKeyspace(config.getKeyspace()) + .withAstyanaxConfiguration(new AstyanaxConfigurationImpl().setDiscoveryType(NodeDiscoveryType.NONE)) + .withConnectionPoolConfiguration( + new ConnectionPoolConfigurationImpl("MyConnectionPool").setMaxConnsPerHost(10) + .setSeeds(config.getHost())).withConnectionPoolMonitor(new CountingConnectionPoolMonitor()) + .buildKeyspace(ThriftFamilyFactory.getInstance()); + this.astyanaxContext.start(); + this.keyspace = this.astyanaxContext.getEntity(); + this.config = config; + indexStorage = new CassandraChunkedStorageProvider(keyspace, INDEX_TABLE_NAME); - descriptorStorage = new ColumnFamily(DESCRIPTOR_TABLE_NAME, - StringSerializer.get(), StringSerializer.get()); - } + descriptorStorage = new ColumnFamily(DESCRIPTOR_TABLE_NAME, + StringSerializer.get(), StringSerializer.get()); + } } diff --git a/extensions-contrib/google-extensions/src/main/java/io/druid/storage/google/GoogleDataSegmentKiller.java b/extensions-contrib/google-extensions/src/main/java/io/druid/storage/google/GoogleDataSegmentKiller.java index 20f2a37cd79..41780ee8564 100644 --- a/extensions-contrib/google-extensions/src/main/java/io/druid/storage/google/GoogleDataSegmentKiller.java +++ b/extensions-contrib/google-extensions/src/main/java/io/druid/storage/google/GoogleDataSegmentKiller.java @@ -60,9 +60,9 @@ public class GoogleDataSegmentKiller implements DataSegmentKiller } } - @Override - public void killAll() throws IOException - { - throw new UnsupportedOperationException("not implemented"); - } + @Override + public void killAll() throws IOException + { + throw new UnsupportedOperationException("not implemented"); + } } diff --git a/extensions-contrib/google-extensions/src/main/java/io/druid/storage/google/GoogleTaskLogs.java b/extensions-contrib/google-extensions/src/main/java/io/druid/storage/google/GoogleTaskLogs.java index 08cf00d82f0..be579253807 100644 --- a/extensions-contrib/google-extensions/src/main/java/io/druid/storage/google/GoogleTaskLogs.java +++ b/extensions-contrib/google-extensions/src/main/java/io/druid/storage/google/GoogleTaskLogs.java @@ -62,8 +62,8 @@ public class GoogleTaskLogs implements TaskLogs { try { if (!storage.exists(config.getBucket(), taskKey)) { - return Optional.absent(); - } + return Optional.absent(); + } final long length = storage.size(config.getBucket(), taskKey); @@ -101,11 +101,11 @@ public class GoogleTaskLogs implements TaskLogs { return config.getPrefix() + "/" + taskid.replaceAll(":", "_"); } - @Override - public void killAll() throws IOException - { - throw new UnsupportedOperationException("not implemented"); - } + @Override + public void killAll() throws IOException + { + throw new UnsupportedOperationException("not implemented"); + } @Override public void killOlderThan(long timestamp) throws IOException diff --git a/extensions-contrib/scan-query/src/test/java/io/druid/query/scan/MultiSegmentScanQueryTest.java b/extensions-contrib/scan-query/src/test/java/io/druid/query/scan/MultiSegmentScanQueryTest.java index 81c485e8f3a..b3ea2e8bdbd 100644 --- a/extensions-contrib/scan-query/src/test/java/io/druid/query/scan/MultiSegmentScanQueryTest.java +++ b/extensions-contrib/scan-query/src/test/java/io/druid/query/scan/MultiSegmentScanQueryTest.java @@ -72,35 +72,35 @@ public class MultiSegmentScanQueryTest // time modified version of druid.sample.numeric.tsv public static final String[] V_0112 = { - "2011-01-12T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 100.000000", - "2011-01-12T01:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 100.000000", - "2011-01-12T02:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 100.000000", - "2011-01-12T03:00:00.000Z spot health\t1300\t13000.0\t130000\tpreferred hpreferred 100.000000", - "2011-01-12T04:00:00.000Z spot mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 100.000000", - "2011-01-12T05:00:00.000Z spot news\t1500\t15000.0\t150000\tpreferred npreferred 100.000000", - "2011-01-12T06:00:00.000Z spot premium\t1600\t16000.0\t160000\tpreferred ppreferred 100.000000", - "2011-01-12T07:00:00.000Z spot technology\t1700\t17000.0\t170000\tpreferred tpreferred 100.000000", - "2011-01-12T08:00:00.000Z spot travel\t1800\t18000.0\t180000\tpreferred tpreferred 100.000000", - "2011-01-12T09:00:00.000Z total_market mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 1000.000000", - "2011-01-12T10:00:00.000Z total_market premium\t1600\t16000.0\t160000\tpreferred ppreferred 1000.000000", - "2011-01-12T11:00:00.000Z upfront mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 800.000000 value", - "2011-01-12T12:00:00.000Z upfront premium\t1600\t16000.0\t160000\tpreferred ppreferred 800.000000 value" + "2011-01-12T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t100.000000", + "2011-01-12T01:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t100.000000", + "2011-01-12T02:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t100.000000", + "2011-01-12T03:00:00.000Z\tspot\thealth\t1300\t13000.0\t130000\tpreferred\thpreferred\t100.000000", + "2011-01-12T04:00:00.000Z\tspot\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t100.000000", + "2011-01-12T05:00:00.000Z\tspot\tnews\t1500\t15000.0\t150000\tpreferred\tnpreferred\t100.000000", + "2011-01-12T06:00:00.000Z\tspot\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t100.000000", + "2011-01-12T07:00:00.000Z\tspot\ttechnology\t1700\t17000.0\t170000\tpreferred\ttpreferred\t100.000000", + "2011-01-12T08:00:00.000Z\tspot\ttravel\t1800\t18000.0\t180000\tpreferred\ttpreferred\t100.000000", + "2011-01-12T09:00:00.000Z\ttotal_market\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t1000.000000", + "2011-01-12T10:00:00.000Z\ttotal_market\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1000.000000", + "2011-01-12T11:00:00.000Z\tupfront\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t800.000000\tvalue", + "2011-01-12T12:00:00.000Z\tupfront\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t800.000000\tvalue" }; public static final String[] V_0113 = { - "2011-01-13T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 94.874713", - "2011-01-13T01:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 103.629399", - "2011-01-13T02:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 110.087299", - "2011-01-13T03:00:00.000Z spot health\t1300\t13000.0\t130000\tpreferred hpreferred 114.947403", - "2011-01-13T04:00:00.000Z spot mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 104.465767", - "2011-01-13T05:00:00.000Z spot news\t1500\t15000.0\t150000\tpreferred npreferred 102.851683", - "2011-01-13T06:00:00.000Z spot premium\t1600\t16000.0\t160000\tpreferred ppreferred 108.863011", - "2011-01-13T07:00:00.000Z spot technology\t1700\t17000.0\t170000\tpreferred tpreferred 111.356672", - "2011-01-13T08:00:00.000Z spot travel\t1800\t18000.0\t180000\tpreferred tpreferred 106.236928", - "2011-01-13T09:00:00.000Z total_market mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 1040.945505", - "2011-01-13T10:00:00.000Z total_market premium\t1600\t16000.0\t160000\tpreferred ppreferred 1689.012875", - "2011-01-13T11:00:00.000Z upfront mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 826.060182 value", - "2011-01-13T12:00:00.000Z upfront premium\t1600\t16000.0\t160000\tpreferred ppreferred 1564.617729 value" + "2011-01-13T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t94.874713", + "2011-01-13T01:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t103.629399", + "2011-01-13T02:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t110.087299", + "2011-01-13T03:00:00.000Z\tspot\thealth\t1300\t13000.0\t130000\tpreferred\thpreferred\t114.947403", + "2011-01-13T04:00:00.000Z\tspot\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t104.465767", + "2011-01-13T05:00:00.000Z\tspot\tnews\t1500\t15000.0\t150000\tpreferred\tnpreferred\t102.851683", + "2011-01-13T06:00:00.000Z\tspot\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t108.863011", + "2011-01-13T07:00:00.000Z\tspot\ttechnology\t1700\t17000.0\t170000\tpreferred\ttpreferred\t111.356672", + "2011-01-13T08:00:00.000Z\tspot\ttravel\t1800\t18000.0\t180000\tpreferred\ttpreferred\t106.236928", + "2011-01-13T09:00:00.000Z\ttotal_market\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t1040.945505", + "2011-01-13T10:00:00.000Z\ttotal_market\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1689.012875", + "2011-01-13T11:00:00.000Z\tupfront\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t826.060182\tvalue", + "2011-01-13T12:00:00.000Z\tupfront\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1564.617729\tvalue" }; private static Segment segment0; diff --git a/extensions-contrib/scan-query/src/test/java/io/druid/query/scan/ScanQueryRunnerTest.java b/extensions-contrib/scan-query/src/test/java/io/druid/query/scan/ScanQueryRunnerTest.java index e19c94b84e4..21f9e7780b6 100644 --- a/extensions-contrib/scan-query/src/test/java/io/druid/query/scan/ScanQueryRunnerTest.java +++ b/extensions-contrib/scan-query/src/test/java/io/druid/query/scan/ScanQueryRunnerTest.java @@ -60,34 +60,34 @@ public class ScanQueryRunnerTest { // copied from druid.sample.numeric.tsv public static final String[] V_0112 = { - "2011-01-12T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 100.000000", - "2011-01-12T00:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 100.000000", - "2011-01-12T00:00:00.000Z spot health\t1300\t13000.0\t130000\tpreferred hpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot news\t1500\t15000.0\t150000\tpreferred npreferred 100.000000", - "2011-01-12T00:00:00.000Z spot premium\t1600\t16000.0\t160000\tpreferred ppreferred 100.000000", - "2011-01-12T00:00:00.000Z spot technology\t1700\t17000.0\t170000\tpreferred tpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot travel\t1800\t18000.0\t180000\tpreferred tpreferred 100.000000", - "2011-01-12T00:00:00.000Z total_market mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 1000.000000", - "2011-01-12T00:00:00.000Z total_market premium\t1600\t16000.0\t160000\tpreferred ppreferred 1000.000000", - "2011-01-12T00:00:00.000Z upfront mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 800.000000 value", - "2011-01-12T00:00:00.000Z upfront premium\t1600\t16000.0\t160000\tpreferred ppreferred 800.000000 value" + "2011-01-12T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\thealth\t1300\t13000.0\t130000\tpreferred\thpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tnews\t1500\t15000.0\t150000\tpreferred\tnpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\ttechnology\t1700\t17000.0\t170000\tpreferred\ttpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\ttravel\t1800\t18000.0\t180000\tpreferred\ttpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\ttotal_market\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t1000.000000", + "2011-01-12T00:00:00.000Z\ttotal_market\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1000.000000", + "2011-01-12T00:00:00.000Z\tupfront\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t800.000000\tvalue", + "2011-01-12T00:00:00.000Z\tupfront\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t800.000000\tvalue" }; public static final String[] V_0113 = { - "2011-01-13T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 94.874713", - "2011-01-13T00:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 103.629399", - "2011-01-13T00:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 110.087299", - "2011-01-13T00:00:00.000Z spot health\t1300\t13000.0\t130000\tpreferred hpreferred 114.947403", - "2011-01-13T00:00:00.000Z spot mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 104.465767", - "2011-01-13T00:00:00.000Z spot news\t1500\t15000.0\t150000\tpreferred npreferred 102.851683", - "2011-01-13T00:00:00.000Z spot premium\t1600\t16000.0\t160000\tpreferred ppreferred 108.863011", - "2011-01-13T00:00:00.000Z spot technology\t1700\t17000.0\t170000\tpreferred tpreferred 111.356672", - "2011-01-13T00:00:00.000Z spot travel\t1800\t18000.0\t180000\tpreferred tpreferred 106.236928", - "2011-01-13T00:00:00.000Z total_market mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 1040.945505", - "2011-01-13T00:00:00.000Z total_market premium\t1600\t16000.0\t160000\tpreferred ppreferred 1689.012875", - "2011-01-13T00:00:00.000Z upfront mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 826.060182 value", - "2011-01-13T00:00:00.000Z upfront premium\t1600\t16000.0\t160000\tpreferred ppreferred 1564.617729 value" + "2011-01-13T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t94.874713", + "2011-01-13T00:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t103.629399", + "2011-01-13T00:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t110.087299", + "2011-01-13T00:00:00.000Z\tspot\thealth\t1300\t13000.0\t130000\tpreferred\thpreferred\t114.947403", + "2011-01-13T00:00:00.000Z\tspot\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t104.465767", + "2011-01-13T00:00:00.000Z\tspot\tnews\t1500\t15000.0\t150000\tpreferred\tnpreferred\t102.851683", + "2011-01-13T00:00:00.000Z\tspot\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t108.863011", + "2011-01-13T00:00:00.000Z\tspot\ttechnology\t1700\t17000.0\t170000\tpreferred\ttpreferred\t111.356672", + "2011-01-13T00:00:00.000Z\tspot\ttravel\t1800\t18000.0\t180000\tpreferred\ttpreferred\t106.236928", + "2011-01-13T00:00:00.000Z\ttotal_market\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t1040.945505", + "2011-01-13T00:00:00.000Z\ttotal_market\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1689.012875", + "2011-01-13T00:00:00.000Z\tupfront\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t826.060182\tvalue", + "2011-01-13T00:00:00.000Z\tupfront\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1564.617729\tvalue" }; public static final QuerySegmentSpec I_0112_0114 = new LegacySegmentSpec( @@ -305,26 +305,26 @@ public class ScanQueryRunnerTest }, // filtered values with day granularity new String[]{ - "2011-01-12T00:00:00.000Z spot automotive preferred apreferred 100.000000", - "2011-01-12T00:00:00.000Z spot business preferred bpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot entertainment preferred epreferred 100.000000", - "2011-01-12T00:00:00.000Z spot health preferred hpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot mezzanine preferred mpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot news preferred npreferred 100.000000", - "2011-01-12T00:00:00.000Z spot premium preferred ppreferred 100.000000", - "2011-01-12T00:00:00.000Z spot technology preferred tpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot travel preferred tpreferred 100.000000" + "2011-01-12T00:00:00.000Z\tspot\tautomotive\tpreferred\tapreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tbusiness\tpreferred\tbpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tentertainment\tpreferred\tepreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\thealth\tpreferred\thpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tmezzanine\tpreferred\tmpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tnews\tpreferred\tnpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tpremium\tpreferred\tppreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\ttechnology\tpreferred\ttpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\ttravel\tpreferred\ttpreferred\t100.000000" }, new String[]{ - "2011-01-13T00:00:00.000Z spot automotive preferred apreferred 94.874713", - "2011-01-13T00:00:00.000Z spot business preferred bpreferred 103.629399", - "2011-01-13T00:00:00.000Z spot entertainment preferred epreferred 110.087299", - "2011-01-13T00:00:00.000Z spot health preferred hpreferred 114.947403", - "2011-01-13T00:00:00.000Z spot mezzanine preferred mpreferred 104.465767", - "2011-01-13T00:00:00.000Z spot news preferred npreferred 102.851683", - "2011-01-13T00:00:00.000Z spot premium preferred ppreferred 108.863011", - "2011-01-13T00:00:00.000Z spot technology preferred tpreferred 111.356672", - "2011-01-13T00:00:00.000Z spot travel preferred tpreferred 106.236928" + "2011-01-13T00:00:00.000Z\tspot\tautomotive\tpreferred\tapreferred\t94.874713", + "2011-01-13T00:00:00.000Z\tspot\tbusiness\tpreferred\tbpreferred\t103.629399", + "2011-01-13T00:00:00.000Z\tspot\tentertainment\tpreferred\tepreferred\t110.087299", + "2011-01-13T00:00:00.000Z\tspot\thealth\tpreferred\thpreferred\t114.947403", + "2011-01-13T00:00:00.000Z\tspot\tmezzanine\tpreferred\tmpreferred\t104.465767", + "2011-01-13T00:00:00.000Z\tspot\tnews\tpreferred\tnpreferred\t102.851683", + "2011-01-13T00:00:00.000Z\tspot\tpremium\tpreferred\tppreferred\t108.863011", + "2011-01-13T00:00:00.000Z\tspot\ttechnology\tpreferred\ttpreferred\t111.356672", + "2011-01-13T00:00:00.000Z\tspot\ttravel\tpreferred\ttpreferred\t106.236928" } ); @@ -371,12 +371,12 @@ public class ScanQueryRunnerTest }, // filtered values with day granularity new String[]{ - "2011-01-12T00:00:00.000Z total_market mezzanine preferred mpreferred 1000.000000", - "2011-01-12T00:00:00.000Z total_market premium preferred ppreferred 1000.000000" + "2011-01-12T00:00:00.000Z\ttotal_market\tmezzanine\tpreferred\tmpreferred\t1000.000000", + "2011-01-12T00:00:00.000Z\ttotal_market\tpremium\tpreferred\tppreferred\t1000.000000" }, new String[]{ - "2011-01-13T00:00:00.000Z total_market mezzanine preferred mpreferred 1040.945505", - "2011-01-13T00:00:00.000Z total_market premium preferred ppreferred 1689.012875" + "2011-01-13T00:00:00.000Z\ttotal_market\tmezzanine\tpreferred\tmpreferred\t1040.945505", + "2011-01-13T00:00:00.000Z\ttotal_market\tpremium\tpreferred\tppreferred\t1689.012875" } ); diff --git a/integration-tests/src/test/java/io/druid/tests/hadoop/ITHadoopIndexTest.java b/integration-tests/src/test/java/io/druid/tests/hadoop/ITHadoopIndexTest.java index d1eee60b6fd..fe445009192 100644 --- a/integration-tests/src/test/java/io/druid/tests/hadoop/ITHadoopIndexTest.java +++ b/integration-tests/src/test/java/io/druid/tests/hadoop/ITHadoopIndexTest.java @@ -21,7 +21,6 @@ package io.druid.tests.hadoop; import com.google.common.base.Throwables; import com.google.inject.Inject; - import io.druid.java.util.common.logger.Logger; import io.druid.testing.IntegrationTestingConfig; import io.druid.testing.guice.DruidTestModuleFactory; @@ -49,14 +48,14 @@ public class ITHadoopIndexTest extends AbstractIndexerTest @BeforeClass public void beforeClass() { - loadData(config.getProperty ("hadoopTestDir") + "/batchHadoop1"); + loadData(config.getProperty("hadoopTestDir") + "/batchHadoop1"); dataLoaded = true; } @Test public void testHadoopIndex() throws Exception { - queryHelper.testQueriesFromFile(BATCH_QUERIES_RESOURCE, 2); + queryHelper.testQueriesFromFile(BATCH_QUERIES_RESOURCE, 2); } private void loadData(String hadoopDir) @@ -64,18 +63,19 @@ public class ITHadoopIndexTest extends AbstractIndexerTest String indexerSpec = ""; try { - LOG.info("indexerFile name: [%s]", BATCH_TASK); - indexerSpec = getTaskAsString(BATCH_TASK); - indexerSpec = indexerSpec.replaceAll("%%HADOOP_TEST_PATH%%", hadoopDir); - } catch (Exception e) { - LOG.error ("could not read and modify indexer file: %s", e.getMessage()); + LOG.info("indexerFile name: [%s]", BATCH_TASK); + indexerSpec = getTaskAsString(BATCH_TASK); + indexerSpec = indexerSpec.replaceAll("%%HADOOP_TEST_PATH%%", hadoopDir); + } + catch (Exception e) { + LOG.error("could not read and modify indexer file: %s", e.getMessage()); throw Throwables.propagate(e); } try { final String taskID = indexer.submitTask(indexerSpec); LOG.info("TaskID for loading index task %s", taskID); - indexer.waitUntilTaskCompletes (taskID, 60000, 20); + indexer.waitUntilTaskCompletes(taskID, 60000, 20); RetryUtil.retryUntil( new Callable() { @@ -91,8 +91,9 @@ public class ITHadoopIndexTest extends AbstractIndexerTest 10, "Segment-Load-Task-" + taskID ); - } catch (Exception e) { - LOG.error ("data could not be loaded: %s", e.getMessage()); + } + catch (Exception e) { + LOG.error("data could not be loaded: %s", e.getMessage()); throw Throwables.propagate(e); } } @@ -100,14 +101,13 @@ public class ITHadoopIndexTest extends AbstractIndexerTest @AfterClass public void afterClass() { - if (dataLoaded) - { - try - { - unloadAndKillData(BATCH_DATASOURCE); - } catch (Exception e) { - LOG.warn ("exception while removing segments: [%s]", e); - } + if (dataLoaded) { + try { + unloadAndKillData(BATCH_DATASOURCE); } + catch (Exception e) { + LOG.warn(e, "exception while removing segments: [%s]"); + } + } } } diff --git a/java-util/src/main/java/io/druid/java/util/common/Pair.java b/java-util/src/main/java/io/druid/java/util/common/Pair.java index 6c30671eb14..456b41970bd 100644 --- a/java-util/src/main/java/io/druid/java/util/common/Pair.java +++ b/java-util/src/main/java/io/druid/java/util/common/Pair.java @@ -27,11 +27,12 @@ import java.util.Comparator; */ public class Pair { - - public static Pair of(T1 lhs, T2 rhs) { + + public static Pair of(T1 lhs, T2 rhs) + { return new Pair<>(lhs, rhs); } - + public final T1 lhs; public final T2 rhs; diff --git a/java-util/src/main/java/io/druid/java/util/common/collect/Utils.java b/java-util/src/main/java/io/druid/java/util/common/collect/Utils.java index 856e8281199..c1ebe384de4 100644 --- a/java-util/src/main/java/io/druid/java/util/common/collect/Utils.java +++ b/java-util/src/main/java/io/druid/java/util/common/collect/Utils.java @@ -36,7 +36,7 @@ public class Utils return zipMapPartial(keys, values); } - + public static Map zipMapPartial(K[] keys, V[] values) { Preconditions.checkArgument(values.length <= keys.length, diff --git a/java-util/src/main/java/io/druid/java/util/common/guava/Comparators.java b/java-util/src/main/java/io/druid/java/util/common/guava/Comparators.java index 4b05f71a861..6b0a8e72a52 100644 --- a/java-util/src/main/java/io/druid/java/util/common/guava/Comparators.java +++ b/java-util/src/main/java/io/druid/java/util/common/guava/Comparators.java @@ -32,7 +32,7 @@ public class Comparators /** * This is a "reverse" comparator. Positive becomes negative, negative becomes positive and 0 (equal) stays the same. * This was poorly named as "inverse" as it's not really inverting a true/false relationship - * + * * @param baseComp * @param * @return diff --git a/processing/src/test/java/io/druid/data/input/ProtoBufInputRowParserTest.java b/processing/src/test/java/io/druid/data/input/ProtoBufInputRowParserTest.java index f2bded3fc77..23da291170f 100644 --- a/processing/src/test/java/io/druid/data/input/ProtoBufInputRowParserTest.java +++ b/processing/src/test/java/io/druid/data/input/ProtoBufInputRowParserTest.java @@ -38,17 +38,17 @@ public class ProtoBufInputRowParserTest public static final String[] DIMENSIONS = new String[]{"eventType", "id", "someOtherId", "isValid"}; /* - eventType = 1; - - required uint64 id = 2; - required string timestamp = 3; - optional uint32 someOtherId = 4; - optional bool isValid = 5; - optional string description = 6; - - optional float someFloatColumn = 7; - optional uint32 someIntColumn = 8; - optional uint64 someLongColumn = 9; + * eventType = 1; + * + * required uint64 id = 2; + * required string timestamp = 3; + * optional uint32 someOtherId = 4; + * optional bool isValid = 5; + * optional string description = 6; + * + * optional float someFloatColumn = 7; + * optional uint32 someIntColumn = 8; + * optional uint64 someLongColumn = 9; */ @Test diff --git a/processing/src/test/java/io/druid/query/select/MultiSegmentSelectQueryTest.java b/processing/src/test/java/io/druid/query/select/MultiSegmentSelectQueryTest.java index d22952d725a..d483be4441a 100644 --- a/processing/src/test/java/io/druid/query/select/MultiSegmentSelectQueryTest.java +++ b/processing/src/test/java/io/druid/query/select/MultiSegmentSelectQueryTest.java @@ -78,42 +78,42 @@ public class MultiSegmentSelectQueryTest // time modified version of druid.sample.numeric.tsv public static final String[] V_0112 = { - "2011-01-12T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 100.000000", - "2011-01-12T01:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 100.000000", - "2011-01-12T02:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 100.000000", - "2011-01-12T03:00:00.000Z spot health\t1300\t13000.0\t130000\tpreferred hpreferred 100.000000", - "2011-01-12T04:00:00.000Z spot mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 100.000000", - "2011-01-12T05:00:00.000Z spot news\t1500\t15000.0\t150000\tpreferred npreferred 100.000000", - "2011-01-12T06:00:00.000Z spot premium\t1600\t16000.0\t160000\tpreferred ppreferred 100.000000", - "2011-01-12T07:00:00.000Z spot technology\t1700\t17000.0\t170000\tpreferred tpreferred 100.000000", - "2011-01-12T08:00:00.000Z spot travel\t1800\t18000.0\t180000\tpreferred tpreferred 100.000000", - "2011-01-12T09:00:00.000Z total_market mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 1000.000000", - "2011-01-12T10:00:00.000Z total_market premium\t1600\t16000.0\t160000\tpreferred ppreferred 1000.000000", - "2011-01-12T11:00:00.000Z upfront mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 800.000000 value", - "2011-01-12T12:00:00.000Z upfront premium\t1600\t16000.0\t160000\tpreferred ppreferred 800.000000 value" + "2011-01-12T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t100.000000", + "2011-01-12T01:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t100.000000", + "2011-01-12T02:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t100.000000", + "2011-01-12T03:00:00.000Z\tspot\thealth\t1300\t13000.0\t130000\tpreferred\thpreferred\t100.000000", + "2011-01-12T04:00:00.000Z\tspot\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t100.000000", + "2011-01-12T05:00:00.000Z\tspot\tnews\t1500\t15000.0\t150000\tpreferred\tnpreferred\t100.000000", + "2011-01-12T06:00:00.000Z\tspot\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t100.000000", + "2011-01-12T07:00:00.000Z\tspot\ttechnology\t1700\t17000.0\t170000\tpreferred\ttpreferred\t100.000000", + "2011-01-12T08:00:00.000Z\tspot\ttravel\t1800\t18000.0\t180000\tpreferred\ttpreferred\t100.000000", + "2011-01-12T09:00:00.000Z\ttotal_market\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t1000.000000", + "2011-01-12T10:00:00.000Z\ttotal_market\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1000.000000", + "2011-01-12T11:00:00.000Z\tupfront\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t800.000000\tvalue", + "2011-01-12T12:00:00.000Z\tupfront\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t800.000000\tvalue" }; public static final String[] V_0113 = { - "2011-01-13T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 94.874713", - "2011-01-13T01:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 103.629399", - "2011-01-13T02:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 110.087299", - "2011-01-13T03:00:00.000Z spot health\t1300\t13000.0\t130000\tpreferred hpreferred 114.947403", - "2011-01-13T04:00:00.000Z spot mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 104.465767", - "2011-01-13T05:00:00.000Z spot news\t1500\t15000.0\t150000\tpreferred npreferred 102.851683", - "2011-01-13T06:00:00.000Z spot premium\t1600\t16000.0\t160000\tpreferred ppreferred 108.863011", - "2011-01-13T07:00:00.000Z spot technology\t1700\t17000.0\t170000\tpreferred tpreferred 111.356672", - "2011-01-13T08:00:00.000Z spot travel\t1800\t18000.0\t180000\tpreferred tpreferred 106.236928", - "2011-01-13T09:00:00.000Z total_market mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 1040.945505", - "2011-01-13T10:00:00.000Z total_market premium\t1600\t16000.0\t160000\tpreferred ppreferred 1689.012875", - "2011-01-13T11:00:00.000Z upfront mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 826.060182 value", - "2011-01-13T12:00:00.000Z upfront premium\t1600\t16000.0\t160000\tpreferred ppreferred 1564.617729 value" + "2011-01-13T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t94.874713", + "2011-01-13T01:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t103.629399", + "2011-01-13T02:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t110.087299", + "2011-01-13T03:00:00.000Z\tspot\thealth\t1300\t13000.0\t130000\tpreferred\thpreferred\t114.947403", + "2011-01-13T04:00:00.000Z\tspot\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t104.465767", + "2011-01-13T05:00:00.000Z\tspot\tnews\t1500\t15000.0\t150000\tpreferred\tnpreferred\t102.851683", + "2011-01-13T06:00:00.000Z\tspot\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t108.863011", + "2011-01-13T07:00:00.000Z\tspot\ttechnology\t1700\t17000.0\t170000\tpreferred\ttpreferred\t111.356672", + "2011-01-13T08:00:00.000Z\tspot\ttravel\t1800\t18000.0\t180000\tpreferred\ttpreferred\t106.236928", + "2011-01-13T09:00:00.000Z\ttotal_market\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t1040.945505", + "2011-01-13T10:00:00.000Z\ttotal_market\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1689.012875", + "2011-01-13T11:00:00.000Z\tupfront\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t826.060182\tvalue", + "2011-01-13T12:00:00.000Z\tupfront\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1564.617729\tvalue" }; public static final String[] V_OVERRIDE = { - "2011-01-12T04:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 999.000000", - "2011-01-12T05:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 999.000000", - "2011-01-12T06:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 999.000000", - "2011-01-12T07:00:00.000Z spot health\t1300\t13000.0\t130000\tpreferred hpreferred 999.000000" + "2011-01-12T04:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t999.000000", + "2011-01-12T05:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t999.000000", + "2011-01-12T06:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t999.000000", + "2011-01-12T07:00:00.000Z\tspot\thealth\t1300\t13000.0\t130000\tpreferred\thpreferred\t999.000000" }; private static Segment segment0; diff --git a/processing/src/test/java/io/druid/query/select/SelectQueryRunnerTest.java b/processing/src/test/java/io/druid/query/select/SelectQueryRunnerTest.java index 7d6b8f62bb2..dfd9b64dbb7 100644 --- a/processing/src/test/java/io/druid/query/select/SelectQueryRunnerTest.java +++ b/processing/src/test/java/io/druid/query/select/SelectQueryRunnerTest.java @@ -74,34 +74,34 @@ public class SelectQueryRunnerTest { // copied from druid.sample.numeric.tsv public static final String[] V_0112 = { - "2011-01-12T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 100.000000", - "2011-01-12T00:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 100.000000", - "2011-01-12T00:00:00.000Z spot health\t1300\t13000.0\t130000\tpreferred hpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot news\t1500\t15000.0\t150000\tpreferred npreferred 100.000000", - "2011-01-12T00:00:00.000Z spot premium\t1600\t16000.0\t160000\tpreferred ppreferred 100.000000", - "2011-01-12T00:00:00.000Z spot technology\t1700\t17000.0\t170000\tpreferred tpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot travel\t1800\t18000.0\t180000\tpreferred tpreferred 100.000000", - "2011-01-12T00:00:00.000Z total_market mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 1000.000000", - "2011-01-12T00:00:00.000Z total_market premium\t1600\t16000.0\t160000\tpreferred ppreferred 1000.000000", - "2011-01-12T00:00:00.000Z upfront mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 800.000000 value", - "2011-01-12T00:00:00.000Z upfront premium\t1600\t16000.0\t160000\tpreferred ppreferred 800.000000 value" + "2011-01-12T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\thealth\t1300\t13000.0\t130000\tpreferred\thpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tnews\t1500\t15000.0\t150000\tpreferred\tnpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\ttechnology\t1700\t17000.0\t170000\tpreferred\ttpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\ttravel\t1800\t18000.0\t180000\tpreferred\ttpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\ttotal_market\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t1000.000000", + "2011-01-12T00:00:00.000Z\ttotal_market\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1000.000000", + "2011-01-12T00:00:00.000Z\tupfront\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t800.000000\tvalue", + "2011-01-12T00:00:00.000Z\tupfront\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t800.000000\tvalue" }; public static final String[] V_0113 = { - "2011-01-13T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 94.874713", - "2011-01-13T00:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 103.629399", - "2011-01-13T00:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 110.087299", - "2011-01-13T00:00:00.000Z spot health\t1300\t13000.0\t130000\tpreferred hpreferred 114.947403", - "2011-01-13T00:00:00.000Z spot mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 104.465767", - "2011-01-13T00:00:00.000Z spot news\t1500\t15000.0\t150000\tpreferred npreferred 102.851683", - "2011-01-13T00:00:00.000Z spot premium\t1600\t16000.0\t160000\tpreferred ppreferred 108.863011", - "2011-01-13T00:00:00.000Z spot technology\t1700\t17000.0\t170000\tpreferred tpreferred 111.356672", - "2011-01-13T00:00:00.000Z spot travel\t1800\t18000.0\t180000\tpreferred tpreferred 106.236928", - "2011-01-13T00:00:00.000Z total_market mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 1040.945505", - "2011-01-13T00:00:00.000Z total_market premium\t1600\t16000.0\t160000\tpreferred ppreferred 1689.012875", - "2011-01-13T00:00:00.000Z upfront mezzanine\t1400\t14000.0\t140000\tpreferred mpreferred 826.060182 value", - "2011-01-13T00:00:00.000Z upfront premium\t1600\t16000.0\t160000\tpreferred ppreferred 1564.617729 value" + "2011-01-13T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t94.874713", + "2011-01-13T00:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t103.629399", + "2011-01-13T00:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t110.087299", + "2011-01-13T00:00:00.000Z\tspot\thealth\t1300\t13000.0\t130000\tpreferred\thpreferred\t114.947403", + "2011-01-13T00:00:00.000Z\tspot\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t104.465767", + "2011-01-13T00:00:00.000Z\tspot\tnews\t1500\t15000.0\t150000\tpreferred\tnpreferred\t102.851683", + "2011-01-13T00:00:00.000Z\tspot\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t108.863011", + "2011-01-13T00:00:00.000Z\tspot\ttechnology\t1700\t17000.0\t170000\tpreferred\ttpreferred\t111.356672", + "2011-01-13T00:00:00.000Z\tspot\ttravel\t1800\t18000.0\t180000\tpreferred\ttpreferred\t106.236928", + "2011-01-13T00:00:00.000Z\ttotal_market\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t1040.945505", + "2011-01-13T00:00:00.000Z\ttotal_market\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1689.012875", + "2011-01-13T00:00:00.000Z\tupfront\tmezzanine\t1400\t14000.0\t140000\tpreferred\tmpreferred\t826.060182\tvalue", + "2011-01-13T00:00:00.000Z\tupfront\tpremium\t1600\t16000.0\t160000\tpreferred\tppreferred\t1564.617729\tvalue" }; public static final QuerySegmentSpec I_0112_0114 = new LegacySegmentSpec( @@ -447,26 +447,26 @@ public class SelectQueryRunnerTest }, // filtered values with day granularity new String[]{ - "2011-01-12T00:00:00.000Z spot automotive preferred apreferred 100.000000", - "2011-01-12T00:00:00.000Z spot business preferred bpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot entertainment preferred epreferred 100.000000", - "2011-01-12T00:00:00.000Z spot health preferred hpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot mezzanine preferred mpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot news preferred npreferred 100.000000", - "2011-01-12T00:00:00.000Z spot premium preferred ppreferred 100.000000", - "2011-01-12T00:00:00.000Z spot technology preferred tpreferred 100.000000", - "2011-01-12T00:00:00.000Z spot travel preferred tpreferred 100.000000" + "2011-01-12T00:00:00.000Z\tspot\tautomotive\tpreferred\tapreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tbusiness\tpreferred\tbpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tentertainment\tpreferred\tepreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\thealth\tpreferred\thpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tmezzanine\tpreferred\tmpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tnews\tpreferred\tnpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\tpremium\tpreferred\tppreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\ttechnology\tpreferred\ttpreferred\t100.000000", + "2011-01-12T00:00:00.000Z\tspot\ttravel\tpreferred\ttpreferred\t100.000000" }, new String[]{ - "2011-01-13T00:00:00.000Z spot automotive preferred apreferred 94.874713", - "2011-01-13T00:00:00.000Z spot business preferred bpreferred 103.629399", - "2011-01-13T00:00:00.000Z spot entertainment preferred epreferred 110.087299", - "2011-01-13T00:00:00.000Z spot health preferred hpreferred 114.947403", - "2011-01-13T00:00:00.000Z spot mezzanine preferred mpreferred 104.465767", - "2011-01-13T00:00:00.000Z spot news preferred npreferred 102.851683", - "2011-01-13T00:00:00.000Z spot premium preferred ppreferred 108.863011", - "2011-01-13T00:00:00.000Z spot technology preferred tpreferred 111.356672", - "2011-01-13T00:00:00.000Z spot travel preferred tpreferred 106.236928" + "2011-01-13T00:00:00.000Z\tspot\tautomotive\tpreferred\tapreferred\t94.874713", + "2011-01-13T00:00:00.000Z\tspot\tbusiness\tpreferred\tbpreferred\t103.629399", + "2011-01-13T00:00:00.000Z\tspot\tentertainment\tpreferred\tepreferred\t110.087299", + "2011-01-13T00:00:00.000Z\tspot\thealth\tpreferred\thpreferred\t114.947403", + "2011-01-13T00:00:00.000Z\tspot\tmezzanine\tpreferred\tmpreferred\t104.465767", + "2011-01-13T00:00:00.000Z\tspot\tnews\tpreferred\tnpreferred\t102.851683", + "2011-01-13T00:00:00.000Z\tspot\tpremium\tpreferred\tppreferred\t108.863011", + "2011-01-13T00:00:00.000Z\tspot\ttechnology\tpreferred\ttpreferred\t111.356672", + "2011-01-13T00:00:00.000Z\tspot\ttravel\tpreferred\ttpreferred\t106.236928" } ); @@ -519,8 +519,8 @@ public class SelectQueryRunnerTest }, // filtered values with all granularity new String[]{ - "2011-01-13T00:00:00.000Z spot health preferred hpreferred 114.947403", - "2011-01-13T00:00:00.000Z spot technology preferred tpreferred 111.356672" + "2011-01-13T00:00:00.000Z\tspot\thealth\tpreferred\thpreferred\t114.947403", + "2011-01-13T00:00:00.000Z\tspot\ttechnology\tpreferred\ttpreferred\t111.356672" } ); @@ -570,12 +570,12 @@ public class SelectQueryRunnerTest }, // filtered values with day granularity new String[]{ - "2011-01-12T00:00:00.000Z total_market mezzanine preferred mpreferred 1000.000000", - "2011-01-12T00:00:00.000Z total_market premium preferred ppreferred 1000.000000" + "2011-01-12T00:00:00.000Z\ttotal_market\tmezzanine\tpreferred\tmpreferred\t1000.000000", + "2011-01-12T00:00:00.000Z\ttotal_market\tpremium\tpreferred\tppreferred\t1000.000000" }, new String[]{ - "2011-01-13T00:00:00.000Z total_market mezzanine preferred mpreferred 1040.945505", - "2011-01-13T00:00:00.000Z total_market premium preferred ppreferred 1689.012875" + "2011-01-13T00:00:00.000Z\ttotal_market\tmezzanine\tpreferred\tmpreferred\t1040.945505", + "2011-01-13T00:00:00.000Z\ttotal_market\tpremium\tpreferred\tppreferred\t1689.012875" } ); diff --git a/processing/src/test/java/io/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java b/processing/src/test/java/io/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java index c9490574926..c0825f63fe9 100644 --- a/processing/src/test/java/io/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java +++ b/processing/src/test/java/io/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java @@ -90,21 +90,21 @@ public class TimeBoundaryQueryRunnerTest // Adapted from MultiSegmentSelectQueryTest, with modifications to make filtering meaningful public static final String[] V_0112 = { - "2011-01-12T01:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 100.000000", - "2011-01-12T02:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 100.000000", - "2011-01-13T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 100.000000", - "2011-01-13T01:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 100.000000", + "2011-01-12T01:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t100.000000", + "2011-01-12T02:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t100.000000", + "2011-01-13T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t100.000000", + "2011-01-13T01:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t100.000000", }; public static final String[] V_0113 = { - "2011-01-14T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 94.874713", - "2011-01-14T02:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 110.087299", - "2011-01-15T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 94.874713", - "2011-01-15T01:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 103.629399", - "2011-01-16T00:00:00.000Z spot automotive\t1000\t10000.0\t100000\tpreferred apreferred 94.874713", - "2011-01-16T01:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 103.629399", - "2011-01-16T02:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 110.087299", - "2011-01-17T01:00:00.000Z spot business\t1100\t11000.0\t110000\tpreferred bpreferred 103.629399", - "2011-01-17T02:00:00.000Z spot entertainment\t1200\t12000.0\t120000\tpreferred epreferred 110.087299", + "2011-01-14T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t94.874713", + "2011-01-14T02:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t110.087299", + "2011-01-15T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t94.874713", + "2011-01-15T01:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t103.629399", + "2011-01-16T00:00:00.000Z\tspot\tautomotive\t1000\t10000.0\t100000\tpreferred\tapreferred\t94.874713", + "2011-01-16T01:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t103.629399", + "2011-01-16T02:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t110.087299", + "2011-01-17T01:00:00.000Z\tspot\tbusiness\t1100\t11000.0\t110000\tpreferred\tbpreferred\t103.629399", + "2011-01-17T02:00:00.000Z\tspot\tentertainment\t1200\t12000.0\t120000\tpreferred\tepreferred\t110.087299", }; private static IncrementalIndex newIndex(String minTimeStamp)