From aa10626b61b5a8dd6264eab0e7bdfe8258e2a4b2 Mon Sep 17 00:00:00 2001 From: Himanshu Gupta Date: Fri, 1 May 2015 19:40:08 -0500 Subject: [PATCH] adding druid.db.tables.xxx renames and druid.db.connectory.*validation* from ConvertProperties --- .../druid/cli/convert/ConvertProperties.java | 11 ++++- .../java/io/druid/cli/convert/Remove.java | 47 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 services/src/main/java/io/druid/cli/convert/Remove.java diff --git a/services/src/main/java/io/druid/cli/convert/ConvertProperties.java b/services/src/main/java/io/druid/cli/convert/ConvertProperties.java index d3f5e0c8aa3..97690e0aa12 100644 --- a/services/src/main/java/io/druid/cli/convert/ConvertProperties.java +++ b/services/src/main/java/io/druid/cli/convert/ConvertProperties.java @@ -68,7 +68,16 @@ public class ConvertProperties implements Runnable new Rename("druid.db.connector.connectURI", "druid.metadata.storage.connector.connectURI"), new Rename("druid.db.connector.user", "druid.metadata.storage.connector.user"), new Rename("druid.db.connector.password", "druid.metadata.storage.connector.password"), + new Remove("druid.db.connector.validationQuery"), + new Remove("druid.db.connector.useValidationQuery"), + new Rename("druid.db.connector.createTables", "druid.metadata.storage.connector.createTables"), new Rename("druid.db.tables.base", "druid.metadata.storage.tables.base"), + new Rename("druid.db.tables.configTable", "druid.metadata.storage.tables.configTable"), + new Rename("druid.db.tables.segmentTable", "druid.metadata.storage.tables.segmentTable"), + new Rename("druid.db.tables.ruleTable", "druid.metadata.storage.tables.ruleTable"), + new Rename("druid.db.tables.taskLock", "druid.metadata.storage.tables.taskLock"), + new Rename("druid.db.tables.tasks", "druid.metadata.storage.tables.tasks"), + new Rename("druid.db.tables.taskLog", "druid.metadata.storage.tables.taskLog"), new PropertyConverter() { // Add a new config for metadata storage type, and update property name @@ -124,7 +133,7 @@ public class ConvertProperties implements Runnable ); } catch (IOException e) { - throw com.google.api.client.repackaged.com.google.common.base.Throwables.propagate(e); + throw Throwables.propagate(e); } coordinates.addAll(oldCoordinates); coordinates.add(String.format("io.druid.extensions:%s-metadata-storage", parseJdbcUrl(jdbcUrl))); diff --git a/services/src/main/java/io/druid/cli/convert/Remove.java b/services/src/main/java/io/druid/cli/convert/Remove.java new file mode 100644 index 00000000000..eb025b14112 --- /dev/null +++ b/services/src/main/java/io/druid/cli/convert/Remove.java @@ -0,0 +1,47 @@ +/* +* Licensed to Metamarkets Group Inc. (Metamarkets) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. Metamarkets licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +package io.druid.cli.convert; + +import com.google.common.collect.ImmutableMap; + +import java.util.Map; +import java.util.Properties; + +public class Remove implements PropertyConverter +{ + private final String propertyToRemove; + + public Remove(String propertyToRemove) + { + this.propertyToRemove = propertyToRemove; + } + + @Override + public boolean canHandle(String property) + { + return this.propertyToRemove.equals(property); + } + + @Override + public Map convert(Properties properties) + { + return ImmutableMap.of(); + } +}