Package org.apache.hadoop.io

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


 
  /** read the long value */
  static long readLong(DataInputStream in) throws IOException {
    LongWritable ustr = TL_DATA.get().U_LONG;
    ustr.readFields(in);
    return ustr.get();
  }

  /** write the long value */
  static void writeLong(long value, DataOutputStream out) throws IOException {
View Full Code Here


  }

  /** read the long value */
  static long readLong(DataInputStream in) throws IOException {
    LongWritable ustr = TL_DATA.get().U_LONG;
    ustr.readFields(in);
    return ustr.get();
  }

  /** write the long value */
  static void writeLong(long value, DataOutputStream out) throws IOException {
View Full Code Here

 
  /** read the long value */
  static long readLong(DataInput in) throws IOException {
    LongWritable uLong = TL_DATA.get().U_LONG;
    uLong.readFields(in);
    return uLong.get();
  }

  /** write the long value */
  static void writeLong(long value, DataOutputStream out) throws IOException {
View Full Code Here

                    all++;
                    DoubleWritable min = new DoubleWritable();
                    min.readFields(input);
                    all++;
                    LongWritable sum = new LongWritable();
                    sum.readFields(input);
                    all++;
                    if (i > 0) {
                        assertTrue(max.get() == maxPageRank);
                        assertTrue(min.get() == minPageRank);
                        assertTrue(sum.get() == numVertices);
View Full Code Here

      for (int i = 0; i < numAggregators; i++) {
        String aggregatorName = input.readUTF();
        String aggregatorClassName = input.readUTF();
        if (aggregatorName.equals(AggregatorUtils.SPECIAL_COUNT_AGGREGATOR)) {
          LongWritable count = new LongWritable(0);
          count.readFields(input);
          aggregatorData.receivedRequestCountFromMaster(count.get(),
              getSenderTaskId());
        } else {
          Class<Aggregator<Writable>> aggregatorClass =
              AggregatorUtils.getAggregatorClass(aggregatorClassName);
View Full Code Here

      for (int i = 0; i < numAggregators; i++) {
        String aggregatorName = input.readUTF();
        if (aggregatorName.equals(
            AggregatorUtils.SPECIAL_COUNT_AGGREGATOR)) {
          LongWritable count = new LongWritable(0);
          count.readFields(input);
          aggregatorData.receivedRequestCountFromWorker(count.get(),
              getSenderTaskId());
        } else {
          Writable aggregatedValue =
              aggregatorData.createAggregatorInitialValue(aggregatorName);
View Full Code Here

      for (int i = 0; i < numAggregators; i++) {
        String aggregatorName = input.readUTF();
        String aggregatorClassName = input.readUTF();
        if (aggregatorName.equals(AggregatorUtils.SPECIAL_COUNT_AGGREGATOR)) {
          LongWritable count = new LongWritable(0);
          count.readFields(input);
          aggregatorData.receivedRequestCountFromWorker(count.get(),
              getSenderTaskId());
        } else {
          Class<Aggregator<Writable>> aggregatorClass =
              AggregatorUtils.getAggregatorClass(aggregatorClassName);
View Full Code Here

    DataInputBuffer keyBuf = new DataInputBuffer();
    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();
      }
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, numOutputs);
        assertTrue(expectedValues.get(partition).remove(keyDeser.get(), valDeser.get()));
      }
      inStream.close();
    }
View Full Code Here

 
  /** read the long value */
  static long readLong(DataInput in) throws IOException {
    LongWritable uLong = TL_DATA.get().U_LONG;
    uLong.readFields(in);
    return uLong.get();
  }

  /** write the long value */
  static void writeLong(long value, DataOutputStream out) throws IOException {
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.