Skip to content

Commit

Permalink
ZOOKEEPER-3411: Remove deprecated ls2 and rmr command
Browse files Browse the repository at this point in the history
Removed Ls2Command.java, DeleteAllCommand.printdeprecatedwarning(), statements creating new objects for ls2 and rmr in ZookeeperMain.java. Updated zookeeperCLI.md and ZookeeperTest.java.

Please do let me know if any additional changes are needed

Author: ravowlga123 <ravowlga@gmail.com>

Reviewers: andor@apache.org

Closes apache#1175 from ravowlga123/ZOOKEEPER-3411
  • Loading branch information
rabi-kumar authored and junyoungKimGit committed Feb 7, 2020
1 parent 7aa75bc commit 0de8235
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 113 deletions.
19 changes: 0 additions & 19 deletions zookeeper-docs/src/main/resources/markdown/zookeeperCLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ ZooKeeper -server host:port cmd args
history
listquota path
ls [-s] [-w] [-R] path
ls2 path [watch]
printwatches on|off
quit
reconfig [-s] [-v version] [[-file path] | [-members serverID=host:port1:port2;port3[,...]*]] | [-add serverId=host:port1:port2;port3[,...]]* [-remove serverId[,...]*]
redo cmdno
removewatches path [-c|-d|-a] [-l]
rmr path
set [-s] [-v version] path data
setAcl [-s] [-v version] [-R] path acl
setquota -n|-b val path
Expand Down Expand Up @@ -324,15 +322,6 @@ Listing the child nodes of one path
WatchedEvent state:SyncConnected type:NodeChildrenChanged path:/brokers
```

## ls2

'ls2' has been deprecated. Please use 'ls [-s] path' instead.

```bash
[zkshell: 7] ls2 /
'ls2' has been deprecated. Please use 'ls [-s] path' instead.
```

## printwatches
A switch to turn on/off whether printing watches or not.

Expand Down Expand Up @@ -422,14 +411,6 @@ Remove the watches under a node.

```

## rmr
The command 'rmr' has been deprecated. Please use 'deleteall' instead.

```bash
[zkshell: 4] rmr /zk-latencies4
The command 'rmr' has been deprecated. Please use 'deleteall' instead
```

## set
Set/update the data on a path.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import org.apache.zookeeper.cli.GetConfigCommand;
import org.apache.zookeeper.cli.GetEphemeralsCommand;
import org.apache.zookeeper.cli.ListQuotaCommand;
import org.apache.zookeeper.cli.Ls2Command;
import org.apache.zookeeper.cli.LsCommand;
import org.apache.zookeeper.cli.MalformedCommandException;
import org.apache.zookeeper.cli.ReconfigCommand;
Expand Down Expand Up @@ -105,12 +104,9 @@ public boolean getPrintWatches() {
new CreateCommand().addToMap(commandMapCli);
new DeleteCommand().addToMap(commandMapCli);
new DeleteAllCommand().addToMap(commandMapCli);
// Depricated: rmr
new DeleteAllCommand("rmr").addToMap(commandMapCli);
new SetCommand().addToMap(commandMapCli);
new GetCommand().addToMap(commandMapCli);
new LsCommand().addToMap(commandMapCli);
new Ls2Command().addToMap(commandMapCli);
new GetAclCommand().addToMap(commandMapCli);
new SetAclCommand().addToMap(commandMapCli);
new StatCommand().addToMap(commandMapCli);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public CliCommand parse(String[] cmdArgs) throws CliParseException {

@Override
public boolean exec() throws CliException {
printDeprecatedWarning();
int batchSize;
try {
batchSize = cl.hasOption("b") ? Integer.parseInt(cl.getOptionValue("b")) : 1000;
Expand All @@ -88,10 +87,4 @@ public boolean exec() throws CliException {
return false;
}

private void printDeprecatedWarning() {
if ("rmr".equals(args[0])) {
err.println("The command 'rmr' has been deprecated. " + "Please use 'deleteall' instead.");
}
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,7 @@ public void testDeleteRecursiveCli() throws IOException, InterruptedException, C
assertTrue(children.contains("c"));

ZooKeeperMain zkMain = new ZooKeeperMain(zk);
// 'rmr' is deprecated, so the test here is just for backwards
// compatibility.
String cmdstring0 = "rmr /a/b/v";
String cmdstring1 = "deleteall /a";
zkMain.cl.parseCommand(cmdstring0);
assertFalse(zkMain.processZKCmd(zkMain.cl));
assertEquals(null, zk.exists("/a/b/v", null));
zkMain.cl.parseCommand(cmdstring1);
assertFalse(zkMain.processZKCmd(zkMain.cl));
assertNull(zk.exists("/a", null));
Expand Down

0 comments on commit 0de8235

Please sign in to comment.