Permalink
Browse files

modified: src/main/java/com/snowballfinance/kddc/job/UserActionSnsJo…

…inJob.java
  • Loading branch information...
1 parent 544633e commit 9515d3c7f3b037c05e0b41d00e9a2fcdc483d9bd Louis Deng committed May 8, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/main/java/com/snowballfinance/kddc/job/UserActionSnsJoinJob.java
View
13 src/main/java/com/snowballfinance/kddc/job/UserActionSnsJoinJob.java
@@ -137,9 +137,16 @@ protected void reduce(Text key, Iterable<UserActionSnsWritable> actions, Context
String[] actionStrs = actionItem.getActions().split("\t");
if(actionStrs != null && actionStrs.length >= 3)
{
- atCount += Integer.valueOf(actionStrs[0].trim(), 10);
- retweetCount += Integer.valueOf(actionStrs[1].trim(), 10);
- commentCount += Integer.valueOf(actionStrs[2].trim(), 10);
+ String str0 = actionStrs[0].trim();
+ String str1 = actionStrs[1].trim();
+ String str2 = actionStrs[2].trim();
+ try {
+ atCount += Integer.valueOf(str0, 10);
+ retweetCount += Integer.valueOf(str1, 10);
+ commentCount += Integer.valueOf(str2, 10);
+ } catch (java.lang.NumberFormatException e) {
+ logger.error("Join Reduce Parse Err:" + str0 + "," + str1 +"," + str2, e);
+ }
} else if(actionItem.isFollowed())
followed = true;
}

0 comments on commit 9515d3c

Please sign in to comment.