use of edu.iu.dsc.tws.api.data.FSDataOutputStream in project twister2 by DSC-SPIDAL.
the class FileOutputWriter method write.
public void write(T out) {
FSDataOutputStream fsOut;
try {
if (fs.exists(outPath)) {
fs.delete(outPath, true);
}
fsOut = fs.create(new Path(outPath, generateRandom(10) + ".csv"));
pw = new PrintWriter(fsOut);
} catch (IOException e) {
throw new RuntimeException("IOException Occured");
}
writeRecord(out);
}
use of edu.iu.dsc.tws.api.data.FSDataOutputStream in project twister2 by DSC-SPIDAL.
the class DataGenerator method generate.
public void generate(Path directory, int size, int dimension) {
try {
FileSystem fs = FileSystemUtils.get(directory.toUri(), config);
if (fs.exists(directory)) {
fs.delete(directory, true);
}
FSDataOutputStream outputStream = fs.create(new Path(directory, generateRandom(10) + ".txt"));
PrintWriter pw = new PrintWriter(outputStream);
String points = generatePoints(size, dimension, 100);
pw.print(points);
outputStream.sync();
pw.close();
} catch (IOException e) {
throw new RuntimeException("Data Generation Error Occured", e);
}
}
Aggregations