public ResourceConfig build() { // TODO: Reenable the validation in the future when ResourceConfig is ready. // validate(); return new ResourceConfig(_resourceId, _monitorDisabled, _numPartitions, _stateModelDefRef, _stateModelFactoryName, _numReplica, _minActiveReplica, _maxPartitionsPerInstance, _instanceGroupTag, _helixEnabled, _resourceGroupName, _resourceType, _groupRoutingEnabled, _externalViewDisabled, _rebalanceConfig, _stateTransitionTimeoutConfig, _preferenceLists, _mapFields, _p2pMessageEnabled); } }
public ResourceConfig build() { // TODO: Reenable the validation in the future when ResourceConfig is ready. // validate(); return new ResourceConfig(_resourceId, _monitorDisabled, _numPartitions, _stateModelDefRef, _stateModelFactoryName, _numReplica, _minActiveReplica, _maxPartitionsPerInstance, _instanceGroupTag, _helixEnabled, _resourceGroupName, _resourceType, _groupRoutingEnabled, _externalViewDisabled, _rebalanceConfig, _stateTransitionTimeoutConfig, _preferenceLists, _mapFields, _p2pMessageEnabled); } }
/** * Get resource config for given resource in given cluster. * * @param clusterName * @param resourceName * * @return */ public ResourceConfig getResourceConfig(String clusterName, String resourceName) { HelixConfigScope scope = new HelixConfigScopeBuilder(ConfigScopeProperty.RESOURCE).forCluster(clusterName) .forResource(resourceName).build(); ZNRecord record = getConfigZnRecord(scope); if (record == null) { LOG.warn("No config found at " + scope.getZkPath()); return null; } return new ResourceConfig(record); }
/** * Get resource config for given resource in given cluster. * * @param clusterName * @param resourceName * * @return */ public ResourceConfig getResourceConfig(String clusterName, String resourceName) { HelixConfigScope scope = new HelixConfigScopeBuilder(ConfigScopeProperty.RESOURCE).forCluster(clusterName) .forResource(resourceName).build(); ZNRecord record = getConfigZnRecord(scope); if (record == null) { LOG.warn("No config found at " + scope.getZkPath()); return null; } return new ResourceConfig(record); }
return badRequest("Input is not a vaild ZNRecord!"); ResourceConfig resourceConfig = new ResourceConfig(record); ConfigAccessor configAccessor = getConfigAccessor(); try {