cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r931237 - /cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
Date Tue, 06 Apr 2010 17:26:30 GMT
Author: johan
Date: Tue Apr  6 17:26:29 2010
New Revision: 931237

URL: http://svn.apache.org/viewvc?rev=931237&view=rev
Log:
Provide correct locations so that Hadoop can schedule map tasks close to the data. Patch by
johan, review by jbellis. CASSANDRA-955

Modified:
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java?rev=931237&r1=931236&r2=931237&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
Tue Apr  6 17:26:29 2010
@@ -22,6 +22,7 @@ package org.apache.cassandra.hadoop;
 
 
 import java.io.IOException;
+import java.net.InetAddress;
 import java.util.*;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
@@ -146,7 +147,12 @@ public class ColumnFamilyInputFormat ext
 
             // turn the sub-ranges into InputSplits
             String[] endpoints = range.endpoints.toArray(new String[range.endpoints.size()]);
-
+            // hadoop needs hostname, not ip
+            for (int i = 0; i < endpoints.length; i++)
+            {
+                endpoints[i] = InetAddress.getByName(endpoints[i]).getHostName();
+            }
+            
             for (int i = 1; i < tokens.size(); i++)
             {
                 ColumnFamilySplit split = new ColumnFamilySplit(tokens.get(i - 1), tokens.get(i),
endpoints);



Mime
View raw message