QuotaProtos.TimedQuota timedQuota = proto.getTimedQuota(); builder.append(", LIMIT => "); if (timedQuota.hasSoftLimit()) {
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasType()) { hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; } if (hasTimedQuota()) { hash = (37 * hash) + TIMED_QUOTA_FIELD_NUMBER; hash = (53 * hash) + getTimedQuota().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
private void assertRPCQuota(ThrottleType type, long limit, TimeUnit tu, QuotaSettings actualSettings) throws Exception { assertTrue( "The actual QuotaSettings was not an instance of " + ThrottleSettings.class + " but of " + actualSettings.getClass(), actualSettings instanceof ThrottleSettings); QuotaProtos.ThrottleRequest throttleRequest = ((ThrottleSettings) actualSettings).getProto(); assertEquals(limit, throttleRequest.getTimedQuota().getSoftLimit()); assertEquals(ProtobufUtil.toProtoTimeUnit(tu), throttleRequest.getTimedQuota().getTimeUnit()); assertEquals(ProtobufUtil.toProtoThrottleType(type), throttleRequest.getType()); }
public TimeUnit getTimeUnit() { return proto.hasTimedQuota() ? ProtobufUtil.toTimeUnit(proto.getTimedQuota().getTimeUnit()) : null; }
public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleRequest other) { if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleRequest.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasTimedQuota()) { mergeTimedQuota(other.getTimedQuota()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public void writeTo(org.apache.hbase.thirdparty.com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, type_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeMessage(2, getTimedQuota()); } unknownFields.writeTo(output); }
private void assertRPCQuota(ThrottleType type, long limit, TimeUnit tu, QuotaSettings actualSettings) throws Exception { assertTrue( "The actual QuotaSettings was not an instance of " + ThrottleSettings.class + " but of " + actualSettings.getClass(), actualSettings instanceof ThrottleSettings); QuotaProtos.ThrottleRequest throttleRequest = ((ThrottleSettings) actualSettings).getProto(); assertEquals(limit, throttleRequest.getTimedQuota().getSoftLimit()); assertEquals(ProtobufUtil.toProtoTimeUnit(tu), throttleRequest.getTimedQuota().getTimeUnit()); assertEquals(ProtobufUtil.toProtoThrottleType(type), throttleRequest.getType()); }
QuotaProtos.TimedQuota timedQuota = proto.getTimedQuota(); builder.append(", LIMIT => "); if (timedQuota.hasSoftLimit()) {
@Override protected ThrottleSettings merge(QuotaSettings other) throws IOException { if (other instanceof ThrottleSettings) { ThrottleSettings otherThrottle = (ThrottleSettings) other; // Make sure this and the other target the same "subject" validateQuotaTarget(other); QuotaProtos.ThrottleRequest.Builder builder = proto.toBuilder(); if (!otherThrottle.proto.hasType()) { return null; } QuotaProtos.ThrottleRequest otherProto = otherThrottle.proto; if (otherProto.hasTimedQuota()) { if (otherProto.hasTimedQuota()) { validateTimedQuota(otherProto.getTimedQuota()); } if (!proto.getType().equals(otherProto.getType())) { throw new IllegalArgumentException( "Cannot merge a ThrottleRequest for " + proto.getType() + " with " + otherProto.getType()); } QuotaProtos.TimedQuota.Builder timedQuotaBuilder = proto.getTimedQuota().toBuilder(); timedQuotaBuilder.mergeFrom(otherProto.getTimedQuota()); QuotaProtos.ThrottleRequest mergedReq = builder.setTimedQuota( timedQuotaBuilder.build()).build(); return new ThrottleSettings(getUserName(), getTableName(), getNamespace(), mergedReq); } } return this; }
public long getSoftLimit() { return proto.hasTimedQuota() ? proto.getTimedQuota().getSoftLimit() : -1; }
public TimeUnit getTimeUnit() { return proto.hasTimedQuota() ? ProtobufUtil.toTimeUnit(proto.getTimedQuota().getTimeUnit()) : null; }
} else { QuotaProtos.ThrottleRequest otherProto = otherThrottle.proto; validateTimedQuota(otherProto.getTimedQuota()); if (throttleBuilder == null) { throttleBuilder = QuotaProtos.Throttle.newBuilder(); throttleBuilder.setReqNum(otherProto.getTimedQuota()); break; case REQUEST_SIZE: throttleBuilder.setReqSize(otherProto.getTimedQuota()); break; case WRITE_NUMBER: throttleBuilder.setWriteNum(otherProto.getTimedQuota()); break; case WRITE_SIZE: throttleBuilder.setWriteSize(otherProto.getTimedQuota()); break; case READ_NUMBER: throttleBuilder.setReadNum(otherProto.getTimedQuota()); break; case READ_SIZE: throttleBuilder.setReadSize(otherProto.getTimedQuota()); break; case REQUEST_CAPACITY_UNIT: throttleBuilder.setReqCapacityUnit(otherProto.getTimedQuota()); break; case READ_CAPACITY_UNIT: throttleBuilder.setReadCapacityUnit(otherProto.getTimedQuota()); break;
@Override protected ThrottleSettings merge(QuotaSettings other) throws IOException { if (other instanceof ThrottleSettings) { ThrottleSettings otherThrottle = (ThrottleSettings) other; // Make sure this and the other target the same "subject" validateQuotaTarget(other); QuotaProtos.ThrottleRequest.Builder builder = proto.toBuilder(); if (!otherThrottle.proto.hasType()) { return null; } QuotaProtos.ThrottleRequest otherProto = otherThrottle.proto; if (otherProto.hasTimedQuota()) { if (otherProto.hasTimedQuota()) { validateTimedQuota(otherProto.getTimedQuota()); } if (!proto.getType().equals(otherProto.getType())) { throw new IllegalArgumentException( "Cannot merge a ThrottleRequest for " + proto.getType() + " with " + otherProto.getType()); } QuotaProtos.TimedQuota.Builder timedQuotaBuilder = proto.getTimedQuota().toBuilder(); timedQuotaBuilder.mergeFrom(otherProto.getTimedQuota()); QuotaProtos.ThrottleRequest mergedReq = builder.setTimedQuota( timedQuotaBuilder.build()).build(); return new ThrottleSettings(getUserName(), getTableName(), getNamespace(), getRegionServer(), mergedReq); } } return this; }
@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.ThrottleRequest)) { return super.equals(obj); } org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleRequest other = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleRequest) obj; boolean result = true; result = result && (hasType() == other.hasType()); if (hasType()) { result = result && type_ == other.type_; } result = result && (hasTimedQuota() == other.hasTimedQuota()); if (hasTimedQuota()) { result = result && getTimedQuota() .equals(other.getTimedQuota()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += org.apache.hbase.thirdparty.com.google.protobuf.CodedOutputStream .computeEnumSize(1, type_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += org.apache.hbase.thirdparty.com.google.protobuf.CodedOutputStream .computeMessageSize(2, getTimedQuota()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public long getSoftLimit() { return proto.hasTimedQuota() ? proto.getTimedQuota().getSoftLimit() : -1; }
public TimeUnit getTimeUnit() { return proto.hasTimedQuota() ? ProtobufUtil.toTimeUnit(proto.getTimedQuota().getTimeUnit()) : null; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (hasTimedQuota()) { if (!getTimedQuota().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleRequest other) { if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleRequest.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasTimedQuota()) { mergeTimedQuota(other.getTimedQuota()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public void writeTo(org.apache.hbase.thirdparty.com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, type_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeMessage(2, getTimedQuota()); } unknownFields.writeTo(output); }