gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject [35/50] [abbrv] git commit: Upgrade to Avro 1.7.x: Replace Map<Utf8, ?> by Map<CharSequence, ?>
Date Wed, 04 Jun 2014 16:36:52 GMT
Upgrade to Avro 1.7.x: Replace Map<Utf8,?> by Map<CharSequence, ?>


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/56cc8cd2
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/56cc8cd2
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/56cc8cd2

Branch: refs/heads/master
Commit: 56cc8cd21679dd60ea95ca43a5f59456bc9182d1
Parents: ace2c80
Author: Damien Raude-Morvan <damien@dictanova.com>
Authored: Thu May 22 15:42:15 2014 +0200
Committer: Damien Raude-Morvan <damien@dictanova.com>
Committed: Thu May 22 15:45:00 2014 +0200

----------------------------------------------------------------------
 .../org/apache/gora/mongodb/store/MongoStore.java     | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/56cc8cd2/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 7bae766..c839ad5 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
@@ -274,7 +274,7 @@ public class MongoStore<K, T extends PersistentBase> extends
     // If initialized create the collection
     mongoClientColl = mongoClientDB.createCollection(
         mapping.getCollectionName(), new BasicDBObject()); // send a DBObject to
-                                                           // force creation
+    // force creation
     // otherwise creation is deferred
     mongoClientColl.setDBEncoderFactory(GoraDBEncoder.FACTORY);
 
@@ -835,7 +835,7 @@ public class MongoStore<K, T extends PersistentBase> extends
                 + ": to store a Gora 'map', target Mongo mapping have to be of 'document'
type");
       }
       Schema valueSchema = fieldSchema.getValueType();
-      result = toMongoMap((Map<Utf8, ?>) value, valueSchema.getType());
+      result = toMongoMap((Map<CharSequence, ?>) value, valueSchema.getType());
       break;
     case ARRAY:
       if (storeType != null && storeType != DocumentFieldType.LIST) {
@@ -984,8 +984,8 @@ public class MongoStore<K, T extends PersistentBase> extends
     case MAP:
       easybson.put(
           key,
-          toMongoMap((Map<Utf8, ?>) value, field.schema().getValueType()
-              .getType()));
+          toMongoMap((Map<CharSequence, ?>) value, field.schema()
+              .getValueType().getType()));
       break;
     case ARRAY:
       easybson.put(
@@ -1018,7 +1018,7 @@ public class MongoStore<K, T extends PersistentBase> extends
         case MAP:
           record.put(
               member.name(),
-              toMongoMap((Map<Utf8, ?>) recValue, member.schema()
+              toMongoMap((Map<CharSequence, ?>) recValue, member.schema()
                   .getElementType().getType()));
         case ARRAY:
           record.put(
@@ -1071,13 +1071,13 @@ public class MongoStore<K, T extends PersistentBase> extends
    * @return a {@link BasicDBObject} version of the {@link Map} that can be
    *         safely serialized into MongoDB.
    */
-  private BasicDBObject toMongoMap(Map<Utf8, ?> jmap, Type type) {
+  private BasicDBObject toMongoMap(Map<CharSequence, ?> jmap, Type type) {
     // Handle null case
     if (jmap == null)
       return null;
     // Handle regular cases
     BasicDBObject map = new BasicDBObject();
-    for (Entry<Utf8, ?> e : jmap.entrySet()) {
+    for (Entry<CharSequence, ?> e : jmap.entrySet()) {
       // ensure Key encoding -> dots replaced with middle dot
       // FIXME: better approach ?
       String vKey = e.getKey().toString().replace(".", "\u00B7");


Mime
View raw message