Package org.apache.hadoop.conf

Examples of org.apache.hadoop.conf.Configuration.readFields()


    Preconditions.checkNotNull(byteString, "ByteString must be specified");
//    SnappyInputStream uncompressIs = new SnappyInputStream(byteString.newInput());
    InflaterInputStream uncompressIs = new InflaterInputStream(byteString.newInput());
    DataInputStream dataInputStream = new DataInputStream(uncompressIs);
    Configuration conf = new Configuration(false);
    conf.readFields(dataInputStream);
    return conf;
  }
 
  public static Configuration createConfFromUserPayload(byte[] bb)
      throws IOException {
View Full Code Here


    Preconditions.checkNotNull(bb, "Bytes must be specified");
    byte[] uncompressed = uncompressBytes(bb);
    DataInputBuffer dib = new DataInputBuffer();
    dib.reset(uncompressed, 0, uncompressed.length);
    Configuration conf = new Configuration(false);
    conf.readFields(dib);
    return conf;
  }

  public static byte[] compressBytes(byte[] inBytes) throws IOException {
    Stopwatch sw = null;
View Full Code Here

  private HamaConfiguration configure(final TaskInfo task) {
    Configuration conf = new Configuration(false);
    try {
      byte[] bytes = task.getData().toByteArray();
      conf.readFields(new DataInputStream(new ByteArrayInputStream(bytes)));
    } catch (IOException e) {
      LOG.warn("Failed to deserialize configuraiton.", e);
      System.exit(1);
    }
View Full Code Here

    DataOutputStream out = new DataOutputStream(new FileOutputStream(tmpFile));
    conf.write(out);
    out.close();
    DataInputStream in = new DataInputStream(new FileInputStream(tmpFile));
    Configuration newConf = new Configuration();
    newConf.readFields(in);
    Assert.assertEquals(str, newConf.get(ValidTxnList.VALID_TXNS_KEY));
  }
}
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.