use of org.twak.utils.Parallel in project chordatlas by twak.
the class MiniStandalone2d method bulk.
// upload to /media/data/guerrero/projects/greeble/data/facade_sources/features
private void bulk() {
File parentFile = new File("/media/twak/8bc5e750-9a70-4180-8eee-ced2fbba6484/data/small");
File outDir = new File("/media/twak/8bc5e750-9a70-4180-8eee-ced2fbba6484/data/f2");
try {
List<File> togo = Files.walk(parentFile.toPath()).map(p -> p.toFile()).filter(f -> f.isDirectory() && new File(f, FeatureCache.PARAMETERS_YML).exists()).collect(Collectors.toList());
new Parallel<File, Integer>(togo, new Work<File, Integer>() {
public Integer work(File f) {
renderAll(new MegaFeatures(f), new File(outDir, parentFile.toPath().relativize(f.toPath()).toString()).getPath());
return 1;
}
}, null, true);
// togo , new Work<File, Integer>() {
//
// }, new Parallel.Complete<Integer>() {
//
// Files.walk( parentFile.toPath() ).
// map( p -> p.toFile() ).
// filter( f -> f.isDirectory() && new File (f, "parameters.yml").exists() ).
// forEach( f -> );
// }, true );
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations