Package com.datasalt.pangool.io

Examples of com.datasalt.pangool.io.Utf8


  }

  protected void readUtf8(DataInputStream input, ITuple tuple, int index) throws IOException {
    Object t = tuple.get(index);
    if(t == null || !(t instanceof Utf8)) {
      t = new Utf8();
      tuple.set(index, t);
    }
    ((Utf8) t).readFields(input);

  }
View Full Code Here


      Type fieldType,Class<?> objectClazz) throws IOException {
    this.ser = new HadoopSerialization(conf);
    this.fieldType = fieldType;
    this.objectClazz = objectClazz;
    switch(fieldType){
      case STRING: this.instance = new Utf8(); break;
      case OBJECT:
        this.instance = ReflectionUtils.newInstance(objectClazz, conf);
        break;
      default:
        this.instance=null;
View Full Code Here

    }
  }
 
  protected void readUtf8(DataInput input,ITuple tuple,int index) throws IOException {
    //this method is safe because tuple is internal, the tuple is not the final one
    Utf8 t = (Utf8)tuple.get(index);
    if (t == null){
      t = new Utf8();
      tuple.set(index,t);
    }
    t.readFields(input);
  }
View Full Code Here

      return (element2 == null) ? 0 : -1;
    } else if(element2 == null) {
      return 1;
    } else {
      if(element1 instanceof String) {
        element1 = new Utf8((String) element1);
      }
      if(element2 instanceof String) {
        element2 = new Utf8((String) element2);
      }
      if(element1 instanceof Comparable) {
        return ((Comparable) element1).compareTo(element2);
      } else if(element2 instanceof Comparable) {
        return -((Comparable) element2).compareTo(element1);
View Full Code Here

      return (element2 == null) ? 0 : -1;
    } else if(element2 == null) {
      return 1;
    } else {
      if(element1 instanceof String) {
        element1 = new Utf8((String) element1);
      }
      if(element2 instanceof String) {
        element2 = new Utf8((String) element2);
      }
      if(element1 instanceof byte[]){
        byte[] buffer1 = (byte[])element1;
        if (element2 instanceof byte[]){
          byte[] buffer2 = (byte[])element2;
View Full Code Here

    }
  }
 
  protected void readUtf8(DataInputStream input,ITuple tuple,int index) throws IOException {
    //this method is safe because tuple is internal, the tuple is not the final one
    Utf8 t = (Utf8)tuple.get(index);
    if (t == null){
      t = new Utf8();
      tuple.set(index,t);
    }
    t.readFields(input);
  }
View Full Code Here

TOP

Related Classes of com.datasalt.pangool.io.Utf8

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.