streaming files into hdfs using flume
<p>I'm trying to move files to HDFS.<br>
And this is my config file:</p>

<pre><code># Naming the components on the current agent. 
FileAgent.sources = File 
FileAgent.channels = MemChannel 
FileAgent.sinks = HDFS      

#configuring the souce
FileAgent.sources.File.type = spooldir
FileAgent.sources.File.spoolDir = /usr/lib/flume/spooldir

# Describing/Configuring the sink    
FileAgent.sinks.HDFS.type = hdfs 
FileAgent.sinks.HDFS.hdfs.path = hdfs://192.168.1.31:8020/user/Flume/
FileAgent.sinks.HDFS.hdfs.fileType = DataStream 
FileAgent.sinks.HDFS.hdfs.writeFormat = Text 
FileAgent.sinks.HDFS.hdfs.batchSize = 1000
FileAgent.sinks.HDFS.hdfs.rollSize = 0 
FileAgent.sinks.HDFS.hdfs.rollCount = 10000 

# Describing/Configuring the channel 
FileAgent.channels.MemChannel.type = memory 
FileAgent.channels.MemChannel.capacity = 10000 
FileAgent.channels.MemChannel.transactionCapacity = 100

# Binding the source and sink to the channel 
FileAgent.sources.File.channels = MemChannel
FileAgent.sinks.HDFS.channel = MemChannel
</code></pre>

<p>And it works well.But the files in hdfs have a name like this: <strong>FlumeData.1460976871742</strong><br>
In my case I want to keep the original file name.<br>
How to keep the original file name in hdfs?
For example, if I have a file <strong>test.txt</strong> in the directory <em>/usr/lib/flume/spooldir</em>, I will have a file <strong>test.txt</strong> in HDFS.</p>