Repository: accumulo Updated Branches: refs/heads/1.5 19cd20998 -> cfb832a1f
ACCUMULO-3474 use the value of the delete flag (with test) Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/cfb832a1 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/cfb832a1 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/cfb832a1 Branch: refs/heads/1.5 Commit: cfb832a1f1d7fa975bd837fbdbdb152aba4cf050 Parents: 19cd209 Author: Eric C. Newton <eric.new...@gmail.com> Authored: Tue Jan 13 12:58:10 2015 -0500 Committer: Eric C. Newton <eric.new...@gmail.com> Committed: Tue Jan 13 12:58:10 2015 -0500 ---------------------------------------------------------------------- .../java/org/apache/accumulo/proxy/ProxyServer.java | 4 ++-- .../test/java/org/apache/accumulo/proxy/SimpleTest.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/cfb832a1/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java ---------------------------------------------------------------------- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java b/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java index 0fedb1d..f873010 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java @@ -1124,13 +1124,13 @@ public class ProxyServer implements AccumuloProxy.Iface { if (update.isSetValue()) value = update.getValue(); if (update.isSetTimestamp()) { - if (update.isSetDeleteCell()) { + if (update.isSetDeleteCell() && update.isDeleteCell()) { m.putDelete(update.getColFamily(), update.getColQualifier(), viz, update.getTimestamp()); } else { m.put(new Text(update.getColFamily()), new Text(update.getColQualifier()), viz, update.getTimestamp(), new Value(value)); } } else { - if (update.isSetDeleteCell()) { + if (update.isSetDeleteCell() && update.isDeleteCell()) { m.putDelete(new Text(update.getColFamily()), new Text(update.getColQualifier()), viz); } else { m.put(new Text(update.getColFamily()), new Text(update.getColQualifier()), viz, new Value(value)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/cfb832a1/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java ---------------------------------------------------------------------- diff --git a/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java b/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java index a1a3a9d..7f29402 100644 --- a/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java +++ b/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java @@ -687,7 +687,7 @@ public class SimpleTest { } catch (UnknownWriter uw) {} } - @Test(timeout = 10000) + @Test(timeout = 10 * 1000) public void testDelete() throws Exception { if (client.tableExists(creds, TABLE_TEST)) client.deleteTable(creds, TABLE_TEST); @@ -701,6 +701,16 @@ public class SimpleTest { assertEquals(1, entries.results.size()); ColumnUpdate upd = new ColumnUpdate(s2bb("cf"), s2bb("cq")); + upd.setDeleteCell(false); + Map<ByteBuffer,List<ColumnUpdate>> notDelete = Collections.singletonMap(s2bb("row0"), Collections.singletonList(upd)); + client.updateAndFlush(creds, TABLE_TEST, notDelete); + scanner = client.createScanner(creds, TABLE_TEST, null); + entries = client.nextK(scanner, 10); + client.closeScanner(scanner); + assertFalse(entries.more); + assertEquals(1, entries.results.size()); + + upd = new ColumnUpdate(s2bb("cf"), s2bb("cq")); upd.setDeleteCell(true); Map<ByteBuffer,List<ColumnUpdate>> delete = Collections.singletonMap(s2bb("row0"), Collections.singletonList(upd));