public void validate()

in pulsar-io/hdfs2/src/main/java/org/apache/pulsar/io/hdfs2/sink/HdfsSinkConfig.java [97:119]


    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");
        }

        if (subdirectoryPattern != null) {
            try {
                LocalDateTime.of(2020, 1, 1, 12, 0).format(DateTimeFormatter.ofPattern(subdirectoryPattern));
            } catch (Exception e) {
                throw new IllegalArgumentException(subdirectoryPattern + " is not a valid pattern: " + e.getMessage());
            }
        }
    }