コード例 #1
0
  /**
   * Get node scope properties UpgradeManager will publish the node scope properties as node
   * information into coordinator Node scope properties are invariants.
   *
   * <p>We check to see if a property is in metadata or not. If it is, it is a target property; If
   * not, it is a local property
   *
   * @param localPropInfo local property info read from /etc/config.properties
   * @return node scope properties
   */
  private PropertyInfoExt getNodeScopeProperties(final PropertyInfoExt localPropInfo) {
    Map<String, PropertyMetadata> metadata = PropertiesMetadata.getGlobalMetadata();
    PropertyInfoExt localScopeProps = new PropertyInfoExt();

    for (Entry<String, String> entry : localPropInfo.getAllProperties().entrySet()) {
      final String key = entry.getKey();
      final String value = entry.getValue();

      if (!metadata.containsKey(key)) {
        localScopeProps.addProperty(key, value);
      }
    }

    return localScopeProps;
  }
コード例 #2
0
  /**
   * Get local target property info
   *
   * <p>For control node, properties that can be found in metadata are target properties For extra
   * node, not only exist in metadata, but also ControlNodeOnly==false
   *
   * @param localPropInfo
   * @return
   */
  private PropertyInfoExt getLocalTargetPropInfo(final PropertyInfoExt localPropInfo) {
    Map<String, PropertyMetadata> metadata = PropertiesMetadata.getGlobalMetadata();
    PropertyInfoExt localTargetProps = new PropertyInfoExt();

    for (Entry<String, String> entry : localPropInfo.getAllProperties().entrySet()) {
      final String key = entry.getKey();
      final String value = entry.getValue();

      if (metadata.containsKey(key)) {
        if (coordinator.isControlNode()) {
          localTargetProps.addProperty(key, value);
        } else {
          if (!metadata.get(key).getControlNodeOnly()) {
            localTargetProps.addProperty(key, value);
          }
        }
      }
    }

    return localTargetProps;
  }