hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Rawson <ryano...@gmail.com>
Subject Re: Delete issue in HBase 0.20 alpha
Date Thu, 09 Jul 2009 21:51:47 GMT
Can you try with the latest trunk? Many bugs, including delete bugs, were
fixed.

On Jul 9, 2009 2:43 PM, "Bryan Keller" <bryanck@gmail.com> wrote:

I am having an issue after deleting a row in the HBase 0.20 alpha. After
deleting the row using the Delete object, I cannot put a row back that uses
the same key as the deleted row. No exceptions occur in my code.
E.g.

HBaseConfiguration config = new HBaseConfiguration();

HTable table = new HTable(config, "myTable");


Put p = new Put(Bytes.toBytes("myRow"));

p.add(Bytes.toBytes("contents"), Bytes.toBytes("id"), Bytes.toBytes(1L));

table.put(p);


Get g = new Get(Bytes.toBytes("myRow"));

Result r = table.get(g);

byte[] valueBytes = r.getValue(Bytes.toBytes("contents"), Bytes.toBytes("id"
));

long value = Bytes.toLong(valueBytes);

System.out.println("GET: " + value); //shows "GET: 1"


Delete d = new Delete(Bytes.toBytes("myRow"));

table.delete(d);


Put p = new Put(Bytes.toBytes("myRow"));

p.add(Bytes.toBytes("contents"), Bytes.toBytes("id"), Bytes.toBytes(1L));

table.put(p);

Get g = new Get(Bytes.toBytes("myRow"));

Result r = table.get(g);

byte[] valueBytes = r.getValue(Bytes.toBytes("contents"), Bytes.toBytes("id"
));

long value = Bytes.toLong(valueBytes);

System.out.println("GET: " + value); //shows "GET: -1", expected "GET: 1"

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message