Examples of readFields()


Examples of org.apache.hadoop.hdfs.server.protocol.RaidTask.readFields()

    byte[] buffer = out.toByteArray();
   
    // read and verify
    ByteArrayInputStream in = new ByteArrayInputStream(buffer);
    RaidTask newTask = new RaidTask();
    newTask.readFields(new DataInputStream(in));
    assertTrue(verifyRaidTask(task, newTask));
   
    // rs
    task = generateRaidTask(RaidCodec.getCodec("rs"), 1, 14, 4);
    out = new ByteArrayOutputStream();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.RemoteEditLog.readFields()

    public void readFields(DataInput in) throws IOException {
      int len = in.readInt();
      logs = new ArrayList<RemoteEditLog>(len);
      for (int i = 0; i < len; i++) {
        RemoteEditLog rel = new RemoteEditLog();
        rel.readFields(in);
        logs.add(rel);
      }
      httpPort = in.readInt();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.RemoteImage.readFields()

    public void readFields(DataInput in) throws IOException {
      int len = in.readInt();
      images = new ArrayList<RemoteImage>(len);
      for (int i = 0; i < len; i++) {
        RemoteImage rel = new RemoteImage();
        rel.readFields(in);
        images.add(rel);
      }
    }
  }
 
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.DateWritable.readFields()

      HiveDecimalWritable hdw = new HiveDecimalWritable();
      hdw.readFields(in);
      return hdw.getHiveDecimal();
    case DataType.DATE:
      DateWritable dw = new DateWritable();
      dw.readFields(in);
      return dw.get();
    case DataType.TIMESTAMP:
      TimestampWritable tw = new TimestampWritable();
      tw.readFields(in);
      return tw.getTimestamp();
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveCharWritable.readFields()

        list.add(readDatum(in));
      }
      return list;
    case DataType.CHAR:
      HiveCharWritable hcw = new HiveCharWritable();
      hcw.readFields(in);
      return hcw.getHiveChar();
    case DataType.VARCHAR:
      HiveVarcharWritable hvw = new HiveVarcharWritable();
      hvw.readFields(in);
      return hvw.getHiveVarchar();
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveDecimalWritable.readFields()

      HiveVarcharWritable hvw = new HiveVarcharWritable();
      hvw.readFields(in);
      return hvw.getHiveVarchar();
    case DataType.DECIMAL:
      HiveDecimalWritable hdw = new HiveDecimalWritable();
      hdw.readFields(in);
      return hdw.getHiveDecimal();
    case DataType.DATE:
      DateWritable dw = new DateWritable();
      dw.readFields(in);
      return dw.get();
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.HiveVarcharWritable.readFields()

      HiveCharWritable hcw = new HiveCharWritable();
      hcw.readFields(in);
      return hcw.getHiveChar();
    case DataType.VARCHAR:
      HiveVarcharWritable hvw = new HiveVarcharWritable();
      hvw.readFields(in);
      return hvw.getHiveVarchar();
    case DataType.DECIMAL:
      HiveDecimalWritable hdw = new HiveDecimalWritable();
      hdw.readFields(in);
      return hdw.getHiveDecimal();
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.TimestampWritable.readFields()

      DateWritable dw = new DateWritable();
      dw.readFields(in);
      return dw.get();
    case DataType.TIMESTAMP:
      TimestampWritable tw = new TimestampWritable();
      tw.readFields(in);
      return tw.getTimestamp();
    default:
      throw new IOException("Unexpected data type " + type +
        " found in stream.");
    }
View Full Code Here

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

            if (logVersion >= 0)
              name.readFields(in)// read name only
            else // other versions do
              // get name and replication
              aw = new ArrayWritable(UTF8.class);
              aw.readFields(in);
              writables = aw.get();
              if (writables.length != 2)
                throw new IOException("Incorrect data fortmat. "
                                      + "Name & replication pair expected");
              name = (UTF8) writables[0];
View Full Code Here

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

    BasicTable.Reader reader = new BasicTable.Reader(path, conf);
    reader.setProjection("a,d,c,f");
    BytesWritable tmp = new BytesWritable();
    DataInputStream dis = reader.getMetaBlock("testMetaBlocks.meta1");
    try {
      tmp.readFields(dis);
      Assert.assertTrue(tmp.compareTo(meta1) == 0);
    } finally {
      dis.close();
    }
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.