Skip to content
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
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Choose a reason for hiding this comment

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

typo? HADOOP-18724

* @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

Choose a reason for hiding this comment

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

shall we mention HADOOP-18724 for all comments with @since Hadoop-3.3.6?

* @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
Expand All @@ -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
Expand Down