Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.Text.find()


    }
    int secondZeroIndex = colq.find("\0", firstZeroIndex + 1);
    if (secondZeroIndex < 0) {
      throw new IllegalArgumentException("bad docid: " + key.toString());
    }
    int thirdZeroIndex = colq.find("\0", secondZeroIndex + 1);
    if (thirdZeroIndex < 0) {
      throw new IllegalArgumentException("bad docid: " + key.toString());
    }
    Text docID = new Text();
    try {
View Full Code Here


      // We're past the index column family, so return a term that will sort lexicographically last.
      // The last unicode character should suffice
      return new Text("\uFFFD");
    }
    Text colq = key.getColumnQualifier();
    int zeroIndex = colq.find("\0");
    Text term = new Text();
    term.set(colq.getBytes(), 0, zeroIndex);
    return term;
  }
 
View Full Code Here

      }
      if (ucomp < 0) { // need to move up
        log.debug("my uid is less than jumpUid, topUid: " + myUid + "   jumpUid: " + jumpUid);
       
        Text cq = jumpKey.getColumnQualifier();
        int index = cq.find(NULL_BYTE);
        if (0 <= index) {
          cq.set(cq.getBytes(), index + 1, cq.getLength() - index - 1);
        } else {
          log.error("Expected a NULL separator in the column qualifier");
          this.topKey = null;
View Full Code Here

    return parseDocID(key);
  }
 
  public static Text parseDocID(Key key) {
    Text colq = key.getColumnQualifier();
    int firstZeroIndex = colq.find("\0");
    if (firstZeroIndex < 0) {
      throw new IllegalArgumentException("bad docid: " + key.toString());
    }
    int secondZeroIndex = colq.find("\0", firstZeroIndex + 1);
    if (secondZeroIndex < 0) {
View Full Code Here

    Text colq = key.getColumnQualifier();
    int firstZeroIndex = colq.find("\0");
    if (firstZeroIndex < 0) {
      throw new IllegalArgumentException("bad docid: " + key.toString());
    }
    int secondZeroIndex = colq.find("\0", firstZeroIndex + 1);
    if (secondZeroIndex < 0) {
      throw new IllegalArgumentException("bad docid: " + key.toString());
    }
    int thirdZeroIndex = colq.find("\0", secondZeroIndex + 1);
    if (thirdZeroIndex < 0) {
View Full Code Here

    }
    int secondZeroIndex = colq.find("\0", firstZeroIndex + 1);
    if (secondZeroIndex < 0) {
      throw new IllegalArgumentException("bad docid: " + key.toString());
    }
    int thirdZeroIndex = colq.find("\0", secondZeroIndex + 1);
    if (thirdZeroIndex < 0) {
      throw new IllegalArgumentException("bad docid: " + key.toString());
    }
    Text docID = new Text();
    try {
View Full Code Here

      // We're past the index column family, so return a term that will sort lexicographically last.
      // The last unicode character should suffice
      return new Text("\uFFFD");
    }
    Text colq = key.getColumnQualifier();
    int zeroIndex = colq.find("\0");
    Text term = new Text();
    term.set(colq.getBytes(), 0, zeroIndex);
    return term;
  }
 
View Full Code Here

  public void text() {
   
    Text t = new Text("\u0041\u00DF\u6771\uD801\uDC00");
    assertThat(t.getLength(), is(10));
   
    assertThat(t.find("\u0041"), is(0));
    assertThat(t.find("\u00DF"), is(1));
    assertThat(t.find("\u6771"), is(3));
    assertThat(t.find("\uD801\uDC00"), is(6));

    assertThat(t.charAt(0), is(0x0041));
View Full Code Here

   
    Text t = new Text("\u0041\u00DF\u6771\uD801\uDC00");
    assertThat(t.getLength(), is(10));
   
    assertThat(t.find("\u0041"), is(0));
    assertThat(t.find("\u00DF"), is(1));
    assertThat(t.find("\u6771"), is(3));
    assertThat(t.find("\uD801\uDC00"), is(6));

    assertThat(t.charAt(0), is(0x0041));
    assertThat(t.charAt(1), is(0x00DF));
View Full Code Here

    Text t = new Text("\u0041\u00DF\u6771\uD801\uDC00");
    assertThat(t.getLength(), is(10));
   
    assertThat(t.find("\u0041"), is(0));
    assertThat(t.find("\u00DF"), is(1));
    assertThat(t.find("\u6771"), is(3));
    assertThat(t.find("\uD801\uDC00"), is(6));

    assertThat(t.charAt(0), is(0x0041));
    assertThat(t.charAt(1), is(0x00DF));
    assertThat(t.charAt(3), is(0x6771));
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.