Repository: gora Updated Branches: refs/heads/master 8a7101781 -> f5a6d842d
http://git-wip-us.apache.org/repos/asf/gora/blob/f5a6d842/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 79c5e91..c0a1d25 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 @@ -63,11 +63,11 @@ import com.mongodb.*; * class to be used for the key * @param <T> * class to be persisted within the store - * @author Fabien Poulard <[email protected]> - * @author Damien Raude-Morvan <[email protected]> + * @author Fabien Poulard [email protected] + * @author Damien Raude-Morvan [email protected] */ public class MongoStore<K, T extends PersistentBase> extends - DataStoreBase<K, T> { +DataStoreBase<K, T> { public static final Logger LOG = LoggerFactory.getLogger(MongoStore.class); @@ -123,7 +123,7 @@ public class MongoStore<K, T extends PersistentBase> extends .getCollection(mapping.getCollectionName()); LOG.info("Initialized Mongo store for database {} of {}.", new Object[] { - parameters.getDbname(), parameters.getServers() }); + parameters.getDbname(), parameters.getServers() }); } catch (IOException e) { LOG.error("Error while initializing MongoDB store: {}", new Object[] { e.getMessage() }); @@ -145,7 +145,7 @@ public class MongoStore<K, T extends PersistentBase> extends throws UnknownHostException { // Configure options MongoClientOptions.Builder optBuilder = new MongoClientOptions.Builder() - .dbEncoderFactory(GoraDBEncoder.FACTORY); // Utf8 serialization! + .dbEncoderFactory(GoraDBEncoder.FACTORY); // Utf8 serialization! if (params.getReadPreference() != null) { optBuilder.readPreference(ReadPreference.valueOf(params.getReadPreference())); } @@ -284,7 +284,6 @@ public class MongoStore<K, T extends PersistentBase> extends * identifier of the document in the database * @param fields * list of fields to be loaded from the database - * @throws IOException */ @Override public T get(final K key, final String[] fields) { @@ -448,7 +447,6 @@ public class MongoStore<K, T extends PersistentBase> extends * the list of fields to be mapped to the persistence class instance * @return a persistence class instance which content was deserialized from * the {@link DBObject} - * @throws IOException */ public T newInstance(final DBObject obj, final String[] fields) { if (obj == null) @@ -579,22 +577,22 @@ public class MongoStore<K, T extends PersistentBase> extends .getDocumentFieldType(innerSchema.getName()); String innerDocField = mapping.getDocumentField(recField.name()) != null ? mapping .getDocumentField(recField.name()) : recField.name(); - String fieldPath = docf + "." + innerDocField; - LOG.debug( - "Load from DBObject (RECORD), field:{}, schemaType:{}, docField:{}, storeType:{}", - new Object[] { recField.name(), innerSchema.getType(), fieldPath, - innerStoreType }); - record.put( - recField.pos(), - fromDBObject(innerSchema, innerStoreType, recField, innerDocField, - innerBson)); + String fieldPath = docf + "." + innerDocField; + LOG.debug( + "Load from DBObject (RECORD), field:{}, schemaType:{}, docField:{}, storeType:{}", + new Object[] { recField.name(), innerSchema.getType(), fieldPath, + innerStoreType }); + record.put( + recField.pos(), + fromDBObject(innerSchema, innerStoreType, recField, innerDocField, + innerBson)); } result = record; return result; } /* pp */ Object fromMongoList(final String docf, final Schema fieldSchema, - final BSONDecorator easybson, final Field f) { + final BSONDecorator easybson, final Field f) { List<Object> list = easybson.getDBList(docf); List<Object> rlist = new ArrayList<>(); if (list == null) { @@ -612,11 +610,11 @@ public class MongoStore<K, T extends PersistentBase> extends } /* pp */ Object fromMongoMap(final String docf, final Schema fieldSchema, - final BSONDecorator easybson, final Field f) { + final BSONDecorator easybson, final Field f) { BasicDBObject map = easybson.getDBObject(docf); Map<Utf8, Object> rmap = new HashMap<>(); if (map == null) { - return new DirtyMapWrapper(rmap); + return new DirtyMapWrapper(rmap); } for (Entry<String, Object> e : map.entrySet()) { String mapKey = e.getKey(); @@ -843,7 +841,7 @@ public class MongoStore<K, T extends PersistentBase> extends } catch (IllegalArgumentException e1) { // Unable to parse anything from Utf8 value, throw error throw new IllegalStateException("Field " + fieldSchema.getType() - + ": Invalid string: unable to convert to ObjectId"); + + ": Invalid string: unable to convert to ObjectId"); } result = id; } @@ -865,7 +863,7 @@ public class MongoStore<K, T extends PersistentBase> extends if (calendar == null) { // Unable to parse anything from Utf8 value, throw error throw new IllegalStateException("Field " + fieldSchema.getType() - + ": Invalid date format '" + value + "'"); + + ": Invalid date format '" + value + "'"); } result = calendar.getTime(); } @@ -942,7 +940,7 @@ public class MongoStore<K, T extends PersistentBase> extends // //////////////////////////////////////////////////////// CLEANUP /** - * Ensure Key encoding -> dots replaced with middle dots + * Ensure Key encoding -> dots replaced with middle dots * * @param key * char with only dots. @@ -956,7 +954,7 @@ public class MongoStore<K, T extends PersistentBase> extends } /** - * Ensure Key decoding -> middle dots replaced with dots + * Ensure Key decoding -> middle dots replaced with dots * * @param key * encoded string with "\u00B7" chars. http://git-wip-us.apache.org/repos/asf/gora/blob/f5a6d842/gora-mongodb/src/main/java/org/apache/gora/mongodb/utils/BSONDecorator.java ---------------------------------------------------------------------- diff --git a/gora-mongodb/src/main/java/org/apache/gora/mongodb/utils/BSONDecorator.java b/gora-mongodb/src/main/java/org/apache/gora/mongodb/utils/BSONDecorator.java index ec48329..ac98096 100644 --- a/gora-mongodb/src/main/java/org/apache/gora/mongodb/utils/BSONDecorator.java +++ b/gora-mongodb/src/main/java/org/apache/gora/mongodb/utils/BSONDecorator.java @@ -30,7 +30,7 @@ import java.util.Date; * Utility class to build {@link DBObject} used by MongoDB in an easy way by * directly specifying the fully qualified names of fields. * - * @author Fabien Poulard <[email protected]> + * @author Fabien Poulard [email protected] */ public class BSONDecorator { http://git-wip-us.apache.org/repos/asf/gora/blob/f5a6d842/gora-shims-hadoop/src/main/java/org/apache/gora/shims/hadoop/HadoopShim.java ---------------------------------------------------------------------- diff --git a/gora-shims-hadoop/src/main/java/org/apache/gora/shims/hadoop/HadoopShim.java b/gora-shims-hadoop/src/main/java/org/apache/gora/shims/hadoop/HadoopShim.java index 78d746a..dc8e975 100644 --- a/gora-shims-hadoop/src/main/java/org/apache/gora/shims/hadoop/HadoopShim.java +++ b/gora-shims-hadoop/src/main/java/org/apache/gora/shims/hadoop/HadoopShim.java @@ -38,7 +38,7 @@ public abstract class HadoopShim { * @param configuration * The job's configuration. * @return A newly created instance backed by the provided configuration. - * @throws IOException + * @throws IOException if the job cannot be created successfully from given configuration */ public abstract Job createJob(Configuration configuration) throws IOException; http://git-wip-us.apache.org/repos/asf/gora/blob/f5a6d842/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java ---------------------------------------------------------------------- diff --git a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java index d993033..0d7be00 100644 --- a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java +++ b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java @@ -106,7 +106,6 @@ public class MetricDatum extends org.apache.gora.persistency.impl.PersistentBase /** * Checks the dirty status of the 'metricDimension' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isMetricDimensionDirty() { return isDirty(0); @@ -130,7 +129,6 @@ public class MetricDatum extends org.apache.gora.persistency.impl.PersistentBase /** * Checks the dirty status of the 'timestamp' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isTimestampDirty() { return isDirty(1); @@ -154,7 +152,6 @@ public class MetricDatum extends org.apache.gora.persistency.impl.PersistentBase /** * Checks the dirty status of the 'metric' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isMetricDirty() { return isDirty(2); @@ -353,7 +350,6 @@ public class MetricDatum extends org.apache.gora.persistency.impl.PersistentBase /** * Checks the dirty status of the 'metricDimension' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isMetricDimensionDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); @@ -376,7 +372,6 @@ public class MetricDatum extends org.apache.gora.persistency.impl.PersistentBase /** * Checks the dirty status of the 'timestamp' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isTimestampDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); @@ -399,7 +394,6 @@ public class MetricDatum extends org.apache.gora.persistency.impl.PersistentBase /** * Checks the dirty status of the 'metric' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isMetricDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); http://git-wip-us.apache.org/repos/asf/gora/blob/f5a6d842/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java ---------------------------------------------------------------------- diff --git a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java index 3238db5..4ace856 100644 --- a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java +++ b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java @@ -132,7 +132,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'url' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isUrlDirty() { return isDirty(0); @@ -156,7 +155,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'timestamp' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isTimestampDirty() { return isDirty(1); @@ -180,7 +178,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'ip' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isIpDirty() { return isDirty(2); @@ -204,7 +201,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'httpMethod' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isHttpMethodDirty() { return isDirty(3); @@ -228,7 +224,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'httpStatusCode' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isHttpStatusCodeDirty() { return isDirty(4); @@ -252,7 +247,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'responseSize' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isResponseSizeDirty() { return isDirty(5); @@ -276,7 +270,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'referrer' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isReferrerDirty() { return isDirty(6); @@ -300,7 +293,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'userAgent' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isUserAgentDirty() { return isDirty(7); @@ -653,7 +645,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'url' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isUrlDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); @@ -676,7 +667,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'timestamp' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isTimestampDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); @@ -699,7 +689,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'ip' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isIpDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); @@ -722,7 +711,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'httpMethod' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isHttpMethodDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); @@ -745,7 +733,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'httpStatusCode' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isHttpStatusCodeDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); @@ -768,7 +755,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'responseSize' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isResponseSizeDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); @@ -788,12 +774,11 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im public void setReferrer(java.lang.CharSequence value) { throw new java.lang.UnsupportedOperationException("Set is not supported on tombstones"); } - - /** - * Checks the dirty status of the 'referrer' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. - */ - public boolean isReferrerDirty() { + + /** + * Checks the dirty status of the 'referrer' field. A field is dirty if it represents a change that has not yet been written to the database. + */ + public boolean isReferrerDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones"); } @@ -803,10 +788,10 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im public java.lang.CharSequence getUserAgent() { throw new java.lang.UnsupportedOperationException("Get is not supported on tombstones"); } - - /** - * Sets the value of the 'userAgent' field. - * @param value the value to set. + + /** + * Sets the value of the 'userAgent' field. + * @param value the value to set. */ public void setUserAgent(java.lang.CharSequence value) { throw new java.lang.UnsupportedOperationException("Set is not supported on tombstones"); @@ -814,7 +799,6 @@ public class Pageview extends org.apache.gora.persistency.impl.PersistentBase im /** * Checks the dirty status of the 'userAgent' field. A field is dirty if it represents a change that has not yet been written to the database. - * @param value the value to set. */ public boolean isUserAgentDirty() { throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones");
