Examples of Pair


Examples of org.apache.crunch.Pair

            LOG.warn("Defaulting to write to a text file from MemPipeline");
            Path outputPath = new Path(path, "out" + outputIndex + ".txt");
            FSDataOutputStream os = fs.create(outputPath);
            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

Examples of org.apache.crunch.Pair

    // test create
    TupleN newTuple = toi.create("Alice", 28, 165.2f);
    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());
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.util.Pair

    FSArray newPropArr = new FSArray(jcas, propArr.size() + 1);
    for (int i = 0; i < propArr.size(); i++) {
      newPropArr.set(i, propArr.get(i));
    }

    Pair annotVerProp = new Pair(jcas);       
    annotVerProp.setAttribute(iv_annotVerPropKey);
    annotVerProp.setValue(String.valueOf(iv_annotVer));

    // add annotation version prop as last item in array
    newPropArr.set(newPropArr.size() - 1, annotVerProp);
    props.setPairs(newPropArr);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.Pair

   * @return the byte size of the index
   */
  public long getIndexHeapSize(String columnName) {
    String[] familyAndQualifier = columnName.split(":");
    if (familyAndQualifier != null && familyAndQualifier.length == 2) {
      Pair fqPair = Pair.of(Bytes.toBytes(familyAndQualifier[0]),
        Bytes.toBytes(familyAndQualifier[1]));
      indexSwitchLock.readLock().lock();
      IdxIndex idx = null;
      try {
        idx = indexMap.get(fqPair);
View Full Code Here

Examples of org.apache.hadoop.hbase.util.Pair

        return true;
      }

    };
    MetaScanner.metaScan(configuration, visitor, this.tableName);
    return new Pair(startKeyList.toArray(new byte[startKeyList.size()][]),
                endKeyList.toArray(new byte[endKeyList.size()][]));
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.Pair

  public void secureBulkLoadHFiles(RpcController controller,
                                   SecureBulkLoadHFilesRequest request,
                                   RpcCallback<SecureBulkLoadHFilesResponse> done) {
    final List<Pair<byte[], String>> familyPaths = new ArrayList<Pair<byte[], String>>();
    for(ClientProtos.BulkLoadHFileRequest.FamilyPath el : request.getFamilyPathList()) {
      familyPaths.add(new Pair(el.getFamily().toByteArray(),el.getPath()));
    }
    final Token userToken =
        new Token(request.getFsToken().getIdentifier().toByteArray(),
                  request.getFsToken().getPassword().toByteArray(),
                  new Text(request.getFsToken().getKind()),
View Full Code Here

Examples of org.apache.hadoop.hbase.util.Pair

        }
        return true;
      }
    };
    MetaScanner.metaScan(configuration, visitor, this.tableName);
    return new Pair(startKeyList.toArray(new byte[startKeyList.size()][]),
                endKeyList.toArray(new byte[endKeyList.size()][]));
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.Pair

        }
        return true;
      }
    };
    MetaScanner.metaScan(configuration, visitor, this.tableName);
    return new Pair(startKeyList.toArray(new byte[startKeyList.size()][]),
                endKeyList.toArray(new byte[endKeyList.size()][]));
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.Pair

        }
        return true;
      }
    };
    MetaScanner.metaScan(configuration, visitor, this.tableName);
    return new Pair(startKeyList.toArray(new byte[startKeyList.size()][]),
                endKeyList.toArray(new byte[endKeyList.size()][]));
  }
View Full Code Here

Examples of org.apache.hadoop.mrunit.types.Pair

    List<Text> values = new ArrayList<Text>();
    values.add(new Text("v1"));
    values.add(new Text("v2"));
    values.add(new Text("v3"));
    Text key = new Text("k");
    Pair<Text, List<Text>> oldInput = new Pair(key, values);
    KeyValueReuseList<Text, Text> updated = feeder.updateInput(oldInput);

    KeyValueReuseList<Text, Text> expected = new KeyValueReuseList<Text, Text>(new Text(), new Text(), driver.getConfiguration());
    for(Text value : values){
      expected.add(new Pair(key, value));
    }

    assertListEquals(expected, updated);
  }
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.