Package org.apache.hadoop.io

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



  @Override
  public void readFields(DataInput in) throws IOException {
    MapWritable map = new MapWritable();
    map.readFields(in);
    setHeaders(fromMapWritable(map));
    byte[] body = null;
    int bodyLength = in.readInt();
    if(bodyLength != -1) {
      body = new byte[bodyLength];
View Full Code Here


  @Override
  public void readFields(DataInput in) throws IOException {
    sequenceId = in.readLong();
    MapWritable map = new MapWritable();
    map.readFields(in);
    setHeaders(fromMapWritable(map));
    byte[] body = null;
    int bodyLength = in.readInt();
    if(bodyLength != -1) {
      body = new byte[bodyLength];
View Full Code Here

        Text.skip(in); // skip toUrl
        Text.skip(in); // skip anchor
        boolean hasMD = in.readBoolean();
        if (hasMD) {
            MapWritable metadata = new org.apache.hadoop.io.MapWritable();
            metadata.readFields(in);
            ;
        }
    }

    public void write(DataOutput out) throws IOException {
View Full Code Here

    MapWritable mapWritable = new MapWritable();
    if (configString != null) {
      try {
        byte[] bytes = Base64.decodeBase64(configString.getBytes());
        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        mapWritable.readFields(new DataInputStream(bais));
        bais.close();
      } catch (IOException e) {
        throw new IllegalStateException("The table query configurations could not be deserialized from the given configuration");
      }
    }
View Full Code Here

    startTime = System.currentTimeMillis();

    for (int i = 0; i < numTrials; i++) {
      HashMapWritable<IntWritable, IntWritable> map = new HashMapWritable<IntWritable, IntWritable>();

      map.readFields(new DataInputStream(new ByteArrayInputStream(storageHashMapWritable[i]
          .toByteArray())));
    }

    System.out.println("Deserializing " + numTrials + " random MapWritables: "
        + (System.currentTimeMillis() - startTime) / 1000.0 + " seconds");
View Full Code Here

    startTime = System.currentTimeMillis();

    for (int i = 0; i < numTrials; i++) {
      MapWritable map = new MapWritable();

      map.readFields(new DataInputStream(new ByteArrayInputStream(storageMapWritable[i]
          .toByteArray())));
    }

    System.out.println("Deserializing " + numTrials + " random MapWritables: "
        + (System.currentTimeMillis() - startTime) / 1000.0 + " seconds");
View Full Code Here

  }
 
  public static final Properties readProperties(DataInput in) throws IOException {
    Properties props = new Properties();
    MapWritable propsWritable = new MapWritable();
    propsWritable.readFields(in);
    for (Entry<Writable, Writable> prop : propsWritable.entrySet()) {
      String key = prop.getKey().toString();
      String value = prop.getValue().toString();
      props.put(key,value);
    }
View Full Code Here

    MapWritable mapWritable = new MapWritable();
    if (configString != null) {
      try {
        byte[] bytes = Base64.decodeBase64(configString.getBytes());
        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        mapWritable.readFields(new DataInputStream(bais));
        bais.close();
      } catch (IOException e) {
        throw new IllegalStateException("The table query configurations could not be deserialized from the given configuration");
      }
    }
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.