Example usage for org.apache.hadoop.conf Configuration set

List of usage examples for org.apache.hadoop.conf Configuration set

Introduction

In this page you can find the example usage for org.apache.hadoop.conf Configuration set.

Prototype

public void set(String name, String value) 

Source Link

Document

Set the value of the name property.

Usage

From source file:co.nubetech.hiho.job.ExportToMySQLDB.java

License:Apache License

public void populateConfiguration(String[] args, Configuration conf) {
    for (int i = 0; i < args.length - 1; i++) {
        if ("-inputPath".equals(args[i])) {
            inputPath = args[++i];//ww  w .  ja va  2s .  c  o  m
        } else if ("-url".equals(args[i])) {
            conf.set(DBConfiguration.URL_PROPERTY, args[++i]);
        } else if ("-userName".equals(args[i])) {
            conf.set(DBConfiguration.USERNAME_PROPERTY, args[++i]);
        } else if ("-password".equals(args[i])) {
            conf.set(DBConfiguration.PASSWORD_PROPERTY, args[++i]);
        } else if ("-querySuffix".equals(args[i])) {
            conf.set(HIHOConf.LOAD_QUERY_SUFFIX, args[++i]);
        }
    }
}

From source file:co.nubetech.hiho.job.ExportToOracleDb.java

License:Apache License

public void populateConfiguration(String[] args, Configuration conf) {
    for (int i = 0; i < args.length - 1; i++) {
        if ("-inputPath".equals(args[i])) {
            inputPath = args[++i];//from  www.  j  a v a  2  s.  com
        } else if ("-oracleFtpAddress".equals(args[i])) {
            conf.set(HIHOConf.ORACLE_FTP_ADDRESS, args[++i]);
        } else if ("-oracleFtpPortNumber".equals(args[i])) {
            conf.set(HIHOConf.ORACLE_FTP_PORT, args[++i]);
        } else if ("-oracleFtpUserName".equals(args[i])) {
            conf.set(HIHOConf.ORACLE_FTP_USER, args[++i]);
        } else if ("-oracleFtpPassword".equals(args[i])) {
            conf.set(HIHOConf.ORACLE_FTP_PASSWORD, args[++i]);
        } else if ("-oracleExternalTableDirectory".equals(args[i])) {
            conf.set(HIHOConf.ORACLE_EXTERNAL_TABLE_DIR, args[++i]);
        } else if ("-driver".equals(args[i])) {
            conf.set(DBConfiguration.DRIVER_CLASS_PROPERTY, args[++i]);
        } else if ("-url".equals(args[i])) {
            conf.set(DBConfiguration.URL_PROPERTY, args[++i]);
        } else if ("-userName".equals(args[i])) {
            conf.set(DBConfiguration.USERNAME_PROPERTY, args[++i]);
        } else if ("-password".equals(args[i])) {
            conf.set(DBConfiguration.PASSWORD_PROPERTY, args[++i]);
        } else if ("-externalTable".equals(args[i])) {
            conf.set(HIHOConf.EXTERNAL_TABLE_DML, args[++i]);
        }
    }
}

From source file:co.nubetech.hiho.job.sf.ExportSalesForceJob.java

License:Apache License

public void populateConfiguration(String[] args, Configuration conf) {
    for (int i = 0; i < args.length - 1; i++) {
        if ("-inputPath".equals(args[i])) {
            inputPath = args[++i];//w w w . j a  v a 2 s.  c  om
        } else if ("-sfUserName".equals(args[i])) {
            conf.set(HIHOConf.SALESFORCE_USERNAME, args[++i]);
        } else if ("-sfPassword".equals(args[i])) {
            conf.set(HIHOConf.SALESFORCE_PASSWORD, args[++i]);
        } else if ("-sfObjectType".equals(args[i])) {
            conf.set(HIHOConf.SALESFORCE_SOBJECTYPE, args[++i]);
        } else if ("-sfHeaders".equals(args[i])) {
            conf.set(HIHOConf.SALESFORCE_HEADERS, args[++i]);
        }
    }
}

From source file:co.nubetech.hiho.job.TestDBQueryInputJob.java

License:Apache License

@Test
public void testCheckMandatoryConfs() throws HIHOException {
    Configuration conf = new Configuration();
    conf.set(DBConfiguration.DRIVER_CLASS_PROPERTY, "value");
    conf.set(DBConfiguration.URL_PROPERTY, "value");
    conf.set(DBConfiguration.USERNAME_PROPERTY, "value");
    conf.set(DBConfiguration.PASSWORD_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_PATH, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_STRATEGY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_DELIMITER, "value");
    conf.set(DBConfiguration.INPUT_TABLE_NAME_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO, "hive");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO_PATH, "value");
    conf.set(HIHOConf.HIVE_DRIVER, "value");
    conf.set(HIHOConf.HIVE_URL, "value");
    conf.set(HIHOConf.HIVE_PARTITION_BY, "value:value");
    conf.set(HIHOConf.HIVE_TABLE_NAME, "value");
    new DBQueryInputJob().checkMandatoryConfs(conf);

}

From source file:co.nubetech.hiho.job.TestDBQueryInputJob.java

License:Apache License

@Test(expected = HIHOException.class)
public void testCheckMandatoryConfsForDriverClass() throws HIHOException {
    Configuration conf = new Configuration();
    // conf.set(DBConfiguration.DRIVER_CLASS_PROPERTY, "value");
    conf.set(DBConfiguration.URL_PROPERTY, "value");
    conf.set(DBConfiguration.USERNAME_PROPERTY, "value");
    conf.set(DBConfiguration.PASSWORD_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_PATH, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_STRATEGY, "DELIMITED");
    conf.set(HIHOConf.INPUT_OUTPUT_DELIMITER, "value");
    conf.set(DBConfiguration.INPUT_TABLE_NAME_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO, "hive");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO_PATH, "value");
    conf.set(HIHOConf.HIVE_DRIVER, "value");
    conf.set(HIHOConf.HIVE_URL, "value");
    conf.set(HIHOConf.HIVE_PARTITION_BY, "value:value");
    conf.set(HIHOConf.HIVE_TABLE_NAME, "value");

    new DBQueryInputJob().checkMandatoryConfs(conf);

}

From source file:co.nubetech.hiho.job.TestDBQueryInputJob.java

License:Apache License

@Test(expected = HIHOException.class)
public void testCheckMandatoryConfsForUrlProperty() throws HIHOException {
    Configuration conf = new Configuration();
    conf.set(DBConfiguration.DRIVER_CLASS_PROPERTY, "value");
    // conf.set(DBConfiguration.URL_PROPERTY, "value");
    conf.set(DBConfiguration.USERNAME_PROPERTY, "value");
    conf.set(DBConfiguration.PASSWORD_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_PATH, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_STRATEGY, "DELIMITED");
    conf.set(HIHOConf.INPUT_OUTPUT_DELIMITER, "value");
    conf.set(DBConfiguration.INPUT_TABLE_NAME_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO, "hive");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO_PATH, "value");
    conf.set(HIHOConf.HIVE_DRIVER, "value");
    conf.set(HIHOConf.HIVE_URL, "value");
    conf.set(HIHOConf.HIVE_PARTITION_BY, "value:value");
    conf.set(HIHOConf.HIVE_TABLE_NAME, "value");

    new DBQueryInputJob().checkMandatoryConfs(conf);
}

From source file:co.nubetech.hiho.job.TestDBQueryInputJob.java

License:Apache License

@Test(expected = HIHOException.class)
public void testCheckMandatoryConfsForUsernameProperty() throws HIHOException {
    Configuration conf = new Configuration();
    conf.set(DBConfiguration.DRIVER_CLASS_PROPERTY, "value");
    conf.set(DBConfiguration.URL_PROPERTY, "value");
    // conf.set(DBConfiguration.USERNAME_PROPERTY, "value");
    conf.set(DBConfiguration.PASSWORD_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_PATH, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_STRATEGY, "DELIMITED");
    conf.set(HIHOConf.INPUT_OUTPUT_DELIMITER, "value");
    conf.set(DBConfiguration.INPUT_TABLE_NAME_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO, "hive");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO_PATH, "value");
    conf.set(HIHOConf.HIVE_DRIVER, "value");
    conf.set(HIHOConf.HIVE_URL, "value");
    conf.set(HIHOConf.HIVE_PARTITION_BY, "value:value");
    conf.set(HIHOConf.HIVE_TABLE_NAME, "value");

    new DBQueryInputJob().checkMandatoryConfs(conf);
}

From source file:co.nubetech.hiho.job.TestDBQueryInputJob.java

License:Apache License

@Test(expected = HIHOException.class)
public void testCheckMandatoryConfsForPasswordProperty() throws HIHOException {
    Configuration conf = new Configuration();
    conf.set(DBConfiguration.DRIVER_CLASS_PROPERTY, "value");
    conf.set(DBConfiguration.URL_PROPERTY, "value");
    conf.set(DBConfiguration.USERNAME_PROPERTY, "value");
    // conf.set(DBConfiguration.PASSWORD_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_PATH, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_STRATEGY, "DELIMITED");
    conf.set(HIHOConf.INPUT_OUTPUT_DELIMITER, "value");
    conf.set(DBConfiguration.INPUT_TABLE_NAME_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO, "hive");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO_PATH, "value");
    conf.set(HIHOConf.HIVE_DRIVER, "value");
    conf.set(HIHOConf.HIVE_URL, "value");
    conf.set(HIHOConf.HIVE_PARTITION_BY, "value:value");
    conf.set(HIHOConf.HIVE_TABLE_NAME, "value");

    new DBQueryInputJob().checkMandatoryConfs(conf);
}

From source file:co.nubetech.hiho.job.TestDBQueryInputJob.java

License:Apache License

@Test(expected = HIHOException.class)
public void testCheckMandatoryConfsForOutputPath() throws HIHOException {
    Configuration conf = new Configuration();
    conf.set(DBConfiguration.DRIVER_CLASS_PROPERTY, "value");
    conf.set(DBConfiguration.URL_PROPERTY, "value");
    conf.set(DBConfiguration.USERNAME_PROPERTY, "value");
    conf.set(DBConfiguration.PASSWORD_PROPERTY, "value");
    // conf.set(HIHOConf.INPUT_OUTPUT_PATH, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_STRATEGY, "DELIMITED");
    conf.set(HIHOConf.INPUT_OUTPUT_DELIMITER, "value");
    conf.set(DBConfiguration.INPUT_TABLE_NAME_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO, "hive");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO_PATH, "value");
    conf.set(HIHOConf.HIVE_DRIVER, "value");
    conf.set(HIHOConf.HIVE_URL, "value");
    conf.set(HIHOConf.HIVE_PARTITION_BY, "value:value");
    conf.set(HIHOConf.HIVE_TABLE_NAME, "value");

    new DBQueryInputJob().checkMandatoryConfs(conf);
}

From source file:co.nubetech.hiho.job.TestDBQueryInputJob.java

License:Apache License

@Test(expected = HIHOException.class)
public void testCheckMandatoryConfsForDelimiter() throws HIHOException {
    Configuration conf = new Configuration();
    conf.set(DBConfiguration.DRIVER_CLASS_PROPERTY, "value");
    conf.set(DBConfiguration.URL_PROPERTY, "value");
    conf.set(DBConfiguration.USERNAME_PROPERTY, "value");
    conf.set(DBConfiguration.PASSWORD_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_PATH, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_STRATEGY, "DELIMITED");
    // conf.set(HIHOConf.INPUT_OUTPUT_DELIMITER, "value");
    conf.set(DBConfiguration.INPUT_QUERY, "value");
    conf.set(DBConfiguration.INPUT_BOUNDING_QUERY, "value");
    conf.set(DBConfiguration.INPUT_TABLE_NAME_PROPERTY, "value");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO, "hive");
    conf.set(HIHOConf.INPUT_OUTPUT_LOADTO_PATH, "value");
    conf.set(HIHOConf.HIVE_DRIVER, "value");
    conf.set(HIHOConf.HIVE_URL, "value");
    conf.set(HIHOConf.HIVE_PARTITION_BY, "value:value");
    conf.set(HIHOConf.HIVE_TABLE_NAME, "value");

    new DBQueryInputJob().checkMandatoryConfs(conf);
}