diff --git a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/pom.xml b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/pom.xml index 6def98b4bb..536fbce4ec 100644 --- a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/pom.xml +++ b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/pom.xml @@ -48,8 +48,8 @@ org.apache.zookeeper zookeeper - + @@ -69,6 +69,7 @@ gson + org.codehaus.groovy groovy-all diff --git a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/DataStatAclNode.java b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/DataStatAclNode.java index 9d7d08150a..2405ce2419 100644 --- a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/DataStatAclNode.java +++ b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/DataStatAclNode.java @@ -25,7 +25,7 @@ import org.apache.zookeeper.data.Stat; import java.util.List; import java.util.Objects; -public class DataStatAclNode { +class DataStatAclNode { private final String path; private final byte[] data; @@ -33,7 +33,7 @@ public class DataStatAclNode { private final List acls; private final long ephemeralOwner; - public DataStatAclNode(String path, byte[] data, Stat stat, List acls, long ephemeralOwner) { + DataStatAclNode(String path, byte[] data, Stat stat, List acls, long ephemeralOwner) { this.path = Preconditions.checkNotNull(path, "path can not be null"); this.data = data; this.stat = Preconditions.checkNotNull(stat, "stat can not be null"); @@ -41,23 +41,23 @@ public class DataStatAclNode { this.ephemeralOwner = ephemeralOwner; } - public String getPath() { + String getPath() { return path; } - public byte[] getData() { + byte[] getData() { return data; } - public Stat getStat() { + Stat getStat() { return stat; } - public List getAcls() { + List getAcls() { return acls; } - public long getEphemeralOwner() { + long getEphemeralOwner() { return ephemeralOwner; } diff --git a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigrator.java b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigrator.java index ab110a6e06..c2ad166872 100644 --- a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigrator.java +++ b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigrator.java @@ -41,7 +41,6 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import java.util.Spliterators; @@ -64,9 +63,9 @@ class ZooKeeperMigrator { private final ZooKeeperEndpointConfig zooKeeperEndpointConfig; - ZooKeeperMigrator(String zookeeperEndpoint) throws URISyntaxException { + ZooKeeperMigrator(String zookeeperEndpoint) { LOGGER.debug("ZooKeeper endpoint parameter: {}", zookeeperEndpoint); - Preconditions.checkArgument(!Strings.isNullOrEmpty(zookeeperEndpoint), "connectString must not be null"); + Preconditions.checkArgument(!Strings.isNullOrEmpty(zookeeperEndpoint), "zookeeper endpoint must not be null"); final String[] connectStringPath = zookeeperEndpoint.split("/", 2); Preconditions.checkArgument(connectStringPath.length >= 1, "invalid ZooKeeper endpoint: %s", zookeeperEndpoint); final String connectString = connectStringPath[0]; @@ -134,7 +133,7 @@ class ZooKeeperMigrator { Preconditions.checkArgument(!Strings.isNullOrEmpty(sourceZooKeeperEndpointConfig.getConnectString()) && !Strings.isNullOrEmpty(sourceZooKeeperEndpointConfig.getPath()), "Source ZooKeeper %s from %s is invalid", sourceZooKeeperEndpointConfig, zkData); Preconditions.checkState(!zooKeeperEndpointConfig.equals(sourceZooKeeperEndpointConfig), - "Source ZooKeeper config %s for the data provided can not be the same as the configured destionation ZooKeeper config %s", + "Source ZooKeeper config %s for the data provided can not be the same as the configured destination ZooKeeper config %s", sourceZooKeeperEndpointConfig, zooKeeperEndpointConfig); // stream through each node read from the json input @@ -277,7 +276,7 @@ class ZooKeeperMigrator { // set data without caring what the previous version of the data at that path zooKeeper.setData(node.getPath(), node.getData(), -1); zooKeeper.setACL(node.getPath(), node.getAcls(), -1); - LOGGER.info("transfered node {} in {}", node, zooKeeperEndpointConfig); + LOGGER.info("transferred node {} in {}", node, zooKeeperEndpointConfig); } catch (Exception e) { throw new RuntimeException(String.format("unable to transmit data to %s for path %s", zooKeeper, node.getPath()), e); } diff --git a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigratorMain.java b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigratorMain.java index 1dbdccac58..bf037a03ad 100644 --- a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigratorMain.java +++ b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigratorMain.java @@ -45,7 +45,7 @@ public class ZooKeeperMigratorMain { .longOpt("zookeeper") .desc("ZooKeeper connect string with path (ex. host:port/path)") .hasArg() - .argName("connect-string") + .argName("zookeeper-endpoint") .required() .build(); private static final Option OPTION_RECEIVE = Option.builder("r") @@ -58,7 +58,7 @@ public class ZooKeeperMigratorMain { .build(); private static final Option OPTION_ZK_AUTH_INFO = Option.builder("a") .longOpt("auth") - .desc("username and password for the given ZK path") + .desc("username and password for the given ZooKeeper path") .hasArg() .argName("username:password") .build();