Index: hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java (working copy)
@@ -237,27 +237,12 @@
public static long addContent(final HRegion r, final byte [] columnFamily, final byte[] column)
throws IOException {
- return addContent(r, columnFamily, column, true);
+ return addContent(r, columnFamily, column, false);
}
- /**
- * Add content to region r on the passed column
- * column.
- * Adds data of the from 'aaa', 'aab', etc where key and value are the same.
- * @param r
- * @param columnFamily
- * @param writeToWAL
- * @throws IOException
- * @return count of what we added.
- */
- public static long addContent(final HRegion r, final byte [] columnFamily, boolean writeToWAL)
- throws IOException {
- return addContent(r, columnFamily, null, writeToWAL);
- }
-
public static long addContent(final HRegion r, final byte [] columnFamily)
throws IOException {
- return addContent(r, columnFamily, null, true);
+ return addContent(r, columnFamily, null);
}
/**
@@ -275,19 +260,9 @@
return addContent(updater, columnFamily, START_KEY_BYTES, null, writeToWAL);
}
- public static long addContent(final Incommon updater,
- final String columnFamily) throws IOException {
- return addContent(updater, columnFamily, START_KEY_BYTES, null, true);
- }
-
public static long addContent(final Incommon updater, final String family,
- final String column, final boolean writeToWAL) throws IOException {
- return addContent(updater, family, column, START_KEY_BYTES, null, writeToWAL);
- }
-
- public static long addContent(final Incommon updater, final String family,
final String column) throws IOException {
- return addContent(updater, family, column, START_KEY_BYTES, null, true);
+ return addContent(updater, family, column, START_KEY_BYTES, null, false);
}
/**
@@ -317,7 +292,7 @@
public static long addContent(final Incommon updater, final String family, String column,
final byte [] startKeyBytes, final byte [] endKey) throws IOException {
- return addContent(updater, family, column, startKeyBytes, endKey, -1, true);
+ return addContent(updater, family, column, startKeyBytes, endKey, -1, false);
}
/**
@@ -409,13 +384,6 @@
return count;
}
- public static long addContent(final Incommon updater,
- final String columnFamily,
- final String column,
- final byte [] startKeyBytes, final byte [] endKey, final long ts) throws IOException {
- return addContent(updater, columnFamily, column, startKeyBytes, endKey, ts, true);
- }
-
/**
* Implementors can flushcache.
*/
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (working copy)
@@ -1630,6 +1630,17 @@
}
/**
+ * Load table with rows from 'aaa' to 'zzz'.
+ * @param t Table
+ * @param f Family
+ * @return Count of rows loaded.
+ * @throws IOException
+ */
+ public int loadTable(final HTable t, final byte[] f, boolean writeToWAL) throws IOException {
+ return loadTable(t, new byte[][] {f}, null, writeToWAL);
+ }
+
+ /**
* Load table of multiple column families with rows from 'aaa' to 'zzz'.
* @param t Table
* @param f Array of Families to load
@@ -1649,10 +1660,23 @@
* @throws IOException
*/
public int loadTable(final HTable t, final byte[][] f, byte[] value) throws IOException {
+ return loadTable(t, f, value, true);
+ }
+
+ /**
+ * Load table of multiple column families with rows from 'aaa' to 'zzz'.
+ * @param t Table
+ * @param f Array of Families to load
+ * @param value the values of the cells. If null is passed, the row key is used as value
+ * @return Count of rows loaded.
+ * @throws IOException
+ */
+ public int loadTable(final HTable t, final byte[][] f, byte[] value, boolean writeToWAL) throws IOException {
t.setAutoFlush(false);
int rowCount = 0;
for (byte[] row : HBaseTestingUtility.ROWS) {
Put put = new Put(row);
+ put.setDurability(writeToWAL ? Durability.USE_DEFAULT : Durability.SKIP_WAL);
for (int i = 0; i < f.length; i++) {
put.add(f[i], null, value != null ? value : row);
}
@@ -1727,6 +1751,19 @@
* @throws IOException
*/
public int loadRegion(final HRegion r, final byte[] f, final boolean flush)
+ throws IOException {
+ return loadRegion(r, f, flush, false);
+ }
+
+ /**
+ * Load region with rows from 'aaa' to 'zzz'.
+ * @param r Region
+ * @param f Family
+ * @param flush flush the cache if true
+ * @return Count of rows loaded.
+ * @throws IOException
+ */
+ public int loadRegion(final HRegion r, final byte[] f, final boolean flush, boolean writeToWAL)
throws IOException {
byte[] k = new byte[3];
int rowCount = 0;
@@ -1737,6 +1774,7 @@
k[1] = b2;
k[2] = b3;
Put put = new Put(k);
+ put.setDurability(writeToWAL ? Durability.USE_DEFAULT : Durability.SKIP_WAL);
put.add(f, null, k);
if (r.getLog() == null) put.setDurability(Durability.SKIP_WAL);
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java (working copy)
@@ -546,7 +546,7 @@
throws IOException, InterruptedException {
byte [] name = Bytes.toBytes("testFilterAcrossMutlipleRegions");
HTable t = TEST_UTIL.createTable(name, FAMILY);
- int rowCount = TEST_UTIL.loadTable(t, FAMILY);
+ int rowCount = TEST_UTIL.loadTable(t, FAMILY, false);
assertRowCount(t, rowCount);
// Split the table. Should split on a reasonable key; 'lqj'
Map regions = splitTable(t);
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java (working copy)
@@ -178,7 +178,7 @@
// put some stuff in the table
HTable table = new HTable(UTIL.getConfiguration(), TABLE_NAME);
- UTIL.loadTable(table, TEST_FAM);
+ UTIL.loadTable(table, TEST_FAM, false);
// get the name of all the regionservers hosting the snapshotted table
Set snapshotServers = new HashSet();
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java (working copy)
@@ -66,7 +66,7 @@
UTIL.startMiniCluster();
HTable table = UTIL.createTable(MULTI_REGION_TABLE_NAME, new byte[][] {INPUT_FAMILY, OUTPUT_FAMILY});
UTIL.createMultiRegions(table, INPUT_FAMILY);
- UTIL.loadTable(table, INPUT_FAMILY);
+ UTIL.loadTable(table, INPUT_FAMILY, false);
UTIL.startMiniMapReduceCluster();
}
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java (working copy)
@@ -79,7 +79,7 @@
// create and fill table
table = TEST_UTIL.createTable(TABLE_NAME, INPUT_FAMILY);
TEST_UTIL.createMultiRegions(table, INPUT_FAMILY);
- TEST_UTIL.loadTable(table, INPUT_FAMILY);
+ TEST_UTIL.loadTable(table, INPUT_FAMILY, false);
// start MR cluster
TEST_UTIL.startMiniMapReduceCluster();
}
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java (working copy)
@@ -77,7 +77,7 @@
HTable table =
UTIL.createTable(MULTI_REGION_TABLE_NAME, new byte[][] { INPUT_FAMILY, OUTPUT_FAMILY });
UTIL.createMultiRegions(table, INPUT_FAMILY);
- UTIL.loadTable(table, INPUT_FAMILY);
+ UTIL.loadTable(table, INPUT_FAMILY, false);
UTIL.startMiniMapReduceCluster();
}
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java (working copy)
@@ -68,7 +68,7 @@
HTable ht = TEST_UTIL.createTable(TABLENAME, FAMILYNAME);
assertTrue(m.assignmentManager.getZKTable().isEnabledTable(TABLENAME));
- TEST_UTIL.loadTable(ht, FAMILYNAME);
+ TEST_UTIL.loadTable(ht, FAMILYNAME, false);
ht.close();
List> tableRegions =
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java (working copy)
@@ -93,7 +93,7 @@
TableName.valueOf("TestSplit");
byte[] familyName = Bytes.toBytes("fam");
HTable ht = TEST_UTIL.createTable(tableName, familyName);
- TEST_UTIL.loadTable(ht, familyName);
+ TEST_UTIL.loadTable(ht, familyName, false);
ht.close();
HRegionServer server = TEST_UTIL.getHBaseCluster().getRegionServer(0);
byte []firstRow = Bytes.toBytes("aaa");
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java (working copy)
@@ -202,7 +202,7 @@
HTable table = new HTable(new Configuration(util.getConfiguration()), tableName);
// Load some data
- util.loadTable(table, fam);
+ util.loadTable(table, fam, false);
table.flushCommits();
util.flush();
util.countRows(table);
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java (working copy)
@@ -130,7 +130,7 @@
// Write some data to each region and flush. Repeat some number of times to
// get multiple files for each region.
for (int i = 0; i < FLUSHES; i++) {
- TEST_UTIL.loadTable(table, COLUMN_FAMILY);
+ TEST_UTIL.loadTable(table, COLUMN_FAMILY, false);
TEST_UTIL.flush();
}
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java (revision 1575631)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java (working copy)
@@ -389,7 +389,7 @@
cluster.getMaster().setCatalogJanitorEnabled(false);
try {
// Add a bit of load up into the table so splittable.
- TESTING_UTIL.loadTable(t, HConstants.CATALOG_FAMILY);
+ TESTING_UTIL.loadTable(t, HConstants.CATALOG_FAMILY, false);
// Get region pre-split.
HRegionServer server = cluster.getRegionServer(tableRegionIndex);
printOutRegions(server, "Initial regions: ");
@@ -462,7 +462,7 @@
cluster.getMaster().setCatalogJanitorEnabled(false);
try {
// Add a bit of load up into the table so splittable.
- TESTING_UTIL.loadTable(t, HConstants.CATALOG_FAMILY);
+ TESTING_UTIL.loadTable(t, HConstants.CATALOG_FAMILY, false);
// Get region pre-split.
HRegionServer server = cluster.getRegionServer(tableRegionIndex);
printOutRegions(server, "Initial regions: ");
@@ -691,7 +691,7 @@
"testMasterRestartWhenSplittingIsPartial", new UselessTestAbortable());
try {
// Add a bit of load up into the table so splittable.
- TESTING_UTIL.loadTable(t, HConstants.CATALOG_FAMILY);
+ TESTING_UTIL.loadTable(t, HConstants.CATALOG_FAMILY, false);
// Get region pre-split.
HRegionServer server = cluster.getRegionServer(tableRegionIndex);
printOutRegions(server, "Initial regions: ");
@@ -781,7 +781,7 @@
"testMasterRestartAtRegionSplitPendingCatalogJanitor", new UselessTestAbortable());
try {
// Add a bit of load up into the table so splittable.
- TESTING_UTIL.loadTable(t, HConstants.CATALOG_FAMILY);
+ TESTING_UTIL.loadTable(t, HConstants.CATALOG_FAMILY, false);
// Get region pre-split.
HRegionServer server = cluster.getRegionServer(tableRegionIndex);
printOutRegions(server, "Initial regions: ");