本文整理了Java中com.alibaba.datax.common.util.Configuration.getString()
方法的一些代码示例,展示了Configuration.getString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getString()
方法的具体详情如下:
包路径:com.alibaba.datax.common.util.Configuration
类名称:Configuration
方法名:getString
[英]根据用户提供的json path,寻址String对象
[中]根据用户提供的json路径寻址一串对象
代码示例来源:origin: ECNU-1X/DataX-Masking
@Override
public String getPluginName() {
assert null != this.pluginConf;
return this.pluginConf.getString("name");
}
代码示例来源:origin: ECNU-1X/DataX-Masking
@Override
public String getDescription() {
assert null != this.pluginConf;
return this.pluginConf.getString("description");
}
代码示例来源:origin: ECNU-1X/DataX-Masking
static void init(final Configuration configuration) {
BytesCast.encoding = configuration.getString("common.column.encoding",
BytesCast.encoding);
return;
}
代码示例来源:origin: ECNU-1X/DataX-Masking
static void init(final Configuration configuration) {
DateCast.datetimeFormat = configuration.getString(
"common.column.datetimeFormat", datetimeFormat);
DateCast.timeFormat = configuration.getString(
"common.column.timeFormat", timeFormat);
DateCast.dateFormat = configuration.getString(
"common.column.dateFormat", dateFormat);
DateCast.timeZone = configuration.getString("common.column.timeZone",
DateCast.timeZone);
DateCast.timeZoner = TimeZone.getTimeZone(DateCast.timeZone);
return;
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static TransferProjectConf create(Configuration adsWriterConf) {
TransferProjectConf res = new TransferProjectConf();
res.accessId = adsWriterConf.getString(KEY_ACCESS_ID);
res.accessKey = adsWriterConf.getString(KEY_ACCESS_KEY);
res.account = adsWriterConf.getString(KEY_ACCOUNT);
res.odpsServer = adsWriterConf.getString(KEY_ODPS_SERVER);
res.odpsTunnel = adsWriterConf.getString(KEY_ODPS_TUNNEL);
res.accountType = adsWriterConf.getString(KEY_ACCOUNT_TYPE, "aliyun");
res.project = adsWriterConf.getString(KEY_PROJECT);
return res;
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static boolean isNeedCleanAlias(Configuration conf) {
String mode = conf.getString("aliasMode", "append");
if ("exclusive".equals(mode)) {
return true;
}
return false;
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static AdsHelper createAdsHelper(Configuration originalConfig){
//Get adsUrl,userName,password,schema等参数,创建AdsHelp实例
String adsUrl = originalConfig.getString(Key.ADS_URL);
String userName = originalConfig.getString(Key.USERNAME);
String password = originalConfig.getString(Key.PASSWORD);
String schema = originalConfig.getString(Key.SCHEMA);
Long socketTimeout = originalConfig.getLong(Key.SOCKET_TIMEOUT, Constant.DEFAULT_SOCKET_TIMEOUT);
String suffix = originalConfig.getString(Key.JDBC_URL_SUFFIX, "");
return new AdsHelper(adsUrl,userName,password,schema,socketTimeout,suffix);
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static String getTypeName(Configuration conf) {
String indexType = conf.getString("indexType");
if(StringUtils.isBlank(indexType)){
indexType = conf.getString("type", getIndexName(conf));
}
return indexType;
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static String prepareJdbcUrl(Configuration conf) {
String adsURL = conf.getString(Key.ADS_URL);
String schema = conf.getString(Key.SCHEMA);
Long socketTimeout = conf.getLong(Key.SOCKET_TIMEOUT,
Constant.DEFAULT_SOCKET_TIMEOUT);
String suffix = conf.getString(Key.JDBC_URL_SUFFIX, "");
return AdsUtil.prepareJdbcUrl(adsURL, schema, socketTimeout, suffix);
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public OrcSerde getOrcSerde(Configuration config){
String fieldDelimiter = config.getString(Key.FIELD_DELIMITER);
String compress = config.getString(Key.COMPRESS);
String encoding = config.getString(Key.ENCODING);
OrcSerde orcSerde = new OrcSerde();
Properties properties = new Properties();
properties.setProperty("orc.bloom.filter.columns", fieldDelimiter);
properties.setProperty("orc.compress", compress);
properties.setProperty("orc.encoding.strategy", encoding);
orcSerde.initialize(conf, properties);
return orcSerde;
}
代码示例来源:origin: ECNU-1X/DataX-Masking
/**
* 注意:convertUserStartRowkey 和 convertInnerStartRowkey,前者会受到 isBinaryRowkey 的影响,只用于第一次对用户配置的 String 类型的 rowkey 转为二进制时使用。而后者约定:切分时得到的二进制的 rowkey 回填到配置中时采用
*/
public static byte[] convertInnerStartRowkey(Configuration configuration) {
String startRowkey = configuration.getString(Key.START_ROWKEY);
if (StringUtils.isBlank(startRowkey)) {
return HConstants.EMPTY_BYTE_ARRAY;
}
return Bytes.toBytesBinary(startRowkey);
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static byte[] convertInnerEndRowkey(Configuration configuration) {
String endRowkey = configuration.getString(Key.END_ROWKEY);
if (StringUtils.isBlank(endRowkey)) {
return HConstants.EMPTY_BYTE_ARRAY;
}
return Bytes.toBytesBinary(endRowkey);
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static byte[] convertUserEndRowkey(com.alibaba.datax.common.util.Configuration configuration) {
String endRowkey = configuration.getString(Key.END_ROWKEY);
if (StringUtils.isBlank(endRowkey)) {
return HConstants.EMPTY_BYTE_ARRAY;
} else {
boolean isBinaryRowkey = configuration.getBool(Key.IS_BINARY_ROWKEY);
return Hbase11xHelper.stringToBytes(endRowkey, isBinaryRowkey);
}
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static String checkStringAndGet(Configuration param, String key) {
String value = param.getString(key);
if (null == value) {
throwNotExistException(key);
} else if (value.length() == 0) {
throwStringLengthZeroException(key);
}
return value;
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static byte[] convertUserStartRowkey(Configuration configuration) {
String startRowkey = configuration.getString(Key.START_ROWKEY);
if (StringUtils.isBlank(startRowkey)) {
return HConstants.EMPTY_BYTE_ARRAY;
} else {
boolean isBinaryRowkey = configuration.getBool(Key.IS_BINARY_ROWKEY);
return Hbase094xHelper.stringToBytes(startRowkey, isBinaryRowkey);
}
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static byte[] convertUserEndRowkey(Configuration configuration) {
String endRowkey = configuration.getString(Key.END_ROWKEY);
if (StringUtils.isBlank(endRowkey)) {
return HConstants.EMPTY_BYTE_ARRAY;
} else {
boolean isBinaryRowkey = configuration.getBool(Key.IS_BINARY_ROWKEY);
return Hbase094xHelper.stringToBytes(endRowkey, isBinaryRowkey);
}
}
代码示例来源:origin: ECNU-1X/DataX-Masking
@Override
public void init() {
this.originalConfig = super.getPluginJobConf();
String path = this.originalConfig.getString(Key.PATH, null);
String fileName = this.originalConfig.getString(Key.FILE_NAME, null);
if(StringUtils.isNoneBlank(path) && StringUtils.isNoneBlank(fileName)) {
validateParameter(path, fileName);
}
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public HbaseAbstractTask(com.alibaba.datax.common.util.Configuration configuration) {
this.htable = Hbase094xHelper.getTable(configuration);
this.columns = configuration.getListConfiguration(Key.COLUMN);
this.rowkeyColumn = configuration.getListConfiguration(Key.ROWKEY_COLUMN);
this.versionColumn = configuration.getConfiguration(Key.VERSION_COLUMN);
this.encoding = configuration.getString(Key.ENCODING,Constant.DEFAULT_ENCODING);
this.nullMode = NullModeType.getByTypeName(configuration.getString(Key.NULL_MODE,Constant.DEFAULT_NULL_MODE));
this.walFlag = configuration.getBool(Key.WAL_FLAG, false);
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public HbaseAbstractTask(com.alibaba.datax.common.util.Configuration configuration) {
//this.htable = Hbase11xHelper.getTable(configuration);
this.bufferedMutator = Hbase11xHelper.getBufferedMutator(configuration);
this.columns = configuration.getListConfiguration(Key.COLUMN);
this.rowkeyColumn = configuration.getListConfiguration(Key.ROWKEY_COLUMN);
this.versionColumn = configuration.getConfiguration(Key.VERSION_COLUMN);
this.encoding = configuration.getString(Key.ENCODING,Constant.DEFAULT_ENCODING);
this.nullMode = NullModeType.getByTypeName(configuration.getString(Key.NULL_MODE,Constant.DEFAULT_NULL_MODE));
this.walFlag = configuration.getBool(Key.WAL_FLAG, false);
}
代码示例来源:origin: ECNU-1X/DataX-Masking
public static Configuration filterSensitiveConfiguration(Configuration configuration){
Set<String> keys = configuration.getKeys();
for (final String key : keys) {
boolean isSensitive = StringUtils.endsWithIgnoreCase(key, "password")
|| StringUtils.endsWithIgnoreCase(key, "accessKey");
if (isSensitive && configuration.get(key) instanceof String) {
configuration.set(key, configuration.getString(key).replaceAll(".", "*"));
}
}
return configuration;
}
内容来源于网络,如有侵权,请联系作者删除!