-
Notifications
You must be signed in to change notification settings - Fork 26
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-27900. [HBOSS] Open file fails with NumberFormatException for S3AFileSystem #39
Open
steveloughran
wants to merge
1
commit into
apache:master
Choose a base branch
from
steveloughran:HBASE-27900-openfile-float
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,30 +135,53 @@ public B opt(@Nonnull final String key, | |
|
||
@Override | ||
public B opt(@Nonnull final String key, final boolean value) { | ||
LOG.debug("{}: option {}=\"{}\"", path, key, value); | ||
wrapped.opt(key, value); | ||
return getThisBuilder(); | ||
return opt(key, Boolean.toString(value)); | ||
} | ||
|
||
/** | ||
* sets the long value. | ||
* @since Hadoop-3.3.6 | ||
* Method added in HADOOP-18274. | ||
* @param key key | ||
* @param value long value | ||
* @return the builder | ||
*/ | ||
public B optLong(@Nonnull final String key, final long value) { | ||
return opt(key, Long.toString(value)); | ||
} | ||
|
||
/** | ||
* Set optional double parameter for the Builder. | ||
* @since Hadoop-3.3.6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shall we mention HADOOP-18724 for all comments with |
||
* @see #opt(String, String) | ||
*/ | ||
public B optDouble(@Nonnull final String key, double value) { | ||
return opt(key, Double.toString(value)); | ||
} | ||
|
||
@Override | ||
public B opt(@Nonnull final String key, final int value) { | ||
LOG.debug("{}: option {}=\"{}\"", path, key, value); | ||
wrapped.opt(key, value); | ||
return getThisBuilder(); | ||
return optLong(key, value); | ||
} | ||
|
||
@Override | ||
/** | ||
* Sets the LONG value, not any float value. | ||
* @param key key | ||
* @param value value to convert to long | ||
* @return the builder. | ||
*/ | ||
public B opt(@Nonnull final String key, final float value) { | ||
LOG.debug("{}: option {}=\"{}\"", path, key, value); | ||
wrapped.opt(key, value); | ||
return getThisBuilder(); | ||
return optLong(key, (long) value); | ||
} | ||
|
||
@Override | ||
/** | ||
* Sets the LONG value, not any double value. | ||
* @param key key | ||
* @param value value to convert to long | ||
* @return the builder. | ||
*/ | ||
public B opt(@Nonnull final String key, final double value) { | ||
LOG.debug("{}: option {}=\"{}\"", path, key, value); | ||
wrapped.opt(key, value); | ||
return getThisBuilder(); | ||
return optLong(key, (long) value); | ||
} | ||
|
||
@Override | ||
|
@@ -176,74 +199,99 @@ public B must(@Nonnull final String key, | |
return getThisBuilder(); | ||
} | ||
|
||
@Override | ||
public B must(@Nonnull final String key, final boolean value) { | ||
LOG.debug("{}: must {}=\"{}\"", path, key, value); | ||
wrapped.must(key, value); | ||
return getThisBuilder(); | ||
} | ||
|
||
@Override | ||
public B must(@Nonnull final String key, final int value) { | ||
LOG.debug("{}: must {}=\"{}\"", path, key, value); | ||
wrapped.must(key, value); | ||
return getThisBuilder(); | ||
/** | ||
* sets the long value. | ||
* @since Hadoop-3.3.6 | ||
*/ | ||
public B mustLong(@Nonnull final String key, final long value) { | ||
return must(key, Long.toString(value)); | ||
} | ||
|
||
@Override | ||
public B must(@Nonnull final String key, final float value) { | ||
LOG.debug("{}: must {}=\"{}\"", path, key, value); | ||
wrapped.must(key, value); | ||
return getThisBuilder(); | ||
/** | ||
* Sets the double value. | ||
* @param key key | ||
* @param value value to set as a double | ||
* @return the builder. | ||
* @since Hadoop-3.3.6 | ||
*/ | ||
public B mustDouble(@Nonnull final String key, double value) { | ||
return must(key, Double.toString(value)); | ||
} | ||
|
||
@Override | ||
public B must(@Nonnull final String key, final double value) { | ||
LOG.debug("{}: must {}=\"{}\"", path, key, value); | ||
wrapped.must(key, value); | ||
return getThisBuilder(); | ||
public B must(@Nonnull final String key, final boolean value) { | ||
return must(key, Boolean.toString(value)); | ||
} | ||
|
||
/** | ||
* Set mandatory int option. | ||
* | ||
* @see #must(String, String) | ||
*/ | ||
@Override | ||
public B must(@Nonnull final String key, | ||
@Nonnull final String... values) { | ||
LOG.debug("{}: must {}=(values)", path, key); | ||
wrapped.must(key, values); | ||
return getThisBuilder(); | ||
public B must(@Nonnull final String key, int value) { | ||
return mustLong(key, value); | ||
} | ||
|
||
/** | ||
* Configure with a long value. | ||
* opt(String, Long) was not on the original interface, | ||
* must(String, Long) was not on the original interface, | ||
* though it is in recent hadoop builds. | ||
* It is implemented in the wrapper by converting | ||
* to a string and calling the wrapper's | ||
* {@code #opt(String, String)}. | ||
* {@code #must(String, String)}. | ||
* It is NOT declared @Override so still compiles and | ||
* runs against hadoop 3.3.0. | ||
* @param key key to set | ||
* @param value long value | ||
* @return the builder | ||
*/ | ||
public B opt(@Nonnull String key, long value) { | ||
return opt(key, Long.toString(value)); | ||
public final B must(@Nonnull final String key, final long value) { | ||
return mustLong(key, value); | ||
} | ||
|
||
/** | ||
* Sets the LONG value, not any float value. | ||
* @param key key | ||
* @param value value to convert to long | ||
* @return the builder. | ||
*/ | ||
public final B must(@Nonnull final String key, final float value) { | ||
return mustLong(key, (long) value); | ||
} | ||
|
||
/** | ||
* Sets the LONG value, not any double value. | ||
* @param key key | ||
* @param value value to convert to long | ||
* @return the builder. | ||
*/ | ||
public final B must(@Nonnull final String key, double value) { | ||
return mustLong(key, (long) value); | ||
} | ||
|
||
public B must(@Nonnull final String key, | ||
@Nonnull final String... values) { | ||
LOG.debug("{}: must {}=(values)", path, key); | ||
wrapped.must(key, values); | ||
return getThisBuilder(); | ||
} | ||
|
||
/** | ||
* Configure with a long value. | ||
* must(String, Long) was not on the original interface, | ||
* opt(String, Long) was not on the original interface, | ||
* though it is in recent hadoop builds. | ||
* It is implemented in the wrapper by converting | ||
* to a string and calling the wrapper's | ||
* {@code #must(String, String)}. | ||
* {@code #opt(String, String)}. | ||
* It is NOT declared @Override so still compiles and | ||
* runs against hadoop 3.3.0. | ||
* @param key key to set | ||
* @param value long value | ||
* @return the builder | ||
*/ | ||
public B must(@Nonnull String key, long value) { | ||
return must(key, Long.toString(value)); | ||
public B opt(@Nonnull String key, long value) { | ||
return opt(key, Long.toString(value)); | ||
} | ||
|
||
@Override | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
typo? HADOOP-18724