Index: hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java (revision 1577407)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java (working copy)
@@ -31,7 +31,6 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.HBaseTestCase.HRegionIncommon;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Durability;
import org.apache.hadoop.hbase.client.Get;
@@ -218,12 +217,10 @@
* @param r
* @param columnFamily
* @param column
- * @param writeToWAL
* @throws IOException
* @return count of what we added.
*/
- public static long addContent(final HRegion r, final byte [] columnFamily, final byte[] column,
- boolean writeToWAL)
+ public static long addContent(final HRegion r, final byte [] columnFamily, final byte[] column)
throws IOException {
byte [] startKey = r.getRegionInfo().getStartKey();
byte [] endKey = r.getRegionInfo().getEndKey();
@@ -232,32 +229,12 @@
startKeyBytes = START_KEY_BYTES;
}
return addContent(new HRegionIncommon(r), Bytes.toString(columnFamily), Bytes.toString(column),
- startKeyBytes, endKey, -1, writeToWAL);
+ startKeyBytes, endKey, -1);
}
- public static long addContent(final HRegion r, final byte [] columnFamily, final byte[] column)
- throws IOException {
- return addContent(r, columnFamily, column, true);
- }
-
- /**
- * 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);
}
/**
@@ -271,23 +248,13 @@
* @return count of what we added.
*/
public static long addContent(final Incommon updater,
- final String columnFamily, final boolean writeToWAL) throws IOException {
- 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);
+ return addContent(updater, columnFamily, START_KEY_BYTES, null);
}
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);
}
/**
@@ -303,21 +270,14 @@
* @throws IOException
*/
public static long addContent(final Incommon updater, final String columnFamily,
- final byte [] startKeyBytes, final byte [] endKey, final boolean writeToWAL)
+ final byte [] startKeyBytes, final byte [] endKey)
throws IOException {
- return addContent(updater, columnFamily, null, startKeyBytes, endKey, -1, writeToWAL);
+ return addContent(updater, columnFamily, null, startKeyBytes, endKey, -1);
}
- public static long addContent(final Incommon updater, final String family,
- final String column, final byte [] startKeyBytes,
- final byte [] endKey,
- final boolean writeToWAL) throws IOException {
- return addContent(updater, family, column, startKeyBytes, endKey, -1, writeToWAL);
- }
-
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);
}
/**
@@ -336,8 +296,7 @@
public static long addContent(final Incommon updater,
final String columnFamily,
final String column,
- final byte [] startKeyBytes, final byte [] endKey, final long ts,
- final boolean writeToWAL)
+ final byte [] startKeyBytes, final byte [] endKey, final long ts)
throws IOException {
long count = 0;
// Add rows of three characters. The first character starts with the
@@ -383,7 +342,7 @@
} else {
put.add(split[0], split[1], t);
}
- put.setDurability(writeToWAL ? Durability.USE_DEFAULT : Durability.SKIP_WAL);
+ put.setDurability(Durability.SKIP_WAL);
updater.put(put);
count++;
} catch (RuntimeException ex) {
@@ -409,13 +368,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.
*/
@@ -586,7 +538,6 @@
scanner.close();
}
- @SuppressWarnings("unchecked")
public Iterator iterator() {
return scanner.iterator();
}
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (revision 1577407)
+++ 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);
}
@@ -1737,6 +1761,7 @@
k[1] = b2;
k[2] = b3;
Put put = new Put(k);
+ put.setDurability(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 1577407)
+++ 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 1577407)
+++ 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 1577407)
+++ 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 1577407)
+++ 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 1577407)
+++ 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 1577407)
+++ 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/TestCompaction.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java (revision 1577407)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java (working copy)
@@ -146,7 +146,7 @@
for (int j = 0; j < jmax; j++) {
p.add(COLUMN_FAMILY, Bytes.toBytes(j), pad);
}
- HBaseTestCase.addContent(loader, Bytes.toString(COLUMN_FAMILY), false);
+ HBaseTestCase.addContent(loader, Bytes.toString(COLUMN_FAMILY));
loader.put(p);
loader.flushcache();
}
@@ -223,7 +223,7 @@
private void createStoreFile(final HRegion region, String family) throws IOException {
HRegionIncommon loader = new HRegionIncommon(region);
- HBaseTestCase.addContent(loader, family, false);
+ HBaseTestCase.addContent(loader, family);
loader.flushcache();
}
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 1577407)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java (working copy)
@@ -99,7 +99,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 1577407)
+++ 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/TestMajorCompaction.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java (revision 1577407)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java (working copy)
@@ -199,7 +199,7 @@
createStoreFile(r);
}
// Add more content.
- HBaseTestCase.addContent(new HRegionIncommon(r), Bytes.toString(COLUMN_FAMILY), false);
+ HBaseTestCase.addContent(new HRegionIncommon(r), Bytes.toString(COLUMN_FAMILY));
// Now there are about 5 versions of each column.
// Default is that there only 3 (MAXVERSIONS) versions allowed per column.
@@ -390,7 +390,7 @@
private void createStoreFile(final HRegion region, String family) throws IOException {
HRegionIncommon loader = new HRegionIncommon(region);
- HBaseTestCase.addContent(loader, family, false);
+ HBaseTestCase.addContent(loader, family);
loader.flushcache();
}
@@ -397,7 +397,7 @@
private void createSmallerStoreFile(final HRegion region) throws IOException {
HRegionIncommon loader = new HRegionIncommon(region);
HBaseTestCase.addContent(loader, Bytes.toString(COLUMN_FAMILY), ("" +
- "bbb").getBytes(), null, false);
+ "bbb").getBytes(), null);
loader.flushcache();
}
Index: hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java
===================================================================
--- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java (revision 1577407)
+++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java (working copy)
@@ -164,13 +164,13 @@
HRegionIncommon loader = new HRegionIncommon(r);
for (int i = 0; i < compactionThreshold + 1; i++) {
HBaseTestCase.addContent(loader, Bytes.toString(fam1), Bytes.toString(col1), firstRowBytes,
- thirdRowBytes, i, false);
+ thirdRowBytes, i);
HBaseTestCase.addContent(loader, Bytes.toString(fam1), Bytes.toString(col2), firstRowBytes,
- thirdRowBytes, i, false);
+ thirdRowBytes, i);
HBaseTestCase.addContent(loader, Bytes.toString(fam2), Bytes.toString(col1), firstRowBytes,
- thirdRowBytes, i, false);
+ thirdRowBytes, i);
HBaseTestCase.addContent(loader, Bytes.toString(fam2), Bytes.toString(col2), firstRowBytes,
- thirdRowBytes, i, false);
+ thirdRowBytes, i);
r.flushcache();
}
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 1577407)
+++ 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 1577407)
+++ 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: ");