use of edu.iu.dsc.tws.api.data.Path 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