pulsar-io/hdfs2/src/main/java/org/apache/pulsar/io/hdfs2/sink/HdfsSinkConfig.java [86:109]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static HdfsSinkConfig load(String yamlFile) throws IOException {
       ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
       return mapper.readValue(new File(yamlFile), HdfsSinkConfig.class);
    }

    public static HdfsSinkConfig load(Map<String, Object> map) throws IOException {
       ObjectMapper mapper = new ObjectMapper();
       return mapper.readValue(new ObjectMapper().writeValueAsString(map), HdfsSinkConfig.class);
    }

    @Override
    public void validate() {
        super.validate();
        if ((StringUtils.isEmpty(fileExtension) && getCompression() == null)
                || StringUtils.isEmpty(filenamePrefix)) {
            throw new IllegalArgumentException("Required property not set.");
        }

        if (syncInterval < 0) {
            throw new IllegalArgumentException("Sync Interval cannot be negative");
        }

        if (maxPendingRecords < 1) {
            throw new IllegalArgumentException("Max Pending Records must be a positive integer");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



pulsar-io/hdfs3/src/main/java/org/apache/pulsar/io/hdfs3/sink/HdfsSinkConfig.java [76:99]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static HdfsSinkConfig load(String yamlFile) throws IOException {
       ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
       return mapper.readValue(new File(yamlFile), HdfsSinkConfig.class);
    }

    public static HdfsSinkConfig load(Map<String, Object> map) throws IOException {
       ObjectMapper mapper = new ObjectMapper();
       return mapper.readValue(new ObjectMapper().writeValueAsString(map), HdfsSinkConfig.class);
    }

    @Override
    public void validate() {
        super.validate();
        if ((StringUtils.isEmpty(fileExtension) && getCompression() == null)
            || StringUtils.isEmpty(filenamePrefix)) {
           throw new IllegalArgumentException("Required property not set.");
        }

        if (syncInterval < 0) {
          throw new IllegalArgumentException("Sync Interval cannot be negative");
        }

        if (maxPendingRecords < 1) {
          throw new IllegalArgumentException("Max Pending Records must be a positive integer");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



