You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2024/05/28 20:30:45 UTC
(accumulo) branch elasticity updated (23ff6460c0 -> cd9e8bc430)
This is an automated email from the ASF dual-hosted git repository.
kturner pushed a change to branch elasticity
in repository https://gitbox.apache.org/repos/asf/accumulo.git
from 23ff6460c0 Merge commit 'f5885481e32f6e7ffc41d391530654156e1a8522' into elasticity
add 814ac68a67 Admin service status server lock changes (#4605)
add 29ff11258d Included port number in Monitor ServiceLockData (#4607)
add bd024372a1 Fix sserver group property argument in ScanServerGroupConfigurationIT (#4606)
new cd9e8bc430 Merge commit 'bd024372a162690792bc8b1baae4c9951e792f4b' into elasticity
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../accumulo/server/util/ServiceStatusCmd.java | 63 +++---
.../util/serviceStatus/ServiceStatusReport.java | 29 ++-
.../accumulo/server/util/ServiceStatusCmdTest.java | 216 +++++++++++++++------
.../serviceStatus/ServiceStatusReportTest.java | 22 +--
.../java/org/apache/accumulo/monitor/Monitor.java | 25 +--
5 files changed, 241 insertions(+), 114 deletions(-)
(accumulo) 01/01: Merge commit 'bd024372a162690792bc8b1baae4c9951e792f4b' into elasticity
Posted by kt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kturner pushed a commit to branch elasticity
in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit cd9e8bc43080ed7bfa58433c8f0e1250ee39d694
Merge: 23ff6460c0 bd024372a1
Author: Keith Turner <kt...@apache.org>
AuthorDate: Tue May 28 20:26:30 2024 +0000
Merge commit 'bd024372a162690792bc8b1baae4c9951e792f4b' into elasticity
.../accumulo/server/util/ServiceStatusCmd.java | 63 +++---
.../util/serviceStatus/ServiceStatusReport.java | 29 ++-
.../accumulo/server/util/ServiceStatusCmdTest.java | 216 +++++++++++++++------
.../serviceStatus/ServiceStatusReportTest.java | 22 +--
.../java/org/apache/accumulo/monitor/Monitor.java | 25 +--
5 files changed, 241 insertions(+), 114 deletions(-)
diff --cc server/base/src/main/java/org/apache/accumulo/server/util/serviceStatus/ServiceStatusReport.java
index 0951831028,b715534d9d..8ba25e74c9
--- a/server/base/src/main/java/org/apache/accumulo/server/util/serviceStatus/ServiceStatusReport.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/serviceStatus/ServiceStatusReport.java
@@@ -18,6 -18,8 +18,8 @@@
*/
package org.apache.accumulo.server.util.serviceStatus;
-import static org.apache.accumulo.core.lock.ServiceLockData.ServiceDescriptor.DEFAULT_GROUP_NAME;
++import static org.apache.accumulo.core.Constants.DEFAULT_RESOURCE_GROUP_NAME;
+
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
@@@ -130,6 -140,12 +140,12 @@@ public class ServiceStatusReport
sb.append(reportKey).append(": unavailable").append("\n");
return;
}
+ // only default group is present, omit grouping from report
+ if (!summary.getResourceGroups().isEmpty()
- && summary.getResourceGroups().equals(Set.of(DEFAULT_GROUP_NAME))) {
++ && summary.getResourceGroups().equals(Set.of(DEFAULT_RESOURCE_GROUP_NAME))) {
+ fmtServiceStatus(sb, reportKey, summary, noHosts);
+ return;
+ }
fmtCounts(sb, summary);
diff --cc server/base/src/test/java/org/apache/accumulo/server/util/ServiceStatusCmdTest.java
index b97384f545,2a8be3a157..93551fcbe8
--- a/server/base/src/test/java/org/apache/accumulo/server/util/ServiceStatusCmdTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/util/ServiceStatusCmdTest.java
@@@ -274,15 -334,24 +334,25 @@@ public class ServiceStatusCmdTest
String host2 = "hostB:9090";
String host3 = "host1:9091";
- // String lockPath = zRoot + Constants.ZCOORDINATOR_LOCK;
+ String lockData1 =
+ "{\"descriptors\":[{\"uuid\":\"1d55f7a5-090d-48fc-a3ea-f1a66e984a21\",\"service\":\"COORDINATOR\",\"address\":\""
+ + host1 + "\",\"group\":\"default\"}]}\n";
+ String lockData2 =
+ "{\"descriptors\":[{\"uuid\":\"1d55f7a5-090d-48fc-a3ea-f1a66e984a21\",\"service\":\"COORDINATOR\",\"address\":\""
+ + host2 + "\",\"group\":\"coord1\"}]}\n";
+ String lockData3 =
+ "{\"descriptors\":[{\"uuid\":\"1d55f7a5-090d-48fc-a3ea-f1a66e984a21\",\"service\":\"COORDINATOR\",\"address\":\""
+ + host3 + "\",\"group\":\"coord2\"}]}\n";
+
- String lockPath = zRoot + Constants.ZCOORDINATOR_LOCK;
+ String lockPath = null;
++ // String lockPath = zRoot + Constants.ZCOORDINATOR_LOCK;
expect(zooReader.getChildren(eq(lockPath))).andReturn(List.of(lock1Name, lock2Name, lock3Name))
.anyTimes();
- expect(zooReader.getData(eq(lockPath + "/" + lock1Name))).andReturn(host1.getBytes(UTF_8))
+ expect(zooReader.getData(eq(lockPath + "/" + lock1Name))).andReturn(lockData1.getBytes(UTF_8))
.anyTimes();
- expect(zooReader.getData(eq(lockPath + "/" + lock2Name))).andReturn(host2.getBytes(UTF_8))
+ expect(zooReader.getData(eq(lockPath + "/" + lock2Name))).andReturn(lockData2.getBytes(UTF_8))
.anyTimes();
- expect(zooReader.getData(eq(lockPath + "/" + lock3Name))).andReturn(host3.getBytes(UTF_8))
+ expect(zooReader.getData(eq(lockPath + "/" + lock3Name))).andReturn(lockData3.getBytes(UTF_8))
.anyTimes();
replay(zooReader);
diff --cc server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
index 1fb3a66108,2740a2049f..6f75e11d6b
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
@@@ -489,8 -485,15 +481,16 @@@ public class Monitor extends AbstractSe
HostAndPort monitorHostAndPort = HostAndPort.fromParts(advertiseHost, livePort);
log.debug("Using {} to advertise monitor location in ZooKeeper", monitorHostAndPort);
+ try {
+ getMonitorLock(monitorHostAndPort);
+ } catch (Exception e) {
+ log.error("Failed to get Monitor ZooKeeper lock");
+ throw new RuntimeException(e);
+ }
++ getContext().setServiceLock(monitorLock);
+
MetricsInfo metricsInfo = getContext().getMetricsInfo();
- metricsInfo.addServiceTags(getApplicationName(), monitorHostAndPort);
+ metricsInfo.addServiceTags(getApplicationName(), monitorHostAndPort, getResourceGroup());
metricsInfo.addMetricsProducers(this);
metricsInfo.init();
@@@ -831,8 -834,8 +832,10 @@@
while (true) {
MoniterLockWatcher monitorLockWatcher = new MoniterLockWatcher();
monitorLock = new ServiceLock(zoo.getZooKeeper(), monitorLockPath, zooLockUUID);
- monitorLock.lock(monitorLockWatcher, new ServiceLockData(zooLockUUID, getHostname(),
- ThriftService.NONE, this.getResourceGroup()));
- monitorLock.lock(monitorLockWatcher, new ServiceLockData(zooLockUUID,
- monitorLocation.getHost() + ":" + monitorLocation.getPort(), ThriftService.NONE));
++ monitorLock.lock(monitorLockWatcher,
++ new ServiceLockData(zooLockUUID,
++ monitorLocation.getHost() + ":" + monitorLocation.getPort(), ThriftService.NONE,
++ this.getResourceGroup()));
monitorLockWatcher.waitForChange();