Skip to content

FileSmoosher requested changes#3673

Merged
fjy merged 2 commits intoapache:masterfrom
akashdw:filesmoosher
Nov 10, 2016
Merged

FileSmoosher requested changes#3673
fjy merged 2 commits intoapache:masterfrom
akashdw:filesmoosher

Conversation

@akashdw
Copy link
Copy Markdown
Contributor

@akashdw akashdw commented Nov 9, 2016

Addresses #3640 and metamx/java-util#55 requested changes.

private final GatheringByteChannel channel = out.getChannel();;
private final GatheringByteChannel channel = out.getChannel();
private final Closer closer = Closer.create();
;
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.

What is this semicolon doing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed.

if (!completedFiles.isEmpty() || !filesInProcess.isEmpty()) {
for (File file : completedFiles) {
if (!file.delete()) {
LOG.warn("Unable to delete file [%s]", file.getPath());
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.

I think just passing file is enough instead of file.getPath()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

}
}
throw new ISE(String.format("%d writers needs to be closed before closing smoosher.", filesInProcess.size() + completedFiles.size()));
throw new ISE(String.format(
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.

ISE does a String.format for you, don't need to duplicate it here. Also, the message is probably a lot nicer if you expose both numbers instead of only exposing the sum.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@akashdw
Copy link
Copy Markdown
Contributor Author

akashdw commented Nov 9, 2016

@cheddar @drcrallen Thanks for reviewing this PR, uploaded a new patch set to address code review comments.

@fjy
Copy link
Copy Markdown
Contributor

fjy commented Nov 10, 2016

👍

@fjy fjy added this to the 0.9.3 milestone Nov 10, 2016
@cheddar
Copy link
Copy Markdown
Contributor

cheddar commented Nov 10, 2016

👍

@fjy fjy merged commit 1acc816 into apache:master Nov 10, 2016
fundead pushed a commit to fundead/druid that referenced this pull request Dec 7, 2016
* FileSmoosher requested changes 

from metamx/java-util#55

* Addressed code review requested changes.
dgolitsyn pushed a commit to metamx/druid that referenced this pull request Feb 14, 2017
* FileSmoosher requested changes 

from metamx/java-util#55

* Addressed code review requested changes.
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.

4 participants