accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ujustgotbi...@apache.org
Subject [05/50] git commit: ACCUMULO-375 fixed input split serialization problem
Date Thu, 06 Feb 2014 05:39:44 GMT
ACCUMULO-375 fixed input split serialization problem

git-svn-id: https://svn.apache.org/repos/asf/incubator/accumulo/branches/1.4@1241526 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/commit/bd7b9cf6
Tree: http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/tree/bd7b9cf6
Diff: http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/diff/bd7b9cf6

Branch: refs/heads/1.4.5-SNAPSHOT
Commit: bd7b9cf699a201014cdf6f36a0bc5b28d26996aa
Parents: a7eaf7d
Author: Adam Fuchs <afuchs@apache.org>
Authored: Tue Feb 7 17:28:48 2012 +0000
Committer: Adam Fuchs <afuchs@apache.org>
Committed: Tue Feb 7 17:28:48 2012 +0000

----------------------------------------------------------------------
 .../wikisearch/ingest/WikipediaInputFormat.java | 23 +++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/blob/bd7b9cf6/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaInputFormat.java
----------------------------------------------------------------------
diff --git a/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaInputFormat.java
b/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaInputFormat.java
index e8b8b52..7c7cf4e 100644
--- a/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaInputFormat.java
+++ b/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaInputFormat.java
@@ -76,9 +76,13 @@ public class WikipediaInputFormat extends TextInputFormat {
       long start = in.readLong();
       long length = in.readLong();
       int numHosts = in.readInt();
-      String[] hosts = new String[numHosts];
-      for(int i = 0; i < numHosts; i++)
-        hosts[i] = in.readUTF();
+      String [] hosts = null;
+      if(in.readBoolean())
+      {
+        hosts = new String[numHosts];
+        for(int i = 0; i < numHosts; i++)
+          hosts[i] = in.readUTF();
+      }
       fileSplit = new FileSplit(file, start, length, hosts);
       partition = in.readInt();
     }
@@ -89,10 +93,17 @@ public class WikipediaInputFormat extends TextInputFormat {
       out.writeLong(fileSplit.getStart());
       out.writeLong(fileSplit.getLength());
       String [] hosts = fileSplit.getLocations();
-      out.writeInt(hosts.length);
-      for(String host:hosts)
+      if(hosts == null)
+      {
+        out.writeBoolean(false);
+      }
+      else
+      {
+        out.writeBoolean(true);
+        out.writeInt(hosts.length);
+        for(String host:hosts)
         out.writeUTF(host);
-      fileSplit.write(out);
+      }
       out.writeInt(partition);
     }
     


Mime
View raw message