All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.ytsaurus.client.operations.VanillaMain Maven / Gradle / Ivy

The newest version!
package tech.ytsaurus.client.operations;

import java.io.OutputStream;

import tech.ytsaurus.core.operations.Yield;
import tech.ytsaurus.lang.NonNullApi;

@NonNullApi
class VanillaMain {
    private VanillaMain() {
    }

    public static void main(String[] args) throws Exception {
        YtMainUtils.setTempDir();
        YtMainUtils.disableSystemOutput();
        OutputStream[] output = YtMainUtils.buildOutputStreams(args);

        VanillaJob mapper = (VanillaJob) YtMainUtils.construct(args);

        try {
            System.exit(apply(mapper, output, new StatisticsImpl()));
        } catch (Throwable e) {
            e.printStackTrace(System.err);
            System.exit(2);
        }
    }

    public static  int apply(VanillaJob job, OutputStream[] output, Statistics statistics)
            throws java.io.IOException {
        YTableEntryType outputType = job.outputType();
        try (statistics; Yield yield = outputType.yield(output)) {
            return job.run(yield, statistics);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy