diff --git a/.travis.yml b/.travis.yml
index b688410..2fd5140 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
language: java
jdk:
- - openjdk6
- - openjdk7
+ - oraclejdk7
+ - oraclejdk8
diff --git a/core/lib/apache-cassandra-0.6.0.jar b/core/lib/apache-cassandra-0.6.0.jar
deleted file mode 100644
index 858e2af..0000000
Binary files a/core/lib/apache-cassandra-0.6.0.jar and /dev/null differ
diff --git a/core/lib/cassandra-javautils.jar b/core/lib/cassandra-javautils.jar
deleted file mode 100644
index 1cd5e4f..0000000
Binary files a/core/lib/cassandra-javautils.jar and /dev/null differ
diff --git a/core/lib/clhm-production-1.0.jar b/core/lib/clhm-production-1.0.jar
deleted file mode 100644
index 028f505..0000000
Binary files a/core/lib/clhm-production-1.0.jar and /dev/null differ
diff --git a/core/lib/commons-lang-2.4.jar b/core/lib/commons-lang-2.4.jar
deleted file mode 100644
index 532939e..0000000
Binary files a/core/lib/commons-lang-2.4.jar and /dev/null differ
diff --git a/core/lib/flexjson-1.7.jar b/core/lib/flexjson-1.7.jar
deleted file mode 100644
index 5e07e12..0000000
Binary files a/core/lib/flexjson-1.7.jar and /dev/null differ
diff --git a/core/lib/hector-0.6.0-15.jar b/core/lib/hector-0.6.0-15.jar
deleted file mode 100644
index edddec6..0000000
Binary files a/core/lib/hector-0.6.0-15.jar and /dev/null differ
diff --git a/core/lib/high-scale-lib-1.0.jar b/core/lib/high-scale-lib-1.0.jar
deleted file mode 100644
index 421a436..0000000
Binary files a/core/lib/high-scale-lib-1.0.jar and /dev/null differ
diff --git a/core/lib/libthrift-r917130.jar b/core/lib/libthrift-r917130.jar
deleted file mode 100644
index 896cdb2..0000000
Binary files a/core/lib/libthrift-r917130.jar and /dev/null differ
diff --git a/core/pom.xml b/core/pom.xml
index 58ce948..bac7380 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -21,10 +21,10 @@
org.apache.maven.plugins
maven-compiler-plugin
- 2.3.1
+ 3.2
-
- 1.5
+
+ 1.7
@@ -45,4 +45,4 @@
test
-
\ No newline at end of file
+
diff --git a/core/src/main/java/org/unigram/likelike/common/FsUtil.java b/core/src/main/java/org/unigram/likelike/common/FsUtil.java
index bcf21e4..b5849e3 100644
--- a/core/src/main/java/org/unigram/likelike/common/FsUtil.java
+++ b/core/src/main/java/org/unigram/likelike/common/FsUtil.java
@@ -16,13 +16,13 @@
*/
package org.unigram.likelike.common;
-import java.io.IOException;
-import java.util.logging.Level;
-
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
+import java.io.IOException;
+import java.util.logging.Level;
+
/**
* File utility class.
*/
@@ -49,7 +49,7 @@ public static boolean checkPath(final Path dir,
final FileSystem fs)
throws IOException {
if (fs.exists(dir)) {
- logger.log(Level.INFO, "Overiding: " + dir.toString());
+ logger.log(Level.INFO, "Overriding: " + dir.toString());
return fs.delete(dir, true);
} else {
logger.log(Level.FINE, "No such file: " + dir.toString());
@@ -80,16 +80,15 @@ public static boolean checkPath(final Path dir,
*/
public static void clean(final FileSystem fs,
final String... fileNames) throws IOException {
-
- for (int i = 0; i < fileNames.length; i++) {
- Path path = new Path(fileNames[i]);
+
+ for (String fileName : fileNames) {
+ Path path = new Path(fileName);
if (fs.exists(path)) {
- logger.log(Level.INFO,
+ logger.log(Level.INFO,
"Removing: " + path.toString());
fs.delete(path, true);
}
}
- return;
- }
+ }
}
diff --git a/core/src/main/java/org/unigram/likelike/common/RelatedUsersWritable.java b/core/src/main/java/org/unigram/likelike/common/RelatedUsersWritable.java
index b3b3e85..e64550b 100644
--- a/core/src/main/java/org/unigram/likelike/common/RelatedUsersWritable.java
+++ b/core/src/main/java/org/unigram/likelike/common/RelatedUsersWritable.java
@@ -16,6 +16,9 @@
*/
package org.unigram.likelike.common;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.Writable;
+
import java.io.DataInput;
import java.io.DataOutput;
import java.io.EOFException;
@@ -23,9 +26,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.io.Writable;
-
/**
*
*/
@@ -72,7 +72,6 @@ public List getRelatedUsers() {
* @param in input stream
* @throws IOException -
*/
- @Override
public void readFields(final DataInput in) throws IOException {
try {
int listSize = in.readInt();
@@ -93,7 +92,6 @@ public void readFields(final DataInput in) throws IOException {
* @param out output stream
* @throws IOException -
*/
- @Override
public void write(final DataOutput out) throws IOException {
out.writeInt(this.relatedUsers.size());
for (LongWritable item : this.relatedUsers) {
diff --git a/core/src/main/java/org/unigram/likelike/feature/FeatureExtraction.java b/core/src/main/java/org/unigram/likelike/feature/FeatureExtraction.java
index e712481..056e591 100644
--- a/core/src/main/java/org/unigram/likelike/feature/FeatureExtraction.java
+++ b/core/src/main/java/org/unigram/likelike/feature/FeatureExtraction.java
@@ -1,7 +1,5 @@
package org.unigram.likelike.feature;
-import java.io.IOException;
-
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.FileSystem;
@@ -13,13 +11,14 @@
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
-
import org.unigram.likelike.common.FsUtil;
import org.unigram.likelike.common.LikelikeConstants;
-import org.unigram.likelike.util.IdentityReducer;
-import org.unigram.likelike.util.InverseMapper;
import org.unigram.likelike.util.AddFeatureMapper;
import org.unigram.likelike.util.AddFeatureReducer;
+import org.unigram.likelike.util.IdentityReducer;
+import org.unigram.likelike.util.InverseMapper;
+
+import java.io.IOException;
/**
*
@@ -33,7 +32,6 @@ public class FeatureExtraction extends Configured
* @return 0 when succeeded
* @throws Exception -
*/
- @Override
public int run(final String[] args) throws Exception {
Configuration conf = getConf();
return this.run(args, conf);
diff --git a/core/src/main/java/org/unigram/likelike/feature/FeatureExtractionReducer.java b/core/src/main/java/org/unigram/likelike/feature/FeatureExtractionReducer.java
index 4498b6f..ed57756 100644
--- a/core/src/main/java/org/unigram/likelike/feature/FeatureExtractionReducer.java
+++ b/core/src/main/java/org/unigram/likelike/feature/FeatureExtractionReducer.java
@@ -97,13 +97,12 @@ public int compare(final Object o1, final Object o2){
Map.Entry obj = (Map.Entry) it.next();
Long feature = (Long) obj.getKey();
if (!targetFeatures.containsKey(feature)) {
- //System.out.println("target: " + target + "\tfeature: " + feature);
- try {
- this.writer.write((Long) target.get(), feature, context);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ try {
+ this.writer.write((Long) target.get(), feature, context);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
}
}
@@ -145,7 +144,7 @@ public final void setup(final Context context) {
LikelikeConstants.DEFAULT_LIKELIKE_OUTPUT_WRITER;
jc.set(LikelikeConstants.CASSANDRA_COLUMNFAMILY_NAME,
- LikelikeConstants.LIKELIKE_CASSANDRA_FEATURE_EXTRACTION_COLUMNFAMILY_NAME);
+ LikelikeConstants.LIKELIKE_CASSANDRA_FEATURE_EXTRACTION_COLUMNFAMILY_NAME);
try {
writerClassName =
diff --git a/core/src/main/java/org/unigram/likelike/lsh/GetRecommendationsReducer.java b/core/src/main/java/org/unigram/likelike/lsh/GetRecommendationsReducer.java
index 204141d..1b372be 100644
--- a/core/src/main/java/org/unigram/likelike/lsh/GetRecommendationsReducer.java
+++ b/core/src/main/java/org/unigram/likelike/lsh/GetRecommendationsReducer.java
@@ -40,7 +40,6 @@
public class GetRecommendationsReducer extends
Reducer {
-
/**
* reduce.
* @param key target
@@ -53,8 +52,7 @@ public void reduce(final LongWritable key,
final Iterable values,
final Context context)
throws IOException, InterruptedException {
-
- HashMap candidates
+ HashMap candidates
= new HashMap();
for (Candidate cand : values) {
Long tid = cand.getId().get();
@@ -63,10 +61,8 @@ public void reduce(final LongWritable key,
weight += 1.0; // not use the size of the cluster
candidates.put(tid, weight);
} else {
- candidates.put(tid,
- new Double(1.0));
+ candidates.put(tid, new Double(1.0));
}
-
if (candidates.size() > 50000) { // TODO should be parameterized
break;
}
@@ -109,7 +105,7 @@ public void reduce(final LongWritable key,
*/
@Override
public final void setup(final Context context) {
- Configuration jc = null;
+ Configuration jc = null;
if (context == null) {
jc = new Configuration();
@@ -118,11 +114,11 @@ public final void setup(final Context context) {
}
this.maxOutputSize = jc.getLong(
- LikelikeConstants.MAX_OUTPUT_SIZE ,
+ LikelikeConstants.MAX_OUTPUT_SIZE,
LikelikeConstants.DEFAULT_MAX_OUTPUT_SIZE);
-
- this.comparator = new Comparator