From 083a012aa2cc34fce941c6bc58bda797b3cb597e Mon Sep 17 00:00:00 2001 From: fjy Date: Mon, 24 Nov 2014 14:54:11 -0800 Subject: [PATCH] Commonalize the cache config and change default to disable cache --- examples/config/_common/common.runtime.properties | 4 ++++ examples/config/broker/runtime.properties | 5 ++++- examples/config/coordinator/runtime.properties | 6 ++++-- examples/config/historical/runtime.properties | 5 +++-- examples/config/overlord/runtime.properties | 1 + examples/config/realtime/runtime.properties | 6 ++++-- server/src/main/java/io/druid/client/cache/CacheConfig.java | 4 ++-- services/src/main/java/io/druid/cli/CliBroker.java | 2 +- services/src/main/java/io/druid/cli/CliHistorical.java | 2 +- 9 files changed, 24 insertions(+), 11 deletions(-) diff --git a/examples/config/_common/common.runtime.properties b/examples/config/_common/common.runtime.properties index c73d92bec8c..348532cd582 100644 --- a/examples/config/_common/common.runtime.properties +++ b/examples/config/_common/common.runtime.properties @@ -14,6 +14,10 @@ druid.metadata.storage.connector.password=diurd druid.storage.type=local druid.storage.storage.storageDirectory=/tmp/druid/localStorage +# Cache (we use a simple 10mb heap-based local cache on the broker) +druid.cache.type=local +druid.cache.sizeInBytes=10000000 + # Indexing service discovery druid.selectors.indexing.serviceName=overlord diff --git a/examples/config/broker/runtime.properties b/examples/config/broker/runtime.properties index 23d1170343b..330918e5f26 100644 --- a/examples/config/broker/runtime.properties +++ b/examples/config/broker/runtime.properties @@ -1,6 +1,9 @@ druid.host=localhost -druid.service=broker druid.port=8080 +druid.service=broker + +druid.broker.cache.useCache=true +druid.broker.cache.populateCache=true # Bump these up only for faster nested groupBy druid.processing.buffer.sizeBytes=100000000 diff --git a/examples/config/coordinator/runtime.properties b/examples/config/coordinator/runtime.properties index c9f16857af4..7d0e82c97c9 100644 --- a/examples/config/coordinator/runtime.properties +++ b/examples/config/coordinator/runtime.properties @@ -1,5 +1,7 @@ druid.host=localhost -druid.service=coordinator druid.port=8082 +druid.service=coordinator -druid.coordinator.startDelay=PT70s \ No newline at end of file +# The coordinator begins assignment operations after the start delay. +# We override the default here to start things up faster for examples. +druid.coordinator.startDelay=PT70s diff --git a/examples/config/historical/runtime.properties b/examples/config/historical/runtime.properties index 332aa0c95b0..cbc5c138ee2 100644 --- a/examples/config/historical/runtime.properties +++ b/examples/config/historical/runtime.properties @@ -1,8 +1,9 @@ druid.host=localhost -druid.service=historical druid.port=8081 +druid.service=historical -# Change these to make Druid faster +# We can only 1 scan segment in parallel with these configs. +# Our intermediate buffer is also very small so longer topNs will be slow. druid.processing.buffer.sizeBytes=100000000 druid.processing.numThreads=1 diff --git a/examples/config/overlord/runtime.properties b/examples/config/overlord/runtime.properties index 3eebd15a9a9..6c5653fb5bc 100644 --- a/examples/config/overlord/runtime.properties +++ b/examples/config/overlord/runtime.properties @@ -2,6 +2,7 @@ druid.host=localhost druid.port=8080 druid.service=overlord +# Run the overlord in local mode with a single peon to execute tasks druid.indexer.queue.startDelay=PT0M druid.indexer.runner.javaOpts="-server -Xmx256m" druid.indexer.fork.property.druid.processing.numThreads=1 diff --git a/examples/config/realtime/runtime.properties b/examples/config/realtime/runtime.properties index 8a69a193277..0565853edd7 100644 --- a/examples/config/realtime/runtime.properties +++ b/examples/config/realtime/runtime.properties @@ -1,10 +1,12 @@ druid.host=localhost -druid.service=realtime druid.port=8083 +druid.service=realtime -# Change this config to metadata to hand off to the rest of the Druid cluster +# Change this config to 'metadata' to hand off to the rest of the Druid cluster druid.publish.type=noop +# We can only 1 scan segment in parallel with these configs. +# Our intermediate buffer is also very small so longer topNs will be slow. druid.processing.buffer.sizeBytes=100000000 druid.processing.numThreads=1 diff --git a/server/src/main/java/io/druid/client/cache/CacheConfig.java b/server/src/main/java/io/druid/client/cache/CacheConfig.java index 25c397b7a83..2e066e6703d 100644 --- a/server/src/main/java/io/druid/client/cache/CacheConfig.java +++ b/server/src/main/java/io/druid/client/cache/CacheConfig.java @@ -31,10 +31,10 @@ public class CacheConfig public static final String POPULATE_CACHE = "populateCache"; @JsonProperty - private boolean useCache = true; + private boolean useCache = false; @JsonProperty - private boolean populateCache = true; + private boolean populateCache = false; @JsonProperty private List unCacheable = Arrays.asList(Query.GROUP_BY, Query.SELECT); diff --git a/services/src/main/java/io/druid/cli/CliBroker.java b/services/src/main/java/io/druid/cli/CliBroker.java index 877a356103e..9050bc827aa 100644 --- a/services/src/main/java/io/druid/cli/CliBroker.java +++ b/services/src/main/java/io/druid/cli/CliBroker.java @@ -90,7 +90,7 @@ public class CliBroker extends ServerRunnable 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); + JsonConfigProvider.bind(binder, "druid.cache", CacheProvider.class); JsonConfigProvider.bind(binder, "druid.broker.cache", CacheConfig.class); JsonConfigProvider.bind(binder, "druid.broker.select", TierSelectorStrategy.class); JsonConfigProvider.bind(binder, "druid.broker.select.tier.custom", CustomTierSelectorStrategyConfig.class); diff --git a/services/src/main/java/io/druid/cli/CliHistorical.java b/services/src/main/java/io/druid/cli/CliHistorical.java index c34b91d2188..79c28b24c54 100644 --- a/services/src/main/java/io/druid/cli/CliHistorical.java +++ b/services/src/main/java/io/druid/cli/CliHistorical.java @@ -88,7 +88,7 @@ public class CliHistorical extends ServerRunnable LifecycleModule.register(binder, ZkCoordinator.class); binder.bind(Cache.class).toProvider(CacheProvider.class).in(ManageLifecycle.class); - JsonConfigProvider.bind(binder, "druid.historical.cache", CacheProvider.class); + JsonConfigProvider.bind(binder, "druid.cache", CacheProvider.class); JsonConfigProvider.bind(binder, "druid.historical.cache", CacheConfig.class); MetricsModule.register(binder, CacheMonitor.class); }