Class HdfsConfiguration


  • @UriParams
    public class HdfsConfiguration
    extends Object
    • Constructor Detail

      • HdfsConfiguration

        public HdfsConfiguration()
    • Method Detail

      • checkConsumerOptions

        public void checkConsumerOptions()
      • checkProducerOptions

        public void checkProducerOptions()
      • getUri

        public URI getUri()
      • setUri

        public void setUri​(URI uri)
      • getHostName

        public String getHostName()
      • setHostName

        public void setHostName​(String hostName)
        HDFS host to use
      • getPort

        public int getPort()
      • setPort

        public void setPort​(int port)
        HDFS port to use
      • getPath

        public String getPath()
      • setPath

        public void setPath​(String path)
        The directory path to use
      • isOverwrite

        public boolean isOverwrite()
      • setOverwrite

        public void setOverwrite​(boolean overwrite)
        Whether to overwrite existing files with the same name
      • isAppend

        public boolean isAppend()
      • isWantAppend

        public boolean isWantAppend()
      • setAppend

        public void setAppend​(boolean append)
        Append to existing file. Notice that not all HDFS file systems support the append option.
      • getBufferSize

        public int getBufferSize()
      • setBufferSize

        public void setBufferSize​(int bufferSize)
        The buffer size used by HDFS
      • getReplication

        public short getReplication()
      • setReplication

        public void setReplication​(short replication)
        The HDFS replication factor
      • getBlockSize

        public long getBlockSize()
      • setBlockSize

        public void setBlockSize​(long blockSize)
        The size of the HDFS blocks
      • setFileType

        public void setFileType​(HdfsFileType fileType)
        The file type to use. For more details see Hadoop HDFS documentation about the various files types.
      • getCompressionType

        public org.apache.hadoop.io.SequenceFile.CompressionType getCompressionType()
      • setCompressionType

        public void setCompressionType​(org.apache.hadoop.io.SequenceFile.CompressionType compressionType)
        The compression type to use (is default not in use)
      • setCompressionCodec

        public void setCompressionCodec​(HdfsCompressionCodec compressionCodec)
        The compression codec to use
      • setFileSystemType

        public void setFileSystemType​(HdfsFileSystemType fileSystemType)
        Set to LOCAL to not use HDFS but local java.io.File instead.
      • setKeyType

        public void setKeyType​(WritableType keyType)
        The type for the key in case of sequence or map files.
      • setValueType

        public void setValueType​(WritableType valueType)
        The type for the key in case of sequence or map files
      • setOpenedSuffix

        public void setOpenedSuffix​(String openedSuffix)
        When a file is opened for reading/writing the file is renamed with this suffix to avoid to read it during the writing phase.
      • getOpenedSuffix

        public String getOpenedSuffix()
      • setReadSuffix

        public void setReadSuffix​(String readSuffix)
        Once the file has been read is renamed with this suffix to avoid to read it again.
      • getReadSuffix

        public String getReadSuffix()
      • setPattern

        public void setPattern​(String pattern)
        The pattern used for scanning the directory
      • getPattern

        public String getPattern()
      • setChunkSize

        public void setChunkSize​(int chunkSize)
        When reading a normal file, this is split into chunks producing a message per chunk.
      • getChunkSize

        public int getChunkSize()
      • setCheckIdleInterval

        public void setCheckIdleInterval​(int checkIdleInterval)
        How often (time in millis) in to run the idle checker background task. This option is only in use if the splitter strategy is IDLE.
      • getCheckIdleInterval

        public int getCheckIdleInterval()
      • hasSplitStrategies

        public boolean hasSplitStrategies()
      • getSplitStrategy

        public String getSplitStrategy()
      • setSplitStrategy

        public void setSplitStrategy​(String splitStrategy)
        In the current version of Hadoop opening a file in append mode is disabled since it's not very reliable. So, for the moment, it's only possible to create new files. The Camel HDFS endpoint tries to solve this problem in this way:
        • If the split strategy option has been defined, the hdfs path will be used as a directory and files will be created using the configured UuidGenerator.
        • Every time a splitting condition is met, a new file is created.
        The splitStrategy option is defined as a string with the following syntax:
        splitStrategy=ST:value,ST:value,...
        where ST can be:
        • BYTES a new file is created, and the old is closed when the number of written bytes is more than value
        • MESSAGES a new file is created, and the old is closed when the number of written messages is more than value
        • IDLE a new file is created, and the old is closed when no writing happened in the last value milliseconds
      • isConnectOnStartup

        public boolean isConnectOnStartup()
      • setConnectOnStartup

        public void setConnectOnStartup​(boolean connectOnStartup)
        Whether to connect to the HDFS file system on starting the producer/consumer. If false then the connection is created on-demand. Notice that HDFS may take up till 15 minutes to establish a connection, as it has hardcoded 45 x 20 sec redelivery. By setting this option to false allows your application to startup, and not block for up till 15 minutes.
      • getMaxMessagesPerPoll

        public int getMaxMessagesPerPoll()
      • setMaxMessagesPerPoll

        public void setMaxMessagesPerPoll​(int maxMessagesPerPoll)
        To define a maximum messages to gather per poll. By default a limit of 100 is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Values can only be greater than 0. Notice: If this option is in use then the limit will be applied on the valid files. For example if you have 100000 files and use maxMessagesPerPoll=500, then only the first 500 files will be picked up.
      • getOwner

        public String getOwner()
      • setOwner

        public void setOwner​(String owner)
        The file owner must match this owner for the consumer to pickup the file. Otherwise the file is skipped.
      • getNamedNodes

        public String getNamedNodes()
      • setNamedNodes

        public void setNamedNodes​(String namedNodes)
        A comma separated list of named nodes (e.g. srv11.example.com:8020,srv12.example.com:8020)
      • getNamedNodeList

        public List<String> getNamedNodeList()
      • hasClusterConfiguration

        public boolean hasClusterConfiguration()
      • getKerberosConfigFileLocation

        public String getKerberosConfigFileLocation()
      • setKerberosConfigFileLocation

        public void setKerberosConfigFileLocation​(String kerberosConfigFileLocation)
        The location of the kerb5.conf file (https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html)
      • getKerberosUsername

        public String getKerberosUsername()
      • setKerberosUsername

        public void setKerberosUsername​(String kerberosUsername)
        The username used to authenticate with the kerberos nodes
      • getKerberosKeytabLocation

        public String getKerberosKeytabLocation()
      • setKerberosKeytabLocation

        public void setKerberosKeytabLocation​(String kerberosKeytabLocation)
        The location of the keytab file used to authenticate with the kerberos nodes (contains pairs of kerberos principals and encrypted keys (which are derived from the Kerberos password))
      • isKerberosAuthentication

        public boolean isKerberosAuthentication()
      • isStreamDownload

        public boolean isStreamDownload()
      • setStreamDownload

        public void setStreamDownload​(boolean streamDownload)
        Sets the download method to use when not using a local working directory. If set to true, the remote files are streamed to the route as they are read. When set to false, the remote files are loaded into memory before being sent into the route.