You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/01/11 00:34:39 UTC
[01/12] git commit: Merge branch '1.4.5-SNAPSHOT' of
https://git-wip-us.apache.org/repos/asf/accumulo into 1.4.5-SNAPSHOT
Updated Branches:
refs/heads/1.5.1-SNAPSHOT 3b41d37ed -> 56230eb9b
refs/heads/1.6.0-SNAPSHOT 7c309097c -> d1b53eda9
refs/heads/master 6a78fbd56 -> c95030cc9
Merge branch '1.4.5-SNAPSHOT' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.4.5-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/c0db9ca3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/c0db9ca3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/c0db9ca3
Branch: refs/heads/1.5.1-SNAPSHOT
Commit: c0db9ca3752355daf9867b44a81a5c85c3316406
Parents: 6d49e1a 96bfa8c
Author: Eric Newton <er...@gmail.com>
Authored: Fri Jan 10 10:14:40 2014 -0500
Committer: Eric Newton <er...@gmail.com>
Committed: Fri Jan 10 10:14:40 2014 -0500
----------------------------------------------------------------------
.../minicluster/MiniAccumuloCluster.java | 8 +++---
.../minicluster/MiniAccumuloConfig.java | 17 ------------
.../minicluster/MiniAccumuloClusterGCTest.java | 27 --------------------
3 files changed, 4 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
[03/12] git commit: Merge branch '1.4.5-SNAPSHOT' of
https://git-wip-us.apache.org/repos/asf/accumulo into 1.4.5-SNAPSHOT
Posted by el...@apache.org.
Merge branch '1.4.5-SNAPSHOT' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.4.5-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/c0db9ca3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/c0db9ca3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/c0db9ca3
Branch: refs/heads/master
Commit: c0db9ca3752355daf9867b44a81a5c85c3316406
Parents: 6d49e1a 96bfa8c
Author: Eric Newton <er...@gmail.com>
Authored: Fri Jan 10 10:14:40 2014 -0500
Committer: Eric Newton <er...@gmail.com>
Committed: Fri Jan 10 10:14:40 2014 -0500
----------------------------------------------------------------------
.../minicluster/MiniAccumuloCluster.java | 8 +++---
.../minicluster/MiniAccumuloConfig.java | 17 ------------
.../minicluster/MiniAccumuloClusterGCTest.java | 27 --------------------
3 files changed, 4 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
[12/12] git commit: Merge branch '1.6.0-SNAPSHOT'
Posted by el...@apache.org.
Merge branch '1.6.0-SNAPSHOT'
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/c95030cc
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/c95030cc
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/c95030cc
Branch: refs/heads/master
Commit: c95030cc96a55818fbb50c77df3df478c45a6466
Parents: 6a78fbd d1b53ed
Author: Josh Elser <jo...@gmail.com>
Authored: Fri Jan 10 18:31:12 2014 -0500
Committer: Josh Elser <jo...@gmail.com>
Committed: Fri Jan 10 18:31:12 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/util/shell/commands/ExecfileCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[06/12] git commit: ACCUMULO-2176 Ensure scanner is closed.
Posted by el...@apache.org.
ACCUMULO-2176 Ensure scanner is closed.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/826dc488
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/826dc488
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/826dc488
Branch: refs/heads/master
Commit: 826dc4880ca1ed916d073dc101fe39d12f5c2fdb
Parents: c0db9ca
Author: Josh Elser <el...@apache.org>
Authored: Fri Jan 10 18:20:41 2014 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Fri Jan 10 18:20:41 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/util/shell/commands/ExecfileCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/826dc488/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
----------------------------------------------------------------------
diff --git a/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java b/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
index c7bf74f..54b1f94 100644
--- a/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
+++ b/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
@@ -35,8 +35,12 @@ public class ExecfileCommand extends Command {
@Override
public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception {
java.util.Scanner scanner = new java.util.Scanner(new File(cl.getArgs()[0]));
- while (scanner.hasNextLine())
- shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
+ try {
+ while (scanner.hasNextLine())
+ shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
+ } finally {
+ scanner.close();
+ }
return 0;
}
[04/12] git commit: ACCUMULO-2176 Ensure scanner is closed.
Posted by el...@apache.org.
ACCUMULO-2176 Ensure scanner is closed.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/826dc488
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/826dc488
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/826dc488
Branch: refs/heads/1.5.1-SNAPSHOT
Commit: 826dc4880ca1ed916d073dc101fe39d12f5c2fdb
Parents: c0db9ca
Author: Josh Elser <el...@apache.org>
Authored: Fri Jan 10 18:20:41 2014 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Fri Jan 10 18:20:41 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/util/shell/commands/ExecfileCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/826dc488/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
----------------------------------------------------------------------
diff --git a/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java b/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
index c7bf74f..54b1f94 100644
--- a/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
+++ b/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
@@ -35,8 +35,12 @@ public class ExecfileCommand extends Command {
@Override
public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception {
java.util.Scanner scanner = new java.util.Scanner(new File(cl.getArgs()[0]));
- while (scanner.hasNextLine())
- shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
+ try {
+ while (scanner.hasNextLine())
+ shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
+ } finally {
+ scanner.close();
+ }
return 0;
}
[11/12] git commit: Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT
Posted by el...@apache.org.
Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d1b53eda
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d1b53eda
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d1b53eda
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: d1b53eda9532310b43d0e1cc41f3495da4642540
Parents: 7c30909 56230eb
Author: Josh Elser <jo...@gmail.com>
Authored: Fri Jan 10 18:31:05 2014 -0500
Committer: Josh Elser <jo...@gmail.com>
Committed: Fri Jan 10 18:31:05 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/util/shell/commands/ExecfileCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[10/12] git commit: Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT
Posted by el...@apache.org.
Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d1b53eda
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d1b53eda
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d1b53eda
Branch: refs/heads/master
Commit: d1b53eda9532310b43d0e1cc41f3495da4642540
Parents: 7c30909 56230eb
Author: Josh Elser <jo...@gmail.com>
Authored: Fri Jan 10 18:31:05 2014 -0500
Committer: Josh Elser <jo...@gmail.com>
Committed: Fri Jan 10 18:31:05 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/util/shell/commands/ExecfileCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[07/12] git commit: Merge branch '1.4.5-SNAPSHOT' into 1.5.1-SNAPSHOT
Posted by el...@apache.org.
Merge branch '1.4.5-SNAPSHOT' into 1.5.1-SNAPSHOT
Conflicts:
core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/56230eb9
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/56230eb9
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/56230eb9
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 56230eb9ba1252110ebcbb538576ceb0f2509799
Parents: 3b41d37 826dc48
Author: Josh Elser <jo...@gmail.com>
Authored: Fri Jan 10 18:30:42 2014 -0500
Committer: Josh Elser <jo...@gmail.com>
Committed: Fri Jan 10 18:30:42 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/util/shell/commands/ExecfileCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/56230eb9/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
index dd91e2d,0000000..a9c409f
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
@@@ -1,62 -1,0 +1,66 @@@
+/*
+ * 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
+ *
+ * http://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.core.util.shell.commands;
+
+import java.io.File;
+import java.util.Scanner;
+
+import org.apache.accumulo.core.util.shell.Shell;
+import org.apache.accumulo.core.util.shell.Shell.Command;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+
+public class ExecfileCommand extends Command {
+ private Option verboseOption;
+
+ @Override
+ public String description() {
+ return "specifies a file containing accumulo commands to execute";
+ }
+
+ @Override
+ public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
+ Scanner scanner = new Scanner(new File(cl.getArgs()[0]));
- while (scanner.hasNextLine()) {
- shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
++ try {
++ while (scanner.hasNextLine()) {
++ shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
++ }
++ } finally {
++ scanner.close();
+ }
+ return 0;
+ }
+
+ @Override
+ public String usage() {
+ return getName() + " <fileName>";
+ }
+
+ @Override
+ public int numArgs() {
+ return 1;
+ }
+
+ @Override
+ public Options getOptions() {
+ final Options opts = new Options();
+ verboseOption = new Option("v", "verbose", false, "display command prompt as commands are executed");
+ opts.addOption(verboseOption);
+ return opts;
+ }
+}
[05/12] git commit: ACCUMULO-2176 Ensure scanner is closed.
Posted by el...@apache.org.
ACCUMULO-2176 Ensure scanner is closed.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/826dc488
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/826dc488
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/826dc488
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 826dc4880ca1ed916d073dc101fe39d12f5c2fdb
Parents: c0db9ca
Author: Josh Elser <el...@apache.org>
Authored: Fri Jan 10 18:20:41 2014 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Fri Jan 10 18:20:41 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/util/shell/commands/ExecfileCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/826dc488/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
----------------------------------------------------------------------
diff --git a/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java b/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
index c7bf74f..54b1f94 100644
--- a/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
+++ b/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
@@ -35,8 +35,12 @@ public class ExecfileCommand extends Command {
@Override
public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception {
java.util.Scanner scanner = new java.util.Scanner(new File(cl.getArgs()[0]));
- while (scanner.hasNextLine())
- shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
+ try {
+ while (scanner.hasNextLine())
+ shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
+ } finally {
+ scanner.close();
+ }
return 0;
}
[09/12] git commit: Merge branch '1.4.5-SNAPSHOT' into 1.5.1-SNAPSHOT
Posted by el...@apache.org.
Merge branch '1.4.5-SNAPSHOT' into 1.5.1-SNAPSHOT
Conflicts:
core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/56230eb9
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/56230eb9
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/56230eb9
Branch: refs/heads/1.5.1-SNAPSHOT
Commit: 56230eb9ba1252110ebcbb538576ceb0f2509799
Parents: 3b41d37 826dc48
Author: Josh Elser <jo...@gmail.com>
Authored: Fri Jan 10 18:30:42 2014 -0500
Committer: Josh Elser <jo...@gmail.com>
Committed: Fri Jan 10 18:30:42 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/util/shell/commands/ExecfileCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/56230eb9/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
index dd91e2d,0000000..a9c409f
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
@@@ -1,62 -1,0 +1,66 @@@
+/*
+ * 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
+ *
+ * http://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.core.util.shell.commands;
+
+import java.io.File;
+import java.util.Scanner;
+
+import org.apache.accumulo.core.util.shell.Shell;
+import org.apache.accumulo.core.util.shell.Shell.Command;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+
+public class ExecfileCommand extends Command {
+ private Option verboseOption;
+
+ @Override
+ public String description() {
+ return "specifies a file containing accumulo commands to execute";
+ }
+
+ @Override
+ public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
+ Scanner scanner = new Scanner(new File(cl.getArgs()[0]));
- while (scanner.hasNextLine()) {
- shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
++ try {
++ while (scanner.hasNextLine()) {
++ shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
++ }
++ } finally {
++ scanner.close();
+ }
+ return 0;
+ }
+
+ @Override
+ public String usage() {
+ return getName() + " <fileName>";
+ }
+
+ @Override
+ public int numArgs() {
+ return 1;
+ }
+
+ @Override
+ public Options getOptions() {
+ final Options opts = new Options();
+ verboseOption = new Option("v", "verbose", false, "display command prompt as commands are executed");
+ opts.addOption(verboseOption);
+ return opts;
+ }
+}
[08/12] git commit: Merge branch '1.4.5-SNAPSHOT' into 1.5.1-SNAPSHOT
Posted by el...@apache.org.
Merge branch '1.4.5-SNAPSHOT' into 1.5.1-SNAPSHOT
Conflicts:
core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/56230eb9
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/56230eb9
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/56230eb9
Branch: refs/heads/master
Commit: 56230eb9ba1252110ebcbb538576ceb0f2509799
Parents: 3b41d37 826dc48
Author: Josh Elser <jo...@gmail.com>
Authored: Fri Jan 10 18:30:42 2014 -0500
Committer: Josh Elser <jo...@gmail.com>
Committed: Fri Jan 10 18:30:42 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/util/shell/commands/ExecfileCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/56230eb9/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
index dd91e2d,0000000..a9c409f
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ExecfileCommand.java
@@@ -1,62 -1,0 +1,66 @@@
+/*
+ * 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
+ *
+ * http://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.core.util.shell.commands;
+
+import java.io.File;
+import java.util.Scanner;
+
+import org.apache.accumulo.core.util.shell.Shell;
+import org.apache.accumulo.core.util.shell.Shell.Command;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+
+public class ExecfileCommand extends Command {
+ private Option verboseOption;
+
+ @Override
+ public String description() {
+ return "specifies a file containing accumulo commands to execute";
+ }
+
+ @Override
+ public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
+ Scanner scanner = new Scanner(new File(cl.getArgs()[0]));
- while (scanner.hasNextLine()) {
- shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
++ try {
++ while (scanner.hasNextLine()) {
++ shellState.execCommand(scanner.nextLine(), true, cl.hasOption(verboseOption.getOpt()));
++ }
++ } finally {
++ scanner.close();
+ }
+ return 0;
+ }
+
+ @Override
+ public String usage() {
+ return getName() + " <fileName>";
+ }
+
+ @Override
+ public int numArgs() {
+ return 1;
+ }
+
+ @Override
+ public Options getOptions() {
+ final Options opts = new Options();
+ verboseOption = new Option("v", "verbose", false, "display command prompt as commands are executed");
+ opts.addOption(verboseOption);
+ return opts;
+ }
+}
[02/12] git commit: Merge branch '1.4.5-SNAPSHOT' of
https://git-wip-us.apache.org/repos/asf/accumulo into 1.4.5-SNAPSHOT
Posted by el...@apache.org.
Merge branch '1.4.5-SNAPSHOT' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.4.5-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/c0db9ca3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/c0db9ca3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/c0db9ca3
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: c0db9ca3752355daf9867b44a81a5c85c3316406
Parents: 6d49e1a 96bfa8c
Author: Eric Newton <er...@gmail.com>
Authored: Fri Jan 10 10:14:40 2014 -0500
Committer: Eric Newton <er...@gmail.com>
Committed: Fri Jan 10 10:14:40 2014 -0500
----------------------------------------------------------------------
.../minicluster/MiniAccumuloCluster.java | 8 +++---
.../minicluster/MiniAccumuloConfig.java | 17 ------------
.../minicluster/MiniAccumuloClusterGCTest.java | 27 --------------------
3 files changed, 4 insertions(+), 48 deletions(-)
----------------------------------------------------------------------