【问题标题】:How to delete records in Accumulo based on an rowkey via Accumulo proxy client如何通过Accumulo代理客户端基于rowkey删除Accumulo中的记录
【发布时间】:2015-07-04 18:46:20
【问题描述】:

我正在使用 Accumulo 1.6,并希望通过 nodejs 中的 accumulo 代理客户端提供的 rowkey 删除一些记录。

但是当我尝试将相同的行键放入 deleteRows API 时,代理客户端会抛出“开始行必须小于结束行”

var rowId = "1";
var proxyClient = getAccumuloProxyClient();
proxyClient.deleteRows(getLogin(), TABLE_NAME, rowId, rowId, callback);

更新: 假设有一个表格如下所示:

rowID | columnFamily | columnQualifier
1        name           John
1        age            25
1        department     sales
2        name           Lisa
2        age            25  
2        department     sales

如果我想删除所有 rowID 等于 1 的行,我应该将哪些参数传递给 deleteRows 函数? 我尝试通过 1 开始和结束,但它抱怨

"org.apache.accumulo.core.client.AccumuloException: start row must be less than end row"

然后我尝试传递 start = 1end = 1\0 以确保 start 小于 end,但没有发生任何事情,没有抛出错误,没有删除行。 我认为由开始引起的是排除和结束是包含删除行。所以我对如何删除一条记录(哪些行具有相同的rowID)感到困惑。

【问题讨论】:

  • 您使用的 Accumulo 的具体版本是什么?
  • @elserj 我只使用 1.6.0
  • 我最初以为您可能会遇到 ACCUMULO-1994,但似乎没有给出 fixVersion
  • 你能提供'watchId'和'END_SIGN'在失败案例中的例子吗?我不知道任何会导致此失败的错误。我会检查您在 javascript 中提供的每个字符串的字节数。
  • 感谢@elserj 的回复,对于混淆的示例感到抱歉,请查看更新后的问题。谢谢!

标签: node.js proxy accumulo


【解决方案1】:

对于我的情况,使用 (char - 1 作为起始行解决了我的问题:

var startRowId = rowId.substring(0, rowId.length - 1) + String.fromCharCode(rowId.charCodeAt(rowId.length - 1) - 1);
proxyClient.deleteRows(getLogin(), TABLE_NAME, startRowId, rowId, callback);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多