From 19a027e49ca3e9a663523214fd85291888e7ccde Mon Sep 17 00:00:00 2001 From: Josh Elser Date: Thu, 17 Nov 2016 15:11:07 -0500 Subject: [PATCH] HBASE-16995 Address some line-wrapping issues (addendum) --- .../hadoop/hbase/quotas/QuotaSettingsFactory.java | 20 ++++++++++++-------- .../hadoop/hbase/quotas/SpaceLimitSettings.java | 8 ++++---- .../hadoop/hbase/shaded/protobuf/ProtobufUtil.java | 9 +++++---- 3 files changed, 21 insertions(+), 16 deletions(-) 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 b8e99b8..f436cf2 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 @@ -130,7 +130,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); @@ -302,29 +303,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); } } 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())); 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 cecaad2..a2676c7 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 @@ -2515,7 +2515,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; @@ -2566,8 +2567,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)) @@ -3288,4 +3289,4 @@ public final class ProtobufUtil { int port = Addressing.parsePort(str); return ServerName.valueOf(hostname, port, -1L); } -} \ No newline at end of file +} -- 2.10.2