pulsar-io/hdfs2/src/main/java/org/apache/pulsar/io/hdfs2/AbstractHdfsConfig.java [31:75]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@Data
@Accessors(chain = true)
public abstract class AbstractHdfsConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * A file or comma separated list of files which contains the Hadoop file system configuration,
     * e.g. 'core-site.xml', 'hdfs-site.xml'.
     */
    private String hdfsConfigResources;

    /**
     * The HDFS directory from which files should be read from or written to.
     */
    private String directory;

    /**
     * The character encoding for the files, e.g. UTF-8, ASCII, etc.
     */
    private String encoding;

    /**
     * The compression codec used to compress/de-compress the files on HDFS.
     */
    private Compression compression;

    /**
     * The Kerberos user principal account to use for authentication.
     */
    private String kerberosUserPrincipal;

    /**
     * The full pathname to the Kerberos keytab file to use for authentication.
     */
    private String keytab;

    public void validate() {
        if (StringUtils.isEmpty(hdfsConfigResources) || StringUtils.isEmpty(directory)) {
           throw new IllegalArgumentException("Required property not set.");
        }

        if ((StringUtils.isNotEmpty(kerberosUserPrincipal) && StringUtils.isEmpty(keytab))
            || (StringUtils.isEmpty(kerberosUserPrincipal) && StringUtils.isNotEmpty(keytab))) {
          throw new IllegalArgumentException("Values for both kerberosUserPrincipal & keytab are required.");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



pulsar-io/hdfs3/src/main/java/org/apache/pulsar/io/hdfs3/AbstractHdfsConfig.java [31:75]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@Data
@Accessors(chain = true)
public abstract class AbstractHdfsConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * A file or comma separated list of files which contains the Hadoop file system configuration,
     * e.g. 'core-site.xml', 'hdfs-site.xml'.
     */
    private String hdfsConfigResources;

    /**
     * The HDFS directory from which files should be read from or written to.
     */
    private String directory;

    /**
     * The character encoding for the files, e.g. UTF-8, ASCII, etc.
     */
    private String encoding;

    /**
     * The compression codec used to compress/de-compress the files on HDFS.
     */
    private Compression compression;

    /**
     * The Kerberos user principal account to use for authentication.
     */
    private String kerberosUserPrincipal;

    /**
     * The full pathname to the Kerberos keytab file to use for authentication.
     */
    private String keytab;

    public void validate() {
        if (StringUtils.isEmpty(hdfsConfigResources) || StringUtils.isEmpty(directory)) {
           throw new IllegalArgumentException("Required property not set.");
        }

        if ((StringUtils.isNotEmpty(kerberosUserPrincipal) && StringUtils.isEmpty(keytab))
            || (StringUtils.isEmpty(kerberosUserPrincipal) && StringUtils.isNotEmpty(keytab))) {
          throw new IllegalArgumentException("Values for both kerberosUserPrincipal & keytab are required.");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



