-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-23195 FSDataInputStreamWrapper unbuffer can NOT invoke the clas… #746
Conversation
…ses that NOT implements CanUnbuffer but its parents class implements CanUnbuffer
hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment on test. Else LGTM
new FSDataInputStreamWrapper(new FSDataInputStream(pc)); | ||
fsdisw1.unbuffer(); | ||
// parent class should be true | ||
assertEquals(true, fsdisw1.instanceOfCanUnbuffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of checking instanceOfCanUnbuffer is set to true once called unbuffer() , you can actually assert whether the unbuffer() in pc is been called or not. Same with ChildClass case also. Can have some boolen there been set on call to unbuffer() and u can assert that here. So no need to even change the visibility of instanceOfCanUnbuffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anoopsjohn Thanks for review! Good suggestion! Changed on your comments, please review it again. Thanks!
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
Outdated
Show resolved
Hide resolved
hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
this.unbuffer.invoke(wrappedStream); | ||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { | ||
this.unbuffer.unbuffer(); | ||
} catch (IllegalArgumentException | UnsupportedOperationException e){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the try catch here, because some UT failed such as TestHFile. The failed message is "this stream org.apache.hadoop.fs.BufferedFSInputStream does not support unbuffering." check the code the BufferedFSInputStream is not implements the unbuffer, through FSDataInputStream implements unbuffer but the InputStream paramenter maybe NOT, so we should catch it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unbuffer here is an CanUnbuffer instance so why we could still get this exception? And for BufferedFSInputStream, it is not a sub class of CanUnbuffer? Could you please check the UT again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Apache9 My fault! We do NOT need catch the IllegalAccessException. Yes, the BufferedFSInputStream is NOT a sub class of CanUnbuffer, checked in the hadoop-common project. So need to catch the UnsupportedOperationException, because the BufferedFSInputStream is NOT a sub class of CanUnbuffer. Commit a change remove catch IllegalAccessException. Thanks for your review and point out my fault.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Apache9 Could you help review again? Thanks!
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
LGTM +1 |
this.unbuffer.invoke(wrappedStream); | ||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { | ||
this.unbuffer.unbuffer(); | ||
} catch (IllegalArgumentException | UnsupportedOperationException e){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unbuffer here is an CanUnbuffer instance so why we could still get this exception? And for BufferedFSInputStream, it is not a sub class of CanUnbuffer? Could you please check the UT again?
🎊 +1 overall
This message was automatically generated. |
hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
Outdated
Show resolved
Hide resolved
hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
Show resolved
Hide resolved
hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
Outdated
Show resolved
Hide resolved
hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
Show resolved
Hide resolved
hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
Outdated
Show resolved
Hide resolved
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Can those who requested changes ok this last PR if they agree so we can get it in? Thanks. |
I think Duo's request https://github.com/apache/hbase/pull/746/files#r341146952 still wasn't addressed (just use |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
1 similar comment
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
1 similar comment
💔 -1 overall
This message was automatically generated. |
@zhaoyim mind addressing the conflicts and the last comment by Duo? Thanks. |
@saintstack Sorry! I missed this issue. Sure! I will go through the commit then do the update based on Dou's comments This week. Thanks for reminder! |
@saintstack @Apache9 I updated the commit use the instanceof replaced the isAssignableFrom, please help review again, Thanks! |
💔 -1 overall
This message was automatically generated. |
2 similar comments
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One trivial change, otherwise lgtm.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Apache9 shout if you have any issues, please. Otherwise, I'll come back and merge this. |
…ses that NOT implements CanUnbuffer but its parents class implements CanUnbuffer Closes #746 Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Josh Elser <elserj@apache.org>
…ses that NOT implements CanUnbuffer but its parents class implements CanUnbuffer Closes #746 Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Josh Elser <elserj@apache.org>
…ses that NOT implements CanUnbuffer but its parents class implements CanUnbuffer Closes #746 Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Josh Elser <elserj@apache.org>
…ses that NOT implements CanUnbuffer but its parents class implements CanUnbuffer Closes apache#746 Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Josh Elser <elserj@apache.org>
…ses that NOT implements CanUnbuffer but its parents class implements CanUnbuffer Closes apache#746 Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Josh Elser <elserj@apache.org> (cherry picked from commit 0b73497) Change-Id: Ic9c953930b69bf76f3d651b69a4c10896d1502b7
…ses that NOT implements CanUnbuffer but its parents class implements CanUnbuffer