Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.BooleanWritable


  private static Log LOG = LogFactory.getLog(UDFOPNotEqual.class.getName());

  BooleanWritable resultCache;
  public UDFOPNotEqual() {
    resultCache = new BooleanWritable();
  }
View Full Code Here


  public UDFOPNotEqual() {
    resultCache = new BooleanWritable();
  }

  public BooleanWritable evaluate(Text a, Text b)  {
    BooleanWritable r = this.resultCache;
    if ((a == null) || (b == null)) {
      r = null;
    } else {
      r.set(!a.equals(b));
    }
    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }
View Full Code Here

    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }

  public BooleanWritable evaluate(ByteWritable a, ByteWritable b)  {
    BooleanWritable r = this.resultCache;
    if ((a == null) || (b == null)) {
      r = null;
    } else {
      r.set(a.get() != b.get());
    }
    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }
View Full Code Here

      // Boolean
      Converter booleanConverter = ObjectInspectorConverters.getConverter(
          PrimitiveObjectInspectorFactory.javaIntObjectInspector,
          PrimitiveObjectInspectorFactory.writableBooleanObjectInspector);
      assertEquals("BooleanConverter",
          new BooleanWritable(false),
          booleanConverter.convert(Integer.valueOf(0))
          );
      assertEquals("BooleanConverter",
          new BooleanWritable(true),
          booleanConverter.convert(Integer.valueOf(1))
          );
     
      // Byte
      Converter byteConverter = ObjectInspectorConverters.getConverter(
View Full Code Here

    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }

  public BooleanWritable evaluate(ShortWritable a, ShortWritable b)  {
    BooleanWritable r = this.resultCache;
    if ((a == null) || (b == null)) {
      r = null;
    } else {
      r.set(a.get() != b.get());
    }
    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }
View Full Code Here

    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }

  public BooleanWritable evaluate(IntWritable a, IntWritable b)  {
    BooleanWritable r = this.resultCache;
    if ((a == null) || (b == null)) {
      r = null;
    } else {
      r.set(a.get() != b.get());
    }
    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }
View Full Code Here

    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }
 
  public BooleanWritable evaluate(LongWritable a, LongWritable b)  {
    BooleanWritable r = this.resultCache;
    if ((a == null) || (b == null)) {
      r = null;
    } else {
      r.set(a.get() != b.get());
    }
    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }
View Full Code Here

    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }
 
  public BooleanWritable evaluate(FloatWritable a, FloatWritable b)  {
    BooleanWritable r = this.resultCache;
    if ((a == null) || (b == null)) {
      r = null;
    } else {
      r.set(a.get() != b.get());
    }
    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
 
View Full Code Here

    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
 

  public BooleanWritable evaluate(DoubleWritable a, DoubleWritable b)  {
    BooleanWritable r = this.resultCache;
    if ((a == null) || (b == null)) {
      r = null;
    } else {
      r.set(a.get() != b.get());
    }
    // LOG.info("evaluate(" + a + "," + b + ")=" + r);
    return r;
  }
View Full Code Here

    return ((BooleanWritable)o).get();
  }

  @Override
  public Object copyObject(Object o) {
    return o == null ? null : new BooleanWritable(((BooleanWritable)o).get());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.io.BooleanWritable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.