[ 
https://issues.apache.org/jira/browse/FLUME-1645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477396#comment-13477396
 ] 

Hari Shreedharan edited comment on FLUME-1645 at 10/16/12 10:08 PM:
--------------------------------------------------------------------

Steve,

I think this should go into BucketWriter#doOpen() method, where the file is 
actually created. You should take the config value as you have done here, then 
pass it to the BucketWriter(perhaps, add a setter for suffix, or add it to the 
constructor as a param) - then add it to the path, before the temp is added. So 
this line :
{code}
        if (codeC == null) {
          bucketPath = filePath + "." + counter;
{code}

would become:

{code}
        if (codeC == null) {
          bucketPath = filePath + "." +  counter + suffix;
{code}
(Of course you should add checks for empty or null suffix too)
This would ensure all your files have a ".avro" extension if suffix is ".avro". 
Else your files would be named : <something>.avro.<timestamp-increment>
                
      was (Author: hshreedharan):
    Steve,

I think this should go into BucketWriter#doOpen() method, where the file is 
actually created. You should take the config value as you have done here, then 
pass it to the BucketWriter(perhaps, add a setter for suffix, or add it to the 
constructor as a param) - then add it to the path, before the temp is added. So 
this line :
{code}
        if (codeC == null) {
          bucketPath = filePath + "." + counter;
{code}

would become:

{code}
        if (codeC == null) {
          bucketPath = filePath + "." +  counter + suffix;
{code}

This would ensure all your files have a ".avro" extension if suffix is ".avro". 
Else your files would be named : <something>.avro.<timestamp-increment>
                  
> add hdfs.fileSuffix property to HDFSEventSink
> ---------------------------------------------
>
>                 Key: FLUME-1645
>                 URL: https://issues.apache.org/jira/browse/FLUME-1645
>             Project: Flume
>          Issue Type: Improvement
>          Components: Sinks+Sources
>    Affects Versions: v1.2.0
>            Reporter: Steve Hoffman
>         Attachments: branch-1.2.0.patch
>
>
> I'd like to be able to use Avro files created by flume as input to a 
> MapReduce job.  However, the AvroInputFormat requires that avro files end in 
> .avro and there appears to be no property on the hdfs sink that allows me to 
> set a suffix (default being blank, of course).
> Thoughts?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to