Quota.proto 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. package pb;
  19. option java_package = "org.apache.hadoop.hbase.protobuf.generated";
  20. option java_outer_classname = "QuotaProtos";
  21. option java_generic_services = true;
  22. option java_generate_equals_and_hash = true;
  23. option optimize_for = SPEED;
  24. import "HBase.proto";
  25. enum QuotaScope {
  26. CLUSTER = 1;
  27. MACHINE = 2;
  28. }
  29. message TimedQuota {
  30. required TimeUnit time_unit = 1;
  31. optional uint64 soft_limit = 2;
  32. optional float share = 3;
  33. optional QuotaScope scope = 4 [default = MACHINE];
  34. }
  35. enum ThrottleType {
  36. REQUEST_NUMBER = 1;
  37. REQUEST_SIZE = 2;
  38. WRITE_NUMBER = 3;
  39. WRITE_SIZE = 4;
  40. READ_NUMBER = 5;
  41. READ_SIZE = 6;
  42. }
  43. message Throttle {
  44. optional TimedQuota req_num = 1;
  45. optional TimedQuota req_size = 2;
  46. optional TimedQuota write_num = 3;
  47. optional TimedQuota write_size = 4;
  48. optional TimedQuota read_num = 5;
  49. optional TimedQuota read_size = 6;
  50. }
  51. message ThrottleRequest {
  52. optional ThrottleType type = 1;
  53. optional TimedQuota timed_quota = 2;
  54. }
  55. enum QuotaType {
  56. THROTTLE = 1;
  57. }
  58. message Quotas {
  59. optional bool bypass_globals = 1 [default = false];
  60. optional Throttle throttle = 2;
  61. }
  62. message QuotaUsage {
  63. }