Implements the {@code delete} subcommand.
@param client The HBase client to use.
@param table The name of the HBase table to use.
@param args Command line arguments ({@code assign name [names]}).
@return The exit status of the command (0 means success).
969714
private static int delete(final TSDB tsdb, final byte[] table,
      final String[] args) throws Exception {
    final String kind = args[1];
    final String name = args[2];
    try {
      tsdb.deleteUidAsync(kind, name).join();
    } catch (HBaseException e) {
      LOG.error("error while processing delete " + name, e);
      return 3;
    } catch (NoSuchUniqueName e) {
      LOG.error(e.getMessage());
      return 1;
    }
    LOG.info("UID " + kind + ' ' + name + " deleted.");
    return 0;
  }
423705
public static void executeSQL(final SQLiteDatabase database, String command) {
		// remove comments
		command = command.replaceAll("\\/\\*.*\\*\\/", "");
		command = command.replaceAll("--.*$", "");

		if (command.trim().length() > 0) {
			Logger.info(command);
			database.execSQL(command);
		}

	}
82052
function _cmdClose(clientId) {
    var client = _clients[clientId];
    if (client) {
        client.socket.close();
        delete _clients[clientId];
    }
}
851445
private void deleteTable(String tableName) {
        m_logger.info("Deleting table: {}", tableName);
        try {
            m_ddbClient.deleteTable(new DeleteTableRequest(tableName));
            for (int seconds = 0; seconds < 10; seconds++) {
                try {
                    m_ddbClient.describeTable(tableName);
                    Thread.sleep(1000);
                } catch (ResourceNotFoundException e) {
                    break;  // Success
                }   // All other exceptions passed to outer try/catch
            }
        } catch (ResourceNotFoundException e) {
            // Already deleted.
        } catch (Exception e) {
            throw new RuntimeException("Error deleting table: " + tableName, e);
        }
    }
281519
public static void executeCommand(String[] args) throws Exception {
        String subCmd = (args.length > 0) ? args[0] : "";
        args = AdminToolUtils.copyArrayCutFirst(args);
        if(subCmd.equals("query-keys")) {
            SubCommandDebugQueryKeys.executeCommand(args);
        } else if(subCmd.equals("route")) {
            SubCommandDebugRoute.executeCommand(args);
        } else {
            printHelp(System.out);
        }
    }
127971
private static int doDeleteAll(CallInfo callInfo, Table table) {
    DB db = table.getDB();
    return db.access(callInfo, () -> {
      String sql = DELETE_FROM_ + table.getName();
      db.logSetup(callInfo, sql);
      try (WrappedStatement ws = db.compile(sql)) {
        return ws.getStatement().executeUpdate();
      }
    });
  }
480670
public static void executeHelp(String[] args, PrintStream stream) throws Exception {
        String subCmd = (args.length > 0) ? args[0] : "";
        if(subCmd.equals("add")) {
            SubCommandStoreAdd.printHelp(stream);
        } else if(subCmd.equals("update")) {
            SubCommandStoreUpdate.printHelp(stream);
        } else if(subCmd.equals("delete")) {
            SubCommandStoreDelete.printHelp(stream);
        } else if(subCmd.equals("rollback-ro")) {
            SubCommandStoreRollbackReadOnly.printHelp(stream);
        } else if(subCmd.equals("truncate-partition")) {
            SubCommandStoreTruncatePartition.printHelp(stream);
        } else if(subCmd.equals("truncate-store")) {
            SubCommandStoreTruncateStore.printHelp(stream);
        } else {
            printHelp(stream);
        }
    }
19246
public boolean delete(String tableName, Record record) {
		String defaultPrimaryKey = config.dialect.getDefaultPrimaryKey();
		Object t = record.get(defaultPrimaryKey);	// 引入中间变量避免 JDK 8 传参有误
		return deleteByIds(tableName, defaultPrimaryKey, t);
	}
775679
public static void main(String[] args) throws Exception {
    System.exit(ToolRunner.run(HBaseConfiguration.create(), new Import(), args));
  }
1198315
public static void main(String[] args) throws IOException {
    AddressClient client = createCredentialedClient();

    System.out.println("Running with Gapic Client.");
    AddressClient.ListAddressesPagedResponse listResponse = listAddresses(client);
    verifyListAddressWithGets(client, listResponse);

    System.out.println("Running with Gapic Client and Resource Name.");
    String newAddressName = "new_address_name";
    System.out.println("Inserting address:");

    insertNewAddressJustClient(client, newAddressName);

    listAddresses(client);

    System.out.println("Deleting address:");
    Operation deleteResponse =
        client.deleteAddress(ProjectRegionAddressName.of(newAddressName, PROJECT_NAME, REGION));
    System.out.format("Result of delete: %s\n", deleteResponse.toString());
    int sleepTimeInSeconds = 3;
    System.out.format("Waiting %d seconds for server to update...\n", sleepTimeInSeconds);
    // Wait for the delete operation to finish on the server.
    try {
      TimeUnit.SECONDS.sleep(sleepTimeInSeconds);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    listAddresses(client);
  }
422417
function command(cmd, args, info) {
  var map = info.commands || Constants.MAP
    , def = map[cmd]
    , sub;

  // support command exec handlers that
  // encapsulate the definition
  if(def && def.definition !== undefined) {
    def = def.definition;
  }

  // top-level command
  if(def === undefined) {
    throw new UnknownCommand(cmd);
  }

  // made it this far, check subcommands
  // for commands that require a subcommand
  if(Constants.SUBCOMMAND[cmd] && args.length > 0) {
    sub = Constants.SUBCOMMAND[cmd][args[0]];
    if(!sub) {
      if(cmd === Constants.MAP.client.name) {
        throw ClientSyntax;
      }
      throw UnknownSubcommand;
    }
    // mutate the sub response to include
    // the subcommand as a primary command
    // and the remaining arguments, callers
    // can use this to locate a subcommand
    // execution method
    sub = {def: sub, cmd: args[0], args: args.slice(1)};
  }

  return {cmd: cmd, args: args, def: def, sub: sub};
}
625774
@Override
    public void deleteRow(Object rowKey, String colName, String colFamily, String tableName) throws IOException
    {
        Table hTable = gethTable(tableName);
        hbaseWriter.delete(hTable, rowKey, colFamily, colName);
        closeHTable(hTable);
    }
1973
public static void executeCommand(String[] args) throws Exception {
        String subCmd = (args.length > 0) ? args[0] : "";
        args = AdminToolUtils.copyArrayCutFirst(args);
        if(subCmd.equals("list")) {
            SubCommandScheduledList.executeCommand(args);
        } else if(subCmd.equals("stop")) {
            SubCommandScheduledStop.executeCommand(args);
        } else if(subCmd.equals("enable")) {
            SubCommandScheduledEnable.executeCommand(args);
        } else {
            printHelp(System.out);
        }
    }
1292426
@CommandDescList({
		@CommandDesc(longName = "load",
				description = "load an input bibliography from a file",
				command = ShellLoadCommand.class),
		@CommandDesc(longName = "get",
				description = "get values of shell variables",
				command = ShellGetCommand.class),
		@CommandDesc(longName = "set",
				description = "assign values to shell variables",
				command = ShellSetCommand.class),
		@CommandDesc(longName = "help",
				description = "display help for a given command",
				command = ShellHelpCommand.class),
		@CommandDesc(longName = "exit",
				description = "exit the interactive shell",
				command = ShellExitCommand.class),
		@CommandDesc(longName = "quit",
				description = "exit the interactive shell",
				command = ShellQuitCommand.class),
	})
	public void setCommand(AbstractCSLToolCommand command) {
		//we don't have to do anything here
	}
994854
function onCommand(cmd, args) {

  if(cmd === Constants.MAP.multi.name) {
    return this._abort(new Error('multi transaction cannot be nested'));
  }

  if(cmd === Constants.MAP.watch.name) {
    return this._abort(
      new Error('watch should be executed before a multi transaction'));
  }

  if(!this._client || !Array.isArray(this._queue)) {
    throw new Error('multi transaction already aborted');
  }

  function doExec(cmd, args, cb) {
    this._client.execute(cmd, args, cb);
  }

  doExec = doExec.bind(this);

  function onComplete(cmd, args, err, reply) {

    if(typeof args[0] === 'function') {
      args[0](err, reply);
    }else{
      this._client.emit('exec', err, reply);
    }

    // reset, this multi can be re-used
    this._reset();
  }

  function onQueue(cmd, args, err, reply) {
    this._queue.push(err || reply);

    var next = this._commands.shift();
    /* istanbul ignore else */
    if(next) {
      // executing a command
      if(next.cmd !== Constants.MAP.exec.name) {
        doExec(next.cmd, next.args, onQueue.bind(this, next.cmd, next.args));
      // running the exec command to get the result
      }else{
        doExec(next.cmd, [], onComplete.bind(this, cmd, next.args));
      }
    }
  }

  // send first multi packet
  if(!this._multi) {
    doExec(
      this._commands[0].cmd,
      this._commands[0].args,
      onQueue.bind(
        this,
        this._commands[0].cmd, []));

    // clear multi packet
    this._commands = [];
    this._multi = true;
  }

  // stash the command in a queue
  this._commands.push({cmd: cmd, args: args});
}
328477
public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();
            String url = null;
            Boolean confirm = false;

            // parse command-line input
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_URL);

            url = (String) options.valueOf(AdminParserUtils.OPT_URL);
            if(options.has(AdminParserUtils.OPT_CONFIRM)) {
                confirm = true;
            }

            // print summary
            System.out.println("Synchronize metadata versions across all nodes");
            System.out.println("Location:");
            System.out.println("  bootstrap url = " + url);
            System.out.println("  node = all nodes");

            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            AdminToolUtils.assertServerNotInRebalancingState(adminClient);

            Versioned<Properties> versionedProps = mergeAllVersions(adminClient);

            printVersions(versionedProps);

            // execute command
            if(!AdminToolUtils.askConfirm(confirm,
                                          "do you want to synchronize metadata versions to all node"))
                return;

            adminClient.metadataMgmtOps.setMetadataVersion(versionedProps);
        }
631415
public int deleteByTableName(String tableName) throws SQLException {
		DeleteBuilder<DataColumns, TableColumnKey> db = deleteBuilder();
		db.where().eq(DataColumns.COLUMN_TABLE_NAME, tableName);
		PreparedDelete<DataColumns> deleteQuery = db.prepare();
		int deleted = delete(deleteQuery);
		return deleted;
	}