acelyc111 commented on code in PR #1378:
URL: 
https://github.com/apache/incubator-pegasus/pull/1378#discussion_r1125687595


##########
src/runtime/ranger/ranger_resource_policy.h:
##########
@@ -46,12 +47,18 @@ extern access_type operator|(access_type lhs, access_type 
rhs);
 
 extern access_type operator&(access_type lhs, access_type rhs);
 
+extern access_type &operator|=(access_type &lhs, access_type rhs);

Review Comment:
   Just a bit of curious that can we remove the `extern`?



##########
src/runtime/test/ranger_resource_policy_manager_test.cpp:
##########
@@ -0,0 +1,182 @@
+// 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.
+
+#include <gtest/gtest.h>
+
+#include "runtime/ranger/ranger_resource_policy.h"
+#include "runtime/ranger/ranger_resource_policy_manager.h"
+
+namespace dsn {
+namespace ranger {
+
+TEST(ranger_resource_policy_manager_test, parse_policies_from_json_for_test)
+{
+    std::string data =
+        R"([{"accesses":)"

Review Comment:
   Futher more, string literal can simplify multiple lines of string.



##########
src/runtime/ranger/ranger_resource_policy.h:
##########
@@ -46,12 +47,18 @@ extern access_type operator|(access_type lhs, access_type 
rhs);
 
 extern access_type operator&(access_type lhs, access_type rhs);
 
+extern access_type &operator|=(access_type &lhs, access_type rhs);
+
+extern uint8_t access_type_to_int8_t(const access_type &ac_type);
+
 // Ranger policy data structure
 struct policy_item
 {
-    access_type access_types;
+    uint8_t access_types;

Review Comment:
   I guess you changed it from `access_type` to `uint8_t` is because that enum 
class is not convenient in same cases, right?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to