http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java index 05e1693..9374fdb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java @@ -91,7 +91,7 @@ public class TestCompactionWithThroughputController { for (int j = 0; j < 10; j++) { byte[] value = new byte[128 * 1024]; rand.nextBytes(value); - table.put(new Put(Bytes.toBytes(i * 10 + j)).add(family, qualifier, value)); + table.put(new Put(Bytes.toBytes(i * 10 + j)).addColumn(family, qualifier, value)); } admin.flush(tableName); } @@ -207,18 +207,21 @@ public class TestCompactionWithThroughputController { assertEquals(10L * 1024 * 1024, throughputController.maxThroughput, EPSILON); Table table = conn.getTable(tableName); for (int i = 0; i < 5; i++) { - table.put(new Put(Bytes.toBytes(i)).add(family, qualifier, new byte[0])); + byte[] value = new byte[0]; + table.put(new Put(Bytes.toBytes(i)).addColumn(family, qualifier, value)); TEST_UTIL.flush(tableName); } Thread.sleep(2000); assertEquals(15L * 1024 * 1024, throughputController.maxThroughput, EPSILON); - table.put(new Put(Bytes.toBytes(5)).add(family, qualifier, new byte[0])); + byte[] value1 = new byte[0]; + table.put(new Put(Bytes.toBytes(5)).addColumn(family, qualifier, value1)); TEST_UTIL.flush(tableName); Thread.sleep(2000); assertEquals(20L * 1024 * 1024, throughputController.maxThroughput, EPSILON); - table.put(new Put(Bytes.toBytes(6)).add(family, qualifier, new byte[0])); + byte[] value = new byte[0]; + table.put(new Put(Bytes.toBytes(6)).addColumn(family, qualifier, value)); TEST_UTIL.flush(tableName); Thread.sleep(2000); assertEquals(Double.MAX_VALUE, throughputController.maxThroughput, EPSILON); @@ -259,27 +262,35 @@ public class TestCompactionWithThroughputController { assertEquals(0.0, store.getCompactionPressure(), EPSILON); Table table = conn.getTable(tableName); for (int i = 0; i < 4; i++) { - table.put(new Put(Bytes.toBytes(i)).add(family, qualifier, new byte[0])); - table.put(new Put(Bytes.toBytes(100 + i)).add(family, qualifier, new byte[0])); + byte[] value1 = new byte[0]; + table.put(new Put(Bytes.toBytes(i)).addColumn(family, qualifier, value1)); + byte[] value = new byte[0]; + table.put(new Put(Bytes.toBytes(100 + i)).addColumn(family, qualifier, value)); TEST_UTIL.flush(tableName); } assertEquals(8, store.getStorefilesCount()); assertEquals(0.0, store.getCompactionPressure(), EPSILON); - table.put(new Put(Bytes.toBytes(4)).add(family, qualifier, new byte[0])); - table.put(new Put(Bytes.toBytes(104)).add(family, qualifier, new byte[0])); + byte[] value5 = new byte[0]; + table.put(new Put(Bytes.toBytes(4)).addColumn(family, qualifier, value5)); + byte[] value4 = new byte[0]; + table.put(new Put(Bytes.toBytes(104)).addColumn(family, qualifier, value4)); TEST_UTIL.flush(tableName); assertEquals(10, store.getStorefilesCount()); assertEquals(0.5, store.getCompactionPressure(), EPSILON); - table.put(new Put(Bytes.toBytes(5)).add(family, qualifier, new byte[0])); - table.put(new Put(Bytes.toBytes(105)).add(family, qualifier, new byte[0])); + byte[] value3 = new byte[0]; + table.put(new Put(Bytes.toBytes(5)).addColumn(family, qualifier, value3)); + byte[] value2 = new byte[0]; + table.put(new Put(Bytes.toBytes(105)).addColumn(family, qualifier, value2)); TEST_UTIL.flush(tableName); assertEquals(12, store.getStorefilesCount()); assertEquals(1.0, store.getCompactionPressure(), EPSILON); - table.put(new Put(Bytes.toBytes(6)).add(family, qualifier, new byte[0])); - table.put(new Put(Bytes.toBytes(106)).add(family, qualifier, new byte[0])); + byte[] value1 = new byte[0]; + table.put(new Put(Bytes.toBytes(6)).addColumn(family, qualifier, value1)); + byte[] value = new byte[0]; + table.put(new Put(Bytes.toBytes(106)).addColumn(family, qualifier, value)); TEST_UTIL.flush(tableName); assertEquals(14, store.getStorefilesCount()); assertEquals(2.0, store.getCompactionPressure(), EPSILON);
http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java index 72e4330..0662716 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java @@ -218,7 +218,7 @@ public class TestDurability { private Put newPut(Durability durability) { Put p = new Put(ROW); - p.add(FAMILY, COL, COL); + p.addColumn(FAMILY, COL, COL); if (durability != null) { p.setDurability(durability); } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java index 8106acf..9dccffe 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java @@ -145,13 +145,13 @@ public class TestLogRollAbort { FSUtils.isAppendSupported(TEST_UTIL.getConfiguration())); Put p = new Put(Bytes.toBytes("row2001")); - p.add(HConstants.CATALOG_FAMILY, Bytes.toBytes("col"), Bytes.toBytes(2001)); + p.addColumn(HConstants.CATALOG_FAMILY, Bytes.toBytes("col"), Bytes.toBytes(2001)); table.put(p); log.sync(); p = new Put(Bytes.toBytes("row2002")); - p.add(HConstants.CATALOG_FAMILY, Bytes.toBytes("col"), Bytes.toBytes(2002)); + p.addColumn(HConstants.CATALOG_FAMILY, Bytes.toBytes("col"), Bytes.toBytes(2002)); table.put(p); dfsCluster.restartDataNodes(); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollPeriod.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollPeriod.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollPeriod.java index 56d0139..f7e5ff7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollPeriod.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollPeriod.java @@ -108,7 +108,7 @@ public class TestLogRollPeriod { long row = 0; while (!interrupted()) { Put p = new Put(Bytes.toBytes(String.format("row%d", row))); - p.add(Bytes.toBytes(family), Bytes.toBytes("col"), Bytes.toBytes(row)); + p.addColumn(Bytes.toBytes(family), Bytes.toBytes("col"), Bytes.toBytes(row)); table.put(p); row++; http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java index a5d366b..3ab49c0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java @@ -268,11 +268,11 @@ public class TestLogRolling { for (int i = 0; i < 10; i++) { Put put = new Put(Bytes.toBytes("row" + String.format("%1$04d", (start + i)))); - put.add(HConstants.CATALOG_FAMILY, null, value); + put.addColumn(HConstants.CATALOG_FAMILY, null, value); table.put(put); } Put tmpPut = new Put(Bytes.toBytes("tmprow")); - tmpPut.add(HConstants.CATALOG_FAMILY, null, value); + tmpPut.addColumn(HConstants.CATALOG_FAMILY, null, value); long startTime = System.currentTimeMillis(); long remaining = timeout; while (remaining > 0) { @@ -631,7 +631,7 @@ public class TestLogRolling { private void doPut(Table table, int i) throws IOException { Put put = new Put(Bytes.toBytes("row" + String.format("%1$04d", i))); - put.add(HConstants.CATALOG_FAMILY, null, value); + put.addColumn(HConstants.CATALOG_FAMILY, null, value); table.put(put); } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java index 1c97a2d..549a018 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java @@ -177,7 +177,7 @@ public class TestWALReplay { TEST_UTIL.createTable(tableName, familys); Table htable = TEST_UTIL.getConnection().getTable(tableName); Put put = new Put(Bytes.toBytes("r1")); - put.add(family1, qualifier, value); + put.addColumn(family1, qualifier, value); htable.put(put); ResultScanner resultScanner = htable.getScanner(new Scan()); int count = 0; @@ -353,7 +353,7 @@ public class TestWALReplay { // Add an edit so something in the WAL byte [] row = tableName.getName(); - region.put((new Put(row)).add(family, family, family)); + region.put((new Put(row)).addColumn(family, family, family)); wal.sync(); final int rowsInsertedCount = 11; @@ -412,7 +412,7 @@ public class TestWALReplay { // Add an edit so something in the WAL byte [] row = tableName.getName(); byte [] family = htd.getFamilies().iterator().next().getName(); - region.put((new Put(row)).add(family, family, family)); + region.put((new Put(row)).addColumn(family, family, family)); wal.sync(); List <Pair<byte[],String>> hfs= new ArrayList<Pair<byte[],String>>(1); @@ -686,7 +686,7 @@ public class TestWALReplay { htd.getFamilies()); for (int i = 0; i < writtenRowCount; i++) { Put put = new Put(Bytes.toBytes(tableName + Integer.toString(i))); - put.add(families.get(i % families.size()).getName(), Bytes.toBytes("q"), + put.addColumn(families.get(i % families.size()).getName(), Bytes.toBytes("q"), Bytes.toBytes("val")); region.put(put); } @@ -712,7 +712,7 @@ public class TestWALReplay { int moreRow = 10; for (int i = writtenRowCount; i < writtenRowCount + moreRow; i++) { Put put = new Put(Bytes.toBytes(tableName + Integer.toString(i))); - put.add(families.get(i % families.size()).getName(), Bytes.toBytes("q"), + put.addColumn(families.get(i % families.size()).getName(), Bytes.toBytes("q"), Bytes.toBytes("val")); region.put(put); } @@ -1008,7 +1008,7 @@ public class TestWALReplay { for (int j = 0; j < count; j++) { byte[] qualifier = Bytes.toBytes(qualifierPrefix + Integer.toString(j)); Put p = new Put(rowName); - p.add(family, qualifier, ee.currentTime(), rowName); + p.addColumn(family, qualifier, ee.currentTime(), rowName); r.put(p); puts.add(p); } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java index c7ffe25..184fd14 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java @@ -195,7 +195,7 @@ public class TestMasterReplication { // cluster 0 putAndWait(row3, famName, htables[0], htables[1]); // now add a local edit to cluster 1 - htables[1].put(new Put(row4).add(famName, row4, row4)); + htables[1].put(new Put(row4).addColumn(famName, row4, row4)); // re-enable replication from cluster 2 to cluster 0 enablePeer("1", 2); // without HBASE-9158 the edit for row4 would have been marked with @@ -373,7 +373,7 @@ public class TestMasterReplication { private void putAndWait(byte[] row, byte[] fam, Table source, Table target) throws Exception { Put put = new Put(row); - put.add(fam, row, row); + put.addColumn(fam, row, row); source.put(put); wait(row, target, false); } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java index 9bd302e..82a0680 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java @@ -171,7 +171,7 @@ public class TestMultiSlaveReplication { checkRow(row3,1,htable3); Put p = new Put(row); - p.add(famName, row, row); + p.addColumn(famName, row, row); htable1.put(p); // now roll the logs again rollWALAndWait(utility1, htable1.getName(), row); @@ -299,7 +299,7 @@ public class TestMultiSlaveReplication { private void putAndWait(byte[] row, byte[] fam, Table source, Table... targets) throws Exception { Put put = new Put(row); - put.add(fam, row, row); + put.addColumn(fam, row, row); source.put(put); Get get = new Get(row); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java index 169feba..c9b20d5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java @@ -439,7 +439,7 @@ public class TestPerTableCFReplication { Table source, Table... targets) throws Exception { Put put = new Put(row); - put.add(fam, row, val); + put.addColumn(fam, row, val); source.put(put); Get get = new Get(row); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java index 4bb1842..ba2a7c1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java @@ -115,7 +115,7 @@ public class TestReplicationChangingPeerRegionservers extends TestReplicationBas private void doPutTest(byte[] row) throws IOException, InterruptedException { Put put = new Put(row); - put.add(famName, row, row); + put.addColumn(famName, row, row); if (htable1 == null) { htable1 = utility1.getConnection().getTable(tableName); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java index 3378c3f..06e1698 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java @@ -54,7 +54,7 @@ public class TestReplicationDisableInactivePeer extends TestReplicationBase { byte[] rowkey = Bytes.toBytes("disable inactive peer"); Put put = new Put(rowkey); - put.add(famName, row, row); + put.addColumn(famName, row, row); htable1.put(put); // wait for the sleep interval of the master cluster to become long http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEndpoint.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEndpoint.java index e247349..66adf70 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEndpoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEndpoint.java @@ -217,7 +217,7 @@ public class TestReplicationEndpoint extends TestReplicationBase { private void doPut(final Connection connection, final byte [] row) throws IOException { try (Table t = connection.getTable(tableName)) { Put put = new Put(row); - put.add(famName, row, row); + put.addColumn(famName, row, row); t.put(put); } } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java index 2dc3c89..7d51ef5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java @@ -123,15 +123,15 @@ public class TestReplicationSmallTests extends TestReplicationBase { long t = EnvironmentEdgeManager.currentTime(); // create three versions for "row" Put put = new Put(row); - put.add(famName, row, t, v1); + put.addColumn(famName, row, t, v1); htable1.put(put); put = new Put(row); - put.add(famName, row, t+1, v2); + put.addColumn(famName, row, t + 1, v2); htable1.put(put); put = new Put(row); - put.add(famName, row, t+2, v3); + put.addColumn(famName, row, t + 2, v3); htable1.put(put); Get get = new Get(row); @@ -203,7 +203,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { public void testSimplePutDelete() throws Exception { LOG.info("testSimplePutDelete"); Put put = new Put(row); - put.add(famName, row, row); + put.addColumn(famName, row, row); htable1 = utility1.getConnection().getTable(tableName); htable1.put(put); @@ -252,7 +252,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { List<Put> puts = new ArrayList<>(); for (int i = 0; i < NB_ROWS_IN_BATCH; i++) { Put put = new Put(Bytes.toBytes(i)); - put.add(famName, row, row); + put.addColumn(famName, row, row); puts.add(put); } htable1.put(puts); @@ -295,7 +295,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { byte[] rowkey = Bytes.toBytes("disable enable"); Put put = new Put(rowkey); - put.add(famName, row, row); + put.addColumn(famName, row, row); htable1.put(put); Get get = new Get(rowkey); @@ -338,7 +338,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { Thread.sleep(SLEEP_TIME); byte[] rowKey = Bytes.toBytes("Won't be replicated"); Put put = new Put(rowKey); - put.add(famName, row, row); + put.addColumn(famName, row, row); htable1.put(put); Get get = new Get(rowKey); @@ -359,7 +359,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { Thread.sleep(SLEEP_TIME); rowKey = Bytes.toBytes("do rep"); put = new Put(rowKey); - put.add(famName, row, row); + put.addColumn(famName, row, row); LOG.info("Adding new row"); htable1.put(put); @@ -391,7 +391,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { List<Put> puts = new ArrayList<Put>(); for (int i = 0; i < NB_ROWS_IN_BIG_BATCH; i++) { Put put = new Put(Bytes.toBytes(i)); - put.add(famName, row, row); + put.addColumn(famName, row, row); puts.add(put); } htable1.setWriteBufferSize(1024); @@ -472,8 +472,8 @@ public class TestReplicationSmallTests extends TestReplicationBase { for (Result result : rs) { put = new Put(result.getRow()); Cell firstVal = result.rawCells()[0]; - put.add(CellUtil.cloneFamily(firstVal), - CellUtil.cloneQualifier(firstVal), Bytes.toBytes("diff data")); + put.addColumn(CellUtil.cloneFamily(firstVal), CellUtil.cloneQualifier(firstVal), + Bytes.toBytes("diff data")); htable2.put(put); } Delete delete = new Delete(put.getRow()); @@ -579,7 +579,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { for (int i = 0; i < NB_ROWS_IN_BATCH; i++) { p = new Put(Bytes.toBytes("row" + i)); - p.add(famName, qualName, Bytes.toBytes("val" + i)); + p.addColumn(famName, qualName, Bytes.toBytes("val" + i)); htable1.put(p); } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java index 26acdab..13545b5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java @@ -225,21 +225,21 @@ public class TestReplicationSyncUpTool extends TestReplicationBase { // 100 + 1 row to t1_syncup for (int i = 0; i < NB_ROWS_IN_BATCH; i++) { p = new Put(Bytes.toBytes("row" + i)); - p.add(famName, qualName, Bytes.toBytes("val" + i)); + p.addColumn(famName, qualName, Bytes.toBytes("val" + i)); ht1Source.put(p); } p = new Put(Bytes.toBytes("row" + 9999)); - p.add(noRepfamName, qualName, Bytes.toBytes("val" + 9999)); + p.addColumn(noRepfamName, qualName, Bytes.toBytes("val" + 9999)); ht1Source.put(p); // 200 + 1 row to t2_syncup for (int i = 0; i < NB_ROWS_IN_BATCH * 2; i++) { p = new Put(Bytes.toBytes("row" + i)); - p.add(famName, qualName, Bytes.toBytes("val" + i)); + p.addColumn(famName, qualName, Bytes.toBytes("val" + i)); ht2Source.put(p); } p = new Put(Bytes.toBytes("row" + 9999)); - p.add(noRepfamName, qualName, Bytes.toBytes("val" + 9999)); + p.addColumn(noRepfamName, qualName, Bytes.toBytes("val" + 9999)); ht2Source.put(p); // ensure replication completed @@ -351,22 +351,22 @@ public class TestReplicationSyncUpTool extends TestReplicationBase { // we should see 100 + 2 rows now for (int i = 0; i < NB_ROWS_IN_BATCH; i++) { p = new Put(Bytes.toBytes("row" + i)); - p.add(famName, qualName, Bytes.toBytes("val" + i)); + p.addColumn(famName, qualName, Bytes.toBytes("val" + i)); ht1Source.put(p); } p = new Put(Bytes.toBytes("row" + 9998)); - p.add(noRepfamName, qualName, Bytes.toBytes("val" + 9998)); + p.addColumn(noRepfamName, qualName, Bytes.toBytes("val" + 9998)); ht1Source.put(p); // another 200 + 1 row to t1_syncup // we should see 200 + 2 rows now for (int i = 0; i < NB_ROWS_IN_BATCH * 2; i++) { p = new Put(Bytes.toBytes("row" + i)); - p.add(famName, qualName, Bytes.toBytes("val" + i)); + p.addColumn(famName, qualName, Bytes.toBytes("val" + i)); ht2Source.put(p); } p = new Put(Bytes.toBytes("row" + 9998)); - p.add(noRepfamName, qualName, Bytes.toBytes("val" + 9998)); + p.addColumn(noRepfamName, qualName, Bytes.toBytes("val" + 9998)); ht2Source.put(p); int rowCount_ht1Source = utility1.countRows(ht1Source); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWithTags.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWithTags.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWithTags.java index 7f5b59c..988373f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWithTags.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWithTags.java @@ -167,7 +167,7 @@ public class TestReplicationWithTags { LOG.info("testSimplePutDelete"); Put put = new Put(ROW); put.setAttribute("visibility", Bytes.toBytes("myTag3")); - put.add(FAMILY, ROW, ROW); + put.addColumn(FAMILY, ROW, ROW); htable1 = utility1.getConnection().getTable(TABLE_NAME); htable1.put(put); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java index 6b0534e..cf01463 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java @@ -115,8 +115,8 @@ public class TestAccessControlFilter extends SecureTestUtil { List<Put> puts = new ArrayList<Put>(100); for (int i=0; i<100; i++) { Put p = new Put(Bytes.toBytes(i)); - p.add(FAMILY, PRIVATE_COL, Bytes.toBytes("secret "+i)); - p.add(FAMILY, PUBLIC_COL, Bytes.toBytes("info "+i)); + p.addColumn(FAMILY, PRIVATE_COL, Bytes.toBytes("secret " + i)); + p.addColumn(FAMILY, PUBLIC_COL, Bytes.toBytes("info " + i)); puts.add(p); } table.put(puts); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java index 60d34ac..8d97915 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java @@ -920,7 +920,7 @@ public class TestAccessController extends SecureTestUtil { @Override public Object run() throws Exception { Put p = new Put(TEST_ROW); - p.add(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes(1)); + p.addColumn(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes(1)); try(Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(TEST_TABLE)) { t.put(p); @@ -984,7 +984,7 @@ public class TestAccessController extends SecureTestUtil { @Override public Object run() throws Exception { Put p = new Put(TEST_ROW); - p.add(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes(1)); + p.addColumn(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes(1)); try(Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(TEST_TABLE);) { t.checkAndPut(TEST_ROW, TEST_FAMILY, TEST_QUALIFIER, @@ -1122,7 +1122,7 @@ public class TestAccessController extends SecureTestUtil { byte[] row = TEST_ROW; byte[] qualifier = TEST_QUALIFIER; Put put = new Put(row); - put.add(TEST_FAMILY, qualifier, Bytes.toBytes(1)); + put.addColumn(TEST_FAMILY, qualifier, Bytes.toBytes(1)); Append append = new Append(row); append.add(TEST_FAMILY, qualifier, Bytes.toBytes(2)); try(Connection conn = ConnectionFactory.createConnection(conf); @@ -1251,8 +1251,8 @@ public class TestAccessController extends SecureTestUtil { @Override public Object run() throws Exception { Put p = new Put(Bytes.toBytes("a")); - p.add(family1, qualifier, Bytes.toBytes("v1")); - p.add(family2, qualifier, Bytes.toBytes("v2")); + p.addColumn(family1, qualifier, Bytes.toBytes("v1")); + p.addColumn(family2, qualifier, Bytes.toBytes("v2")); try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(tableName);) { @@ -1266,7 +1266,7 @@ public class TestAccessController extends SecureTestUtil { @Override public Object run() throws Exception { Put p = new Put(Bytes.toBytes("a")); - p.add(family1, qualifier, Bytes.toBytes("v1")); + p.addColumn(family1, qualifier, Bytes.toBytes("v1")); try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(tableName)) { @@ -1280,7 +1280,7 @@ public class TestAccessController extends SecureTestUtil { @Override public Object run() throws Exception { Put p = new Put(Bytes.toBytes("a")); - p.add(family2, qualifier, Bytes.toBytes("v2")); + p.addColumn(family2, qualifier, Bytes.toBytes("v2")); try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(tableName);) { t.put(p); @@ -1515,7 +1515,7 @@ public class TestAccessController extends SecureTestUtil { @Override public Object run() throws Exception { Put p = new Put(TEST_ROW); - p.add(family1, qualifier, Bytes.toBytes("v1")); + p.addColumn(family1, qualifier, Bytes.toBytes("v1")); try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(tableName)) { t.put(p); @@ -2145,7 +2145,7 @@ public class TestAccessController extends SecureTestUtil { @Override public Object run() throws Exception { Put put = new Put(Bytes.toBytes("test")); - put.add(TEST_FAMILY, Bytes.toBytes("qual"), Bytes.toBytes("value")); + put.addColumn(TEST_FAMILY, Bytes.toBytes("qual"), Bytes.toBytes("value")); table.put(put); return null; } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java index 7151c46..b939156 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java @@ -288,8 +288,8 @@ public class TestAccessController2 extends SecureTestUtil { try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(AccessControlLists.ACL_TABLE_NAME)) { - t.put(new Put(TEST_ROW).add(AccessControlLists.ACL_LIST_FAMILY, TEST_QUALIFIER, - TEST_VALUE)); + t.put(new Put(TEST_ROW).addColumn(AccessControlLists.ACL_LIST_FAMILY, + TEST_QUALIFIER, TEST_VALUE)); return null; } finally { } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLWithMultipleVersions.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLWithMultipleVersions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLWithMultipleVersions.java index a98bfc3..549db3c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLWithMultipleVersions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLWithMultipleVersions.java @@ -169,20 +169,20 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { Table t = connection.getTable(TEST_TABLE.getTableName())) { Put p; // with ro ACL - p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, ZERO); p.setACL(writePerms); t.put(p); // with ro ACL - p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, ZERO); p.setACL(readPerms); t.put(p); - p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, ZERO); p.setACL(writePerms); t.put(p); - p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, ZERO); p.setACL(readPerms); t.put(p); - p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, ZERO); p.setACL(writePerms); t.put(p); } @@ -228,13 +228,13 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { try(Connection connection = ConnectionFactory.createConnection(conf); Table t = connection.getTable(TEST_TABLE.getTableName())) { Put p; - p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, ZERO); p.setACL(writePerms); t.put(p); - p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, ZERO); p.setACL(readPerms); t.put(p); - p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, ZERO); p.setACL(writePerms); t.put(p); } @@ -275,15 +275,15 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { try (Table t = connection.getTable(TEST_TABLE.getTableName())) { // with rw ACL for "user1" Put p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, ZERO); - p.add(TEST_FAMILY1, TEST_Q2, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, ZERO); p.setACL(user1.getShortName(), new Permission(Permission.Action.READ, Permission.Action.WRITE)); t.put(p); // with rw ACL for "user1" p = new Put(TEST_ROW2); - p.add(TEST_FAMILY1, TEST_Q1, ZERO); - p.add(TEST_FAMILY1, TEST_Q2, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, ZERO); p.setACL(user1.getShortName(), new Permission(Permission.Action.READ, Permission.Action.WRITE)); t.put(p); @@ -300,8 +300,8 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { try (Table t = connection.getTable(TEST_TABLE.getTableName())) { // with rw ACL for "user1", "user2" and "@group" Put p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, ZERO); - p.add(TEST_FAMILY1, TEST_Q2, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, ZERO); Map<String, Permission> perms = prepareCellPermissions(new String[] { user1.getShortName(), user2.getShortName(), AuthUtil.toGroupEntry(GROUP) }, Action.READ, Action.WRITE); @@ -309,8 +309,8 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { t.put(p); // with rw ACL for "user1", "user2" and "@group" p = new Put(TEST_ROW2); - p.add(TEST_FAMILY1, TEST_Q1, ZERO); - p.add(TEST_FAMILY1, TEST_Q2, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, ZERO); p.setACL(perms); t.put(p); } @@ -391,17 +391,17 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { try (Connection connection = ConnectionFactory.createConnection(conf)) { try (Table t = connection.getTable(TEST_TABLE.getTableName())) { // Store a read write ACL without a timestamp, server will use current time - Put p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q2, ONE); + Put p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q2, ONE); Map<String, Permission> readAndWritePerms = prepareCellPermissions(usersAndGroups, Action.READ, Action.WRITE); p.setACL(readAndWritePerms); t.put(p); - p = new Put(TEST_ROW).add(TEST_FAMILY2, TEST_Q2, ONE); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY2, TEST_Q2, ONE); p.setACL(readAndWritePerms); t.put(p); LOG.info("Stored at current time"); // Store read only ACL at a future time - p = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, + p = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, EnvironmentEdgeManager.currentTime() + 1000000, ZERO); p.setACL(prepareCellPermissions(new String[]{ USER_OTHER.getShortName(), AuthUtil.toGroupEntry(GROUP)}, Action.READ)); @@ -484,8 +484,8 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { try (Table t = connection.getTable(TEST_TABLE.getTableName())) { // This version (TS = 123) with rw ACL for USER_OTHER and USER_OTHER2 Put p = new Put(TEST_ROW); - p.add(TEST_FAMILY1, TEST_Q1, 123L, ZERO); - p.add(TEST_FAMILY1, TEST_Q2, 123L, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, 123L, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, 123L, ZERO); p.setACL(prepareCellPermissions( new String[] { USER_OTHER.getShortName(), AuthUtil.toGroupEntry(GROUP), USER_OTHER2.getShortName() }, Permission.Action.READ, Permission.Action.WRITE)); @@ -493,8 +493,8 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { // This version (TS = 125) with rw ACL for USER_OTHER p = new Put(TEST_ROW); - p.add(TEST_FAMILY1, TEST_Q1, 125L, ONE); - p.add(TEST_FAMILY1, TEST_Q2, 125L, ONE); + p.addColumn(TEST_FAMILY1, TEST_Q1, 125L, ONE); + p.addColumn(TEST_FAMILY1, TEST_Q2, 125L, ONE); p.setACL(prepareCellPermissions( new String[] { USER_OTHER.getShortName(), AuthUtil.toGroupEntry(GROUP) }, Action.READ, Action.WRITE)); @@ -502,8 +502,8 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { // This version (TS = 127) with rw ACL for USER_OTHER p = new Put(TEST_ROW); - p.add(TEST_FAMILY1, TEST_Q1, 127L, TWO); - p.add(TEST_FAMILY1, TEST_Q2, 127L, TWO); + p.addColumn(TEST_FAMILY1, TEST_Q1, 127L, TWO); + p.addColumn(TEST_FAMILY1, TEST_Q2, 127L, TWO); p.setACL(prepareCellPermissions( new String[] { USER_OTHER.getShortName(), AuthUtil.toGroupEntry(GROUP) }, Action.READ, Action.WRITE)); @@ -570,36 +570,36 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { new String[] { user2.getShortName(), AuthUtil.toGroupEntry(GROUP), USER_OWNER.getShortName() }, Action.READ, Action.WRITE); Put p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 123, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 123, ZERO); p.setACL(permsU1andOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q2, 123, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, (long) 123, ZERO); p.setACL(permsU2andGUandOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY2, TEST_Q1, 123, ZERO); - p.add(TEST_FAMILY2, TEST_Q2, 123, ZERO); + p.addColumn(TEST_FAMILY2, TEST_Q1, (long) 123, ZERO); + p.addColumn(TEST_FAMILY2, TEST_Q2, (long) 123, ZERO); p.setACL(permsU2andGUandOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY2, TEST_Q1, 125, ZERO); - p.add(TEST_FAMILY2, TEST_Q2, 125, ZERO); + p.addColumn(TEST_FAMILY2, TEST_Q1, (long) 125, ZERO); + p.addColumn(TEST_FAMILY2, TEST_Q2, (long) 125, ZERO); p.setACL(permsU1andOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 127, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 127, ZERO); p.setACL(permsU2andGUandOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q2, 127, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, (long) 127, ZERO); p.setACL(permsU1andOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY2, TEST_Q1, 129, ZERO); - p.add(TEST_FAMILY2, TEST_Q2, 129, ZERO); + p.addColumn(TEST_FAMILY2, TEST_Q1, (long) 129, ZERO); + p.addColumn(TEST_FAMILY2, TEST_Q2, (long) 129, ZERO); p.setACL(permsU1andOwner); t.put(p); } @@ -676,20 +676,20 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { new String[] { user2.getShortName(), AuthUtil.toGroupEntry(GROUP), USER_OWNER.getShortName() }, Action.READ, Action.WRITE); Put p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 123, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 123, ZERO); p.setACL(permsU1andOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q2, 123, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, (long) 123, ZERO); p.setACL(permsU2andGUandOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 127, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 127, ZERO); p.setACL(permsU2andGUandOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q2, 127, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, (long) 127, ZERO); p.setACL(permsU1andOwner); t.put(p); } @@ -768,20 +768,20 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { permsU2andGUandOwner.put(USER_OWNER.getShortName(), new Permission(Permission.Action.READ, Permission.Action.WRITE)); Put p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 123, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 123, ZERO); p.setACL(permsU1andOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q2, 123, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, (long) 123, ZERO); p.setACL(permsU2andGUandOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 127, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 127, ZERO); p.setACL(permsU2andGUandOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q2, 127, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, (long) 127, ZERO); p.setACL(permsU1andOwner); t.put(p); } @@ -799,8 +799,8 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { try (Connection connection = ConnectionFactory.createConnection(conf)) { try (Table t = connection.getTable(TEST_TABLE.getTableName())) { Put p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 125, ZERO); - p.add(TEST_FAMILY1, TEST_Q2, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 125, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, ZERO); p.setACL(user2.getShortName(), new Permission(Permission.Action.READ, Permission.Action.WRITE)); t.put(p); @@ -864,26 +864,26 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { AuthUtil.toGroupEntry(GROUP) }, Action.READ, Action.WRITE); Put p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 120, ZERO); - p.add(TEST_FAMILY1, TEST_Q2, 120, ZERO); - p.add(TEST_FAMILY1, TEST_Q3, 120, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 120, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, (long) 120, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q3, (long) 120, ZERO); p.setACL(permsU1andU2andGUandOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 123, ZERO); - p.add(TEST_FAMILY1, TEST_Q2, 123, ZERO); - p.add(TEST_FAMILY1, TEST_Q3, 123, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 123, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, (long) 123, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q3, (long) 123, ZERO); p.setACL(permsU1andOwner); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q1, 127, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q1, (long) 127, ZERO); p.setACL(permsU1_U2andGU); t.put(p); p = new Put(TEST_ROW1); - p.add(TEST_FAMILY1, TEST_Q2, 127, ZERO); + p.addColumn(TEST_FAMILY1, TEST_Q2, (long) 127, ZERO); p.setACL(user2.getShortName(), new Permission(Permission.Action.READ)); t.put(p); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java index f73fcfd..7f1e720 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java @@ -161,17 +161,17 @@ public class TestCellACLs extends SecureTestUtil { Table t = connection.getTable(TEST_TABLE.getTableName())) { Put p; // with ro ACL - p = new Put(TEST_ROW).add(TEST_FAMILY, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY, TEST_Q1, ZERO); p.setACL(prepareCellPermissions(usersAndGroups, Action.READ)); t.put(p); // with rw ACL - p = new Put(TEST_ROW).add(TEST_FAMILY, TEST_Q2, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY, TEST_Q2, ZERO); p.setACL(prepareCellPermissions(usersAndGroups, Action.READ, Action.WRITE)); t.put(p); // no ACL p = new Put(TEST_ROW) - .add(TEST_FAMILY, TEST_Q3, ZERO) - .add(TEST_FAMILY, TEST_Q4, ZERO); + .addColumn(TEST_FAMILY, TEST_Q3, ZERO) + .addColumn(TEST_FAMILY, TEST_Q4, ZERO); t.put(p); } return null; @@ -401,7 +401,7 @@ public class TestCellACLs extends SecureTestUtil { try(Connection connection = ConnectionFactory.createConnection(conf); Table t = connection.getTable(TEST_TABLE.getTableName())) { Put p; - p = new Put(TEST_ROW).add(TEST_FAMILY, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY, TEST_Q1, ZERO); t.put(p); } return null; http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java index 06bc616..74105e1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java @@ -161,14 +161,14 @@ public class TestScanEarlyTermination extends SecureTestUtil { Connection connection = ConnectionFactory.createConnection(conf); Table t = connection.getTable(TEST_TABLE.getTableName()); try { - Put put = new Put(TEST_ROW).add(TEST_FAMILY1, TEST_Q1, ZERO); + Put put = new Put(TEST_ROW).addColumn(TEST_FAMILY1, TEST_Q1, ZERO); t.put(put); // Set a READ cell ACL for USER_OTHER on this value in FAMILY2 - put = new Put(TEST_ROW).add(TEST_FAMILY2, TEST_Q1, ZERO); + put = new Put(TEST_ROW).addColumn(TEST_FAMILY2, TEST_Q1, ZERO); put.setACL(USER_OTHER.getShortName(), new Permission(Action.READ)); t.put(put); // Set an empty cell ACL for USER_OTHER on this other value in FAMILY2 - put = new Put(TEST_ROW).add(TEST_FAMILY2, TEST_Q2, ZERO); + put = new Put(TEST_ROW).addColumn(TEST_FAMILY2, TEST_Q2, ZERO); put.setACL(USER_OTHER.getShortName(), new Permission()); t.put(put); } finally { http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java index 2934ad1..f7def51 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java @@ -289,9 +289,9 @@ public class TestTablePermissions { Table table = UTIL.getConnection().getTable(TEST_TABLE); table.put(new Put(Bytes.toBytes("row1")) - .add(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes("v1"))); + .addColumn(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes("v1"))); table.put(new Put(Bytes.toBytes("row2")) - .add(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes("v2"))); + .addColumn(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes("v2"))); Admin admin = UTIL.getHBaseAdmin(); admin.split(TEST_TABLE); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java index 880056f..4c6df38 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java @@ -1010,17 +1010,17 @@ public class TestWithDisabledAuthorization extends SecureTestUtil { Table t = connection.getTable(TEST_TABLE.getTableName())) { Put p; // with ro ACL - p = new Put(TEST_ROW).add(TEST_FAMILY, TEST_Q1, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY, TEST_Q1, ZERO); p.setACL(USER_NONE.getShortName(), new Permission(Action.READ)); t.put(p); // with rw ACL - p = new Put(TEST_ROW).add(TEST_FAMILY, TEST_Q2, ZERO); + p = new Put(TEST_ROW).addColumn(TEST_FAMILY, TEST_Q2, ZERO); p.setACL(USER_NONE.getShortName(), new Permission(Action.READ, Action.WRITE)); t.put(p); // no ACL p = new Put(TEST_ROW) - .add(TEST_FAMILY, TEST_Q3, ZERO) - .add(TEST_FAMILY, TEST_Q4, ZERO); + .addColumn(TEST_FAMILY, TEST_Q3, ZERO) + .addColumn(TEST_FAMILY, TEST_Q4, ZERO); t.put(p); } return null; http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestDefaultScanLabelGeneratorStack.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestDefaultScanLabelGeneratorStack.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestDefaultScanLabelGeneratorStack.java index 39b7f1b..9da2531 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestDefaultScanLabelGeneratorStack.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestDefaultScanLabelGeneratorStack.java @@ -106,15 +106,15 @@ public class TestDefaultScanLabelGeneratorStack { try (Connection connection = ConnectionFactory.createConnection(conf); Table table = TEST_UTIL.createTable(tableName, CF)) { Put put = new Put(ROW_1); - put.add(CF, Q1, HConstants.LATEST_TIMESTAMP, value1); + put.addColumn(CF, Q1, HConstants.LATEST_TIMESTAMP, value1); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); put = new Put(ROW_1); - put.add(CF, Q2, HConstants.LATEST_TIMESTAMP, value2); + put.addColumn(CF, Q2, HConstants.LATEST_TIMESTAMP, value2); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(ROW_1); - put.add(CF, Q3, HConstants.LATEST_TIMESTAMP, value3); + put.addColumn(CF, Q3, HConstants.LATEST_TIMESTAMP, value3); table.put(put); return null; } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestEnforcingScanLabelGenerator.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestEnforcingScanLabelGenerator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestEnforcingScanLabelGenerator.java index 45c8ef5..a0703fc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestEnforcingScanLabelGenerator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestEnforcingScanLabelGenerator.java @@ -103,15 +103,15 @@ public class TestEnforcingScanLabelGenerator { try (Connection connection = ConnectionFactory.createConnection(conf); Table table = TEST_UTIL.createTable(tableName, CF)) { Put put = new Put(ROW_1); - put.add(CF, Q1, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(CF, Q1, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); put = new Put(ROW_1); - put.add(CF, Q2, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(CF, Q2, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(ROW_1); - put.add(CF, Q3, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(CF, Q3, HConstants.LATEST_TIMESTAMP, value); table.put(put); return null; } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java index e885983..ab2bacc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java @@ -575,12 +575,12 @@ public abstract class TestVisibilityLabels { try (Table table = TEST_UTIL.createTable(tableName, fam)) { byte[] row1 = Bytes.toBytes("row1"); Put put = new Put(row1); - put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(SECRET + " & " + CONFIDENTIAL)); table.checkAndPut(row1, fam, qual, null, put); byte[] row2 = Bytes.toBytes("row2"); put = new Put(row2); - put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(SECRET)); table.checkAndPut(row2, fam, qual, null, put); @@ -602,7 +602,7 @@ public abstract class TestVisibilityLabels { byte[] row1 = Bytes.toBytes("row1"); byte[] val = Bytes.toBytes(1L); Put put = new Put(row1); - put.add(fam, qual, HConstants.LATEST_TIMESTAMP, val); + put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, val); put.setCellVisibility(new CellVisibility(SECRET + " & " + CONFIDENTIAL)); table.put(put); Get get = new Get(row1); @@ -628,7 +628,7 @@ public abstract class TestVisibilityLabels { byte[] row1 = Bytes.toBytes("row1"); byte[] val = Bytes.toBytes("a"); Put put = new Put(row1); - put.add(fam, qual, HConstants.LATEST_TIMESTAMP, val); + put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, val); put.setCellVisibility(new CellVisibility(SECRET + " & " + CONFIDENTIAL)); table.put(put); Get get = new Get(row1); @@ -708,32 +708,32 @@ public abstract class TestVisibilityLabels { TEST_UTIL.getHBaseAdmin().createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put put = new Put(r1); - put.add(fam, qual, 3l, v1); - put.add(fam, qual2, 3l, v1); - put.add(fam2, qual, 3l, v1); - put.add(fam2, qual2, 3l, v1); + put.addColumn(fam, qual, 3l, v1); + put.addColumn(fam, qual2, 3l, v1); + put.addColumn(fam2, qual, 3l, v1); + put.addColumn(fam2, qual2, 3l, v1); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); put = new Put(r1); - put.add(fam, qual, 4l, v2); - put.add(fam, qual2, 4l, v2); - put.add(fam2, qual, 4l, v2); - put.add(fam2, qual2, 4l, v2); + put.addColumn(fam, qual, 4l, v2); + put.addColumn(fam, qual2, 4l, v2); + put.addColumn(fam2, qual, 4l, v2); + put.addColumn(fam2, qual2, 4l, v2); put.setCellVisibility(new CellVisibility(PRIVATE)); table.put(put); put = new Put(r2); - put.add(fam, qual, 3l, v1); - put.add(fam, qual2, 3l, v1); - put.add(fam2, qual, 3l, v1); - put.add(fam2, qual2, 3l, v1); + put.addColumn(fam, qual, 3l, v1); + put.addColumn(fam, qual2, 3l, v1); + put.addColumn(fam2, qual, 3l, v1); + put.addColumn(fam2, qual2, 3l, v1); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); put = new Put(r2); - put.add(fam, qual, 4l, v2); - put.add(fam, qual2, 4l, v2); - put.add(fam2, qual, 4l, v2); - put.add(fam2, qual2, 4l, v2); + put.addColumn(fam, qual, 4l, v2); + put.addColumn(fam, qual2, 4l, v2); + put.addColumn(fam2, qual, 4l, v2); + put.addColumn(fam2, qual2, 4l, v2); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); @@ -792,11 +792,11 @@ public abstract class TestVisibilityLabels { TEST_UTIL.getHBaseAdmin().createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)){ Put p1 = new Put(row1); - p1.add(fam, qual, value); + p1.addColumn(fam, qual, value); p1.setCellVisibility(new CellVisibility(CONFIDENTIAL)); Put p2 = new Put(row1); - p2.add(fam, qual2, value); + p2.addColumn(fam, qual2, value); p2.setCellVisibility(new CellVisibility(SECRET)); RowMutations rm = new RowMutations(row1); @@ -828,11 +828,11 @@ public abstract class TestVisibilityLabels { TEST_UTIL.getHBaseAdmin().createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put p1 = new Put(row1); - p1.add(fam, qual, value); + p1.addColumn(fam, qual, value); p1.setCellVisibility(new CellVisibility(CONFIDENTIAL)); Put p2 = new Put(row1); - p2.add(fam, qual2, value); + p2.addColumn(fam, qual2, value); p2.setCellVisibility(new CellVisibility(SECRET)); RowMutations rm = new RowMutations(row1); @@ -856,7 +856,7 @@ public abstract class TestVisibilityLabels { List<Put> puts = new ArrayList<Put>(); for (int i = 0; i < labelExps.length; i++) { Put put = new Put(Bytes.toBytes("row" + (i+1))); - put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(labelExps[i])); puts.add(put); } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java index 7fa240e..00186c1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java @@ -381,7 +381,7 @@ public class TestVisibilityLabelsReplication { List<Put> puts = new ArrayList<Put>(); for (String labelExp : labelExps) { Put put = new Put(Bytes.toBytes("row" + i)); - put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(labelExp)); put.setAttribute(NON_VISIBILITY, Bytes.toBytes(TEMP)); puts.add(put); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java index a6192fc..f67296d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java @@ -318,7 +318,7 @@ public class TestVisibilityLabelsWithACL { List<Put> puts = new ArrayList<Put>(); for (String labelExp : labelExps) { Put put = new Put(Bytes.toBytes("row" + i)); - put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(labelExp)); puts.add(put); i++; http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDeletes.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDeletes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDeletes.java index 2e549b2..c67d869 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDeletes.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDeletes.java @@ -480,11 +480,11 @@ public class TestVisibilityLabelsWithDeletes { hBaseAdmin.createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, value); + put.addColumn(fam, qual, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, value); + put.addColumn(fam, qual, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); TEST_UTIL.getHBaseAdmin().flush(tableName); @@ -511,7 +511,7 @@ public class TestVisibilityLabelsWithDeletes { Result[] next = scanner.next(3); assertEquals(next.length, 1); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, value1); + put.addColumn(fam, qual, value1); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); actiona = new PrivilegedExceptionAction<Void>() { @@ -556,11 +556,11 @@ public class TestVisibilityLabelsWithDeletes { hBaseAdmin.createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, value); + put.addColumn(fam, qual, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, value); + put.addColumn(fam, qual, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); TEST_UTIL.getHBaseAdmin().flush(tableName); @@ -587,7 +587,7 @@ public class TestVisibilityLabelsWithDeletes { Result[] next = scanner.next(3); assertEquals(next.length, 1); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, value1); + put.addColumn(fam, qual, value1); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); actiona = new PrivilegedExceptionAction<Void>() { @@ -632,11 +632,11 @@ public class TestVisibilityLabelsWithDeletes { hBaseAdmin.createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 123l, value); + put.addColumn(fam, qual, 123l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 124l, value1); + put.addColumn(fam, qual, 124l, value1); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); PrivilegedExceptionAction<Void> actiona = new PrivilegedExceptionAction<Void>() { @@ -686,11 +686,11 @@ public class TestVisibilityLabelsWithDeletes { try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put put1 = new Put(Bytes.toBytes("row1")); - put1.add(fam, qual, 123l, value); + put1.addColumn(fam, qual, 123l, value); put1.setCellVisibility(new CellVisibility(CONFIDENTIAL)); Put put2 = new Put(Bytes.toBytes("row1")); - put2.add(fam, qual, 123l, value1); + put2.addColumn(fam, qual, 123l, value1); put2.setCellVisibility(new CellVisibility(SECRET)); table.put(createList(put1, put2)); @@ -861,36 +861,36 @@ public class TestVisibilityLabelsWithDeletes { List<Put> puts = new ArrayList<Put>(); Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 123l, value); + put.addColumn(fam, qual, 123l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 124l, value); + put.addColumn(fam, qual, 124l, value); put.setCellVisibility(new CellVisibility("(" + CONFIDENTIAL + "&" + PRIVATE + ")|(" + TOPSECRET + "&" + SECRET+")")); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 125l, value); + put.addColumn(fam, qual, 125l, value); put.setCellVisibility(new CellVisibility(SECRET + "&" + TOPSECRET)); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 126l, value); + put.addColumn(fam, qual, 126l, value); put.setCellVisibility(new CellVisibility("(" + CONFIDENTIAL + "&" + PRIVATE + ")|(" + TOPSECRET + "&" + SECRET+")")); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 127l, value); + put.addColumn(fam, qual, 127l, value); put.setCellVisibility(new CellVisibility("(" + CONFIDENTIAL + "&" + PRIVATE + ")|(" + TOPSECRET + "&" + SECRET+")")); puts.add(put); TEST_UTIL.getHBaseAdmin().flush(tableName); put = new Put(Bytes.toBytes("row2")); - put.add(fam, qual, 127l, value); + put.addColumn(fam, qual, 127l, value); put.setCellVisibility(new CellVisibility("(" + CONFIDENTIAL + "&" + PRIVATE + ")|(" + TOPSECRET + "&" + SECRET + ")")); puts.add(put); @@ -911,28 +911,28 @@ public class TestVisibilityLabelsWithDeletes { List<Put> puts = new ArrayList<>(); Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 123l, value); + put.addColumn(fam, qual, 123l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 124l, value); + put.addColumn(fam, qual, 124l, value); put.setCellVisibility(new CellVisibility("(" + CONFIDENTIAL + "&" + PRIVATE + ")|(" + TOPSECRET + "&" + SECRET+")")); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 125l, value); + put.addColumn(fam, qual, 125l, value); put.setCellVisibility(new CellVisibility(SECRET + "&" + TOPSECRET)); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual1, 126l, value); + put.addColumn(fam, qual1, 126l, value); put.setCellVisibility(new CellVisibility(SECRET + "&" + TOPSECRET)); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual2, 127l, value); + put.addColumn(fam, qual2, 127l, value); put.setCellVisibility(new CellVisibility("(" + CONFIDENTIAL + "&" + PRIVATE + ")|(" + TOPSECRET + "&" + SECRET+")")); puts.add(put); @@ -952,23 +952,23 @@ public class TestVisibilityLabelsWithDeletes { hBaseAdmin.createTable(desc); List<Put> puts = new ArrayList<>(); Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 123l, value); + put.addColumn(fam, qual, 123l, value); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 124l, value); + put.addColumn(fam, qual, 124l, value); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 125l, value); + put.addColumn(fam, qual, 125l, value); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 126l, value); + put.addColumn(fam, qual, 126l, value); puts.add(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 127l, value); + put.addColumn(fam, qual, 127l, value); puts.add(put); Table table = TEST_UTIL.getConnection().getTable(tableName); @@ -977,7 +977,7 @@ public class TestVisibilityLabelsWithDeletes { TEST_UTIL.getHBaseAdmin().flush(tableName); put = new Put(Bytes.toBytes("row2")); - put.add(fam, qual, 127l, value); + put.addColumn(fam, qual, 127l, value); table.put(put); return table; @@ -1116,7 +1116,7 @@ public class TestVisibilityLabelsWithDeletes { try (Table table = doPuts(tableName)) { TEST_UTIL.getHBaseAdmin().flush(tableName); Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 128l, value); + put.addColumn(fam, qual, 128l, value); put.setCellVisibility(new CellVisibility(TOPSECRET)); table.put(put); PrivilegedExceptionAction<Void> actiona = new PrivilegedExceptionAction<Void>() { @@ -1176,7 +1176,7 @@ public class TestVisibilityLabelsWithDeletes { current.getRowLength(), row2, 0, row2.length)); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 129l, value); + put.addColumn(fam, qual, 129l, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); @@ -1220,7 +1220,7 @@ public class TestVisibilityLabelsWithDeletes { SUPERUSER.runAs(actiona); TEST_UTIL.getHBaseAdmin().flush(tableName); Put put = new Put(Bytes.toBytes("row3")); - put.add(fam, qual, 127l, value); + put.addColumn(fam, qual, 127l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL + "&" + PRIVATE)); table.put(put); TEST_UTIL.getHBaseAdmin().flush(tableName); @@ -1380,11 +1380,11 @@ public class TestVisibilityLabelsWithDeletes { hBaseAdmin.createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual1, 125l, value); + put.addColumn(fam, qual1, 125l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual1, 126l, value); + put.addColumn(fam, qual1, 126l, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); TEST_UTIL.getHBaseAdmin().flush(tableName); @@ -1428,11 +1428,11 @@ public class TestVisibilityLabelsWithDeletes { hBaseAdmin.createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual1, 125l, value); + put.addColumn(fam, qual1, 125l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual1, 126l, value); + put.addColumn(fam, qual1, 126l, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); TEST_UTIL.getHBaseAdmin().flush(tableName); @@ -1647,7 +1647,7 @@ public class TestVisibilityLabelsWithDeletes { TEST_UTIL.getHBaseAdmin().flush(tableName); Put put = new Put(Bytes.toBytes("row3")); - put.add(fam, qual, 127l, value); + put.addColumn(fam, qual, 127l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL + "&" + PRIVATE)); table.put(put); TEST_UTIL.getHBaseAdmin().flush(tableName); @@ -2782,11 +2782,11 @@ public class TestVisibilityLabelsWithDeletes { hBaseAdmin.createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 123l, value); + put.addColumn(fam, qual, 123l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(Bytes.toBytes("row1")); - put.add(fam, qual, 124l, value); + put.addColumn(fam, qual, 124l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL + "|" + PRIVATE)); table.put(put); TEST_UTIL.getHBaseAdmin().flush(tableName); @@ -2941,7 +2941,7 @@ public class TestVisibilityLabelsWithDeletes { List<Put> puts = new ArrayList<Put>(); for (String labelExp : labelExps) { Put put = new Put(Bytes.toBytes("row" + i)); - put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(labelExp)); puts.add(put); table.put(put); @@ -2959,7 +2959,7 @@ public class TestVisibilityLabelsWithDeletes { List<Put> puts = new ArrayList<Put>(); for (String labelExp : labelExps) { Put put = new Put(Bytes.toBytes("row" + i)); - put.add(fam, qual, timestamp[i - 1], value); + put.addColumn(fam, qual, timestamp[i - 1], value); put.setCellVisibility(new CellVisibility(labelExp)); puts.add(put); table.put(put); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithSLGStack.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithSLGStack.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithSLGStack.java index c48b4c4..b6a1c6d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithSLGStack.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithSLGStack.java @@ -86,11 +86,11 @@ public class TestVisibilityLabelsWithSLGStack { TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = TEST_UTIL.createTable(tableName, CF)) { Put put = new Put(ROW_1); - put.add(CF, Q1, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(CF, Q1, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); put = new Put(ROW_1); - put.add(CF, Q2, HConstants.LATEST_TIMESTAMP, value); + put.addColumn(CF, Q2, HConstants.LATEST_TIMESTAMP, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLablesWithGroups.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLablesWithGroups.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLablesWithGroups.java index 6c1a47b..1410c78 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLablesWithGroups.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLablesWithGroups.java @@ -120,15 +120,15 @@ public class TestVisibilityLablesWithGroups { try (Connection connection = ConnectionFactory.createConnection(conf); Table table = connection.getTable(tableName)) { Put put = new Put(ROW_1); - put.add(CF, Q1, HConstants.LATEST_TIMESTAMP, value1); + put.addColumn(CF, Q1, HConstants.LATEST_TIMESTAMP, value1); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); put = new Put(ROW_1); - put.add(CF, Q2, HConstants.LATEST_TIMESTAMP, value2); + put.addColumn(CF, Q2, HConstants.LATEST_TIMESTAMP, value2); put.setCellVisibility(new CellVisibility(CONFIDENTIAL)); table.put(put); put = new Put(ROW_1); - put.add(CF, Q3, HConstants.LATEST_TIMESTAMP, value3); + put.addColumn(CF, Q3, HConstants.LATEST_TIMESTAMP, value3); table.put(put); } return null; http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java index 0b0d9d0..96203b5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java @@ -137,7 +137,7 @@ public class TestVisibilityWithCheckAuths { Table table = connection.getTable(tableName)) { Put p = new Put(row1); p.setCellVisibility(new CellVisibility(PUBLIC + "&" + TOPSECRET)); - p.add(fam, qual, 125l, value); + p.addColumn(fam, qual, 125l, value); table.put(p); Assert.fail("Testcase should fail with AccesDeniedException"); } catch (Throwable t) { @@ -177,7 +177,7 @@ public class TestVisibilityWithCheckAuths { try (Connection connection = ConnectionFactory.createConnection(conf); Table table = connection.getTable(tableName)) { Put put = new Put(row1); - put.add(fam, qual, HConstants.LATEST_TIMESTAMP, val); + put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, val); put.setCellVisibility(new CellVisibility(TOPSECRET)); table.put(put); } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java index 8a22f37..39c8f21 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java @@ -710,7 +710,7 @@ public class SnapshotTestingUtils { Put put = new Put(key); put.setDurability(Durability.SKIP_WAL); for (byte[] family: families) { - put.add(family, q, value); + put.addColumn(family, q, value); } return put; } http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/trace/TestHTraceHooks.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/trace/TestHTraceHooks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/trace/TestHTraceHooks.java index 9167c7d..205f1d8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/trace/TestHTraceHooks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/trace/TestHTraceHooks.java @@ -42,7 +42,6 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; - @Category({MiscTests.class, MediumTests.class}) public class TestHTraceHooks { @@ -117,7 +116,7 @@ public class TestHTraceHooks { assertTrue(spans.size() > 5); Put put = new Put("row".getBytes()); - put.add(FAMILY_BYTES, "col".getBytes(), "value".getBytes()); + put.addColumn(FAMILY_BYTES, "col".getBytes(), "value".getBytes()); TraceScope putSpan = Trace.startSpan("doing put", Sampler.ALWAYS); try { http://git-wip-us.apache.org/repos/asf/hbase/blob/de9555ce/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java index 8e8bb41..e91d0e1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java @@ -90,7 +90,6 @@ import org.apache.hadoop.hbase.util.HBaseFsck.ErrorReporter.ERROR_CODE; import org.apache.hadoop.hbase.util.HBaseFsck.HbckInfo; import org.apache.hadoop.hbase.util.HBaseFsck.TableInfo; import org.apache.hadoop.hbase.util.hbck.HFileCorruptionChecker; -import org.apache.hadoop.hbase.util.hbck.HbckTestingUtil; import org.apache.zookeeper.KeeperException; import org.junit.Assert; import org.junit.Before; @@ -98,7 +97,6 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.rules.TestName; - /** * This is the base class for HBaseFsck's ability to detect reasons for inconsistent tables. * @@ -313,7 +311,7 @@ public class BaseTestHBaseFsck { List<Put> puts = new ArrayList<Put>(); for (byte[] row : ROWKEYS) { Put p = new Put(row); - p.add(FAM, Bytes.toBytes("val"), row); + p.addColumn(FAM, Bytes.toBytes("val"), row); puts.add(p); } tbl.put(puts); @@ -468,7 +466,7 @@ public class BaseTestHBaseFsck { tbl = connection.getTable(desc.getTableName()); for (int i = 0; i < 5; i++) { Put p1 = new Put(("r" + i).getBytes()); - p1.add(Bytes.toBytes("f"), "q1".getBytes(), "v".getBytes()); + p1.addColumn(Bytes.toBytes("f"), "q1".getBytes(), "v".getBytes()); tbl.put(p1); } admin.flush(desc.getTableName());