Skip to content

Adds possibility to read '.gz' files when using local firehose - #2394

Closed
se7entyse7en wants to merge 2 commits into
apache:masterfrom
se7entyse7en:feature-local-firehose-gzip
Closed

se7entyse7en wants to merge 2 commits into
apache:masterfrom
se7entyse7en:feature-local-firehose-gzip

Conversation

@se7entyse7en

Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest com.metamx.common.CompressionUtils#isGz

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also proposing

InputStream inputStream = new FileInputStream(f);
if(CompressionUtils.isGz(f.getName()))
{
    inputStream = CompressionUtils.gzipInputStream(inputStream)
}

@drcrallen

Copy link
Copy Markdown
Contributor

Hi @se7entyse7en, thanks for the PR!

Can you add a unit test that confirms this works?

@se7entyse7en
se7entyse7en force-pushed the feature-local-firehose-gzip branch from 5784ded to 1b12ceb Compare February 5, 2016 09:44
rawInputStream.close();
} catch (IOException ioe)
{
Throwables.propagate(ioe);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest e.addSuppressed(ioe); throw Throwables.propagate(e);

@drcrallen

Copy link
Copy Markdown
Contributor

@se7entyse7en it is possible that a certain change may have performance improvements in some areas. But to retain the prior behavior you should return IOUtils.lineIterator(inputStream, Charsets.UTF_8);

Or submit proper benchmarking showing the impact on heap and performance.

@fjy

fjy commented Feb 5, 2016

Copy link
Copy Markdown
Contributor

👍

firehoseParser
);
}
private static final EmittingLogger log = new EmittingLogger(LocalFirehoseFactory.class);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it appears you changed spaces to tabs. druid uses 2 spaces for indentation. pls use appropriate formatter as mentioned in https://github.com/druid-io/druid/blob/master/CONTRIBUTING.md

@fjy

fjy commented Mar 14, 2016

Copy link
Copy Markdown
Contributor

@se7entyse7en can we finish this up?

@gianm

gianm commented Nov 14, 2018

Copy link
Copy Markdown
Contributor

Similar functionality was added in another PR (I don't have the number handy) and then improved in #5586 to handle more formats.

@gianm gianm closed this Nov 14, 2018
seoeun25 pushed a commit to seoeun25/incubator-druid that referenced this pull request Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants