accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [4/5] accumulo git commit: Merge branch '1.6' into 1.7
Date Tue, 15 Mar 2016 00:46:24 GMT
Merge branch '1.6' into 1.7


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/422815aa
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/422815aa
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/422815aa

Branch: refs/heads/1.7
Commit: 422815aa2090ffaccc51ab5c3efee482548e318b
Parents: 37857c5 ecfd95c
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Mon Mar 14 20:45:56 2016 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Mon Mar 14 20:45:56 2016 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/shell/commands/DeleteRowsCommand.java  | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/422815aa/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteRowsCommand.java
----------------------------------------------------------------------
diff --cc shell/src/main/java/org/apache/accumulo/shell/commands/DeleteRowsCommand.java
index 527efe6,0000000..2fc87b0
mode 100644,000000..100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteRowsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteRowsCommand.java
@@@ -1,63 -1,0 +1,62 @@@
 +/*
 + * 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.shell.commands;
 +
 +import org.apache.accumulo.shell.Shell;
 +import org.apache.accumulo.shell.Shell.Command;
 +import org.apache.commons.cli.CommandLine;
 +import org.apache.commons.cli.Option;
 +import org.apache.commons.cli.Options;
 +import org.apache.hadoop.io.Text;
 +
 +public class DeleteRowsCommand extends Command {
 +  private Option forceOpt;
-   private Option startRowOptExclusive;
 +
 +  @Override
 +  public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws Exception {
 +    final String tableName = OptUtil.getTableOpt(cl, shellState);
 +    final Text startRow = OptUtil.getStartRow(cl);
 +    final Text endRow = OptUtil.getEndRow(cl);
 +    if (!cl.hasOption(forceOpt.getOpt()) && (startRow == null || endRow == null))
{
 +      shellState.getReader().println("Not deleting unbounded range. Specify both ends, or
use --force");
 +      return 1;
 +    }
 +    shellState.getConnector().tableOperations().deleteRows(tableName, startRow, endRow);
 +    return 0;
 +  }
 +
 +  @Override
 +  public String description() {
 +    return "deletes a range of rows in a table.  Note that rows matching the start row ARE
NOT deleted, but rows matching the end row ARE deleted.";
 +  }
 +
 +  @Override
 +  public int numArgs() {
 +    return 0;
 +  }
 +
 +  @Override
 +  public Options getOptions() {
 +    final Options o = new Options();
 +    forceOpt = new Option("f", "force", false, "delete data even if start or end are not
specified");
 +    o.addOption(OptUtil.startRowOpt());
 +    o.addOption(OptUtil.endRowOpt());
 +    o.addOption(OptUtil.tableOpt("table to delete a row range from"));
 +    o.addOption(forceOpt);
 +    return o;
 +  }
 +}


Mime
View raw message