protected RelatedOptions getCommonOptions()

in client/migrationx/migrationx-transformer/src/main/java/com/aliyun/dataworks/migrationx/transformer/core/sqoop/BaseSqoopTool.java [331:405]


    protected RelatedOptions getCommonOptions() {
        // Connection args (common)
        RelatedOptions commonOpts = new RelatedOptions("Common arguments");
        commonOpts.addOption(OptionBuilder.withArgName("jdbc-uri")
            .hasArg().withDescription("Specify JDBC connect string")
            .withLongOpt(CONNECT_STRING_ARG)
            .create());
        commonOpts.addOption(OptionBuilder.withArgName("class-name")
            .hasArg().withDescription("Specify connection manager class name")
            .withLongOpt(CONN_MANAGER_CLASS_NAME)
            .create());
        commonOpts.addOption(OptionBuilder.withArgName("properties-file")
            .hasArg().withDescription("Specify connection parameters file")
            .withLongOpt(CONNECT_PARAM_FILE)
            .create());
        commonOpts.addOption(OptionBuilder.withArgName("class-name")
            .hasArg().withDescription("Manually specify JDBC driver class to use")
            .withLongOpt(DRIVER_ARG)
            .create());
        commonOpts.addOption(OptionBuilder.withArgName("username")
            .hasArg().withDescription("Set authentication username")
            .withLongOpt(USERNAME_ARG)
            .create());
        commonOpts.addOption(OptionBuilder.withArgName("password")
            .hasArg().withDescription("Set authentication password")
            .withLongOpt(PASSWORD_ARG)
            .create());
        commonOpts.addOption(OptionBuilder.withArgName(PASSWORD_PATH_ARG)
            .hasArg().withDescription("Set authentication password file path")
            .withLongOpt(PASSWORD_PATH_ARG)
            .create());
        commonOpts.addOption(OptionBuilder
            .withDescription("Read password from console")
            .create(PASSWORD_PROMPT_ARG));
        commonOpts.addOption(OptionBuilder.withArgName(PASSWORD_ALIAS_ARG)
            .hasArg().withDescription("Credential provider password alias")
            .withLongOpt(PASSWORD_ALIAS_ARG)
            .create());
        commonOpts.addOption(OptionBuilder.withArgName("dir")
            .hasArg().withDescription("Override $HADOOP_MAPRED_HOME_ARG")
            .withLongOpt(HADOOP_MAPRED_HOME_ARG)
            .create());

        commonOpts.addOption(OptionBuilder.withArgName("hdir")
            .hasArg().withDescription("Override $HADOOP_MAPRED_HOME_ARG")
            .withLongOpt(HADOOP_HOME_ARG)
            .create());
        commonOpts.addOption(OptionBuilder
            .withDescription("Skip copying jars to distributed cache")
            .withLongOpt(SKIP_DISTCACHE_ARG)
            .create());

        // misc (common)
        commonOpts.addOption(OptionBuilder
            .withDescription("Print more information while working")
            .withLongOpt(VERBOSE_ARG)
            .create());
        commonOpts.addOption(OptionBuilder
            .withDescription("Print usage instructions")
            .withLongOpt(HELP_ARG)
            .create());
        commonOpts.addOption(OptionBuilder
            .withDescription("Defines the temporary root directory for the import")
            .withLongOpt(TEMP_ROOTDIR_ARG)
            .hasArg()
            .withArgName("rootdir")
            .create());
        // relax isolation requirements
        commonOpts.addOption(OptionBuilder
            .withDescription("Use read-uncommitted isolation for imports")
            .withLongOpt(RELAXED_ISOLATION)
            .create());

        return commonOpts;
    }