Package org.apache.hadoop.io

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


    // nullColumns
    nullColumns.clear();
    size = in.readInt();
    for (int i = 0; i < size; i++) {
      Text key = new Text();
      key.readFields(in);
      setColumnFilter(key, null);
    }
  }

  /**
 
View Full Code Here


    DataInputBuffer valueBuf = new DataInputBuffer();
    long prev = Long.MIN_VALUE;
    while (reader.nextRawKey(keyBuf)) {
      reader.nextRawValue(valueBuf);
      key.readFields(keyBuf);
      value.readFields(valueBuf);
      if (prev != Long.MIN_VALUE) {
        assert(prev <= key.get());
        prev = key.get();
      }
      LOG.info("key = " + key.get() + "; value = " + value);
View Full Code Here

      IFile.Reader reader = new IFile.Reader(inStream, indexRecord.getPartLength(), codec, null,
          null, false, 0, -1);
      while (reader.nextRawKey(keyBuffer)) {
        reader.nextRawValue(valBuffer);
        keyDeser.readFields(keyBuffer);
        valDeser.readFields(valBuffer);
        int partition = partitioner.getPartition(keyDeser, valDeser, numPartitions);
        assertTrue(expectedValues.get(partition).remove(keyDeser.toString(), valDeser.toString()));
      }
      inStream.close();
    }
View Full Code Here

  public void readFields(DataInput in) throws IOException {
    instance.clear();
    int entries = WritableUtils.readVInt(in);
    for (int i = 0; i < entries; i++) {
      Text txt = new Text();
      txt.readFields(in);
      BytesWritable value = new BytesWritable();
      value.readFields(in);
      instance.put(txt, value);
    }
  }
View Full Code Here

  public void readFields(DataInput in) throws IOException {
    int len = in.readInt();
    tuple = Lists.newArrayListWithCapacity(len);
    Text value = new Text();
    for (int i = 0; i < len; i++) {
      value.readFields(in);
      tuple.add(value.toString());
    }
  }
 
  @Override
View Full Code Here

        return super.compare(b1, s1, l1, b2, s2, l2);
      }
     
      try {
        Text logline1 = new Text();
        logline1.readFields(new DataInputStream(new ByteArrayInputStream(b1, s1, l1)));
        String line1 = logline1.toString();
        String[] logColumns1 = line1.split(columnSeparator);
       
        Text logline2 = new Text();
        logline2.readFields(new DataInputStream(new ByteArrayInputStream(b2, s2, l2)));
View Full Code Here

        logline1.readFields(new DataInputStream(new ByteArrayInputStream(b1, s1, l1)));
        String line1 = logline1.toString();
        String[] logColumns1 = line1.split(columnSeparator);
       
        Text logline2 = new Text();
        logline2.readFields(new DataInputStream(new ByteArrayInputStream(b2, s2, l2)));
        String line2 = logline2.toString();
        String[] logColumns2 = line2.split(columnSeparator);
       
        if(logColumns1 == null || logColumns2 == null) {
          return super.compare(b1, s1, l1, b2, s2, l2);
View Full Code Here

        return in.readDouble();
    }
   
    public Text readString(String tag) throws IOException {
        Text text = new Text();
        text.readFields(in);
        return text;
    }
   
    public ByteArrayOutputStream readBuffer(String tag) throws IOException {
        int len = readInt(tag);
View Full Code Here

    FSDataInputStream in = dfs.open(new Path(expectedPath));

    String className = in.readUTF();
    Text message = (Text) ReflectionUtils.newInstance(Class.forName(className),
        config);
    message.readFields(in);

    assertEquals("data", message.toString());

    dfs.delete(new Path("checkpoint"), true);
  }
View Full Code Here

  /** {@inheritDoc} */
  public void readFields(DataInput in) throws IOException {
    int versionNumber = in.readByte();
    if (versionNumber <= 2) {
      Text t = new Text();
      t.readFields(in);
      this.name = t.getBytes();
      if (HStoreKey.getFamilyDelimiterIndex(this.name) > 0) {
        this.name = stripColon(this.name);
      }
    } else {
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.