From ac0bd1abda8701f319d0ee3b0827ac829dbdac27 Mon Sep 17 00:00:00 2001 From: Ernesto Posse Date: Fri, 29 Nov 2024 18:01:20 -0500 Subject: [PATCH 1/2] Issue #418: Added new properties to the PSDD connector Signed-off-by: Ernesto Posse --- .../models/CCM_PSDD.uml | 336 +++++++++++++----- 1 file changed, 252 insertions(+), 84 deletions(-) diff --git a/bundles/com.zeligsoft.domain.dds4ccm.psddconnector/models/CCM_PSDD.uml b/bundles/com.zeligsoft.domain.dds4ccm.psddconnector/models/CCM_PSDD.uml index 3c7035c1b..e085de799 100644 --- a/bundles/com.zeligsoft.domain.dds4ccm.psddconnector/models/CCM_PSDD.uml +++ b/bundles/com.zeligsoft.domain.dds4ccm.psddconnector/models/CCM_PSDD.uml @@ -1,36 +1,36 @@ - -
-
+ +
+
- + - + - - - + + + - + - + - + @@ -38,164 +38,291 @@ - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - - + + + + - - - + + + - - - - - + + + + + - + - + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - + @@ -203,17 +330,17 @@ - - + + - + - - + + - + @@ -308,4 +435,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d410ed6bc16535aa1cd93092dca140f81a9ed075 Mon Sep 17 00:00:00 2001 From: Ernesto Posse Date: Mon, 2 Dec 2024 18:37:28 -0500 Subject: [PATCH 2/2] Issue #518: Added ZMQ service properties to the PSDD connector Signed-off-by: Ernesto Posse --- .../domain/dds4ccm/utils/DDS4CCMUtil.java | 122 ++++++++++-------- .../dds4ccm/utils/PropertyVariable.java | 8 +- 2 files changed, 72 insertions(+), 58 deletions(-) diff --git a/bundles/com.zeligsoft.domain.dds4ccm/src/com/zeligsoft/domain/dds4ccm/utils/DDS4CCMUtil.java b/bundles/com.zeligsoft.domain.dds4ccm/src/com/zeligsoft/domain/dds4ccm/utils/DDS4CCMUtil.java index 2fa4d3ee5..fd24cda63 100644 --- a/bundles/com.zeligsoft.domain.dds4ccm/src/com/zeligsoft/domain/dds4ccm/utils/DDS4CCMUtil.java +++ b/bundles/com.zeligsoft.domain.dds4ccm/src/com/zeligsoft/domain/dds4ccm/utils/DDS4CCMUtil.java @@ -139,7 +139,39 @@ public static boolean isUsedSynchronously(Interface intf) { } - /** + private static EObject getPropertyType(Component containerProcess, PropertyVariable property) { + switch (property) { + case LM_PROCESSNAME: + case LM_CPUAFFINITY: + case LM_PROCESSPRIORITY: + case LOCALITY_ARGUMENTS: + return CORBAUtil.getCORBAPrimitiveType(containerProcess, "CXString"); //$NON-NLS-1$ + case ZMQ_SRV_IOTHREADS: + case ZMQ_SRV_POLLINGTHREADS: + case ZMQ_SRV_MAXSOCKETS: + case ZMQ_SRV_THREADPRIO: + case ZMQ_SRV_THREADSCHEDPOLICY: + return CORBAUtil.getCORBAPrimitiveType(containerProcess, "CXULong"); //$NON-NLS-1$ + default: + return CORBAUtil.getCORBAPrimitiveType(containerProcess, "CXString"); //$NON-NLS-1$ + } + } + + private static PropertyVariable[] CONTAINER_PROPERTIES_TO_ADD = { + PropertyVariable.LM_CPUAFFINITY, + PropertyVariable.LM_PROCESSPRIORITY, + PropertyVariable.LOCALITY_ARGUMENTS, + PropertyVariable.ZMQ_SRV_IOTHREADS, + PropertyVariable.ZMQ_SRV_POLLINGTHREADS, + PropertyVariable.ZMQ_SRV_MAXSOCKETS, + PropertyVariable.ZMQ_SRV_THREADPRIO, + PropertyVariable.ZMQ_SRV_THREADSCHEDPOLICY + }; + + private static PropertyVariable[] CONTAINER_PROPERTIES_TO_REMOVE = { + PropertyVariable.LM_PROCESSNAME + }; +/** * * * @param containerProcess @@ -149,69 +181,45 @@ public static boolean setupContainerProcessResources( String modelType = DDS4CCMUtil.getModelType(containerProcess); - final String cpuAffinity = PropertyVariable.LM_CPUAFFINITY.getName(modelType); - - final String processName = PropertyVariable.LM_PROCESSNAME.getName(modelType); - - final String processPriority = PropertyVariable.LM_PROCESSPRIORITY.getName(modelType); - - final String localityArgs = PropertyVariable.LOCALITY_ARGUMENTS.getName(modelType); - - EObject corbaStringType = CORBAUtil.getCORBAPrimitiveType(containerProcess, "CXString"); //$NON-NLS-1$ - boolean b_containerProcessModified = false; - - boolean b_hasAffinity = false; - boolean b_hasProcessName = false; - boolean b_hasProcessPriority = false; - boolean b_hasLocalityArgs = false; + boolean containerProcessModified = false; if (ZDLUtil.isZDLConcept(containerProcess, CCMNames.CONTAINER_PROCESS)) { - for (Property p : containerProcess.getOwnedAttributes()) { - if (p.getName().matches(cpuAffinity)) { - b_hasAffinity = true; - } else if (p.getName().matches(processName)) { - b_hasProcessName = true; - } else if (p.getName().matches(processPriority)) { - b_hasProcessPriority = true; - } else if (p.getName().matches(localityArgs)) { - b_hasLocalityArgs = true; + for (PropertyVariable p: CONTAINER_PROPERTIES_TO_ADD) { + String name = p.getName(modelType); + boolean hasRequiredProperty = false; + for (Property umlProperty: containerProcess.getOwnedAttributes()) { + if (name.equals(umlProperty.getName())) { + hasRequiredProperty = true; + } + } + if (!hasRequiredProperty) { + containerProcessModified = true; + EObject property = ZDLUtil.createZDLConceptIn(containerProcess, + CCMNames.PROPERTY); + ZDLUtil.setValue(property, CCMNames.PROPERTY, + ZMLMMNames.NAMED_ELEMENT__NAME, name); + ZDLUtil.setValue(property, CCMNames.PROPERTY, + ZMLMMNames.TYPED_ELEMENT__TYPE, getPropertyType(containerProcess, p)); } } - - if (!b_hasAffinity) { - b_containerProcessModified = true; - EObject property = ZDLUtil.createZDLConceptIn(containerProcess, - CCMNames.PROPERTY); - ZDLUtil.setValue(property, CCMNames.PROPERTY, - ZMLMMNames.NAMED_ELEMENT__NAME, cpuAffinity); - ZDLUtil.setValue(property, CCMNames.PROPERTY, - ZMLMMNames.TYPED_ELEMENT__TYPE, corbaStringType); - } - if (b_hasProcessName) { - Command cmd = BaseUtil.getDeleteCommand(Collections.singletonList(containerProcess.getOwnedMember(processName))); - TransactionUtil.getEditingDomain(containerProcess).getCommandStack().execute(cmd); - } - if (!b_hasProcessPriority) { - b_containerProcessModified = true; - EObject property = ZDLUtil.createZDLConceptIn(containerProcess, - CCMNames.PROPERTY); - ZDLUtil.setValue(property, CCMNames.PROPERTY, - ZMLMMNames.NAMED_ELEMENT__NAME, processPriority); - ZDLUtil.setValue(property, CCMNames.PROPERTY, - ZMLMMNames.TYPED_ELEMENT__TYPE, corbaStringType); - } - if (!b_hasLocalityArgs) { - b_containerProcessModified = true; - EObject property = ZDLUtil.createZDLConceptIn(containerProcess, - CCMNames.PROPERTY); - ZDLUtil.setValue(property, CCMNames.PROPERTY, - ZMLMMNames.NAMED_ELEMENT__NAME, localityArgs); - ZDLUtil.setValue(property, CCMNames.PROPERTY, - ZMLMMNames.TYPED_ELEMENT__TYPE, corbaStringType); + for (PropertyVariable p: CONTAINER_PROPERTIES_TO_REMOVE) { + String name = p.getName(modelType); + boolean hasUndesiredProperty = false; + for (Property umlProperty: containerProcess.getOwnedAttributes()) { + if (name.equals(umlProperty.getName())) { + hasUndesiredProperty = true; + break; + } + } + if (hasUndesiredProperty) { + containerProcessModified = true; + Command cmd = BaseUtil.getDeleteCommand(Collections.singletonList(containerProcess.getOwnedMember(name))); + TransactionUtil.getEditingDomain(containerProcess).getCommandStack().execute(cmd); + } } } - return b_containerProcessModified; + return containerProcessModified; } public static boolean addRegisterNamingProperty(Class zdlClass) { diff --git a/bundles/com.zeligsoft.domain.dds4ccm/src/com/zeligsoft/domain/dds4ccm/utils/PropertyVariable.java b/bundles/com.zeligsoft.domain.dds4ccm/src/com/zeligsoft/domain/dds4ccm/utils/PropertyVariable.java index f4ab553ac..f60c5ecac 100644 --- a/bundles/com.zeligsoft.domain.dds4ccm/src/com/zeligsoft/domain/dds4ccm/utils/PropertyVariable.java +++ b/bundles/com.zeligsoft.domain.dds4ccm/src/com/zeligsoft/domain/dds4ccm/utils/PropertyVariable.java @@ -20,7 +20,13 @@ public enum PropertyVariable { LM_CPUAFFINITY("edu.vanderbilt.dre.DAnCE.LocalityManager.CPUAffinity", "nl.remedy.it.DnCX11.LocalityManager.CPUAffinity"), LM_PROCESSNAME("edu.vanderbilt.dre.DAnCE.LocalityManager.ProcessName", "nl.remedy.it.DnCX11.LocalityManager.ProcessName"), LM_PROCESSPRIORITY("edu.vanderbilt.dre.DAnCE.LocalityManager.ProcessPriority", "nl.remedy.it.DnCX11.LocalityManager.ProcessPriority"), - LOCALITY_ARGUMENTS("edu.vanderbilt.dre.DAnCE.LocalityArguments", "nl.remedy.it.DnCX11.LocalityArguments"); + LOCALITY_ARGUMENTS("edu.vanderbilt.dre.DAnCE.LocalityArguments", "nl.remedy.it.DnCX11.LocalityArguments"), + ZMQ_SRV_IOTHREADS("nl.remedy.it.PSDD.ZMQ.Service.IOThreads","nl.remedy.it.PSDD.ZMQ.Service.IOThreads"), + ZMQ_SRV_POLLINGTHREADS("nl.remedy.it.PSDD.ZMQ.Service.PollingThreads","nl.remedy.it.PSDD.ZMQ.Service.PollingThreads"), + ZMQ_SRV_MAXSOCKETS("nl.remedy.it.PSDD.ZMQ.Service.MaxSockets","nl.remedy.it.PSDD.ZMQ.Service.MaxSockets"), + ZMQ_SRV_THREADPRIO("nl.remedy.it.PSDD.ZMQ.Service.ThreadPrio","nl.remedy.it.PSDD.ZMQ.Service.ThreadPrio"), + ZMQ_SRV_THREADSCHEDPOLICY("nl.remedy.it.PSDD.ZMQ.Service.ThreadSchedPolicy","nl.remedy.it.PSDD.ZMQ.Service.ThreadSchedPolicy"); + private final String axciomaName; private final String atcdName;