crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gr...@apache.org
Subject git commit: CRUNCH-291 Add toString method on CrunchInputSplit
Date Fri, 01 Nov 2013 04:08:20 GMT
Updated Branches:
  refs/heads/master dcf5d32b3 -> a3b56322d


CRUNCH-291 Add toString method on CrunchInputSplit


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

Branch: refs/heads/master
Commit: a3b56322d0185a34be0887b6571793ebcf056d52
Parents: dcf5d32
Author: Gabriel Reid <greid@apache.org>
Authored: Thu Oct 31 11:08:54 2013 +0100
Committer: Gabriel Reid <greid@apache.org>
Committed: Thu Oct 31 11:20:41 2013 +0100

----------------------------------------------------------------------
 .../apache/crunch/impl/mr/run/CrunchInputSplit.java    | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/crunch/blob/a3b56322/crunch-core/src/main/java/org/apache/crunch/impl/mr/run/CrunchInputSplit.java
----------------------------------------------------------------------
diff --git a/crunch-core/src/main/java/org/apache/crunch/impl/mr/run/CrunchInputSplit.java
b/crunch-core/src/main/java/org/apache/crunch/impl/mr/run/CrunchInputSplit.java
index 479a7c2..1f542df 100644
--- a/crunch-core/src/main/java/org/apache/crunch/impl/mr/run/CrunchInputSplit.java
+++ b/crunch-core/src/main/java/org/apache/crunch/impl/mr/run/CrunchInputSplit.java
@@ -64,12 +64,12 @@ class CrunchInputSplit extends InputSplit implements Writable, Configurable
{
       this.bundle.configure(conf);
     }
   }
-  
+
   @Override
   public Configuration getConf() {
     return conf;
   }
-  
+
   public int getNodeIndex() {
     return nodeIndex;
   }
@@ -92,14 +92,19 @@ class CrunchInputSplit extends InputSplit implements Writable, Configurable
{
     return inputSplit.getLocations();
   }
 
+  @Override
+  public String toString() {
+    return String.format("CrunchInputSplit(%s)", inputSplit);
+  }
+
   public void readFields(DataInput in) throws IOException {
     nodeIndex = in.readInt();
     bundle = new FormatBundle();
     bundle.setConf(conf);
     bundle.readFields(in);
     bundle.configure(conf); // yay bootstrap!
-    Class<? extends InputSplit> inputSplitClass = (Class<? extends InputSplit>)
readClass(in);
-    inputSplit = (InputSplit) ReflectionUtils.newInstance(inputSplitClass, conf);
+    Class<? extends InputSplit> inputSplitClass = readClass(in);
+    inputSplit = ReflectionUtils.newInstance(inputSplitClass, conf);
     SerializationFactory factory = new SerializationFactory(conf);
     Deserializer deserializer = factory.getDeserializer(inputSplitClass);
     deserializer.open((DataInputStream) in);


Mime
View raw message