Package com.datasalt.pangool.io

Examples of com.datasalt.pangool.io.Utf8


    }
  }
 
  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


      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

  }

  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

      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

      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

  }

  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

      tuple.set(0, "Pere");
      tuple.set(1, 100);
      tuple.set(2, new Text("ES"));

      // We use the multiple outputs here -
      collector.write(OUTPUT_1, new Utf8((String) tuple.get(0)), new Utf8((Text) tuple.get(2)));
      collector.write(OUTPUT_2, new IntWritable((Integer) tuple.get(1)), NullWritable.get());
      collector.write(TUPLEOUTPUT_1, tuple, NullWritable.get());

      collector.write(tuple);
    }
View Full Code Here

    public void reduce(ITuple group, Iterable<ITuple> tuples, TupleMRContext context, Collector collector)
        throws IOException, InterruptedException, TupleMRException {
      Iterator<ITuple> iterator = tuples.iterator();
      while(iterator.hasNext()) {
        ITuple tuple = iterator.next();
        Utf8 text = (Utf8) tuple.get("word");
        countToEmit.set((Integer) tuple.get("count"));
        collector.write(text, countToEmit);
        Assert.assertFalse(iterator.hasNext());
      }
    }
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.