本文整理汇总了Java中io.confluent.connect.hdfs.HdfsSinkConnectorConfig.TIMEZONE_CONFIG属性的典型用法代码示例。如果您正苦于以下问题:Java HdfsSinkConnectorConfig.TIMEZONE_CONFIG属性的具体用法?Java HdfsSinkConnectorConfig.TIMEZONE_CONFIG怎么用?Java HdfsSinkConnectorConfig.TIMEZONE_CONFIG使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类io.confluent.connect.hdfs.HdfsSinkConnectorConfig
的用法示例。
在下文中一共展示了HdfsSinkConnectorConfig.TIMEZONE_CONFIG属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
@Override
public void configure(Map<String, Object> config) {
String localeString = (String) config.get(HdfsSinkConnectorConfig.LOCALE_CONFIG);
if (localeString.equals("")) {
throw new ConfigException(HdfsSinkConnectorConfig.LOCALE_CONFIG,
localeString, "Locale cannot be empty.");
}
String timeZoneString = (String) config.get(HdfsSinkConnectorConfig.TIMEZONE_CONFIG);
if (timeZoneString.equals("")) {
throw new ConfigException(HdfsSinkConnectorConfig.TIMEZONE_CONFIG,
timeZoneString, "Timezone cannot be empty.");
}
String hiveIntString = (String) config.get(HdfsSinkConnectorConfig.HIVE_INTEGRATION_CONFIG);
boolean hiveIntegration = hiveIntString != null && hiveIntString.toLowerCase().equals("true");
Locale locale = new Locale(localeString);
DateTimeZone timeZone = DateTimeZone.forID(timeZoneString);
init(partitionDurationMs, pathFormat, locale, timeZone, hiveIntegration);
}
示例2: configure
@Override
public void configure(Map<String, Object> config) {
long partitionDurationMs = (long) config.get(HdfsSinkConnectorConfig.PARTITION_DURATION_MS_CONFIG);
if (partitionDurationMs < 0) {
throw new ConfigException(HdfsSinkConnectorConfig.PARTITION_DURATION_MS_CONFIG,
partitionDurationMs, "Partition duration needs to be a positive.");
}
String pathFormat = (String) config.get(HdfsSinkConnectorConfig.PATH_FORMAT_CONFIG);
if (pathFormat.equals("")) {
throw new ConfigException(HdfsSinkConnectorConfig.PATH_FORMAT_CONFIG,
pathFormat, "Path format cannot be empty.");
}
String localeString = (String) config.get(HdfsSinkConnectorConfig.LOCALE_CONFIG);
if (localeString.equals("")) {
throw new ConfigException(HdfsSinkConnectorConfig.LOCALE_CONFIG,
localeString, "Locale cannot be empty.");
}
String timeZoneString = (String) config.get(HdfsSinkConnectorConfig.TIMEZONE_CONFIG);
if (timeZoneString.equals("")) {
throw new ConfigException(HdfsSinkConnectorConfig.TIMEZONE_CONFIG,
timeZoneString, "Timezone cannot be empty.");
}
String hiveIntString = (String) config.get(HdfsSinkConnectorConfig.HIVE_INTEGRATION_CONFIG);
boolean hiveIntegration = hiveIntString != null && hiveIntString.toLowerCase().equals("true");
Locale locale = new Locale(localeString);
DateTimeZone timeZone = DateTimeZone.forID(timeZoneString);
init(partitionDurationMs, pathFormat, locale, timeZone, hiveIntegration);
}