HBASE-16995 Build client Java API and client protobuf messages - addendum fixes line lengths (Josh Elser)
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3a5087ed Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3a5087ed Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3a5087ed Branch: refs/heads/HBASE-16961 Commit: 3a5087ed113c48ddd33a96b47c23bf62b5cceaa3 Parents: 2b9b00b Author: tedyu <yuzhih...@gmail.com> Authored: Mon Nov 21 13:00:27 2016 -0800 Committer: Josh Elser <els...@apache.org> Committed: Tue Apr 25 18:20:14 2017 -0400 ---------------------------------------------------------------------- .../hbase/quotas/QuotaSettingsFactory.java | 20 ++++++++++++-------- .../hadoop/hbase/quotas/SpaceLimitSettings.java | 8 ++++---- .../hbase/shaded/protobuf/ProtobufUtil.java | 7 ++++--- 3 files changed, 20 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/3a5087ed/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaSettingsFactory.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaSettingsFactory.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaSettingsFactory.java index 8512e39..7f1c180 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaSettingsFactory.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaSettingsFactory.java @@ -128,7 +128,8 @@ public class QuotaSettingsFactory { static QuotaSettings fromSpace(TableName table, String namespace, SpaceQuota protoQuota) { if ((null == table && null == namespace) || (null != table && null != namespace)) { - throw new IllegalArgumentException("Can only construct SpaceLimitSettings for a table or namespace."); + throw new IllegalArgumentException( + "Can only construct SpaceLimitSettings for a table or namespace."); } if (null != table) { return SpaceLimitSettings.fromSpaceQuota(table, protoQuota); @@ -300,29 +301,32 @@ public class QuotaSettingsFactory { */ /** - * Creates a {@link QuotaSettings} object to limit the FileSystem space usage for the given table to the given size in bytes. - * When the space usage is exceeded by the table, the provided {@link SpaceViolationPolicy} is enacted on the table. + * Creates a {@link QuotaSettings} object to limit the FileSystem space usage for the given table + * to the given size in bytes. When the space usage is exceeded by the table, the provided + * {@link SpaceViolationPolicy} is enacted on the table. * * @param tableName The name of the table on which the quota should be applied. * @param sizeLimit The limit of a table's size in bytes. * @param violationPolicy The action to take when the quota is exceeded. * @return An {@link QuotaSettings} object. */ - public static QuotaSettings limitTableSpace(final TableName tableName, long sizeLimit, final SpaceViolationPolicy violationPolicy) { + public static QuotaSettings limitTableSpace( + final TableName tableName, long sizeLimit, final SpaceViolationPolicy violationPolicy) { return new SpaceLimitSettings(tableName, sizeLimit, violationPolicy); } /** - * Creates a {@link QuotaSettings} object to limit the FileSystem space usage for the given namespace to the given size in bytes. - * When the space usage is exceeded by all tables in the namespace, the provided {@link SpaceViolationPolicy} is enacted on - * all tables in the namespace. + * Creates a {@link QuotaSettings} object to limit the FileSystem space usage for the given + * namespace to the given size in bytes. When the space usage is exceeded by all tables in the + * namespace, the provided {@link SpaceViolationPolicy} is enacted on all tables in the namespace. * * @param namespace The namespace on which the quota should be applied. * @param sizeLimit The limit of the namespace's size in bytes. * @param violationPolicy The action to take when the the quota is exceeded. * @return An {@link QuotaSettings} object. */ - public static QuotaSettings limitNamespaceSpace(final String namespace, long sizeLimit, final SpaceViolationPolicy violationPolicy) { + public static QuotaSettings limitNamespaceSpace( + final String namespace, long sizeLimit, final SpaceViolationPolicy violationPolicy) { return new SpaceLimitSettings(namespace, sizeLimit, violationPolicy); } } http://git-wip-us.apache.org/repos/asf/hbase/blob/3a5087ed/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/SpaceLimitSettings.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/SpaceLimitSettings.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/SpaceLimitSettings.java index dded9b5..e54882e 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/SpaceLimitSettings.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/SpaceLimitSettings.java @@ -93,8 +93,8 @@ class SpaceLimitSettings extends QuotaSettings { * @param proto The protobuf representation. * @return A QuotaSettings. */ - static SpaceLimitSettings fromSpaceQuota(final TableName tableName, - final QuotaProtos.SpaceQuota proto) { + static SpaceLimitSettings fromSpaceQuota( + final TableName tableName, final QuotaProtos.SpaceQuota proto) { validateProtoArguments(proto); return new SpaceLimitSettings(tableName, proto.getSoftLimit(), ProtobufUtil.toViolationPolicy(proto.getViolationPolicy())); @@ -107,8 +107,8 @@ class SpaceLimitSettings extends QuotaSettings { * @param proto The protobuf representation. * @return A QuotaSettings. */ - static SpaceLimitSettings fromSpaceQuota(final String namespace, - final QuotaProtos.SpaceQuota proto) { + static SpaceLimitSettings fromSpaceQuota( + final String namespace, final QuotaProtos.SpaceQuota proto) { validateProtoArguments(proto); return new SpaceLimitSettings(namespace, proto.getSoftLimit(), ProtobufUtil.toViolationPolicy(proto.getViolationPolicy())); http://git-wip-us.apache.org/repos/asf/hbase/blob/3a5087ed/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java index 0d813f4..2eeb126 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java @@ -2567,7 +2567,8 @@ public final class ProtobufUtil { * @param proto The protocol buffer space violation policy. * @return The corresponding client SpaceViolationPolicy. */ - public static SpaceViolationPolicy toViolationPolicy(final QuotaProtos.SpaceViolationPolicy proto) { + public static SpaceViolationPolicy toViolationPolicy( + final QuotaProtos.SpaceViolationPolicy proto) { switch (proto) { case DISABLE: return SpaceViolationPolicy.DISABLE; case NO_WRITES_COMPACTIONS: return SpaceViolationPolicy.NO_WRITES_COMPACTIONS; @@ -2618,8 +2619,8 @@ public final class ProtobufUtil { * @param violationPolicy The policy to apply when the quota is violated. * @return The protocol buffer SpaceQuota. */ - public static QuotaProtos.SpaceQuota toProtoSpaceQuota(final long limit, - final SpaceViolationPolicy violationPolicy) { + public static QuotaProtos.SpaceQuota toProtoSpaceQuota( + final long limit, final SpaceViolationPolicy violationPolicy) { return QuotaProtos.SpaceQuota.newBuilder() .setSoftLimit(limit) .setViolationPolicy(toProtoViolationPolicy(violationPolicy))