This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

validate shardnum is numeric and log when it's not

  • Loading branch information...
1 parent 09b9f38 commit d9d4a33300fa3cacf6c39a97832d7a744ba5cb5f @tjake committed Aug 24, 2011
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/lucandra/cluster/CassandraIndexManager.java
@@ -353,8 +353,18 @@ private synchronized ShardInfo getShardInfo(String indexName, boolean force) thr
for (IColumn c : row.cf.getSortedColumns())
{
String shardStr = ByteBufferUtil.string(c.name());
- Integer shardNum = Integer.valueOf(shardStr);
-
+ Integer shardNum = null;
+
+ try
+ {
+ shardNum = Integer.valueOf(shardStr);
+ }
+ catch(NumberFormatException e)
+ {
+ logger.warn("invalid shard name encountered: "+shardStr+" "+ByteBufferUtil.string(c.value()));
+ continue;
+ }
+
assert c instanceof SuperColumn;
NodeInfo nodes = new NodeInfo(shardNum);

0 comments on commit d9d4a33

Please sign in to comment.