Repository: gora Updated Branches: refs/heads/master 750bf9d42 -> 346ec4300
GORA-530: Removed redundant logging on several try/catch Project: http://git-wip-us.apache.org/repos/asf/gora/repo Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/b782a0a5 Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/b782a0a5 Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/b782a0a5 Branch: refs/heads/master Commit: b782a0a58ad5886604e1e80a051727dc7fe101f3 Parents: e2d7341 Author: Alfonso Nishikawa Muñumer <[email protected]> Authored: Sat Mar 3 10:52:04 2018 -0100 Committer: Alfonso Nishikawa Muñumer <[email protected]> Committed: Sat Mar 3 10:52:04 2018 -0100 ---------------------------------------------------------------------- .../gora/accumulo/store/AccumuloStore.java | 55 ++++++---------- .../gora/aerospike/store/AerospikeStore.java | 6 -- .../cassandra/serializers/AvroSerializer.java | 5 -- .../serializers/CassandraSerializer.java | 5 -- .../cassandra/serializers/NativeSerializer.java | 5 -- .../gora/cassandra/store/CassandraStore.java | 5 -- .../org/apache/gora/avro/store/AvroStore.java | 2 - .../gora/avro/store/DataFileAvroStore.java | 2 - .../org/apache/gora/memory/store/MemStore.java | 1 - .../gora/persistency/impl/BeanFactoryImpl.java | 1 - .../apache/gora/store/impl/DataStoreBase.java | 2 - .../store/impl/FileBackedDataStoreBase.java | 2 - .../store/ws/impl/WSBackedDataStoreBase.java | 1 - .../apache/gora/couchdb/store/CouchDBStore.java | 15 +---- .../dynamodb/store/DynamoDBNativeStore.java | 6 -- .../gora/dynamodb/store/DynamoDBStore.java | 3 - .../org/apache/gora/hbase/store/HBaseStore.java | 14 +--- .../gora/infinispan/store/InfinispanClient.java | 2 - .../gora/infinispan/store/InfinispanStore.java | 8 --- .../apache/gora/jcache/store/JCacheStore.java | 68 +++++++++----------- .../apache/gora/mongodb/store/MongoStore.java | 9 --- .../gora/orientdb/store/OrientDBStore.java | 11 ---- .../org/apache/gora/solr/query/SolrResult.java | 1 - .../org/apache/gora/solr/store/SolrStore.java | 16 +---- 24 files changed, 54 insertions(+), 191 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java ---------------------------------------------------------------------- diff --git a/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java b/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java index 3500733..3c5ae14 100644 --- a/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java +++ b/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java @@ -360,9 +360,10 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T */ @Override public void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) throws GoraException { - try{ - super.initialize(keyClass, persistentClass, properties); + super.initialize(keyClass, persistentClass, properties); + try { + String mock = DataStoreFactory.findProperty(properties, this, MOCK_PROPERTY, null); String mappingFile = DataStoreFactory.getMappingFile(properties, this, DEFAULT_MAPPING_FILE); String user = DataStoreFactory.findProperty(properties, this, USERNAME_PROPERTY, null); @@ -373,33 +374,24 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T if (mapping.encoder == null || "".equals(mapping.encoder)) { encoder = new BinaryEncoder(); } else { - try { encoder = (Encoder) getClass().getClassLoader().loadClass(mapping.encoder).newInstance(); - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { - LOG.error(e.getMessage(), e); - throw new GoraException(e); - } } - try { - AuthenticationToken token = new PasswordToken(password); - if (mock == null || !mock.equals("true")) { - String instance = DataStoreFactory.findProperty(properties, this, INSTANCE_NAME_PROPERTY, null); - String zookeepers = DataStoreFactory.findProperty(properties, this, ZOOKEEPERS_NAME_PROPERTY, null); - conn = new ZooKeeperInstance(instance, zookeepers).getConnector(user, token); - } else { - conn = new MockInstance().getConnector(user, token); - } - credentials = new Credentials(user, token); - - if (autoCreateSchema && !schemaExists()) - createSchema(); - } catch (AccumuloException | AccumuloSecurityException e) { - LOG.error(e.getMessage(), e); - throw new GoraException(e); + AuthenticationToken token = new PasswordToken(password); + if (mock == null || !mock.equals("true")) { + String instance = DataStoreFactory.findProperty(properties, this, INSTANCE_NAME_PROPERTY, null); + String zookeepers = DataStoreFactory.findProperty(properties, this, ZOOKEEPERS_NAME_PROPERTY, null); + conn = new ZooKeeperInstance(instance, zookeepers).getConnector(user, token); + } else { + conn = new MockInstance().getConnector(user, token); } - } catch(IOException e){ - LOG.error(e.getMessage(), e); + credentials = new Credentials(user, token); + + if (autoCreateSchema && !schemaExists()) + createSchema(); + + } catch (IOException | InstantiationException | IllegalAccessException | + ClassNotFoundException | AccumuloException | AccumuloSecurityException e) { throw new GoraException(e); } } @@ -481,12 +473,11 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T conn.tableOperations().setProperty(mapping.tableName, entry.getKey(), entry.getValue()); } - } catch (AccumuloException | AccumuloSecurityException e) { - LOG.error(e.getMessage(), e); - throw new GoraException(e); } catch (TableExistsException e) { LOG.debug(e.getMessage(), e); // Assume this is not an error + } catch (AccumuloException | AccumuloSecurityException e) { + throw new GoraException(e); } } @@ -500,7 +491,6 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T } catch (TableNotFoundException e) { // Ignore. Delete a non existant schema is a success } catch (AccumuloException | AccumuloSecurityException e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -510,7 +500,6 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T try { return conn.tableOperations().exists(mapping.tableName); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -667,7 +656,6 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T return null; return persistent; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -738,7 +726,6 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -828,7 +815,6 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T return count; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -876,7 +862,6 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T Scanner scanner = createScanner(query); return new AccumuloResult<>(this, query, scanner); } catch (TableNotFoundException e) { - LOG.error(e.getMessage(), e); throw new GoraException(e) ; } } @@ -968,7 +953,6 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T return ret; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } @@ -1032,7 +1016,6 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T batchWriter.flush(); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java ---------------------------------------------------------------------- diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java index cf41392..643f355 100644 --- a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java +++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java @@ -114,7 +114,6 @@ public class AerospikeStore<K, T extends PersistentBase> extends DataStoreBase<K aerospikeParameters.validateServerBinConfiguration(persistentClass.getFields()); LOG.info("Aerospike Gora datastore initialized successfully."); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -183,7 +182,6 @@ public class AerospikeStore<K, T extends PersistentBase> extends DataStoreBase<K } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -230,7 +228,6 @@ public class AerospikeStore<K, T extends PersistentBase> extends DataStoreBase<K .put(aerospikeParameters.getAerospikeMapping().getWritePolicy(), recordKey, bin); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -248,7 +245,6 @@ public class AerospikeStore<K, T extends PersistentBase> extends DataStoreBase<K return aerospikeClient .delete(aerospikeParameters.getAerospikeMapping().getWritePolicy(), recordKey); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -271,7 +267,6 @@ public class AerospikeStore<K, T extends PersistentBase> extends DataStoreBase<K } return deleteCount; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -338,7 +333,6 @@ public class AerospikeStore<K, T extends PersistentBase> extends DataStoreBase<K // } return new AerospikeQueryResult<>(this, query, resultRecords, getFieldsToQuery(null)); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e) ; } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/AvroSerializer.java ---------------------------------------------------------------------- diff --git a/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/AvroSerializer.java b/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/AvroSerializer.java index 9660485..b2d273e 100644 --- a/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/AvroSerializer.java +++ b/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/AvroSerializer.java @@ -163,7 +163,6 @@ class AvroSerializer<K, T extends PersistentBase> extends CassandraSerializer { } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -239,7 +238,6 @@ class AvroSerializer<K, T extends PersistentBase> extends CassandraSerializer { LOG.error("{} Persistent bean isn't extended by {} .", new Object[]{this.persistentClass, PersistentBase.class}); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -272,7 +270,6 @@ class AvroSerializer<K, T extends PersistentBase> extends CassandraSerializer { } return obj; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -411,7 +408,6 @@ class AvroSerializer<K, T extends PersistentBase> extends CassandraSerializer { ResultSet resultSet = client.getSession().execute(statement); return resultSet.wasApplied(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -466,7 +462,6 @@ class AvroSerializer<K, T extends PersistentBase> extends CassandraSerializer { } return cassandraResult; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CassandraSerializer.java ---------------------------------------------------------------------- diff --git a/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CassandraSerializer.java b/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CassandraSerializer.java index cd806d0..dbf6bd8 100644 --- a/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CassandraSerializer.java +++ b/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/CassandraSerializer.java @@ -114,7 +114,6 @@ public abstract class CassandraSerializer<K, T extends Persistent> { LOG.debug("creating Cassandra column family / table {}", mapping.getCoreName()); this.client.getSession().execute(CassandraQueryFactory.getCreateTableQuery(mapping)); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -126,7 +125,6 @@ public abstract class CassandraSerializer<K, T extends Persistent> { LOG.debug("dropping Cassandra keyspace {}", mapping.getKeySpace().getName()); this.client.getSession().execute(CassandraQueryFactory.getDropKeySpaceQuery(mapping)); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -140,7 +138,6 @@ public abstract class CassandraSerializer<K, T extends Persistent> { LOG.debug("truncating Cassandra table {}", mapping.getCoreName()); this.client.getSession().execute(CassandraQueryFactory.getTruncateTableQuery(mapping)); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -155,7 +152,6 @@ public abstract class CassandraSerializer<K, T extends Persistent> { return false; } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -245,7 +241,6 @@ public abstract class CassandraSerializer<K, T extends Persistent> { LOG.info("Delete By Query method doesn't return the deleted element count."); return 0; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/NativeSerializer.java ---------------------------------------------------------------------- diff --git a/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/NativeSerializer.java b/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/NativeSerializer.java index 3fb8e10..54255bf 100644 --- a/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/NativeSerializer.java +++ b/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/NativeSerializer.java @@ -55,7 +55,6 @@ class NativeSerializer<K, T extends Persistent> extends CassandraSerializer { try { analyzePersistent(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException("Error occurred while analyzing the persistent class, :" + e.getMessage(), e); } this.createSchema(); @@ -82,7 +81,6 @@ class NativeSerializer<K, T extends Persistent> extends CassandraSerializer { LOG.debug("Object is saved with key : {} and value : {}", key, value); mapper.save((T) value); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -104,7 +102,6 @@ class NativeSerializer<K, T extends Persistent> extends CassandraSerializer { } return object; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -122,7 +119,6 @@ class NativeSerializer<K, T extends Persistent> extends CassandraSerializer { mapper.delete(key); return true; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -231,7 +227,6 @@ class NativeSerializer<K, T extends Persistent> extends CassandraSerializer { } return cassandraResult; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java ---------------------------------------------------------------------- diff --git a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java index 865d8cf..f0514ad 100644 --- a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java +++ b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java @@ -90,7 +90,6 @@ public class CassandraStore<K, T extends Persistent> implements DataStore<K, T> } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException("Error while initializing Cassandra store: " + e.getMessage(), e); } } @@ -170,7 +169,6 @@ public class CassandraStore<K, T extends Persistent> implements DataStore<K, T> return keyClass.newInstance(); } } catch (Exception e) { - LOG.error("Error while instantiating a key: " + e.getMessage(), e); throw new GoraException("Error while instantiating a key: " + e.getMessage(), e); } } @@ -188,7 +186,6 @@ public class CassandraStore<K, T extends Persistent> implements DataStore<K, T> return persistentClass.newInstance(); } } catch (Exception e) { - LOG.error("Error while instantiating a persistent: " + e.getMessage(), e); throw new GoraException("Error while instantiating a key: " + e.getMessage(), e); } } @@ -265,7 +262,6 @@ public class CassandraStore<K, T extends Persistent> implements DataStore<K, T> try { return (Result<K, T>) cassandraSerializer.execute(this, query); } catch (Exception e) { - this.LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -301,7 +297,6 @@ public class CassandraStore<K, T extends Persistent> implements DataStore<K, T> partitions.add(pqi); return partitions; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java ---------------------------------------------------------------------- diff --git a/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java b/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java index 570d5ec..a35b2c0 100644 --- a/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java +++ b/gora-core/src/main/java/org/apache/gora/avro/store/AvroStore.java @@ -158,7 +158,6 @@ extends FileBackedDataStoreBase<K, T> implements Configurable { if(encoder != null) encoder.flush(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -178,7 +177,6 @@ extends FileBackedDataStoreBase<K, T> implements Configurable { try{ getDatumWriter().write(obj, getEncoder()); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java ---------------------------------------------------------------------- diff --git a/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java b/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java index 0e42d71..3ff5d4d 100644 --- a/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java +++ b/gora-core/src/main/java/org/apache/gora/avro/store/DataFileAvroStore.java @@ -60,7 +60,6 @@ public class DataFileAvroStore<K, T extends PersistentBase> extends AvroStore<K, try{ getWriter().append(obj); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -106,7 +105,6 @@ public class DataFileAvroStore<K, T extends PersistentBase> extends AvroStore<K, } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-core/src/main/java/org/apache/gora/memory/store/MemStore.java ---------------------------------------------------------------------- diff --git a/gora-core/src/main/java/org/apache/gora/memory/store/MemStore.java b/gora-core/src/main/java/org/apache/gora/memory/store/MemStore.java index 06596d5..0829182 100644 --- a/gora-core/src/main/java/org/apache/gora/memory/store/MemStore.java +++ b/gora-core/src/main/java/org/apache/gora/memory/store/MemStore.java @@ -169,7 +169,6 @@ public class MemStore<K, T extends PersistentBase> extends DataStoreBase<K, T> { try { submap = map.subMap(startKey, true, endKey, true); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } else { http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java ---------------------------------------------------------------------- diff --git a/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java b/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java index 1e9911a..929f25a 100644 --- a/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java +++ b/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java @@ -71,7 +71,6 @@ public class BeanFactoryImpl<K, T extends Persistent> implements BeanFactory<K, } this.persistent = ReflectionUtils.newInstance(persistentClass); } catch (Exception ex) { - Log.error(ex.getMessage(), ex); throw new GoraException(ex); } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java ---------------------------------------------------------------------- diff --git a/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java b/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java index cb0e5c5..8187357 100644 --- a/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java +++ b/gora-core/src/main/java/org/apache/gora/store/impl/DataStoreBase.java @@ -127,7 +127,6 @@ public abstract class DataStoreBase<K, T extends PersistentBase> try { return beanFactory.newKey(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -137,7 +136,6 @@ public abstract class DataStoreBase<K, T extends PersistentBase> try { return beanFactory.newPersistent(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java ---------------------------------------------------------------------- diff --git a/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java b/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java index a46b116..29d3572 100644 --- a/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java +++ b/gora-core/src/main/java/org/apache/gora/store/impl/FileBackedDataStoreBase.java @@ -190,7 +190,6 @@ extends DataStoreBase<K, T> implements FileBackedDataStore<K, T> { } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } return results; @@ -223,7 +222,6 @@ extends DataStoreBase<K, T> implements FileBackedDataStore<K, T> { if(outputStream != null) outputStream.flush(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java ---------------------------------------------------------------------- diff --git a/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java b/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java index bc806fa..a374995 100644 --- a/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java +++ b/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java @@ -56,7 +56,6 @@ public abstract class WSBackedDataStoreBase<K, T extends Persistent> try { return executeQuery(query); } catch (IOException e) { - LOG.error(e.getMessage()); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-couchdb/src/main/java/org/apache/gora/couchdb/store/CouchDBStore.java ---------------------------------------------------------------------- diff --git a/gora-couchdb/src/main/java/org/apache/gora/couchdb/store/CouchDBStore.java b/gora-couchdb/src/main/java/org/apache/gora/couchdb/store/CouchDBStore.java index 8890ff3..95705d0 100644 --- a/gora-couchdb/src/main/java/org/apache/gora/couchdb/store/CouchDBStore.java +++ b/gora-couchdb/src/main/java/org/apache/gora/couchdb/store/CouchDBStore.java @@ -143,8 +143,7 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, db = new StdCouchDbConnector(mapping.getDatabaseName(), dbInstance, myObjectMapperFactory); db.createDatabaseIfNotExists(); } catch (Exception e) { - LOG.error("Error while initializing CouchDB store: {}", new Object[] { e.getMessage() }); - throw new GoraException(e); + throw new GoraException("Error while initializing CouchDB store", e); } } @@ -183,7 +182,6 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -200,7 +198,6 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -213,7 +210,6 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, try { return dbInstance.checkIfDbExists(mapping.getDatabaseName()); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -236,7 +232,6 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -380,7 +375,6 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, final Map<String, Object> referenceData = db.get(Map.class, keyString); return StringUtils.isNotEmpty(db.delete(keyString, referenceData.get("_rev").toString())); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -424,7 +418,6 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, } return db.purge(revisionsToPurge).getPurged().size(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -459,7 +452,6 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, return couchDBResult; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e) ; } @@ -522,7 +514,7 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, try { clazz = ClassLoadingUtils.loadClass(fieldSchema.getFullName()); } catch (ClassNotFoundException e) { - LOG.debug(e.getMessage()); + throw new GoraException(e) ; } final PersistentBase record = (PersistentBase) new BeanFactoryImpl(keyClass, clazz).newPersistent(); @@ -570,7 +562,7 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, // Deserialize as if schema was ["type"] result = fromDBObject(innerSchema, field, docf, value); } else { - throw new IllegalStateException( + throw new GoraException( "CouchDBStore doesn't support 3 types union field yet. Please update your mapping"); } return result; @@ -671,7 +663,6 @@ public class CouchDBStore<K, T extends PersistentBase> extends DataStoreBase<K, bulkDocs.clear(); db.flushBulkBuffer(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBNativeStore.java ---------------------------------------------------------------------- diff --git a/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBNativeStore.java b/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBNativeStore.java index b2b0da2..ba3efbb 100644 --- a/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBNativeStore.java +++ b/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBNativeStore.java @@ -91,7 +91,6 @@ public class DynamoDBNativeStore<K, T extends Persistent> extends } catch (GoraException e) { throw e ; // If it is a GoraException we assume it is already logged } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } return deletes.size(); @@ -116,7 +115,6 @@ public class DynamoDBNativeStore<K, T extends Persistent> extends (DynamoDBScanExpression) dynamoDBQuery.getQueryExpression()); return new DynamoDBResult<K, T>(this, query, objList); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -160,7 +158,6 @@ public class DynamoDBNativeStore<K, T extends Persistent> extends } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -228,7 +225,6 @@ public class DynamoDBNativeStore<K, T extends Persistent> extends } else throw new GoraException("No HashKey found in Key nor in Object."); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -274,7 +270,6 @@ public class DynamoDBNativeStore<K, T extends Persistent> extends mapper.delete(object); return true; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -374,7 +369,6 @@ public class DynamoDBNativeStore<K, T extends Persistent> extends dynamoDBStoreHandler.getTableProvisionedThroughput(tableName)); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java ---------------------------------------------------------------------- diff --git a/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java b/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java index f5e53a3..b3cb09f 100644 --- a/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java +++ b/gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBStore.java @@ -139,7 +139,6 @@ public class DynamoDBStore<K, T extends Persistent> implements DataStore<K, T> { executeDeleteTableRequest(preferredSchema); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -216,7 +215,6 @@ public class DynamoDBStore<K, T extends Persistent> implements DataStore<K, T> { } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -281,7 +279,6 @@ public class DynamoDBStore<K, T extends Persistent> implements DataStore<K, T> { LOG.info("Finished verifying schemas."); return (success != null) ? true : false; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java ---------------------------------------------------------------------- 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 349c6d9..518a286 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 @@ -133,10 +133,8 @@ implements Configurable { mapping = readMapping(getConf().get(PARSE_MAPPING_FILE_KEY, DEFAULT_MAPPING_FILE)); filterUtil = new HBaseFilterUtil<>(this.conf); } catch (FileNotFoundException ex) { - LOG.error("{} is not found, please check the file.", DEFAULT_MAPPING_FILE); - throw new GoraException(ex); + throw new GoraException("Mapping file '" + getConf().get(PARSE_MAPPING_FILE_KEY, DEFAULT_MAPPING_FILE) + "' not found.",ex); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } @@ -158,7 +156,6 @@ implements Configurable { boolean autoflush = this.conf.getBoolean("hbase.client.autoflush.default", false); table = new HBaseTableConnection(getConf(), getSchemaName(), autoflush); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } closeHBaseAdmin(); @@ -186,7 +183,6 @@ implements Configurable { } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } closeHBaseAdmin(); @@ -203,7 +199,6 @@ implements Configurable { } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } closeHBaseAdmin(); @@ -214,7 +209,6 @@ implements Configurable { try{ return admin.tableExists(mapping.getTable().getTableName()); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -230,7 +224,6 @@ implements Configurable { } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -285,7 +278,6 @@ implements Configurable { } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -369,7 +361,6 @@ implements Configurable { //success is a bit costly return true; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -397,7 +388,6 @@ implements Configurable { } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -407,7 +397,6 @@ implements Configurable { try{ table.flushCommits(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -491,7 +480,6 @@ implements Configurable { return result; } }catch(IOException ex){ - LOG.error(ex.getMessage(), ex); throw new GoraException(ex) ; } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanClient.java ---------------------------------------------------------------------- diff --git a/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanClient.java b/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanClient.java index a41245c..617e2b2 100644 --- a/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanClient.java +++ b/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanClient.java @@ -98,7 +98,6 @@ public class InfinispanClient<K, T extends PersistentBase> implements Configurab try { Support.registerSchema(cacheManager, persistentClass.newInstance().getSchema()); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -113,7 +112,6 @@ public class InfinispanClient<K, T extends PersistentBase> implements Configurab cache.clear(); cacheExists = false; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanStore.java ---------------------------------------------------------------------- diff --git a/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanStore.java b/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanStore.java index c072d2d..9ac1f56 100644 --- a/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanStore.java +++ b/gora-infinispan/src/main/java/org/apache/gora/infinispan/store/InfinispanStore.java @@ -107,7 +107,6 @@ public class InfinispanStore<K, T extends PersistentBase> extends DataStoreBase< } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -131,7 +130,6 @@ public class InfinispanStore<K, T extends PersistentBase> extends DataStoreBase< this.infinispanClient.deleteByKey(key); return true; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -148,7 +146,6 @@ public class InfinispanStore<K, T extends PersistentBase> extends DataStoreBase< } return q.getResultSize(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -173,7 +170,6 @@ public class InfinispanStore<K, T extends PersistentBase> extends DataStoreBase< LOG.trace("result size: " + result.size()); return result; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -184,7 +180,6 @@ public class InfinispanStore<K, T extends PersistentBase> extends DataStoreBase< try { return infinispanClient.get(key); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -205,7 +200,6 @@ public class InfinispanStore<K, T extends PersistentBase> extends DataStoreBase< result.next(); return result.get(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -274,7 +268,6 @@ public class InfinispanStore<K, T extends PersistentBase> extends DataStoreBase< try { infinispanClient.flush(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -312,7 +305,6 @@ public class InfinispanStore<K, T extends PersistentBase> extends DataStoreBase< try { this.infinispanClient.put(key, obj); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-jcache/src/main/java/org/apache/gora/jcache/store/JCacheStore.java ---------------------------------------------------------------------- diff --git a/gora-jcache/src/main/java/org/apache/gora/jcache/store/JCacheStore.java b/gora-jcache/src/main/java/org/apache/gora/jcache/store/JCacheStore.java index b07bf69..91230f3 100644 --- a/gora-jcache/src/main/java/org/apache/gora/jcache/store/JCacheStore.java +++ b/gora-jcache/src/main/java/org/apache/gora/jcache/store/JCacheStore.java @@ -20,32 +20,28 @@ package org.apache.gora.jcache.store; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -import java.util.Iterator; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Iterator; import java.util.List; -import java.util.NavigableMap; import java.util.NavigableSet; import java.util.Properties; -import java.util.ArrayList; import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.TimeUnit; -import com.hazelcast.cache.HazelcastCachingProvider; -import com.hazelcast.cache.ICache; -import com.hazelcast.client.HazelcastClient; -import com.hazelcast.client.config.ClientConfig; -import com.hazelcast.client.config.XmlClientConfigBuilder; -import com.hazelcast.config.CacheConfig; -import com.hazelcast.config.Config; -import com.hazelcast.config.ClasspathXmlConfig; -import com.hazelcast.config.EvictionPolicy; -import com.hazelcast.config.EvictionConfig; -import com.hazelcast.config.InMemoryFormat; -import com.hazelcast.core.Hazelcast; -import com.hazelcast.core.HazelcastInstance; -import com.hazelcast.core.Member; -import com.hazelcast.core.Partition; +import javax.cache.Cache; +import javax.cache.CacheManager; +import javax.cache.Caching; +import javax.cache.configuration.FactoryBuilder; +import javax.cache.configuration.MutableCacheEntryListenerConfiguration; +import javax.cache.expiry.AccessedExpiryPolicy; +import javax.cache.expiry.CreatedExpiryPolicy; +import javax.cache.expiry.Duration; +import javax.cache.expiry.ModifiedExpiryPolicy; +import javax.cache.expiry.TouchedExpiryPolicy; +import javax.cache.spi.CachingProvider; + import org.apache.avro.Schema; import org.apache.gora.jcache.query.JCacheQuery; import org.apache.gora.jcache.query.JCacheResult; @@ -63,18 +59,21 @@ import org.apache.hadoop.conf.Configuration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.cache.Cache; -import javax.cache.CacheManager; -import javax.cache.Caching; -import javax.cache.configuration.CacheEntryListenerConfiguration; -import javax.cache.configuration.FactoryBuilder; -import javax.cache.configuration.MutableCacheEntryListenerConfiguration; -import javax.cache.expiry.AccessedExpiryPolicy; -import javax.cache.expiry.ModifiedExpiryPolicy; -import javax.cache.expiry.CreatedExpiryPolicy; -import javax.cache.expiry.TouchedExpiryPolicy; -import javax.cache.expiry.Duration; -import javax.cache.spi.CachingProvider; +import com.hazelcast.cache.HazelcastCachingProvider; +import com.hazelcast.cache.ICache; +import com.hazelcast.client.HazelcastClient; +import com.hazelcast.client.config.ClientConfig; +import com.hazelcast.client.config.XmlClientConfigBuilder; +import com.hazelcast.config.CacheConfig; +import com.hazelcast.config.ClasspathXmlConfig; +import com.hazelcast.config.Config; +import com.hazelcast.config.EvictionConfig; +import com.hazelcast.config.EvictionPolicy; +import com.hazelcast.config.InMemoryFormat; +import com.hazelcast.core.Hazelcast; +import com.hazelcast.core.HazelcastInstance; +import com.hazelcast.core.Member; +import com.hazelcast.core.Partition; /** * {@link org.apache.gora.jcache.store.JCacheStore} is the primary class @@ -295,7 +294,6 @@ public class JCacheStore<K, T extends PersistentBase> extends DataStoreBase<K, T } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -311,7 +309,6 @@ public class JCacheStore<K, T extends PersistentBase> extends DataStoreBase<K, T } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -321,7 +318,6 @@ public class JCacheStore<K, T extends PersistentBase> extends DataStoreBase<K, T try { return (manager.getCache(super.getPersistentClass().getSimpleName(), keyClass, persistentClass) != null); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -335,7 +331,6 @@ public class JCacheStore<K, T extends PersistentBase> extends DataStoreBase<K, T } return getPersistent(persitent, fields); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -345,7 +340,6 @@ public class JCacheStore<K, T extends PersistentBase> extends DataStoreBase<K, T try { return cache.get(key); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -355,7 +349,6 @@ public class JCacheStore<K, T extends PersistentBase> extends DataStoreBase<K, T try { cache.put(key, val); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -365,7 +358,6 @@ public class JCacheStore<K, T extends PersistentBase> extends DataStoreBase<K, T try { return cache.remove(key); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -402,7 +394,6 @@ public class JCacheStore<K, T extends PersistentBase> extends DataStoreBase<K, T } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -428,7 +419,6 @@ public class JCacheStore<K, T extends PersistentBase> extends DataStoreBase<K, T try { cacheEntrySubList = cacheEntryList.subSet(startKey, true, endKey, true); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } else { http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java ---------------------------------------------------------------------- diff --git a/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java b/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java index 5532cb5..2130c3f 100644 --- a/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java +++ b/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java @@ -291,7 +291,6 @@ DataStoreBase<K, T> { LOG.debug("Collection {} has been created for Mongo instance {}.", new Object[] { mapping.getCollectionName(), mongoClientDB.getMongo() }); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -313,7 +312,6 @@ DataStoreBase<K, T> { "Collection {} has been dropped for Mongo instance {}.", new Object[] { mongoClientColl.getFullName(), mongoClientDB.getMongo() }); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -326,7 +324,6 @@ DataStoreBase<K, T> { try { return mongoClientDB.collectionExists(mapping.getCollectionName()); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -343,7 +340,6 @@ DataStoreBase<K, T> { new Object[] { client }); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -381,7 +377,6 @@ DataStoreBase<K, T> { // Build the corresponding persistent return newInstance(res, dbFields); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -405,7 +400,6 @@ DataStoreBase<K, T> { + "new, neither dirty.", new Object[] { obj }); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -452,7 +446,6 @@ DataStoreBase<K, T> { WriteResult writeResult = mongoClientColl.remove(removeKey); return writeResult != null && writeResult.getN() > 0; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -468,7 +461,6 @@ DataStoreBase<K, T> { } return 0; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -505,7 +497,6 @@ DataStoreBase<K, T> { return mongoResult; } catch(Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-orientdb/src/main/java/org/apache/gora/orientdb/store/OrientDBStore.java ---------------------------------------------------------------------- diff --git a/gora-orientdb/src/main/java/org/apache/gora/orientdb/store/OrientDBStore.java b/gora-orientdb/src/main/java/org/apache/gora/orientdb/store/OrientDBStore.java index faf0607..a66136b 100644 --- a/gora-orientdb/src/main/java/org/apache/gora/orientdb/store/OrientDBStore.java +++ b/gora-orientdb/src/main/java/org/apache/gora/orientdb/store/OrientDBStore.java @@ -171,7 +171,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, } schemaTx.getMetadata().getSchema().reload(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -186,7 +185,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, schemaTx.activateOnCurrentThread(); schemaTx.getMetadata().getSchema().dropClass(orientDBMapping.getDocumentClass()); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -202,7 +200,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, return schemaTx.getMetadata().getSchema() .existsClass(orientDBMapping.getDocumentClass()); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -235,7 +232,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, return null; } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -265,7 +261,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, docBatch.add(document); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } else { @@ -296,7 +291,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, return false; } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -334,7 +328,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, return 0; } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } else { @@ -362,7 +355,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, return result.size(); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -388,7 +380,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, result.setLimit((int) query.getLimit()); return new OrientDBResult<K, T>(this, query, result); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -430,7 +421,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, updateTx.save(document); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } finally { docBatch.clear(); @@ -691,7 +681,6 @@ public class OrientDBStore<K, T extends PersistentBase> extends DataStoreBase<K, try { clazz = ClassLoadingUtils.loadClass(fieldSchema.getFullName()); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } PersistentBase record = (PersistentBase) new BeanFactoryImpl(keyClass, clazz).newPersistent(); http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java b/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java index 1f2cfe1..6841b70 100644 --- a/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java +++ b/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java @@ -88,7 +88,6 @@ public class SolrResult<K, T extends PersistentBase> extends ResultBase<K, T> { QueryResponse rsp = server.query(params); list = rsp.getResults(); } catch (SolrServerException | IOException e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } http://git-wip-us.apache.org/repos/asf/gora/blob/b782a0a5/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java index ae85a66..a652102 100644 --- a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java +++ b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java @@ -209,7 +209,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> DEFAULT_MAPPING_FILE); mapping = readMapping(mappingFile); } catch (IOException e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } @@ -268,14 +267,12 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> try { this.adminServer = new LBHttpSolrClient(solrUrlElements); } catch (MalformedURLException e) { - LOG.error(e.getMessage()); - throw new RuntimeException(e); + throw new GoraException(e); } try { this.server = new LBHttpSolrClient( solrUrlElements + "/" + mapping.getCoreName() ); } catch (MalformedURLException e) { - LOG.error(e.getMessage()); - throw new RuntimeException(e); + throw new GoraException(e); } if (serverUserAuth) { HttpClientUtil.setBasicAuth( @@ -379,7 +376,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> CoreAdminRequest.createCore(mapping.getCoreName(), mapping.getCoreName(), adminServer, solrConfig, solrSchema); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -391,7 +387,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> server.deleteByQuery("*:*"); server.commit(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -408,7 +403,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> if (e.getMessage().contains("No such core")) { return; // it's ok, the core is not there } else { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -422,7 +416,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> adminServer); exists = rsp.getUptime(mapping.getCoreName()) != null; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } return exists; @@ -474,7 +467,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> } return newInstance((SolrDocument) o, fields); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -624,7 +616,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> add(batch, commitWithin); batch.clear(); } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -738,7 +729,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> LOG.info(rsp.toString()); return true; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } } @@ -783,7 +773,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> } catch (GoraException e) { throw e; } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } return 0; @@ -820,7 +809,6 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> batch.clear(); } } catch (Exception e) { - LOG.error(e.getMessage(), e); throw new GoraException(e); } }
