Skip to content

Commit

Permalink
prepare for next release (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiddlet2666 authored Jul 20, 2023
1 parent fec799a commit a38ad7e
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-against-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
coherenceVersion:
- 23.03.1-SNAPSHOT
- 23.03.2-SNAPSHOT
- 22.06.6-SNAPSHOT

steps:
Expand Down
2 changes: 1 addition & 1 deletion coherence-visualvm-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<parent>
<groupId>com.oracle.coherence.plugin.visualvm</groupId>
<artifactId>coherence-visualvm-main</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2023 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -56,6 +56,7 @@ public CoherenceApplicationType(Application app, Jvm jvm, String sMainClass)
+ " (" + sMainClass + ")"
+ "\nCommand Line:" + jvm.getJvmArgs();
this.f_sIconPath = IMAGE_PATH;
this.f_app = app;
}

// ----- accessors ------------------------------------------------------
Expand Down Expand Up @@ -101,6 +102,11 @@ public Image getIcon()
*/
private final String f_sIconPath;

/**
* Application.
*/
private final Application f_app;

/**
* {@link Map} of possible classes to detect.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public String analyze(boolean fVerbose)
e.getValue()));
setMetrics.stream()
.filter(m->m.getServiceName().equals(s) && m.getPartitionId() == nPartitionId)
.forEach(m->sb.append(String.format(" %s%n", mapLines.get(m.getLineId()))));
.forEach(m->sb.append(String.format(FORMAT, mapLines.get(m.getLineId()))));
});

sb.append("\nOutput by partition and event for ").append(s).append('\n');
Expand All @@ -563,10 +563,10 @@ public String analyze(boolean fVerbose)
sb.append("- Partition ").append(p).append('\n');
// retrieve the initial partition assign which has been marked with partition of -1
setMetrics.stream().filter(m -> m.getServiceName().equals(s) && m.getPartitionId() == -1)
.forEach(m -> sb.append(String.format(" %s%n", mapLines.get(m.getLineId()))));
.forEach(m -> sb.append(String.format(FORMAT, mapLines.get(m.getLineId()))));
setMetrics.stream()
.filter(m -> m.getServiceName().equals(s) && m.getPartitionId() == p)
.forEach(m -> sb.append(String.format(" %s%n", mapLines.get(m.getLineId()))));
.forEach(m -> sb.append(String.format(FORMAT, mapLines.get(m.getLineId()))));
});
}
});
Expand Down Expand Up @@ -608,6 +608,7 @@ private String formatLine(String sFormat, long nTotalMillis, String sServiceName
private static final String MIN = " Min (ms)";
private static final String TOTAL = " Total (ms)";
private static final String PERCENT = " Percent";
private static final String FORMAT = " %s%n";

// ----- data members -----------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,8 @@ private boolean shouldRetrieveData(DataType type)
return false;
}

if (!isExecutorConfigured() &&
(
clazz.equals(DataType.EXECUTOR.getClassName())
))
{
return false;
}

return true;
return isExecutorConfigured() ||
(!clazz.equals(DataType.EXECUTOR.getClassName()));
}

/**
Expand Down Expand Up @@ -1343,8 +1336,8 @@ public enum DataType

private DataType(Class<?> clz, String[] asMeta)
{
clazz = clz;
asMetadata = asMeta;
f_clazz = clz;
f_asMetadata = asMeta;
}

/**
Expand All @@ -1354,7 +1347,7 @@ private DataType(Class<?> clz, String[] asMeta)
*/
public Class<?> getClassName()
{
return clazz;
return f_clazz;
}

/**
Expand All @@ -1364,18 +1357,18 @@ public Class<?> getClassName()
*/
public String[] getMetadata()
{
return asMetadata;
return f_asMetadata;
}

/**
* The {@link Class} associated with this enum.
*/
private final Class<?> clazz;
private final Class<?> f_clazz;

/**
* The column name associated with this enum.
*/
private final String[] asMetadata;
private final String[] f_asMetadata;
}

/**
Expand All @@ -1393,6 +1386,8 @@ public String[] getMetadata()
private static final String LBL_SIZE = "LBL_size";
private static final String LBL_CACHE_HITS = "LBL_cache_hits";
private static final String LBL_CACHE_MISSES = "LBL_cache_misses";
private static final String LBL_TOTAL_GETS = "LBL_total_gets";
private static final String LBL_TOTAL_PUTS = "LBL_total_puts";

/**
* Labels for service table.
Expand Down Expand Up @@ -1472,8 +1467,8 @@ public String[] getMetadata()
private static final String[] CACHE_DETAIL_LABELS = new String[]
{
Localization.getLocalText(LBL_NODE_ID), Localization.getLocalText(LBL_SIZE),
Localization.getLocalText(LBL_MEMORY_BYTES), Localization.getLocalText("LBL_total_gets"),
Localization.getLocalText("LBL_total_puts"), Localization.getLocalText(LBL_CACHE_HITS),
Localization.getLocalText(LBL_MEMORY_BYTES), Localization.getLocalText(LBL_TOTAL_GETS),
Localization.getLocalText(LBL_TOTAL_PUTS), Localization.getLocalText(LBL_CACHE_HITS),
Localization.getLocalText(LBL_CACHE_MISSES), Localization.getLocalText("LBL_hit_probability")
};

Expand All @@ -1483,7 +1478,7 @@ public String[] getMetadata()
private static final String[] CACHE_FRONT_DETAIL_LABELS = new String[]
{
Localization.getLocalText(LBL_NODE_ID), Localization.getLocalText(LBL_SIZE),
Localization.getLocalText("LBL_total_gets"), Localization.getLocalText("LBL_total_puts"),
Localization.getLocalText(LBL_TOTAL_GETS), Localization.getLocalText(LBL_TOTAL_PUTS),
Localization.getLocalText(LBL_CACHE_HITS), Localization.getLocalText(LBL_CACHE_MISSES),
Localization.getLocalText("LBL_hit_probability")
};
Expand Down Expand Up @@ -1684,8 +1679,8 @@ public String[] getMetadata()
*/
private static final String[] JCACHE_STATS_LABELS = new String[]
{
Localization.getLocalText("LBL_config_cache"), Localization.getLocalText("LBL_total_puts"),
Localization.getLocalText("LBL_total_gets"), Localization.getLocalText("LBL_removals"),
Localization.getLocalText("LBL_config_cache"), Localization.getLocalText(LBL_TOTAL_PUTS),
Localization.getLocalText(LBL_TOTAL_GETS), Localization.getLocalText("LBL_removals"),
Localization.getLocalText(LBL_CACHE_HITS), Localization.getLocalText(LBL_CACHE_MISSES),
Localization.getLocalText("LBL_evictions"), Localization.getLocalText("GRPH_average_get_time"),
Localization.getLocalText("GRPH_average_put_time"), Localization.getLocalText("GRPH_average_remove_time"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ public Set<ObjectName> getAllServiceMembers()

// the type attribute returned in the response is the service type, but in the object name,
// type is always Service
mapKeysProps.put("type", "Service");
mapKeysProps.put("type", SERVICE_CC);
setObjectNames.add(new ObjectName(COHERENCE, mapKeysProps));
}
}
Expand Down Expand Up @@ -799,7 +799,7 @@ public Object executeSubscriberOperation(Pair<String, String> topic, long nSubsc
{
case CoherenceTopicPanel.RETRIEVE_HEADS:
sRealOperation = "heads";
sKey = "links";
sKey = LINKS;
break;
case CoherenceTopicPanel.NOTIFY_POPULATED:
sRealOperation = "notifyPopulated";
Expand Down Expand Up @@ -865,7 +865,7 @@ public Set<ObjectName> getMembersOfService(String sServiceName, String sDomainPa

Hashtable<String, String> mapKeysProps = new Hashtable<>();
serviceMember.fields().forEachRemaining(e -> mapKeysProps.put(e.getKey(), e.getValue().asText()));
mapKeysProps.put("type", "Service");
mapKeysProps.put("type", SERVICE_CC);
setObjectNames.add(new ObjectName(COHERENCE, mapKeysProps));
}
}
Expand Down Expand Up @@ -1617,7 +1617,7 @@ private URLBuilder modifyTarget(ObjectName objectName, URLBuilder urlBuilder)
.addPathSegment(encodeServiceName(getKeyPropertyFromObjName(objectName, SERVICE)))
.addPathSegment(CACHES).addPathSegment(objectName.getKeyProperty("cache"))
.addPathSegment(MEMBERS).addPathSegment(getKeyPropertyFromObjName(objectName, NODE_ID));
case "Service":
case SERVICE_CC:
return urlBuilder.addPathSegment(SERVICES)
.addPathSegment(encodeServiceName(getKeyPropertyFromObjName(objectName, "name")))
.addPathSegment(MEMBERS).addPathSegment(getKeyPropertyFromObjName(objectName, NODE_ID))
Expand Down Expand Up @@ -1676,8 +1676,9 @@ private URLBuilder modifyTarget(ObjectName objectName, URLBuilder urlBuilder)
return urlBuilder.addPathSegment("operatingSystem");
}
}
default:
return null;
}
return null;
}

/**
Expand Down Expand Up @@ -2003,6 +2004,7 @@ private void initSSL()
private static final String SUBSCRIBERS = "subscribers";
private static final String SUBGROUPS = "subscriberGroups";
private static final String SERVICE = "service";
private static final String SERVICE_CC = "Service";
private static final String MEMBERS = "members";
private static final String CACHES = "caches";
private static final String PERSISTENCE = "persistence";
Expand Down Expand Up @@ -2037,11 +2039,13 @@ public java.security.cert.X509Certificate[] getAcceptedIssuers()
@Override
public void checkClientTrusted(X509Certificate[] certs, String authType)
{
// empty as we want a way for user to connect using invalid cer
}

@Override
public void checkServerTrusted(X509Certificate[] certs, String authType)
{
// empty as we want a way for user to connect using invalid cert
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public Set getCacheMembers(String sServiceName, String sCacheName, String sDomai
throws Exception
{
return f_connection.queryNames(new ObjectName("Coherence:type=Cache,service=" + sServiceName
+ (sDomainPartition != null ? ",domainPartition=" + sDomainPartition : "")
+ ",name=" + sCacheName + ",*"), null);
+ (sDomainPartition != null ? DOMAIN_PARTITION + sDomainPartition : "")
+ NAME + sCacheName + ",*"), null);
}

@Override
Expand All @@ -148,15 +148,15 @@ public Set<ObjectName> getCacheStorageMembers(String sServiceName, String sCache
{

return f_connection.queryNames(new ObjectName("Coherence:type=StorageManager,service="
+ sServiceName + (sDomainPartition != null ? ",domainPartition=" + sDomainPartition : "")
+ sServiceName + (sDomainPartition != null ? DOMAIN_PARTITION + sDomainPartition : "")
+ ",cache=" + sCacheName + ",*"), null);
}

@Override
public Set<ObjectName> getAllClusters()
throws Exception
{
return f_connection.queryNames(new ObjectName("Coherence:type=Cluster,*"), null);
return f_connection.queryNames(new ObjectName(CLUSTER), null);
}

@Override
Expand Down Expand Up @@ -232,7 +232,7 @@ public Set<ObjectName> getMembersOfService(String sServiceName, String sDomainPa
throws Exception
{
return f_connection.queryNames(new ObjectName("Coherence:type=Service,name=" + sServiceName +
(sDomainPartition != null ? ",domainPartition=" + sDomainPartition : "") + ",*"), null);
(sDomainPartition != null ? DOMAIN_PARTITION + sDomainPartition : "") + ",*"), null);
}

@Override
Expand Down Expand Up @@ -261,7 +261,7 @@ public Set<ObjectName> getPartitionAssignmentObjectName(String sService, String
throws Exception
{
String sQuery = "Coherence:type=PartitionAssignment,service="
+ sService + (sDomainPartition != null ? ",domainPartition=" + sDomainPartition : "")
+ sService + (sDomainPartition != null ? DOMAIN_PARTITION + sDomainPartition : "")
+ ",responsibility=DistributionCoordinator,*";
return f_connection.queryNames(new ObjectName(sQuery), null);
}
Expand Down Expand Up @@ -304,13 +304,13 @@ public void invokeDisconnectAll(String sService, String sTopic, String sSubscrib
if (sSubscriberGroup == null)
{
// topic only
objectName = new ObjectName("Coherence:type=PagedTopic,service=" + sService + ",name=" + sTopic + ",*");
objectName = new ObjectName("Coherence:type=PagedTopic,service=" + sService + NAME + sTopic + ",*");
}
else
{
// subscriber group
objectName = new ObjectName("Coherence:type=PagedTopicSubscriberGroup,service=" + sService + ",topic=" + sTopic +
",name=" + sSubscriberGroup + ",*");
NAME + sSubscriberGroup + ",*");
}


Expand Down Expand Up @@ -380,7 +380,7 @@ public void dumpClusterHeap(String sRole) throws Exception
{
// look up the full name of the MBean in case we are in container
Set<ObjectName> setResult = getCompleteObjectName(
new ObjectName("Coherence:type=Cluster,*"));
new ObjectName(CLUSTER));

String sFQN = getFirstResult(setResult);

Expand Down Expand Up @@ -491,7 +491,7 @@ public int getLocalMemberId()

try
{
memberId = (Integer) JMXUtils.runJMXQuerySingleResult(f_connection, "Coherence:type=Cluster,*",
memberId = (Integer) JMXUtils.runJMXQuerySingleResult(f_connection, CLUSTER,
new JMXUtils.Attribute("LocalMemberId"));
}
catch (Exception e)
Expand Down Expand Up @@ -618,6 +618,10 @@ private String getFirstResult(Set<ObjectName> setResult)
*/
private static final Logger LOGGER = Logger.getLogger(JMXRequestSender.class.getName());

private static final String DOMAIN_PARTITION = ",domainPartition=";
private static final String NAME = ",name=";
private static final String CLUSTER = "Coherence:type=Cluster,*";

// ------ data members --------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
*/
public class JMXUtils
{
// ----- constructors ---------------------------------------------------

/**
* Private constructor.
*/
private JMXUtils()
{
}

// ----- helpers --------------------------------------------------------

Expand Down Expand Up @@ -188,7 +196,7 @@ public Attribute(String sName)
/**
* A representation of a JMX Field request which can be an Attribute or Key.
*/
protected static abstract class JMXField
protected abstract static class JMXField
{
/**
* Construct a new field request for a given name.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -54,6 +54,15 @@
*/
public class CoherenceClusterProvider
{
// ----- constructors ---------------------------------------------------

/**
* Private constructor.
*/
private CoherenceClusterProvider()
{
}

// ----- CoherenceClusterProvider methods -------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<parent>
<groupId>com.oracle.coherence.plugin.visualvm</groupId>
<artifactId>coherence-visualvm-tests</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit a38ad7e

Please sign in to comment.