From 1ce9a887a93006180ea19b00b28473acde4c8b05 Mon Sep 17 00:00:00 2001 From: cihad guzel Date: Sun, 22 May 2016 22:56:08 +0300 Subject: [PATCH] GORA-465 remove deprecated logic --- .../org/apache/gora/store/DataStoreFactory.java | 7 ------- .../gora/store/ws/impl/WSDataStoreFactory.java | 7 ------- .../org/apache/gora/hbase/store/HBaseStore.java | 16 ++-------------- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java b/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java index b0bc1d857..e892012c8 100644 --- a/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java +++ b/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java @@ -58,13 +58,6 @@ public class DataStoreFactory{ public static final String SCHEMA_NAME = "schema.name"; - /** - * Do not use! Deprecated because it shares system wide state. - * Use {@link #createProps()} instead. - */ - @Deprecated() - public static final Properties properties = createProps(); - /** * Creates a new {@link Properties}. It adds the default gora configuration * resources. This properties object can be modified and used to instantiate diff --git a/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java b/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java index 35d1df06b..8cebb26d2 100644 --- a/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java +++ b/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java @@ -56,13 +56,6 @@ public class WSDataStoreFactory{ public static final String MAPPING_FILE = "mapping.file"; public static final String SCHEMA_NAME = "schema.name"; - - /** - * Do not use! Deprecated because it shares system wide state. - * Use {@link #createProps()} instead. - */ - @Deprecated() - public static final Properties properties = createProps(); /** * Creates a new {@link Properties}. It adds the default gora configuration diff --git a/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java b/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java index bb83ff2b5..f0dc9a6cf 100644 --- a/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java +++ b/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java @@ -83,8 +83,6 @@ public class HBaseStore extends DataStoreBase public static final String PARSE_MAPPING_FILE_KEY = "gora.hbase.mapping.file"; - @Deprecated - private static final String DEPRECATED_MAPPING_FILE = "hbase-mapping.xml"; public static final String DEFAULT_MAPPING_FILE = "gora-hbase-mapping.xml"; private static final String SCANNER_CACHING_PROPERTIES_KEY = "scanner.caching" ; @@ -116,18 +114,8 @@ public void initialize(Class keyClass, Class persistentClass, mapping = readMapping(getConf().get(PARSE_MAPPING_FILE_KEY, DEFAULT_MAPPING_FILE)); filterUtil = new HBaseFilterUtil<>(this.conf); } catch (FileNotFoundException ex) { - try { - mapping = readMapping(getConf().get(PARSE_MAPPING_FILE_KEY, DEPRECATED_MAPPING_FILE)); - LOG.warn(DEPRECATED_MAPPING_FILE + " is deprecated, please rename the file to " - + DEFAULT_MAPPING_FILE); - } catch (FileNotFoundException ex1) { - LOG.error(ex1.getMessage(), ex1); - //throw (ex1); //throw the original exception - } catch (Exception ex1) { - LOG.warn(DEPRECATED_MAPPING_FILE + " is deprecated, please rename the file to " - + DEFAULT_MAPPING_FILE); - throw new RuntimeException(ex1); - } + LOG.error("{} is not found, please check the file.", DEFAULT_MAPPING_FILE); + throw new RuntimeException(ex); } catch (Exception e) { throw new RuntimeException(e); }