本文整理汇总了Java中com.github.jcustenborder.kafka.connect.utils.data.type.DateTypeParser类的典型用法代码示例。如果您正苦于以下问题:Java DateTypeParser类的具体用法?Java DateTypeParser怎么用?Java DateTypeParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DateTypeParser类属于com.github.jcustenborder.kafka.connect.utils.data.type包,在下文中一共展示了DateTypeParser类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Parser
import com.github.jcustenborder.kafka.connect.utils.data.type.DateTypeParser; //导入依赖的package包/类
public Parser() {
this.typeParsers = new HashMap<>();
registerTypeParser(Schema.BOOLEAN_SCHEMA, new BooleanParser());
registerTypeParser(Schema.BOOLEAN_SCHEMA, new BooleanParser());
registerTypeParser(Schema.FLOAT32_SCHEMA, new Float32TypeParser());
registerTypeParser(Schema.FLOAT64_SCHEMA, new Float64TypeParser());
registerTypeParser(Schema.INT8_SCHEMA, new Int8TypeParser());
registerTypeParser(Schema.INT16_SCHEMA, new Int16TypeParser());
registerTypeParser(Schema.INT32_SCHEMA, new Int32TypeParser());
registerTypeParser(Schema.INT64_SCHEMA, new Int64TypeParser());
registerTypeParser(Schema.STRING_SCHEMA, new StringTypeParser());
registerTypeParser(Decimal.schema(1), new DecimalTypeParser());
registerTypeParser(Date.SCHEMA, new DateTypeParser());
registerTypeParser(Time.SCHEMA, new TimeTypeParser());
registerTypeParser(Timestamp.SCHEMA, new TimestampTypeParser());
}
示例2: start
import com.github.jcustenborder.kafka.connect.utils.data.type.DateTypeParser; //导入依赖的package包/类
@Override
public void start(Map<String, String> settings) {
this.config = config(settings);
checkDirectory(SpoolDirSourceConnectorConfig.INPUT_PATH_CONFIG, this.config.inputPath);
checkDirectory(SpoolDirSourceConnectorConfig.FINISHED_PATH_CONFIG, this.config.finishedPath);
checkDirectory(SpoolDirSourceConnectorConfig.ERROR_PATH_CONFIG, this.config.errorPath);
this.parser = new Parser();
Map<Schema, TypeParser> dateTypeParsers = ImmutableMap.of(
Timestamp.SCHEMA, new TimestampTypeParser(this.config.parserTimestampTimezone, this.config.parserTimestampDateFormats),
Date.SCHEMA, new DateTypeParser(this.config.parserTimestampTimezone, this.config.parserTimestampDateFormats),
Time.SCHEMA, new TimeTypeParser(this.config.parserTimestampTimezone, this.config.parserTimestampDateFormats)
);
for (Map.Entry<Schema, TypeParser> kvp : dateTypeParsers.entrySet()) {
this.parser.registerTypeParser(kvp.getKey(), kvp.getValue());
}
}