You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/06/01 18:54:25 UTC
[GitHub] [accumulo] ctubbsii commented on a diff in pull request #2215: Remove the use of SiteConfiguration from FateCommand
ctubbsii commented on code in PR #2215:
URL: https://github.com/apache/accumulo/pull/2215#discussion_r887197537
##########
core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java:
##########
@@ -284,6 +287,42 @@ public void waitForBalance() throws AccumuloException {
}
+ @Override
+ public void fateFail(List<String> txids) throws AccumuloException {
+ checkArgument(txids != null, "txids is null");
+ executeAdminOperation(AdminOperation.FAIL, txids, null);
+ }
+
+ @Override
+ public void fateDelete(List<String> txids) throws AccumuloException {
+ checkArgument(txids != null, "txids is null");
+ executeAdminOperation(AdminOperation.DELETE, txids, null);
+ }
+
+ @Override
+ public List<TransactionStatus> fateStatus(List<String> txids, List<String> tStatus)
+ throws AccumuloException {
+ checkArgument(txids != null, "txids is null");
+ List<TransactionStatus> txStatus = new ArrayList<>();
+ for (var tx : executeAdminOperation(AdminOperation.PRINT, txids, tStatus)) {
+ txStatus.add(new TransactionStatus(tx.getTxid(), tx.getTstatus(), tx.getDebug(),
+ tx.getHlocks(), tx.getWlocks(), tx.getTop(), tx.getTimecreated(), tx.getStackInfo()));
+ }
+ return txStatus;
+ }
+
+ private List<FateTransaction> executeAdminOperation(AdminOperation op, List<String> txids,
+ List<String> filterStatuses) throws AccumuloException {
+ try {
+ return ThriftClientTypes.CLIENT.execute(context,
+ client -> client.executeAdminOperation(TraceUtil.traceInfo(), context.rpcCreds(), op,
+ txids, filterStatuses));
+ } catch (AccumuloSecurityException e) {
+ throw new RuntimeException("Unexpected exception thrown", e);
Review Comment:
AccumuloSecurityException is typically intended to be thrown from our public API, so it should propagate all the way to that. The shell is probably already set up to catch it and log an error message/stack trace if any commands throw it.
--
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