Search in sources :

Example 1 with CheckPointDataOutput

use of org.goldenorb.io.output.checkpoint.CheckPointDataOutput in project goldenorb by jzachr.

the class CheckPointDataTest method testCheckpointOutput.

/**
 * Tests the CheckPointDataOutput class by writing several different types of Writables to the checkpoint.
 *
 * @throws Exception
 */
@Test
public void testCheckpointOutput() throws Exception {
    int superStep = 0;
    int partition = 0;
    OrbConfiguration orbConf = new OrbConfiguration();
    orbConf.set("fs.default.name", "hdfs://localhost:" + cluster.getNameNodePort());
    orbConf.setJobNumber("0");
    orbConf.setFileOutputPath("test");
    CheckPointDataOutput checkpointOutput = new CheckPointDataOutput(orbConf, superStep, partition);
    IntWritable intOutput = new IntWritable(4);
    intOutput.write(checkpointOutput);
    LongWritable longOutput = new LongWritable(9223372036854775807L);
    longOutput.write(checkpointOutput);
    Text textOutput = new Text("test");
    textOutput.write(checkpointOutput);
    FloatWritable floatOutput = new FloatWritable(3.14159F);
    floatOutput.write(checkpointOutput);
    checkpointOutput.close();
    assertThat(checkpointOutput, notNullValue());
}
Also used : CheckPointDataOutput(org.goldenorb.io.output.checkpoint.CheckPointDataOutput) FloatWritable(org.apache.hadoop.io.FloatWritable) OrbConfiguration(org.goldenorb.conf.OrbConfiguration) Text(org.apache.hadoop.io.Text) LongWritable(org.apache.hadoop.io.LongWritable) IntWritable(org.apache.hadoop.io.IntWritable)

Aggregations

FloatWritable (org.apache.hadoop.io.FloatWritable)1 IntWritable (org.apache.hadoop.io.IntWritable)1 LongWritable (org.apache.hadoop.io.LongWritable)1 Text (org.apache.hadoop.io.Text)1 OrbConfiguration (org.goldenorb.conf.OrbConfiguration)1 CheckPointDataOutput (org.goldenorb.io.output.checkpoint.CheckPointDataOutput)1