List of usage examples for org.apache.hadoop.io BooleanWritable BooleanWritable
public BooleanWritable(boolean value)
From source file:edu.hku.sdb.udf.hive.SdbEqUDF.java
License:Apache License
public BooleanWritable evaluate(Text value) { if (value == null) { return new BooleanWritable(false); }/*from www. ja v a 2s . c o m*/ return new BooleanWritable(UDFHandler.equal(TypeCast.textToBigInt(value))); }
From source file:edu.hku.sdb.udf.hive.SdbGeUDF.java
License:Apache License
public BooleanWritable evaluate(Text value, Text halfN) { if (value == null || halfN == null) { return new BooleanWritable(false); }/*from w w w . jav a2 s . com*/ if (UDFHandler.greatThan(TypeCast.textToBigInt(value), TypeCast.textToBigInt(halfN))) return new BooleanWritable(true); if (UDFHandler.equal(TypeCast.textToBigInt(value))) return new BooleanWritable(true); return new BooleanWritable(false); }
From source file:edu.hku.sdb.udf.hive.SdbGtUDF.java
License:Apache License
public BooleanWritable evaluate(Text value, Text halfN) { if (value == null || halfN == null) { return new BooleanWritable(false); }/*www.j ava 2s .c o m*/ return new BooleanWritable( UDFHandler.greatThan(TypeCast.textToBigInt(value), TypeCast.textToBigInt(halfN))); }
From source file:edu.hku.sdb.udf.hive.SdbLeUDF.java
License:Apache License
public BooleanWritable evaluate(Text value, Text halfN) { if (value == null || halfN == null) { return new BooleanWritable(false); }//from w ww . ja v a 2 s . c om if (UDFHandler.lessThan(TypeCast.textToBigInt(value), TypeCast.textToBigInt(halfN))) return new BooleanWritable(true); if (UDFHandler.equal(TypeCast.textToBigInt(value))) return new BooleanWritable(true); return new BooleanWritable(false); }
From source file:edu.hku.sdb.udf.hive.SdbLtUDF.java
License:Apache License
public BooleanWritable evaluate(Text value, Text halfN) { if (value == null || halfN == null) { return new BooleanWritable(false); }// ww w. j a va 2s . co m return new BooleanWritable(UDFHandler.lessThan(TypeCast.textToBigInt(value), TypeCast.textToBigInt(halfN))); }
From source file:edu.hku.sdb.udf.hive.SdbNeUDF.java
License:Apache License
public BooleanWritable evaluate(Text value) { if (value == null) { return new BooleanWritable(false); }/*from w w w . ja v a 2 s .c o m*/ return new BooleanWritable(!UDFHandler.equal(TypeCast.textToBigInt(value))); }
From source file:edu.hku.sdb.udf.hive.SdbSearchUDF.java
License:Apache License
public BooleanWritable evaluate(ArrayList<String> a, Text b, Text n) { return new BooleanWritable(UDFHandler.match(a, b.toString(), n.toString())); }
From source file:edu.ub.ahstfg.io.DocumentDistance.java
License:Open Source License
/** * Unparametrized constructor.//from w w w. j a v a 2 s .c o m */ public DocumentDistance() { doc = new DocumentDescriptor(); distance = new DoubleWritable(0.0); stub = new BooleanWritable(false); }
From source file:edu.ub.ahstfg.io.DocumentDistance.java
License:Open Source License
/** * Constructor for stub documents./* w w w. j a v a 2s.c o m*/ * @param stub true to make a stub docuemnt. */ public DocumentDistance(boolean stub) { doc = new DocumentDescriptor(); distance = new DoubleWritable(0.0); this.stub = new BooleanWritable(stub); }
From source file:edu.ub.ahstfg.io.DocumentDistance.java
License:Open Source License
/** * Constructor specifying the document descriptor and the distance to centroid. * @param doc Document descriptor./*from www . j av a 2 s .c o m*/ * @param distance Distance to centroid. */ public DocumentDistance(DocumentDescriptor doc, DoubleWritable distance) { this.doc = doc; this.distance = distance; stub = new BooleanWritable(false); }