Package org.apache.crunch

Examples of org.apache.crunch.Pair.second()


            if (collection instanceof PTable) {
              for (Object o : collection.materialize()) {
                Pair p = (Pair) o;
                os.writeBytes(p.first().toString());
                os.writeBytes("\t");
                os.writeBytes(p.second().toString());
                os.writeBytes("\r\n");
              }
            } else {
              for (Object o : collection.materialize()) {
                os.writeBytes(o.toString() + "\r\n");
View Full Code Here


    assertEquals(tuple, newTuple);
    TupleObjectInspector<Pair> poi = new TupleObjectInspector<Pair>(TupleFactory.PAIR,
        Writables.strings(), Writables.ints());
    Pair pair = poi.create("word", 29);
    assertEquals("word", pair.first());
    assertEquals(29, pair.second());
  }
 
  @Test
  public void testByteBufferObjectInspector() {
    byte[] bytes = {0, 9, 4, 18, 64, 6, 1};
View Full Code Here

            if (collection instanceof PTable) {
              for (Object o : collection.materialize()) {
                Pair p = (Pair) o;
                os.writeBytes(p.first().toString());
                os.writeBytes("\t");
                os.writeBytes(p.second().toString());
                os.writeBytes("\r\n");
              }
            } else {
              for (Object o : collection.materialize()) {
                os.writeBytes(o.toString() + "\r\n");
View Full Code Here

              byte[] tab = "\t".getBytes(Charsets.UTF_8);
              for (Object o : collection.materialize()) {
                Pair p = (Pair) o;
                os.write(p.first().toString().getBytes(Charsets.UTF_8));
                os.write(tab);
                os.write(p.second().toString().getBytes(Charsets.UTF_8));
                os.write(newLine);
              }
            } else {
              for (Object o : collection.materialize()) {
                os.write(o.toString().getBytes(Charsets.UTF_8));
View Full Code Here

        if (collection instanceof PTable) {
          for (Object o : collection.materialize()) {
            Pair p = (Pair) o;
            os.writeBytes(p.first().toString());
            os.writeBytes("\t");
            os.writeBytes(p.second().toString());
            os.writeBytes("\r\n");
          }
        } else {
          for (Object o : collection.materialize()) {
            os.writeBytes(o.toString() + "\r\n");
View Full Code Here

              byte[] tab = "\t".getBytes(Charsets.UTF_8);
              for (Object o : collection.materialize()) {
                Pair p = (Pair) o;
                os.write(p.first().toString().getBytes(Charsets.UTF_8));
                os.write(tab);
                os.write(p.second().toString().getBytes(Charsets.UTF_8));
                os.write(newLine);
              }
            } else {
              for (Object o : collection.materialize()) {
                os.write(o.toString().getBytes(Charsets.UTF_8));
View Full Code Here

            if (collection instanceof PTable) {
              for (Object o : collection.materialize()) {
                Pair p = (Pair) o;
                os.writeBytes(p.first().toString());
                os.writeBytes("\t");
                os.writeBytes(p.second().toString());
                os.writeBytes("\r\n");
              }
            } else {
              for (Object o : collection.materialize()) {
                os.writeBytes(o.toString() + "\r\n");
View Full Code Here

        if (collection instanceof PTable) {
          for (Object o : collection.materialize()) {
            Pair p = (Pair) o;
            os.writeBytes(p.first().toString());
            os.writeBytes("\t");
            os.writeBytes(p.second().toString());
            os.writeBytes("\r\n");
          }
        } else {
          for (Object o : collection.materialize()) {
            os.writeBytes(o.toString() + "\r\n");
View Full Code Here

        if (collection instanceof PTable) {
          for (Object o : collection.materialize()) {
            Pair p = (Pair) o;
            os.writeBytes(p.first().toString());
            os.writeBytes("\t");
            os.writeBytes(p.second().toString());
            os.writeBytes("\r\n");
          }
        } else {
          for (Object o : collection.materialize()) {
            os.writeBytes(o.toString() + "\r\n");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.