String clusterName = scopeArgs[0];
Map<String, String> results = new HashMap<String, String>();
switch (scopeType) {
case CLUSTER: {
ClusterAccessor accessor = clusterAccessor(clusterName);
Scope<ClusterId> scope = Scope.cluster(ClusterId.from(clusterName));
UserConfig userConfig = userConfig(scope, null, keyValues);
accessor.setUserConfig(userConfig);
break;
}
case PARTICIPANT: {
ParticipantId participantId = ParticipantId.from(scopeArgs[1]);
ParticipantAccessor accessor = participantAccessor(clusterName);
Scope<ParticipantId> scope = Scope.participant(participantId);
UserConfig userConfig = userConfig(scope, null, keyValues);
accessor.setUserConfig(participantId, userConfig);
break;
}
case RESOURCE: {
ResourceId resourceId = ResourceId.from(scopeArgs[1]);
ResourceAccessor accessor = resourceAccessor(clusterName);
Scope<ResourceId> scope = Scope.resource(resourceId);
UserConfig userConfig = userConfig(scope, null, keyValues);
accessor.setUserConfig(resourceId, userConfig);
break;
}
case PARTITION: {
ResourceId resourceId = ResourceId.from(scopeArgs[1]);
String partitionId = scopeArgs[2];
ResourceAccessor accessor = resourceAccessor(clusterName);
Scope<ResourceId> scope = Scope.resource(resourceId);
UserConfig userConfig = userConfig(scope, partitionId, keyValues);
accessor.setUserConfig(resourceId, userConfig);
break;
}
default:
System.err.println("Non-recognized scopeType: " + scopeType);
break;