Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.BooleanWritable$Comparator


    assertEquals(md5HashKey1, md5HashKey2);
  }

  @Test
  public void testMD5HashForBooleanWritableKey() throws IOException {
    BooleanWritable key = new BooleanWritable(true);
    MD5Hash md5HashKey1 = HashUtility.getMD5Hash(key);
    MD5Hash md5HashKey2 = HashUtility.getMD5Hash(key);
    assertEquals(md5HashKey1, md5HashKey2);
  }
View Full Code Here


    this.val = val;
    this.valClass = new Text(val.getClass().getName());
  }

  public void setIsOld(Boolean isOld) {
    this.isOld = new BooleanWritable(isOld);
  }
View Full Code Here

    this.isOld = new BooleanWritable(isOld);
  }

  @Override
  public void readFields(DataInput in) throws IOException {
    isOld = new BooleanWritable();
    isOld.readFields(in);
    valClass = new Text();
    valClass.readFields(in);
    try {
      val = (V) Class.forName(valClass.toString()).newInstance();
View Full Code Here

    return o == null ? null : new OrcLazyBoolean((OrcLazyBoolean) o);
  }

  @Override
  public Object getPrimitiveJavaObject(Object o) {
    BooleanWritable writable = getPrimitiveWritableObject(o);
    return writable == null ? null : Boolean.valueOf(writable.get());
  }
View Full Code Here

  }

  public OrcLazyBoolean(OrcLazyBoolean copy) {
    super(copy);
    if (copy.previous != null) {
      previous = new BooleanWritable(((BooleanWritable)copy.previous).get());
    }
  }
View Full Code Here

          inputs.stringValues, inputs.byteValues, inputs.words, rowNumber);
      break;
    }

    OrcLazyBoolean lazyBoolean1 = (OrcLazyBoolean) row.getFieldValue(0);
    BooleanWritable boolean1 = (BooleanWritable) lazyBoolean1.materialize();
    if (boolean1 == null) {
      assertNull(expected.boolean1);
    } else {
      assertEquals(expected.boolean1.booleanValue(), boolean1.get());
    }

    ByteWritable byte1 = (ByteWritable) ((OrcLazyByte) row.getFieldValue(1)).materialize();
    if (byte1 == null) {
      assertNull(expected.byte1);
View Full Code Here

    return latestRead;
  }


  BooleanWritable createWritable(Object previous, boolean v) throws IOException {
    BooleanWritable result = null;
    if (previous == null) {
      result = new BooleanWritable();
    } else {
      result = (BooleanWritable) previous;
    }
    result.set(v);
    return result;
  }
View Full Code Here

  }

  @Override
  public Object next(Object previous) throws IOException {
    BooleanWritable result = null;
    if (valuePresent) {
      result = createWritable(previous, readBoolean());
    }
    return result;
  }
View Full Code Here

      int nextCalls = 0;

      @Override
      public Object next(Object previous) throws IOException {
        if (nextCalls == 0) {
          return new BooleanWritable(true);
        }

        throw new IOException("next should only be called once");
      }
View Full Code Here

    MapWritable map = new MapWritable();
    map.put(new Text("one"), new VIntWritable(1));
    map.put(new Text("two"), new VLongWritable(2));
    Writable[] writables = new Writable[] {
      new BytesWritable(new byte[] { 1, 2, 3, 4 }),
      new ByteWritable((byte) 123), new BooleanWritable(true),
      new VIntWritable(12345), new VLongWritable(123456789L),
      new FloatWritable((float) 1.2), new DoubleWritable(1.234),
      new Text("random string"),
      new ObjectWritable("test")
    };
View Full Code Here

TOP

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

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.