narendly commented on a change in pull request #653: add Helix properties 
factory and class
URL: https://github.com/apache/helix/pull/653#discussion_r360514701
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/HelixParticipantProperty.java
 ##########
 @@ -0,0 +1,70 @@
+package org.apache.helix;
+
+/*
+ * 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.
+ */
+
+import java.util.Properties;
+import org.apache.helix.model.CloudConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * hold participant properties
+ */
+public class HelixParticipantProperty {
+  private static final Logger logger = 
LoggerFactory.getLogger(HelixParticipantProperty.class.getName());
+  private String _version;
+  private Integer _healthReportLatency;
+  private HelixCloudProperty _helixCloudProperty;
+
+  /**
+   * Initialize Helix Participant Property with default value
+   * @param
+   */
+  public HelixParticipantProperty(Properties properties, CloudConfig 
cloudConfig) {
+    _helixCloudProperty = new HelixCloudProperty(cloudConfig);
+    
setVersion(properties.getProperty(SystemPropertyKeys.CLUSTER_MANAGER_VERSION));
+    
setHealthReportLatency(properties.getProperty(SystemPropertyKeys.PARTICIPANT_HEALTH_REPORT_LATENCY));
+  }
+
+  public HelixCloudProperty getHelixCloudProperty() {
+    return _helixCloudProperty;
+  }
+
+  public String getVersion() {
+    return _version;
+  }
+
+  public Integer getHealthReportLatency() {
+    return _healthReportLatency;
+  }
+
+  public void setHelixCloudProperty(HelixCloudProperty helixCloudProperty) {
+    _helixCloudProperty = helixCloudProperty;
+  }
+
+  public void setVersion(String version) {
+    _version = version;
+  }
+
+  public void setHealthReportLatency(String latency) {
+    _healthReportLatency = Integer.valueOf(latency);
+  }
 
 Review comment:
   Could we add a proper JavaDoc for public API methods?
   
   ```
   /** 
    * Get the current value of the foo property.
    * The foo property controls the initial guess used by the bla algorithm in
    * {@link #bla}
    * @return The initial guess used by {@link #bla}
    */
   int getFoo() {
     return foo;
   }
   ```
   From:
   
https://stackoverflow.com/questions/211041/do-you-use-javadoc-for-every-method-you-write

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to