/** * Validates that the provided protobuf SpaceQuota has the necessary information to construct * a {@link SpaceLimitSettings}. * * @param proto The protobuf message to validate. */ static void validateProtoArguments(final QuotaProtos.SpaceQuota proto) { if (!Objects.requireNonNull(proto).hasSoftLimit()) { throw new IllegalArgumentException("Cannot handle SpaceQuota without a soft limit"); } if (!proto.hasViolationPolicy()) { throw new IllegalArgumentException("Cannot handle SpaceQuota without a violation policy"); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasSoftLimit()) { hash = (37 * hash) + SOFT_LIMIT_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong( getSoftLimit()); } if (hasViolationPolicy()) { hash = (37 * hash) + VIOLATION_POLICY_FIELD_NUMBER; hash = (53 * hash) + violationPolicy_; } if (hasRemove()) { hash = (37 * hash) + REMOVE_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashBoolean( getRemove()); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * Validates that the provided protobuf SpaceQuota has the necessary information to construct * a {@link SpaceLimitSettings}. * * @param proto The protobuf message to validate. */ static void validateProtoArguments(final QuotaProtos.SpaceQuota proto) { if (!Objects.requireNonNull(proto).hasSoftLimit()) { throw new IllegalArgumentException("Cannot handle SpaceQuota without a soft limit"); } if (!proto.hasViolationPolicy()) { throw new IllegalArgumentException("Cannot handle SpaceQuota without a violation policy"); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasSoftLimit()) { hash = (37 * hash) + SOFT_LIMIT_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong( getSoftLimit()); } if (hasViolationPolicy()) { hash = (37 * hash) + VIOLATION_POLICY_FIELD_NUMBER; hash = (53 * hash) + violationPolicy_; } if (hasRemove()) { hash = (37 * hash) + REMOVE_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashBoolean( getRemove()); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota)) { return super.equals(obj); } org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota other = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota) obj; boolean result = true; result = result && (hasSoftLimit() == other.hasSoftLimit()); if (hasSoftLimit()) { result = result && (getSoftLimit() == other.getSoftLimit()); } result = result && (hasViolationPolicy() == other.hasViolationPolicy()); if (hasViolationPolicy()) { result = result && violationPolicy_ == other.violationPolicy_; } result = result && (hasRemove() == other.hasRemove()); if (hasRemove()) { result = result && (getRemove() == other.getRemove()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota other) { if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota.getDefaultInstance()) return this; if (other.hasSoftLimit()) { setSoftLimit(other.getSoftLimit()); } if (other.hasViolationPolicy()) { setViolationPolicy(other.getViolationPolicy()); } if (other.hasRemove()) { setRemove(other.getRemove()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * Validates that the provided protobuf SpaceQuota has the necessary information to construct * a {@link SpaceLimitSettings}. * * @param proto The protobuf message to validate. */ static void validateProtoArguments(final QuotaProtos.SpaceQuota proto) { if (!Objects.requireNonNull(proto).hasSoftLimit()) { throw new IllegalArgumentException("Cannot handle SpaceQuota without a soft limit"); } if (!proto.hasViolationPolicy()) { throw new IllegalArgumentException("Cannot handle SpaceQuota without a violation policy"); } }
public static boolean isEmptyQuota(final Quotas quotas) { boolean hasSettings = false; hasSettings |= quotas.hasThrottle(); hasSettings |= quotas.hasBypassGlobals(); // Only when there is a space quota, make sure there's actually both fields provided // Otherwise, it's a noop. if (quotas.hasSpace()) { hasSettings |= (quotas.getSpace().hasSoftLimit() && quotas.getSpace().hasViolationPolicy()); } return !hasSettings; }
public static boolean isEmptyQuota(final Quotas quotas) { boolean hasSettings = false; hasSettings |= quotas.hasThrottle(); hasSettings |= quotas.hasBypassGlobals(); // Only when there is a space quota, make sure there's actually both fields provided // Otherwise, it's a noop. if (quotas.hasSpace()) { hasSettings |= (quotas.getSpace().hasSoftLimit() && quotas.getSpace().hasViolationPolicy()); } return !hasSettings; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota)) { return super.equals(obj); } org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota other = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota) obj; boolean result = true; result = result && (hasSoftLimit() == other.hasSoftLimit()); if (hasSoftLimit()) { result = result && (getSoftLimit() == other.getSoftLimit()); } result = result && (hasViolationPolicy() == other.hasViolationPolicy()); if (hasViolationPolicy()) { result = result && violationPolicy_ == other.violationPolicy_; } result = result && (hasRemove() == other.hasRemove()); if (hasRemove()) { result = result && (getRemove() == other.getRemove()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota other) { if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota.getDefaultInstance()) return this; if (other.hasSoftLimit()) { setSoftLimit(other.getSoftLimit()); } if (other.hasViolationPolicy()) { setViolationPolicy(other.getViolationPolicy()); } if (other.hasRemove()) { setRemove(other.getRemove()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public static boolean isEmptyQuota(final Quotas quotas) { boolean hasSettings = false; hasSettings |= quotas.hasThrottle(); hasSettings |= quotas.hasBypassGlobals(); // Only when there is a space quota, make sure there's actually both fields provided // Otherwise, it's a noop. if (quotas.hasSpace()) { hasSettings |= (quotas.getSpace().hasSoftLimit() && quotas.getSpace().hasViolationPolicy()); } return !hasSettings; }