You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "dlmarion (via GitHub)" <gi...@apache.org> on 2026/01/30 16:54:54 UTC
[PR] Removed ECAdmin, created 3 new KeywordExecutable commands [accumulo]
dlmarion opened a new pull request, #6104:
URL: https://github.com/apache/accumulo/pull/6104
Closes #6087
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Removed ECAdmin, created 3 new KeywordExecutable commands [accumulo]
Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on code in PR #6104:
URL: https://github.com/apache/accumulo/pull/6104#discussion_r2748017993
##########
core/src/main/java/org/apache/accumulo/core/util/compaction/ExternalCompactionUtil.java:
##########
@@ -112,6 +113,26 @@ public static Optional<HostAndPort> findCompactionCoordinator(ClientContext cont
.map(sld -> sld.getAddress(ThriftService.COORDINATOR));
}
+ /**
+ * @param context client context
+ * @return CompactionCoordinator Thrift client, user has the responsibility to call
+ * {@code ThriftUtil.returnClient(coordinatorClient, context);}
+ */
+ public static CompactionCoordinatorService.Client getCoordinatorClient(ClientContext context) {
+ var coordinatorHost = ExternalCompactionUtil.findCompactionCoordinator(context);
+ if (coordinatorHost.isEmpty()) {
+ throw new IllegalStateException("Unable to find coordinator. Check that it is running.");
+ }
+ HostAndPort address = coordinatorHost.orElseThrow();
+ CompactionCoordinatorService.Client coordinatorClient;
+ try {
+ coordinatorClient = ThriftUtil.getClient(ThriftClientTypes.COORDINATOR, address, context);
+ } catch (Exception e) {
Review Comment:
This exception catch block should be more narrow.
##########
server/base/src/main/java/org/apache/accumulo/server/util/CancelCompaction.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo.server.util;
+
+import org.apache.accumulo.core.compaction.thrift.CompactionCoordinatorService;
+import org.apache.accumulo.core.metadata.schema.ExternalCompactionId;
+import org.apache.accumulo.core.rpc.ThriftUtil;
+import org.apache.accumulo.core.trace.TraceUtil;
+import org.apache.accumulo.core.util.compaction.ExternalCompactionUtil;
+import org.apache.accumulo.server.ServerContext;
+import org.apache.accumulo.server.cli.ServerUtilOpts;
+import org.apache.accumulo.start.spi.KeywordExecutable;
+
+import com.beust.jcommander.JCommander;
+import com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import com.google.auto.service.AutoService;
+
+@AutoService(KeywordExecutable.class)
+public class CancelCompaction implements KeywordExecutable {
+
+ @Parameters(commandNames = "cancel",
+ commandDescription = "cancel the external compaction with given ECID")
+ static class CancelCommand {
+ @Parameter(names = "-ecid", description = "<ecid>", required = true)
+ String ecid;
+ }
+
+ @Override
+ public String keyword() {
+ return "cancel-compaction";
Review Comment:
It would probably be good to have compaction related stuff together, either in the same group, like one named "compaction" or having a common prefix, like "compaction-cancel" instead of "cancel-compaction".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Removed ECAdmin, created 3 new KeywordExecutable commands [accumulo]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #6104:
URL: https://github.com/apache/accumulo/pull/6104#discussion_r2765939971
##########
core/src/main/java/org/apache/accumulo/core/util/compaction/ExternalCompactionUtil.java:
##########
@@ -112,6 +113,26 @@ public static Optional<HostAndPort> findCompactionCoordinator(ClientContext cont
.map(sld -> sld.getAddress(ThriftService.COORDINATOR));
}
+ /**
+ * @param context client context
+ * @return CompactionCoordinator Thrift client, user has the responsibility to call
+ * {@code ThriftUtil.returnClient(coordinatorClient, context);}
+ */
+ public static CompactionCoordinatorService.Client getCoordinatorClient(ClientContext context) {
+ var coordinatorHost = ExternalCompactionUtil.findCompactionCoordinator(context);
+ if (coordinatorHost.isEmpty()) {
+ throw new IllegalStateException("Unable to find coordinator. Check that it is running.");
+ }
+ HostAndPort address = coordinatorHost.orElseThrow();
+ CompactionCoordinatorService.Client coordinatorClient;
+ try {
+ coordinatorClient = ThriftUtil.getClient(ThriftClientTypes.COORDINATOR, address, context);
+ } catch (Exception e) {
Review Comment:
Fixed in c93fb11
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Removed ECAdmin, created 3 new KeywordExecutable commands [accumulo]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #6104:
URL: https://github.com/apache/accumulo/pull/6104#discussion_r2747216097
##########
test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java:
##########
@@ -168,8 +172,9 @@ public void testExpectedClasses() {
while (expectIter.hasNext() && actualIter.hasNext()) {
expected = expectIter.next();
actual = actualIter.next();
- assertEquals(expected.getKey(), actual.getKey());
- assertEquals(expected.getValue(), actual.getValue().getClass());
+ System.out.println(expected.getKey() + " -> " + actual.getKey());
+ // assertEquals(expected.getKey(), actual.getKey());
Review Comment:
Thanks for catching that. I was testing something and forgot to uncomment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Removed ECAdmin, created 3 new KeywordExecutable commands [accumulo]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #6104:
URL: https://github.com/apache/accumulo/pull/6104#discussion_r2747249045
##########
test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java:
##########
@@ -168,8 +172,9 @@ public void testExpectedClasses() {
while (expectIter.hasNext() && actualIter.hasNext()) {
expected = expectIter.next();
actual = actualIter.next();
- assertEquals(expected.getKey(), actual.getKey());
- assertEquals(expected.getValue(), actual.getValue().getClass());
+ System.out.println(expected.getKey() + " -> " + actual.getKey());
+ // assertEquals(expected.getKey(), actual.getKey());
Review Comment:
Fixed in 54a7f5a
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Removed ECAdmin, created 3 new KeywordExecutable commands [accumulo]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #6104:
URL: https://github.com/apache/accumulo/pull/6104#discussion_r2765942459
##########
server/base/src/main/java/org/apache/accumulo/server/util/CancelCompaction.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo.server.util;
+
+import org.apache.accumulo.core.compaction.thrift.CompactionCoordinatorService;
+import org.apache.accumulo.core.metadata.schema.ExternalCompactionId;
+import org.apache.accumulo.core.rpc.ThriftUtil;
+import org.apache.accumulo.core.trace.TraceUtil;
+import org.apache.accumulo.core.util.compaction.ExternalCompactionUtil;
+import org.apache.accumulo.server.ServerContext;
+import org.apache.accumulo.server.cli.ServerUtilOpts;
+import org.apache.accumulo.start.spi.KeywordExecutable;
+
+import com.beust.jcommander.JCommander;
+import com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import com.google.auto.service.AutoService;
+
+@AutoService(KeywordExecutable.class)
+public class CancelCompaction implements KeywordExecutable {
+
+ @Parameters(commandNames = "cancel",
+ commandDescription = "cancel the external compaction with given ECID")
+ static class CancelCommand {
+ @Parameter(names = "-ecid", description = "<ecid>", required = true)
+ String ecid;
+ }
+
+ @Override
+ public String keyword() {
+ return "cancel-compaction";
Review Comment:
I added a `COMPACTION` UsageGroup in c93fb11 and modified the command names. The commands are now `accumulo compaction cancel`, `accumulo compaction list`, and `accumulo process list-compactors`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Removed ECAdmin, created 3 new KeywordExecutable commands [accumulo]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion merged PR #6104:
URL: https://github.com/apache/accumulo/pull/6104
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Removed ECAdmin, created 3 new KeywordExecutable commands [accumulo]
Posted by "ddanielr (via GitHub)" <gi...@apache.org>.
ddanielr commented on code in PR #6104:
URL: https://github.com/apache/accumulo/pull/6104#discussion_r2747212644
##########
test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java:
##########
@@ -168,8 +172,9 @@ public void testExpectedClasses() {
while (expectIter.hasNext() && actualIter.hasNext()) {
expected = expectIter.next();
actual = actualIter.next();
- assertEquals(expected.getKey(), actual.getKey());
- assertEquals(expected.getValue(), actual.getValue().getClass());
+ System.out.println(expected.getKey() + " -> " + actual.getKey());
+ // assertEquals(expected.getKey(), actual.getKey());
Review Comment:
Why leave these commented out in favor of the print statement?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org