private void clusterPolicyChanged() { ClusterPolicy clusterPolicy = getClusterPolicy().getSelectedItem(); Map<String, String> policyProperties = new HashMap<>(); Map<Guid, PolicyUnit> allPolicyUnits = new HashMap<>(); if (clusterPolicy.getFilters() != null) { for (Guid policyUnitId : clusterPolicy.getFilters()) { allPolicyUnits.put(policyUnitId, policyUnitMap.get(policyUnitId)); } } if (clusterPolicy.getFunctions() != null) { for (Pair<Guid, Integer> pair : clusterPolicy.getFunctions()) { allPolicyUnits.put(pair.getFirst(), policyUnitMap.get(pair.getFirst())); } } if (clusterPolicy.getBalance() != null) { allPolicyUnits.put(clusterPolicy.getBalance(), policyUnitMap.get(clusterPolicy.getBalance())); } for (PolicyUnit policyUnit : allPolicyUnits.values()) { if (policyUnit.getParameterRegExMap() != null) { policyProperties.putAll(policyUnit.getParameterRegExMap()); } } getCustomPropertySheet().setKeyValueMap(policyProperties); if (getIsEdit() && clusterPolicy.getId().equals(getEntity().getClusterPolicyId())) { getCustomPropertySheet().deserialize(KeyValueModel.convertProperties(getEntity().getClusterPolicyProperties())); } else { getCustomPropertySheet().deserialize(KeyValueModel.convertProperties(clusterPolicy.getParameterMap())); } }
if (entity.getClusterPolicyProperties() != null && !entity.getClusterPolicyProperties().isEmpty()) { model.setCustomSchedulingPolicyProperties(CustomPropertiesParser.fromMap(entity .getClusterPolicyProperties()));
Map<String, String> properties = entity.getClusterPolicyProperties(); if (properties == null) { properties = new HashMap<>();
.addValue("cluster_policy_id", cluster.getClusterPolicyId()) .addValue("cluster_policy_custom_properties", SerializationFactory.getSerializer().serialize(cluster.getClusterPolicyProperties())) .addValue("architecture", cluster.getArchitecture()) .addValue("enable_balloon", cluster.isEnableBallooning())