Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

APEXMALHAR-2226 Fixed the Not supported exception while re-deploying the AbstractFileOutput Operator #401

Merged
merged 1 commit into from Oct 3, 2016

Conversation

chaithu14
Copy link
Contributor

No description provided.

Copy link
Contributor

@yogidevendra yogidevendra left a comment

Choose a reason for hiding this comment

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

Added my feedback for the changes. Otherwise looks OK.

@@ -636,7 +638,7 @@ protected FSDataOutputStream openStream(Path filepath, boolean append) throws IO
{
FSDataOutputStream fsOutput;
if (append) {
fsOutput = fs.append(filepath);
return openStreamForNonAppendFS(filepath);
Copy link
Contributor

Choose a reason for hiding this comment

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

How about
fsOutput = openStreamForNonAppendFS(filepath);
to keep it consistent with the original one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay.

try {
fsOutput = fs.append(filepath);
} catch (IOException e) {
if (e.getMessage().contains("Not supported")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is output of e.getMessage() in this case? Can we make it e.getMessage().equals instead of contains?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Error message consists of very huge contents. I think contains() is the best option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, my bad. Error message contains "Not Supported" only. I changed to equals() instead of contains.

FSDataOutputStream fsOut = fs.create(filepath);
IOUtils.copy(fsIn, fsOut);
flush(fsOut);
fs.delete(appendTmpFile);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to close fsIn before delete?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. We need to close stream before delete.

@chaithu14
Copy link
Contributor Author

@yogidevendra Incorporated review comments and Updated the branch.

@yogidevendra
Copy link
Contributor

Looks OK to me. Would wait for 1 day for any other comments from community else merge it.

@asfgit asfgit merged commit 1333910 into apache:master Oct 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants