Can you try with the latest trunk? Many bugs, including delete bugs, were
fixed.

On Jul 9, 2009 2:43 PM, "Bryan Keller" <brya...@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"

Reply via email to