From fa66e1d2cc39d9e8436f32946bd1e4f2ff07b1bc Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Wed, 13 Mar 2013 16:29:34 -0500 Subject: [PATCH 1/3] 1) SQL is hard --- .../main/java/com/metamx/druid/config/ConfigManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/metamx/druid/config/ConfigManager.java b/common/src/main/java/com/metamx/druid/config/ConfigManager.java index 1ecfd24482c..4aa97e7ffc7 100644 --- a/common/src/main/java/com/metamx/druid/config/ConfigManager.java +++ b/common/src/main/java/com/metamx/druid/config/ConfigManager.java @@ -38,6 +38,7 @@ public class ConfigManager private final ScheduledExecutorService exec; private final ConcurrentMap watchedConfigs; private final String selectStatement; + private final String insertStatement; private volatile ConfigManager.PollingCallable poller; @@ -49,6 +50,10 @@ public class ConfigManager this.exec = ScheduledExecutors.fixed(1, "config-manager-%s"); this.watchedConfigs = Maps.newConcurrentMap(); this.selectStatement = String.format("SELECT payload FROM %s WHERE name = :name", config.getConfigTable()); + insertStatement = String.format( + "INSERT INTO %s (name, payload) VALUES (:name, :payload) ON DUPLICATE KEY UPDATE payload = :payload", + config.getConfigTable() + ); } @LifecycleStart @@ -192,9 +197,7 @@ public class ConfigManager @Override public Void withHandle(Handle handle) throws Exception { - handle.createStatement( - "INSERT INTO %s (name, payload) VALUES (:name, :payload) ON DUPLICATE KEY UPDATE payload = :payload" - ) + handle.createStatement(insertStatement) .bind("name", key) .bind("payload", newBytes) .execute(); From 8aac482618d3a215909899d847286d900367384f Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Wed, 13 Mar 2013 16:33:10 -0500 Subject: [PATCH 2/3] [maven-release-plugin] prepare release druid-0.3.20 --- client/pom.xml | 2 +- common/pom.xml | 2 +- druid-services/pom.xml | 4 ++-- examples/pom.xml | 2 +- examples/rand/pom.xml | 2 +- examples/twitter/pom.xml | 2 +- index-common/pom.xml | 2 +- indexer/pom.xml | 2 +- merger/pom.xml | 2 +- pom.xml | 2 +- realtime/pom.xml | 2 +- server/pom.xml | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/client/pom.xml b/client/pom.xml index cd8bacf5dc0..f6e2d1bc8e7 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/common/pom.xml b/common/pom.xml index 7f47d7fffed..8db43bd87ff 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/druid-services/pom.xml b/druid-services/pom.xml index ca691b5e84a..5be8af0ee5c 100644 --- a/druid-services/pom.xml +++ b/druid-services/pom.xml @@ -24,11 +24,11 @@ druid-services druid-services druid-services - 0.3.20-SNAPSHOT + 0.3.20 com.metamx druid - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/examples/pom.xml b/examples/pom.xml index 3e790ab4be6..ab99556ef2a 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/examples/rand/pom.xml b/examples/rand/pom.xml index b4394161de6..69fd75ea590 100644 --- a/examples/rand/pom.xml +++ b/examples/rand/pom.xml @@ -9,7 +9,7 @@ com.metamx druid-examples - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/examples/twitter/pom.xml b/examples/twitter/pom.xml index 3f68c7c82a6..01f606108e0 100644 --- a/examples/twitter/pom.xml +++ b/examples/twitter/pom.xml @@ -9,7 +9,7 @@ com.metamx druid-examples - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/index-common/pom.xml b/index-common/pom.xml index ebe57f00fb1..20a5d9a28e1 100644 --- a/index-common/pom.xml +++ b/index-common/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/indexer/pom.xml b/indexer/pom.xml index a736362d25d..ca3dfcc366f 100644 --- a/indexer/pom.xml +++ b/indexer/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/merger/pom.xml b/merger/pom.xml index d478400f00c..3a02cf10581 100644 --- a/merger/pom.xml +++ b/merger/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/pom.xml b/pom.xml index 5d2635955a7..ef260d207de 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ com.metamx druid pom - 0.3.20-SNAPSHOT + 0.3.20 druid druid diff --git a/realtime/pom.xml b/realtime/pom.xml index 0ded94e9d25..b43709c064b 100644 --- a/realtime/pom.xml +++ b/realtime/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20-SNAPSHOT + 0.3.20 diff --git a/server/pom.xml b/server/pom.xml index c8ec34d5f14..d72fc05ea1b 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20-SNAPSHOT + 0.3.20 From f1175389c4434502ee0dccf75c4f48676d6956fd Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Wed, 13 Mar 2013 16:33:17 -0500 Subject: [PATCH 3/3] [maven-release-plugin] prepare for next development iteration --- client/pom.xml | 2 +- common/pom.xml | 2 +- druid-services/pom.xml | 4 ++-- examples/pom.xml | 2 +- examples/rand/pom.xml | 2 +- examples/twitter/pom.xml | 2 +- index-common/pom.xml | 2 +- indexer/pom.xml | 2 +- merger/pom.xml | 2 +- pom.xml | 2 +- realtime/pom.xml | 2 +- server/pom.xml | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/client/pom.xml b/client/pom.xml index f6e2d1bc8e7..bef5ae94e48 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/common/pom.xml b/common/pom.xml index 8db43bd87ff..cbaa95f3f35 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/druid-services/pom.xml b/druid-services/pom.xml index 5be8af0ee5c..610dee6a6d8 100644 --- a/druid-services/pom.xml +++ b/druid-services/pom.xml @@ -24,11 +24,11 @@ druid-services druid-services druid-services - 0.3.20 + 0.3.21-SNAPSHOT com.metamx druid - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/examples/pom.xml b/examples/pom.xml index ab99556ef2a..68ff0659504 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/examples/rand/pom.xml b/examples/rand/pom.xml index 69fd75ea590..eee585b036f 100644 --- a/examples/rand/pom.xml +++ b/examples/rand/pom.xml @@ -9,7 +9,7 @@ com.metamx druid-examples - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/examples/twitter/pom.xml b/examples/twitter/pom.xml index 01f606108e0..160d2e882ea 100644 --- a/examples/twitter/pom.xml +++ b/examples/twitter/pom.xml @@ -9,7 +9,7 @@ com.metamx druid-examples - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/index-common/pom.xml b/index-common/pom.xml index 20a5d9a28e1..3f4905b3b93 100644 --- a/index-common/pom.xml +++ b/index-common/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/indexer/pom.xml b/indexer/pom.xml index ca3dfcc366f..4c2b714f84d 100644 --- a/indexer/pom.xml +++ b/indexer/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/merger/pom.xml b/merger/pom.xml index 3a02cf10581..c4ae6ce1b73 100644 --- a/merger/pom.xml +++ b/merger/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/pom.xml b/pom.xml index ef260d207de..67e03a2d585 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ com.metamx druid pom - 0.3.20 + 0.3.21-SNAPSHOT druid druid diff --git a/realtime/pom.xml b/realtime/pom.xml index b43709c064b..a21b6d26a22 100644 --- a/realtime/pom.xml +++ b/realtime/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20 + 0.3.21-SNAPSHOT diff --git a/server/pom.xml b/server/pom.xml index d72fc05ea1b..8c1ddddad0e 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -28,7 +28,7 @@ com.metamx druid - 0.3.20 + 0.3.21-SNAPSHOT