public static void main(String[] args) throws Exception {
        RealtimeConfig.loadSubtypes();
        MyOptions options = new MyOptions();
        CmdLineParser parser = RuntimeUtil.parseArgs(args, options);
        if (options.help) {
            parser.printUsage(System.out);
            return;
        }

        if (Strings.isEmpty(options.ouputPath)) {
            System.out.println("Please specify output path by -s");
        }

        Plugins.loadPlugins();
        Path tmpPath = Paths.get(options.tmpPath);
        IndexRConfig config = new IndexRConfig();
        int exitCode = 0;
        try {
            doLoad(config, options, options.ouputPath, tmpPath);
        } catch (Exception e) {
            System.err.printf("Load [%s] failed:\n", options.ouputPath);
            e.printStackTrace(System.err);
            exitCode = 1;
        } finally {
            IOUtils.closeQuietly(config);
            try {
                // Remove temporary dir.
                FileUtils.deleteDirectory(tmpPath.toFile());
                if (!options.quiet) {
                    System.out.printf("Deleted tmp path %s\n", tmpPath.toString());
                }
            } catch (IOException e) {
                System.err.println("Delete tmp path failed!");
                e.printStackTrace(System.err);
            }
        }
        System.exit(exitCode);
    }
TODO handle the case when row number is larger then {@link StorageSegment#MAX_ROW_COUNT}.
indexr-server/src/main/java/io/indexr/tool/CSVSegmentLoader.java