hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1679354 - /hama/trunk/core/src/test/java/org/apache/hama/bsp/TestKeyValueTextInputFormat.java
Date Thu, 14 May 2015 12:18:11 GMT
Author: edwardyoon
Date: Thu May 14 12:18:11 2015
New Revision: 1679354

URL: http://svn.apache.org/r1679354
Log: (empty)

Modified:
    hama/trunk/core/src/test/java/org/apache/hama/bsp/TestKeyValueTextInputFormat.java

Modified: hama/trunk/core/src/test/java/org/apache/hama/bsp/TestKeyValueTextInputFormat.java
URL: http://svn.apache.org/viewvc/hama/trunk/core/src/test/java/org/apache/hama/bsp/TestKeyValueTextInputFormat.java?rev=1679354&r1=1679353&r2=1679354&view=diff
==============================================================================
--- hama/trunk/core/src/test/java/org/apache/hama/bsp/TestKeyValueTextInputFormat.java (original)
+++ hama/trunk/core/src/test/java/org/apache/hama/bsp/TestKeyValueTextInputFormat.java Thu
May 14 12:18:11 2015
@@ -49,9 +49,6 @@ public class TestKeyValueTextInputFormat
 
     private int numTasks = 0;
     private int maxValue = 0;
-    private MapWritable expectedKeys = new MapWritable();
-
-    // private Set<Text> expectedKeys = new HashSet<Text>();
 
     @Override
     public void setup(
@@ -66,6 +63,8 @@ public class TestKeyValueTextInputFormat
     public void bsp(
         BSPPeer<Text, Text, NullWritable, NullWritable, MapWritable> peer)
         throws IOException, SyncException, InterruptedException {
+      MapWritable expectedKeys = new MapWritable();
+      
       Text key = null;
       Text value = null;
       MapWritable message = new MapWritable();
@@ -80,8 +79,8 @@ public class TestKeyValueTextInputFormat
         int expectedPeerId = Math.abs(key.hashCode() % numTasks);
 
         if (expectedPeerId == peer.getPeerIndex()) {
+          System.out.println(key + ", " + expectedPeerId + ", " + peer.getPeerIndex());
           if (expectedKeys.containsKey(key)) {
-            System.out.println("duplicate: " + value + ", " + expectedKeys.get(key));
             // same key twice, incorrect
             message.put(new Text(
                 KeyValueHashPartitionedBSP.TEST_UNEXPECTED_KEYS),
@@ -91,7 +90,6 @@ public class TestKeyValueTextInputFormat
             expectedKeys.put(new Text(key), new Text(value));
           }
         } else {
-          System.out.println("duplicate: " + value + ", " + expectedKeys.get(key));
           message.put(
               new Text(KeyValueHashPartitionedBSP.TEST_UNEXPECTED_KEYS),
               new BooleanWritable(true));



Mime
View raw message