mody

cassnadra-hadoop-CFIF.patch

Aug 17th, 2011
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.42 KB | None | 0 0
  1. diff --git a/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java b/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
  2. index 97b6753..a64af73 100644
  3. --- a/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
  4. +++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
  5. @@ -152,6 +152,11 @@ public class ColumnFamilyInputFormat extends InputFormat<ByteBuffer, SortedMap<B
  6.              ArrayList<InputSplit> splits = new ArrayList<InputSplit>();
  7.              List<String> tokens = getSubSplits(keyspace, cfName, range, conf);
  8.  
  9. +            if(tokens.size() == 0)
  10. +            {
  11. +                return splits;
  12. +            }
  13. +
  14.              // turn the sub-ranges into InputSplits
  15.              String[] endpoints = range.endpoints.toArray(new String[range.endpoints.size()]);
  16.              // hadoop needs hostname, not ip
  17. @@ -194,7 +199,8 @@ public class ColumnFamilyInputFormat extends InputFormat<ByteBuffer, SortedMap<B
  18.                  throw new RuntimeException(e);
  19.              }
  20.          }
  21. -        throw new IOException("failed connecting to all endpoints " + StringUtils.join(range.endpoints, ","));
  22. +        logger.debug("failed connecting to all endpoints " + StringUtils.join(range.endpoints, ","));
  23. +        return new ArrayList<String>();
  24.      }
  25.  
  26.      private static Cassandra.Client createConnection(String host, Integer port, boolean framed) throws IOException
Advertisement
Add Comment
Please, Sign In to add comment