You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mm...@apache.org on 2022/09/22 18:35:54 UTC

[accumulo] branch main updated: Drop FateAdmin classes (#2947)

This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new acd457ace6 Drop FateAdmin classes (#2947)
acd457ace6 is described below

commit acd457ace6c6840d09768c59447954e29c259db7
Author: Mike Miller <mm...@apache.org>
AuthorDate: Thu Sep 22 18:35:48 2022 +0000

    Drop FateAdmin classes (#2947)
---
 server/manager/pom.xml                             |   4 -
 .../apache/accumulo/manager/util/FateAdmin.java    | 109 ---------------------
 .../org/apache/accumulo/master/util/FateAdmin.java |  38 -------
 3 files changed, 151 deletions(-)

diff --git a/server/manager/pom.xml b/server/manager/pom.xml
index da01ba8247..3197219820 100644
--- a/server/manager/pom.xml
+++ b/server/manager/pom.xml
@@ -31,10 +31,6 @@
   <name>Apache Accumulo Manager Server</name>
   <description>The manager server for Apache Accumulo for load balancing and other system-wide operations.</description>
   <dependencies>
-    <dependency>
-      <groupId>com.beust</groupId>
-      <artifactId>jcommander</artifactId>
-    </dependency>
     <dependency>
       <groupId>com.google.auto.service</groupId>
       <artifactId>auto-service</artifactId>
diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/util/FateAdmin.java b/server/manager/src/main/java/org/apache/accumulo/manager/util/FateAdmin.java
deleted file mode 100644
index ed76b52ec8..0000000000
--- a/server/manager/src/main/java/org/apache/accumulo/manager/util/FateAdmin.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.manager.util;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map.Entry;
-
-import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.cli.Help;
-import org.apache.accumulo.core.conf.SiteConfiguration;
-import org.apache.accumulo.fate.AdminUtil;
-import org.apache.accumulo.fate.ReadOnlyStore;
-import org.apache.accumulo.fate.ZooStore;
-import org.apache.accumulo.fate.zookeeper.ServiceLock;
-import org.apache.accumulo.fate.zookeeper.ZooReaderWriter;
-import org.apache.accumulo.manager.Manager;
-import org.apache.accumulo.server.ServerContext;
-
-import com.beust.jcommander.JCommander;
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.Parameters;
-
-/**
- * A utility to administer FATE operations
- */
-public class FateAdmin {
-
-  static class TxOpts {
-    @Parameter(description = "<txid>...", required = true)
-    List<String> txids = new ArrayList<>();
-  }
-
-  @Parameters(commandDescription = "Stop an existing FATE by transaction id")
-  static class FailOpts extends TxOpts {}
-
-  @Parameters(commandDescription = "Delete an existing FATE by transaction id")
-  static class DeleteOpts extends TxOpts {}
-
-  @Parameters(commandDescription = "List the existing FATE transactions")
-  static class PrintOpts {}
-
-  public static void main(String[] args) throws Exception {
-    Help opts = new Help();
-    JCommander jc = new JCommander(opts);
-    jc.setProgramName(FateAdmin.class.getName());
-    LinkedHashMap<String,TxOpts> txOpts = new LinkedHashMap<>(2);
-    txOpts.put("fail", new FailOpts());
-    txOpts.put("delete", new DeleteOpts());
-    for (Entry<String,TxOpts> entry : txOpts.entrySet()) {
-      jc.addCommand(entry.getKey(), entry.getValue());
-    }
-    jc.addCommand("print", new PrintOpts());
-    jc.parse(args);
-    if (opts.help || jc.getParsedCommand() == null) {
-      jc.usage();
-      System.exit(1);
-    }
-
-    System.err.printf("This tool has been deprecated%nFATE administration now"
-        + " available within 'accumulo shell'%n$ fate fail <txid>... | delete"
-        + " <txid>... | print [<txid>...]%n%n");
-
-    AdminUtil<Manager> admin = new AdminUtil<>(true);
-
-    try (var context = new ServerContext(SiteConfiguration.auto())) {
-      final String zkRoot = context.getZooKeeperRoot();
-      var zLockManagerPath = ServiceLock.path(zkRoot + Constants.ZMANAGER_LOCK);
-      var zTableLocksPath = ServiceLock.path(zkRoot + Constants.ZTABLE_LOCKS);
-      String path = zkRoot + Constants.ZFATE;
-      ZooReaderWriter zk = context.getZooReaderWriter();
-      ZooStore<Manager> zs = new ZooStore<>(path, zk);
-
-      if (jc.getParsedCommand().equals("fail")) {
-        for (String txid : txOpts.get(jc.getParsedCommand()).txids) {
-          if (!admin.prepFail(zs, zk, zLockManagerPath, txid)) {
-            System.exit(1);
-          }
-        }
-      } else if (jc.getParsedCommand().equals("delete")) {
-        for (String txid : txOpts.get(jc.getParsedCommand()).txids) {
-          if (!admin.prepDelete(zs, zk, zLockManagerPath, txid)) {
-            System.exit(1);
-          }
-          admin.deleteLocks(zk, zTableLocksPath, txid);
-        }
-      } else if (jc.getParsedCommand().equals("print")) {
-        admin.printAll(new ReadOnlyStore<>(zs), zk, zTableLocksPath);
-      }
-    }
-  }
-}
diff --git a/server/manager/src/main/java/org/apache/accumulo/master/util/FateAdmin.java b/server/manager/src/main/java/org/apache/accumulo/master/util/FateAdmin.java
deleted file mode 100644
index 3d0c773051..0000000000
--- a/server/manager/src/main/java/org/apache/accumulo/master/util/FateAdmin.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.master.util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A utility to administer FATE operations
- *
- * @deprecated since 2.1.0. Use {@link org.apache.accumulo.manager.util.FateAdmin} instead
- */
-@Deprecated(since = "2.1.0")
-public class FateAdmin {
-  final static private Logger log = LoggerFactory.getLogger(FateAdmin.class);
-
-  public static void main(String[] args) throws Exception {
-    log.warn("{} is deprecated. Use {} instead.", FateAdmin.class.getName(),
-        org.apache.accumulo.manager.util.FateAdmin.class.getName());
-    org.apache.accumulo.manager.util.FateAdmin.main(args);
-  }
-}