jdeppe-pivotal commented on a change in pull request #6960:
URL: https://github.com/apache/geode/pull/6960#discussion_r732788011



##########
File path: 
geode-for-redis/src/main/java/org/apache/geode/redis/internal/RedisProperties.java
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.geode.redis.internal;
+
+public class RedisProperties {
+  /** System Property Names **/
+  public static final String REDIS_REGION_NAME_PROPERTY = 
"geode-for-redis-region-name";
+
+
+  public static String getStringSystemProperty(String propName, String 
defaultValue,

Review comment:
       It feels like the `emptyIsValid` option is not really necessary and 
over-complicating how to reason about properties. I think this helper should 
just follow the same semantics as regular retrieval of system properties - if 
the property is set, you get that value. Then this could just be:
   ```
       String geodeValue = System.getProperty("geode." + propName);
       if (StringUtils.isNotBlank(geodeValue)) {
         return geodeValue;
       }
       String gemfireValue = System.getProperty("gemfire." + propName);
       if (StringUtils.isNotBlank(gemfireValue)) {
         return gemfireValue;
       }
   ```

##########
File path: 
geode-for-redis/src/main/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContext.java
##########
@@ -506,4 +517,7 @@ private RedisData getRedisData(RedisKey key, boolean 
updateStats) {
     return getRegionProvider().getRedisData(key, updateStats);
   }
 
+  private static String getRegionName() {

Review comment:
       This can be inlined. Even though it's private, in general we shouldn't 
have methods that query system properties. Inadvertent use could be a big 
performance impact.




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


Reply via email to