beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [22/50] incubator-beam git commit: [BEAM-1018] Updated getEstimatedSizeBytes() to use Number.longValue() in MongoDbIO
Date Wed, 23 Nov 2016 06:52:18 GMT
[BEAM-1018] Updated getEstimatedSizeBytes() to use Number.longValue() in MongoDbIO


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/a761b0c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/a761b0c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/a761b0c1

Branch: refs/heads/gearpump-runner
Commit: a761b0c154b67daada2968c24c7de9c4afe13884
Parents: 875631f
Author: Sandeep Parikh <sandeep@clusterbeep.org>
Authored: Mon Nov 21 10:05:36 2016 -0600
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Mon Nov 21 20:37:11 2016 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/a761b0c1/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
b/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
index 71c017d..cd5cdaf 100644
--- a/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
+++ b/sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
@@ -224,7 +224,7 @@ public class MongoDbIO {
       BasicDBObject stat = new BasicDBObject();
       stat.append("collStats", spec.collection());
       Document stats = mongoDatabase.runCommand(stat);
-      return Long.parseLong(stats.get("size").toString());
+      return stats.get("size", Number.class).longValue();
     }
 
     @Override


Mime
View raw message