Examples of readFields()


Examples of org.apache.hama.bsp.TaskAttemptID.readFields()

  public static TaskAttemptID deserializeTaskId(byte[] arr) {
    ByteArrayInputStream bis = new ByteArrayInputStream(arr);
    DataInputStream in = new DataInputStream(bis);
    TaskAttemptID id = new TaskAttemptID();
    try {
      id.readFields(in);
    } catch (IOException e) {
      LOG.error(e);
    } finally {
      try {
        in.close();
View Full Code Here

Examples of org.apache.hcatalog.data.DefaultHCatRecord.readFields()

    InputStream fInStream = new FileInputStream(f);
    DataInput inpStream = new DataInputStream(fInStream);

    for(int i =0; i < recs.length; i++){
      HCatRecord rec = new DefaultHCatRecord();
      rec.readFields(inpStream);
      Assert.assertEquals(recs[i],rec);
    }

    Assert.assertEquals(fInStream.available(), 0);
    fInStream.close();
View Full Code Here

Examples of org.apache.hcatalog.data.HCatRecord.readFields()

    InputStream fInStream = new FileInputStream(f);
    DataInput inpStream = new DataInputStream(fInStream);

    for(int i =0; i < recs.length; i++){
      HCatRecord rec = new DefaultHCatRecord();
      rec.readFields(inpStream);
      Assert.assertEquals(recs[i],rec);
    }

    Assert.assertEquals(fInStream.available(), 0);
    fInStream.close();
View Full Code Here

Examples of org.apache.hcatalog.mapreduce.HCatSplit.readFields()

    this.inputLength = in.readLong();
    int size = in.readInt();
    this.hCatSplits = new ArrayList<HCatSplit>(size);
    for (int i = 0; i < size; ++i) {
      HCatSplit hs = new HCatSplit();
      hs.readFields(in);
      hCatSplits.add(hs);
    }
  }
}
View Full Code Here

Examples of org.apache.hive.hcatalog.mapreduce.HCatSplit.readFields()

    ClassNotFoundException {
    conf.readFields(in);
    int numOfSplits = in.readInt();
    for (int i = 0; i < numOfSplits; i++) {
      HCatSplit split = new HCatSplit();
      split.readFields(in);
      splits.add(split);
    }
  }
}
View Full Code Here

Examples of org.apache.mahout.clustering.Cluster.readFields()

 
  /** Reads a typed Model instance from the input stream */
  public static Cluster readModel(DataInput in) throws IOException {
    String modelClassName = in.readUTF();
    Cluster model = ClassUtils.instantiateAs(modelClassName, Cluster.class);
    model.readFields(in);
    return model;
  }
 
  @Override
  public String asFormatString(String[] bindings) {
View Full Code Here

Examples of org.apache.mahout.clustering.ClusterObservations.readFields()

    DataOutputBuffer out = new DataOutputBuffer();
    reference.write(out);
    ClusterObservations info = new ClusterObservations();
    DataInputBuffer in = new DataInputBuffer();
    in.reset(out.getData(), out.getLength());
    info.readFields(in);
    assertEquals("probability", reference.getS0(), info.getS0(), EPSILON);
    assertEquals("point total", reference.getS1(), info.getS1());
    assertEquals("combiner", reference.getCombinerState(), info.getCombinerState());
  }
View Full Code Here

Examples of org.apache.mahout.clustering.dirichlet.models.AsymmetricSampledNormalModel.readFields()

    DataOutputBuffer out = new DataOutputBuffer();
    model.write(out);
    Model<?> model2 = new AsymmetricSampledNormalModel();
    DataInputBuffer in = new DataInputBuffer();
    in.reset(out.getData(), out.getLength());
    model2.readFields(in);
    assertEquals("models", model.toString(), model2.toString());
  }
 
  public void testClusterWritableSerialization() throws Exception {
    double[] m = {1.1, 2.2, 3.3};
View Full Code Here

Examples of org.apache.mahout.clustering.dirichlet.models.NormalModel.readFields()

    DataOutputBuffer out = new DataOutputBuffer();
    model.write(out);
    Model<?> model2 = new NormalModel();
    DataInputBuffer in = new DataInputBuffer();
    in.reset(out.getData(), out.getLength());
    model2.readFields(in);
    assertEquals("models", model.toString(), model2.toString());
  }
 
  public void testSampledNormalModelWritableSerialization() throws Exception {
    double[] m = {1.1, 2.2, 3.3};
View Full Code Here

Examples of org.apache.mahout.clustering.dirichlet.models.SampledNormalModel.readFields()

    DataOutputBuffer out = new DataOutputBuffer();
    model.write(out);
    Model<?> model2 = new SampledNormalModel();
    DataInputBuffer in = new DataInputBuffer();
    in.reset(out.getData(), out.getLength());
    model2.readFields(in);
    assertEquals("models", model.toString(), model2.toString());
  }
 
  public void testAsymmetricSampledNormalModelWritableSerialization() throws Exception {
    double[] m = {1.1, 2.2, 3.3};
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.