You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/13 21:23:00 UTC

[GitHub] [pulsar] ravi-vaidyanathan opened a new pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

ravi-vaidyanathan opened a new pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218


   
   ### Motivation
   
   PIP-82 adds support for distributed resource quota enforcement at a tenant, namespace or topic level.
   
   ### Modifications
   - Add REST endpoints for crud operations on ResourceGroup
   - Add REST endpoints for setting/removing ResourceGroup on namespaces.
   - Add pulsar-admin cli support for crud operations on ResourceGroup
   - Add pulsar-admin cli support for setting/removing ResourceGroup on namespace.
   
   ### Verifying this change
   
   - Added unit tests.
   
   ### Does this pull request potentially affect one of the following parts: 
   
   *If `yes` was chosen, please highlight the changes*
   
     - The public API: yes
     - The admin cli options: yes
   
   ### Documentation
   
     - Does this pull request introduce a new feature? yes
     - The documentation of the same will be added in a subsequent PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] merlimat commented on a change in pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#discussion_r614484082



##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/ResourceGroup.java
##########
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.common.policies.data;
+
+import com.google.common.base.MoreObjects;
+
+import java.util.Objects;
+
+public class ResourceGroup {

Review comment:
       We can use `@Data` annotation from Lombok to automatically generate the constructors, hashcode, equals and toString methods. (and mark the fields as private)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] ravi-vaidyanathan commented on pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
ravi-vaidyanathan commented on pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#issuecomment-820704799


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] ravi-vaidyanathan commented on pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
ravi-vaidyanathan commented on pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#issuecomment-819902060


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] ravi-vaidyanathan commented on pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
ravi-vaidyanathan commented on pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#issuecomment-819155077


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] ravi-vaidyanathan commented on pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
ravi-vaidyanathan commented on pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#issuecomment-820600109


   @merlimat Could you take a look at this PR when you get a chance, in the meantime i will continue to try re-running the tests to get a pass. Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] ravi-vaidyanathan commented on pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
ravi-vaidyanathan commented on pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#issuecomment-819800391


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] ravi-vaidyanathan commented on a change in pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
ravi-vaidyanathan commented on a change in pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#discussion_r614957049



##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/ResourceGroup.java
##########
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.common.policies.data;
+
+import com.google.common.base.MoreObjects;
+
+import java.util.Objects;
+
+public class ResourceGroup {

Review comment:
       done,




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] ravi-vaidyanathan commented on a change in pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
ravi-vaidyanathan commented on a change in pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#discussion_r614956929



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/cache/ConfigurationCacheService.java
##########
@@ -101,6 +104,13 @@ public Policies deserialize(String path, byte[] content) throws Exception {
             }
         };
 
+        this.resourcegroupsCache = new ZooKeeperDataCache<ResourceGroup>(cache) {

Review comment:
       Thanks for catching this, removed it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] merlimat merged pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] ravi-vaidyanathan commented on pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
ravi-vaidyanathan commented on pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#issuecomment-820516088


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] ravi-vaidyanathan commented on pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
ravi-vaidyanathan commented on pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#issuecomment-819493313


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] merlimat commented on a change in pull request #10218: [PIP-82] [pulsar-broker] CRUD support for ResourceGroup

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #10218:
URL: https://github.com/apache/pulsar/pull/10218#discussion_r614482887



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/cache/ConfigurationCacheService.java
##########
@@ -101,6 +104,13 @@ public Policies deserialize(String path, byte[] content) throws Exception {
             }
         };
 
+        this.resourcegroupsCache = new ZooKeeperDataCache<ResourceGroup>(cache) {

Review comment:
       Since we're moving towards having all accesses through the metadata store API, is there a way to avoid this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org