Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request #64 from myui/feature/distcache
Browse files Browse the repository at this point in the history
Feature/distcache
  • Loading branch information
myui committed Jul 1, 2014
2 parents 1008ff8 + d9951b6 commit 4647931
Show file tree
Hide file tree
Showing 36 changed files with 260 additions and 34 deletions.
3 changes: 3 additions & 0 deletions scripts/ddl/define-all.hive
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ create temporary function taskid as 'hivemall.tools.mapred.TaskIdUDF';
drop temporary function rowid;
create temporary function rowid as 'hivemall.tools.mapred.RowIdUDF';

drop temporary function distcache_gets;
create temporary function distcache_gets as 'hivemall.tools.mapred.DistributedCacheLookupUDF';

----------------------
-- string functions --
----------------------
Expand Down
3 changes: 3 additions & 0 deletions scripts/ddl/define-tools-udf.hive
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ create temporary function taskid as 'hivemall.tools.mapred.TaskIdUDF';
drop temporary function rowid;
create temporary function rowid as 'hivemall.tools.mapred.RowIdUDF';

drop temporary function distcache_gets;
create temporary function distcache_gets as 'hivemall.tools.mapred.DistributedCacheLookupUDF';

----------------------
-- string functions --
----------------------
Expand Down
4 changes: 2 additions & 2 deletions src/main/hivemall/classifier/BinaryOnlineClassifierUDTF.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import hivemall.common.WeightValue;
import hivemall.utils.collections.OpenHashMap;
import hivemall.utils.collections.OpenHashMap.IMapIterator;
import hivemall.utils.hadoop.HiveUtils;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -47,7 +48,6 @@
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableConstantStringObjectInspector;
import org.apache.hadoop.io.FloatWritable;
import org.apache.hadoop.io.Text;

Expand Down Expand Up @@ -122,7 +122,7 @@ protected CommandLine processOptions(ObjectInspector[] argOIs) throws UDFArgumen

CommandLine cl = null;
if(argOIs.length >= 3) {
String rawArgs = ((WritableConstantStringObjectInspector) argOIs[2]).getWritableConstantValue().toString();
String rawArgs = HiveUtils.getConstString(argOIs[2]);
cl = parseOptions(rawArgs);

if(cl.hasOption("fh")) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/common/RandomizedAmplifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.common;

import hivemall.utils.ArrayUtils;
import hivemall.utils.lang.ArrayUtils;

import java.util.Random;

Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/ensemble/MaxValueLabelUDAF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ensemble;

import hivemall.utils.WritableUtils;
import hivemall.utils.hadoop.WritableUtils;

import org.apache.hadoop.hive.ql.exec.UDAF;
import org.apache.hadoop.hive.ql.exec.UDAFEvaluator;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/ensemble/bagging/VotedAvgUDAF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ensemble.bagging;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import org.apache.hadoop.hive.ql.exec.UDAF;
import org.apache.hadoop.hive.ql.exec.UDAFEvaluator;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/ensemble/bagging/WeightVotedAvgUDAF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ensemble.bagging;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import org.apache.hadoop.hive.ql.exec.UDAF;
import org.apache.hadoop.hive.ql.exec.UDAFEvaluator;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/ftvec/AddBiasUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package hivemall.ftvec;

import hivemall.HivemallConstants;
import hivemall.utils.WritableUtils;
import hivemall.utils.hadoop.WritableUtils;

import java.util.List;

Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/ftvec/hashing/ArrayHashValuesUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ftvec.hashing;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;
import hivemall.utils.hashing.MurmurHash3;

import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ftvec.hashing;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;
import hivemall.utils.hashing.MurmurHash3;

import java.util.Arrays;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/ftvec/hashing/MurmurHash3UDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ftvec.hashing;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;
import hivemall.utils.hashing.MurmurHash3;

import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/ftvec/hashing/Sha1UDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ftvec.hashing;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ftvec.scaling;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/ftvec/scaling/RescaleUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ftvec.scaling;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.FloatWritable;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/ftvec/scaling/ZScoreUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.ftvec.scaling;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.FloatWritable;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/knn/distance/CosineSimilarityUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.knn.distance;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;
import hivemall.common.FeatureValue;

import java.util.Collections;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/knn/distance/HammingDistanceUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.knn.distance;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import java.math.BigInteger;
import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/knn/distance/JaccardIndexUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.knn.distance;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import java.math.BigInteger;

Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/knn/distance/PopcountUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.knn.distance;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import java.math.BigInteger;
import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/knn/lsh/MinHashesUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/package hivemall.knn.lsh;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;
import hivemall.common.FeatureValue;
import hivemall.utils.hashing.MurmurHash3;

Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/knn/lsh/bBitMinHashUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/package hivemall.knn.lsh;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;
import hivemall.common.FeatureValue;
import hivemall.utils.hashing.MurmurHash3;

Expand Down
4 changes: 2 additions & 2 deletions src/main/hivemall/regression/OnlineRegressionUDTF.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import hivemall.common.WeightValue;
import hivemall.utils.collections.OpenHashMap;
import hivemall.utils.collections.OpenHashMap.IMapIterator;
import hivemall.utils.hadoop.HiveUtils;

import java.util.ArrayList;
import java.util.Collection;
Expand All @@ -48,7 +49,6 @@
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.FloatObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableConstantStringObjectInspector;
import org.apache.hadoop.io.FloatWritable;
import org.apache.hadoop.io.Text;

Expand Down Expand Up @@ -133,7 +133,7 @@ protected CommandLine processOptions(ObjectInspector[] argOIs) throws UDFArgumen

CommandLine cl = null;
if(argOIs.length >= 3) {
String rawArgs = ((WritableConstantStringObjectInspector) argOIs[2]).getWritableConstantValue().toString();
String rawArgs = HiveUtils.getConstString(argOIs[2]);
cl = parseOptions(rawArgs);

if(cl.hasOption("fh")) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/hivemall/tools/map/MapGetSumUDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package hivemall.tools.map;

import static hivemall.utils.WritableUtils.val;
import static hivemall.utils.hadoop.WritableUtils.val;

import java.util.List;
import java.util.Map;
Expand Down
Loading

0 comments on commit 4647931

Please sign in to comment.