Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@ topology:
ListenPort: 8001
Cluster: 'cluster-1'
CoherenceClusterSystemResource: CoherenceCluster
CoherenceMemberConfig:
UnicastListenAddress: 'coherence-managed-domain-cluster-1-managed-server${id}'
'cluster-2-template':
ListenPort: 8001
Cluster: 'cluster-2'
CoherenceClusterSystemResource: CoherenceCluster
CoherenceMemberConfig:
UnicastListenAddress: 'coherence-managed-domain-cluster-2-managed-server${id}'
resources:
CoherenceClusterSystemResource:
CoherenceCluster:
Expand Down
17 changes: 17 additions & 0 deletions operator/src/main/resources/scripts/introspectDomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,8 @@ def customizeServerTemplate(self, template):
self.writeListenAddress(template.getListenAddress(),listen_address)
self.customizeNetworkAccessPoints(template,listen_address)
self.customizeManagedIstioNetworkAccessPoint(listen_address, template)
if (self.getCoherenceClusterSystemResourceOrNone(template) is not None):
self.customizeCoherenceMemberConfig(listen_address)
self.undent()
self.writeln("</d:server-template>")

Expand Down Expand Up @@ -1163,6 +1165,21 @@ def _writeIstioNAP(self, name, server, listen_address, listen_port, protocol, ht
self.undent()
self.writeln('</d:network-access-point>')

def getCoherenceClusterSystemResourceOrNone(self, serverOrTemplate):
try:
ret = serverOrTemplate.getCoherenceClusterSystemResource()
except:
trace("Ignoring getCoherenceClusterSystemResource () exception, this is expected.")
ret = None
return ret

def customizeCoherenceMemberConfig(self, listen_address):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it always be an 'add' action or is it possible that a unicast-listen-address already exists? That is, do we need to handle a replace of the 'replace' action scenario?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was confused with the mbean name in my earlier comment, please disregard as we discussed earlier. We do need to use replace if it is already there for sitconfig.

self.writeln('<d:coherence-member-config f:combine-mode="add">')
self.indent()
self.writeln('<d:unicast-listen-address f:combine-mode="add">%s</d:unicast-listen-address>' % listen_address)
self.undent()
self.writeln('</d:coherence-member-config>')

def customizeServerIstioNetworkAccessPoint(self, listen_address, server):
istio_enabled = self.env.getEnvOrDef("ISTIO_ENABLED", "false")
if istio_enabled == 'false':
Expand Down
17 changes: 17 additions & 0 deletions operator/src/main/resources/scripts/model_wdt_mii_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def customizeServerTemplates(model):
customizeServerTemplate(topology, template)



def customizeServerTemplate(topology, template):
server_name_prefix = getServerNamePrefix(topology, template)
domain_uid = env.getDomainUID()
Expand All @@ -216,6 +217,8 @@ def customizeServerTemplate(topology, template):
setServerListenAddress(template, listen_address)
customizeNetworkAccessPoints(template, listen_address)
customizeManagedIstioNetworkAccessPoint(template, listen_address)
if (getCoherenceClusterSystemResourceOrNone(template) is not None):
customizeCoherenceMemberConfig(template, listen_address)


def getServerNamePrefix(topology, template):
Expand Down Expand Up @@ -307,6 +310,14 @@ def customizeServer(server, name):
customizeServerIstioNetworkAccessPoint(server, listen_address)


def customizeCoherenceMemberConfig(server, listen_address):
if 'CoherenceMemberConfig ' not in server:
server['CoherenceMemberConfig'] = {}

cmc = server['CoherenceMemberConfig']
cmc['UnicastListenAddress'] = listen_address


def getAdministrationPort(server, topology):
port = 0
if 'AdministrationPort' in server:
Expand Down Expand Up @@ -593,6 +604,12 @@ def getClusterOrNone(topology, name):
return None


def getCoherenceClusterSystemResourceOrNone(serverOrTemplate):
if 'CoherenceClusterSystemResource' not in serverOrTemplate:
return None

return serverOrTemplate['CoherenceClusterSystemResource']

def getDynamicServerOrNone(cluster):
if 'DynamicServers' not in cluster:
return None
Expand Down