asyncMultiDel
异步删同一HashKey下的多行数据。
- public static interface MultiDelListener extends GenericFutureListener<Future<Void>> {
- /**
- * This function will be called when listened asyncMultiDel future is done.
- * @param future the listened future
- * @throws Exception
- *
- * Notice: User shouldn't do any operations that may block or time-consuming
- */
- @Override
- public void operationComplete(Future<Void> future) throws Exception;
- }
- /**
- * delete mutiple values for a specific hashKey, async version
- * @param hashKey used to decide which partition the key may exist
- * if null or empty, means hash key is "".
- * @param sortKeys all the sortKeys need to be deleted
- * should not be null or empty
- * @param timeout how long will the operation timeout in milliseconds.
- * if timeout > 0, it is a timeout value for current op,
- * else the timeout value in the configuration file will be used.
- *
- * @return the future for current op
- *
- * Future return:
- * On success: no return
- * On failure: a throwable, which is an instance of PException
- *
- * Thread safety:
- * All the listeners for the same table are guaranteed to be dispatched in the same thread, so all the
- * listeners for the same future are guaranteed to be executed as the same order as the listeners added.
- * But listeners for different tables are not guaranteed to be dispatched in the same thread.
- */
- public Future<Void> asyncMultiDel(byte[] hashKey, List<byte[]> sortKeys, int timeout/*ms*/);
注:
- 参数:需传入HashKey、SortKeys、timeout。
- SortKeys不允许为空,如果不知道该HashKey下面有哪些SortKey,可以通过multiGetSortKeys方法获取。
- timeout单位为毫秒,如果<=0,表示使用配置文件中的默认超时。
- 返回值:Future
。