You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by li...@apache.org on 2014/03/12 22:17:20 UTC
svn commit: r1576909 [16/18] - in /hbase/branches/0.89-fb/src: ./
examples/thrift/ main/java/org/apache/hadoop/hbase/
main/java/org/apache/hadoop/hbase/avro/
main/java/org/apache/hadoop/hbase/avro/generated/
main/java/org/apache/hadoop/hbase/client/ ma...
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java Wed Mar 12 21:17:13 2014
@@ -228,7 +228,7 @@ public class TestTimestampsFilter {
private void testWithVersionDeletes(boolean flushTables) throws IOException {
byte [] TABLE = Bytes.toBytes("testWithVersionDeletes_" +
- (flushTables ? "flush" : "noflush"));
+ (flushTables ? "flush" : "noflush"));
byte [] FAMILY = Bytes.toBytes("event_log");
byte [][] FAMILIES = new byte[][] { FAMILY };
@@ -465,3 +465,4 @@ public class TestTimestampsFilter {
assertTrue(results.isEmpty());
}
}
+
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java Wed Mar 12 21:17:13 2014
@@ -289,8 +289,9 @@ public class TestFilter extends HBaseTes
final int pageSize = 4;
Scan s = new Scan();
- WhileMatchFilter filter = new WhileMatchFilter(new PageFilter(pageSize));
+ Filter filter = new WhileMatchFilter(new PageFilter(pageSize));
s.setFilter(filter);
+ filter = s.getFilter();
InternalScanner scanner = this.region.getScanner(s);
int scannerCounter = 0;
@@ -320,8 +321,9 @@ public class TestFilter extends HBaseTes
public void testWhileMatchFilterWithFilterRowKey() throws Exception {
Scan s = new Scan();
String prefix = "testRowOne";
- WhileMatchFilter filter = new WhileMatchFilter(new PrefixFilter(Bytes.toBytes(prefix)));
+ Filter filter = new WhileMatchFilter(new PrefixFilter(Bytes.toBytes(prefix)));
s.setFilter(filter);
+ filter = s.getFilter();
InternalScanner scanner = this.region.getScanner(s);
while (true) {
@@ -347,10 +349,11 @@ public class TestFilter extends HBaseTes
*/
public void testWhileMatchFilterWithFilterKeyValue() throws Exception {
Scan s = new Scan();
- WhileMatchFilter filter = new WhileMatchFilter(
+ Filter filter = new WhileMatchFilter(
new SingleColumnValueFilter(FAMILIES[0], QUALIFIERS_ONE[0], CompareOp.EQUAL, Bytes.toBytes("foo"))
);
s.setFilter(filter);
+ filter = s.getFilter();
InternalScanner scanner = this.region.getScanner(s);
while (true) {
@@ -1129,7 +1132,7 @@ public class TestFilter extends HBaseTes
assertFalse("Should not have returned whole value",
Bytes.equals(kv.getValue(), kvs[idx].getValue()));
if (useLen) {
- assertEquals("Value in result is not SIZEOF_INT",
+ assertEquals("Value in result is not SIZEOF_INT",
kv.getValue().length, Bytes.SIZEOF_INT);
LOG.info("idx = " + idx + ", len=" + kvs[idx].getValueLength()
+ ", actual=" + Bytes.toInt(kv.getValue()));
@@ -1137,7 +1140,7 @@ public class TestFilter extends HBaseTes
kvs[idx].getValueLength(), Bytes.toInt(kv.getValue()) );
LOG.info("good");
} else {
- assertEquals("Value in result is not empty",
+ assertEquals("Value in result is not empty",
kv.getValue().length, 0);
}
idx++;
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockCacheColumnFamilySummary.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockCacheColumnFamilySummary.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockCacheColumnFamilySummary.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockCacheColumnFamilySummary.java Wed Mar 12 21:17:13 2014
@@ -30,13 +30,13 @@ import org.junit.Test;
/**
* Tests the BlockCacheColumnFamilySummary class
- *
+ *
*/
public class TestBlockCacheColumnFamilySummary {
/**
- *
+ *
*/
@Test
public void testEquals() {
@@ -44,7 +44,7 @@ public class TestBlockCacheColumnFamilyS
BlockCacheColumnFamilySummary e1 = new BlockCacheColumnFamilySummary();
e1.setTable("table1");
e1.setColumnFamily("cf1");
-
+
BlockCacheColumnFamilySummary e2 = new BlockCacheColumnFamilySummary();
e2.setTable("table1");
e2.setColumnFamily("cf1");
@@ -53,7 +53,7 @@ public class TestBlockCacheColumnFamilyS
}
/**
- *
+ *
*/
@Test
public void testNotEquals() {
@@ -61,7 +61,7 @@ public class TestBlockCacheColumnFamilyS
BlockCacheColumnFamilySummary e1 = new BlockCacheColumnFamilySummary();
e1.setTable("table1");
e1.setColumnFamily("cf1");
-
+
BlockCacheColumnFamilySummary e2 = new BlockCacheColumnFamilySummary();
e2.setTable("tablexxxxxx");
e2.setColumnFamily("cf1");
@@ -70,12 +70,12 @@ public class TestBlockCacheColumnFamilyS
}
/**
- *
+ *
*/
@Test
public void testMapLookup() {
-
- Map<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary> bcs =
+
+ Map<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary> bcs =
new HashMap<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary>();
BlockCacheColumnFamilySummary e1 = new BlockCacheColumnFamilySummary("table1","cf1");
@@ -97,23 +97,23 @@ public class TestBlockCacheColumnFamilyS
}
/**
- *
+ *
*/
@Test
public void testMapEntry() {
-
- Map<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary> bcs =
+
+ Map<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary> bcs =
new HashMap<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary>();
BlockCacheColumnFamilySummary e1 = new BlockCacheColumnFamilySummary("table1","cf1");
bcs.put(e1, e1);
-
+
BlockCacheColumnFamilySummary e2 = new BlockCacheColumnFamilySummary("table1","cf1");
bcs.put(e2, e2);
-
+
BlockCacheColumnFamilySummary e3 = new BlockCacheColumnFamilySummary("table1","cf1");
bcs.put(e3, e3);
-
+
assertEquals("mapSize",1,bcs.size());
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java Wed Mar 12 21:17:13 2014
@@ -314,7 +314,7 @@ public class TestCacheOnWrite {
final String cf = "myCF";
final byte[] cfBytes = Bytes.toBytes(cf);
final int maxVersions = 3;
- HRegion region = TEST_UTIL.createTestRegion(table,
+ HRegion region = TEST_UTIL.createTestRegion(table,
new HColumnDescriptor(cf)
.setCompressionType(compress)
.setBloomFilterType(BLOOM_TYPE)
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCachedBlockQueue.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCachedBlockQueue.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCachedBlockQueue.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCachedBlockQueue.java Wed Mar 12 21:17:13 2014
@@ -61,7 +61,7 @@ public class TestCachedBlockQueue extend
assertEquals(queue.heapSize(), expectedSize);
for (int i = 1; i <= 8; i++) {
- assertEquals(queue.pollLast().getCacheKey().getHfileName(), "cb"+i);
+ assertEquals(queue.pollLast().getCacheKey().getHfileName(), "cb"+i);
}
}
@@ -106,7 +106,7 @@ public class TestCachedBlockQueue extend
assertEquals(queue.heapSize(), expectedSize);
for (int i = 0; i <= 8; i++) {
- assertEquals(queue.pollLast().getCacheKey().getHfileName(), "cb"+i);
+ assertEquals(queue.pollLast().getCacheKey().getHfileName(), "cb"+i);
}
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestFixedFileTrailer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestFixedFileTrailer.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestFixedFileTrailer.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestFixedFileTrailer.java Wed Mar 12 21:17:13 2014
@@ -144,7 +144,7 @@ public class TestFixedFileTrailer {
String cleanMsg = msg.replaceAll(
"^(java(\\.[a-zA-Z]+)+:\\s+)?|\\s+\\(.*\\)\\s*$", "");
assertEquals("Actual exception message is \"" + msg + "\".\n" +
- "Cleaned-up message", // will be followed by " expected: ..."
+ "Cleaned-up message", // will be followed by " expected: ..."
"Invalid HFile version: " + invalidVersion, cleanMsg);
LOG.info("Got an expected exception: " + msg);
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestForceCacheImportantBlocks.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestForceCacheImportantBlocks.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestForceCacheImportantBlocks.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestForceCacheImportantBlocks.java Wed Mar 12 21:17:13 2014
@@ -66,7 +66,7 @@ public class TestForceCacheImportantBloc
/** Extremely small block size, so that we can get some index blocks */
private static final int BLOCK_SIZE = 256;
-
+
private static final Algorithm COMPRESSION_ALGORITHM =
Compression.Algorithm.GZ;
private static final BloomType BLOOM_TYPE = BloomType.ROW;
@@ -168,3 +168,4 @@ public class TestForceCacheImportantBloc
}
}
+
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLruBlockCache.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLruBlockCache.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLruBlockCache.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLruBlockCache.java Wed Mar 12 21:17:13 2014
@@ -578,7 +578,7 @@ public class TestLruBlockCache {
private static class CachedItem implements Cacheable {
BlockCacheKey cacheKey;
int size;
-
+
CachedItem(String blockName, int size) {
this.cacheKey = new BlockCacheKey(blockName, 0);
this.size = size;
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingTTL.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingTTL.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingTTL.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingTTL.java Wed Mar 12 21:17:13 2014
@@ -155,7 +155,7 @@ public class TestScannerSelectionUsingTT
region.close();
}
-
+
private void verifyDataBlockRead(Map<String, Long> metricsBeforeCompaction,
int expectCompactionDataBlocksRead){
SchemaMetrics.validateMetricChanges(metricsBeforeCompaction);
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/ipc/TestPerRequestProfiling.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/ipc/TestPerRequestProfiling.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/ipc/TestPerRequestProfiling.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/ipc/TestPerRequestProfiling.java Wed Mar 12 21:17:13 2014
@@ -1,23 +1,20 @@
package org.apache.hadoop.hbase.ipc;
+
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import java.util.ArrayList;
-import java.util.concurrent.ThreadPoolExecutor;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.io.hfile.Compression;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.After;
import org.junit.AfterClass;
@@ -92,7 +89,7 @@ public class TestPerRequestProfiling {
put.add(FAMILIES[0], QUALIFIER, VALUE);
table.put(put);
// autoflush is on by default, or else move this check after flush
- assertTrue (table.getProfilingData () == null);
+ assertNull(table.getProfilingData());
}
LOG.debug("Wrote some puts to table " + new String(TABLE));
@@ -102,14 +99,13 @@ public class TestPerRequestProfiling {
// read back the values
for (int i = 0; i < ROWS.length; i++) {
- Get get = new Get(ROWS[i]);
- get.addColumn(FAMILIES[0], QUALIFIER);
+ Get get = new Get.Builder(ROWS[i]).addColumn(FAMILIES[0], QUALIFIER)
+ .create();
Result result = table.get(get);
assertEquals(new String(VALUE),
- new String(result.getValue(FAMILIES[0], QUALIFIER)));
-
- assertTrue (table.getProfilingData () == null);
+ new String(result.getValue(FAMILIES[0], QUALIFIER)));
+ assertNull(table.getProfilingData());
}
LOG.debug("Read and verified from table " + new String(TABLE));
@@ -122,7 +118,7 @@ public class TestPerRequestProfiling {
put.add(FAMILIES[0], QUALIFIER, VALUE);
table.put(put);
// autoflush is on by default, or else move this check after flush
- assertTrue (table.getProfilingData () != null);
+ assertNotNull(table.getProfilingData());
}
LOG.debug("Wrote some puts to table " + new String(TABLE));
@@ -132,14 +128,13 @@ public class TestPerRequestProfiling {
// read back the values
for (int i = 0; i < ROWS.length; i++) {
- Get get = new Get(ROWS[i]);
- get.addColumn(FAMILIES[0], QUALIFIER);
+ Get get = new Get.Builder(ROWS[i]).addColumn(FAMILIES[0], QUALIFIER)
+ .create();
Result result = table.get(get);
assertEquals(new String(VALUE),
new String(result.getValue(FAMILIES[0], QUALIFIER)));
-
- assertTrue (table.getProfilingData () != null);
+ assertNotNull(table.getProfilingData());
}
LOG.debug("Read and verified from table " + new String(TABLE));
@@ -152,7 +147,7 @@ public class TestPerRequestProfiling {
put.add(FAMILIES[0], QUALIFIER, VALUE);
table.put(put);
// autoflush is on by default, or else move this check after flush
- assertTrue (table.getProfilingData () == null);
+ assertNull(table.getProfilingData());
}
LOG.debug("Wrote some puts to table " + new String(TABLE));
@@ -162,14 +157,12 @@ public class TestPerRequestProfiling {
// read back the values
for (int i = 0; i < ROWS.length; i++) {
- Get get = new Get(ROWS[i]);
- get.addColumn(FAMILIES[0], QUALIFIER);
+ Get get = new Get.Builder(ROWS[i]).addColumn(FAMILIES[0], QUALIFIER).create();
Result result = table.get(get);
assertEquals(new String(VALUE),
new String(result.getValue(FAMILIES[0], QUALIFIER)));
-
- assertTrue (table.getProfilingData () == null);
+ assertNull(table.getProfilingData());
}
LOG.debug("Read and verified from table " + new String(TABLE));
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/ipc/TestRPCCompression.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/ipc/TestRPCCompression.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/ipc/TestRPCCompression.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/ipc/TestRPCCompression.java Wed Mar 12 21:17:13 2014
@@ -64,7 +64,7 @@ public class TestRPCCompression {
public void tearDown() throws Exception {
// Nothing to do.
}
-
+
@Test
public void testCompressedRPC() throws Exception {
byte[] TABLE = Bytes.toBytes("testRPCCompression");
@@ -75,14 +75,14 @@ public class TestRPCCompression {
// create a table
TEST_UTIL.createTable(TABLE, FAMILIES);
LOG.debug("Created table " + new String(TABLE));
-
+
// open the table with compressed RPC
Configuration conf = HBaseConfiguration.create();
String zkPortStr = TEST_UTIL.getConfiguration().get(
"hbase.zookeeper.property.clientPort");
- conf.setInt("hbase.zookeeper.property.clientPort",
+ conf.setInt("hbase.zookeeper.property.clientPort",
Integer.parseInt(zkPortStr));
- conf.set(HConstants.HBASE_RPC_COMPRESSION_KEY,
+ conf.set(HConstants.HBASE_RPC_COMPRESSION_KEY,
Compression.Algorithm.GZ.getName());
HTable table = new HTable(conf, TABLE);
@@ -104,9 +104,9 @@ public class TestRPCCompression {
Get get = new Get(ROWS[i]);
get.addColumn(FAMILIES[0], QUALIFIER);
Result result = table.get(get);
-
- assertEquals(new String(VALUE),
- new String(result.getValue(FAMILIES[0], QUALIFIER)));
+
+ assertEquals(new String(VALUE),
+ new String(result.getValue(FAMILIES[0], QUALIFIER)));
}
LOG.debug("Read and verified from table " + new String(TABLE));
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/ColumnFamilyProperties.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/ColumnFamilyProperties.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/ColumnFamilyProperties.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/ColumnFamilyProperties.java Wed Mar 12 21:17:13 2014
@@ -8,7 +8,7 @@ public class ColumnFamilyProperties {
private static final Log LOG = LogFactory.getLog(ColumnFamilyProperties.class);
public static int familyIndex = 1;
-
+
public String familyName;
public int startTimestamp;
public int endTimestamp;
@@ -32,7 +32,7 @@ public class ColumnFamilyProperties {
LOG.info("Compression type: " + compressionType + "\n\n");
}
- public static final String defaultColumnProperties =
+ public static final String defaultColumnProperties =
"\nReaderThreads=10" +
"\nWriterThreads=10" +
"\nStartKey=1" +
@@ -82,7 +82,7 @@ public class ColumnFamilyProperties {
"";
}
-/**
+/**
If creating an external file, you should use the following as a starting point and
make whatever changes you want. It would be best not to omit any fields.
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/DataGenerator.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/DataGenerator.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/DataGenerator.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/DataGenerator.java Wed Mar 12 21:17:13 2014
@@ -131,7 +131,7 @@ public class DataGenerator {
* Returns a set containing keys for the passed row based on the information
* in familyProperties. This is a slightly redundant form of the above
* function but is required for efficiency.
- *
+ *
* @param rowID
* @param familyProperties
* @return
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/LoadTester.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/LoadTester.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/LoadTester.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/LoadTester.java Wed Mar 12 21:17:13 2014
@@ -74,7 +74,7 @@ public class LoadTester {
}
this.config = HBaseUtils.getHBaseConfFromZkNode(zkNodeName);
- // for admin operations create a similar config, except
+ // for admin operations create a similar config, except
// set the RPC timeout much higher (5 mins).
this.adminConfig = HBaseUtils.getHBaseConfFromZkNode(zkNodeName);
this.adminConfig.setInt("hbase.rpc.timeout", 5 * 60 * 1000);
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/MultiThreadedAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/MultiThreadedAction.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/MultiThreadedAction.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/MultiThreadedAction.java Wed Mar 12 21:17:13 2014
@@ -94,12 +94,12 @@ public abstract class MultiThreadedActio
LOG.info(threadsLeft + "Rows = " + numRowsNumber +
", keys = " + DisplayFormatUtils.formatNumber(numKeys_.get()) +
", time = " + DisplayFormatUtils.formatTime(time) +
- ((numRowsNumber > 0 && time > 0)?
+ ((numRowsNumber > 0 && time > 0)?
(" Overall: [" +
"keys/s = " + numRowsNumber*1000/time +
", latency = " + cumulativeOpTime/numRowsNumber + " ms]")
: "") +
- ((numRowsDelta > 0) ?
+ ((numRowsDelta > 0) ?
(" Current: [" +
"rows/s = " + numRowsDelta*1000/reportingInterval +
", latency = " + cumulativeOpTimeDelta/numRowsDelta +
@@ -127,7 +127,7 @@ public abstract class MultiThreadedActio
public void setVerbose(boolean verbose) {
this.verbose = verbose;
}
-
+
public boolean getVerbose() {
return this.verbose;
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/MultiThreadedWriter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/MultiThreadedWriter.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/MultiThreadedWriter.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/MultiThreadedWriter.java Wed Mar 12 21:17:13 2014
@@ -43,7 +43,7 @@ public class MultiThreadedWriter extends
private static final Log LOG = LogFactory.getLog(MultiThreadedWriter.class);
Set<HBaseWriter> writers_ = new HashSet<HBaseWriter>();
- /* This is the current key to be inserted by any thread. Each thread does an
+ /* This is the current key to be inserted by any thread. Each thread does an
atomic get and increment operation and inserts the current value. */
public static AtomicLong currentKey_ = null;
/* The sorted set of keys inserted by the writers */
@@ -81,7 +81,7 @@ public class MultiThreadedWriter extends
startReporter("W");
}
-
+
public void setBulkLoad(boolean bulkLoad) {
this.bulkLoad = bulkLoad;
}
@@ -169,7 +169,7 @@ public class MultiThreadedWriter extends
public void insertKeys(long rowKey,
ColumnFamilyProperties[] familyProperties) {
byte[] row = RegionSplitter.getHBaseKeyFromRowID(rowKey);
- //LOG.info("Inserting row: "+Bytes.toString(row));
+ //LOG.info("Inserting row: "+Bytes.toString(row));
int insertedSize = 0;
try {
long start = System.currentTimeMillis();
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/RegionSplitter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/RegionSplitter.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/RegionSplitter.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/loadtest/RegionSplitter.java Wed Mar 12 21:17:13 2014
@@ -150,7 +150,7 @@ public class RegionSplitter {
}
/////////////////////////////////////
- /**Code for hashing*/
+ /**Code from Prometheus for hashing*/
/////////////////////////////////////
public static byte[] getHBaseKeyFromRowID(long rowID) {
@@ -334,7 +334,7 @@ public class RegionSplitter {
byte[] sk = regionLoc.getRegionInfo().getStartKey();
if (sk.length != 0) {
if (Bytes.equals(split, sk)) {
- LOG.debug("Region already split on "
+ LOG.debug("Region already split on "
+ Bytes.toStringBinary(split)
+ ". Skipping this region...");
dr = null;
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/DataGenerator.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/DataGenerator.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/DataGenerator.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/DataGenerator.java Wed Mar 12 21:17:13 2014
@@ -35,7 +35,7 @@ public class DataGenerator {
String md5hash = MD5Hash.getMD5AsHex(Bytes.toBytes(stringKey));
// flip the key to randomize
- return md5hash + ":" + stringKey;
+ return md5hash + ":" + stringKey;
}
public DataGenerator(int minDataSize, int maxDataSize) {
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/HBaseUtils.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/HBaseUtils.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/HBaseUtils.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/HBaseUtils.java Wed Mar 12 21:17:13 2014
@@ -45,7 +45,7 @@ import org.apache.commons.lang.StringUti
public class HBaseUtils
{
private static final Log LOG = LogFactory.getLog(HBaseUtils.class);
-
+
private final static String MAXMD5 = "FFFFFFFF";
private final static int rowComparisonLength = MAXMD5.length();
private static int DEFAULT_REGIONS_PER_SERVER = 5;
@@ -79,7 +79,7 @@ public class HBaseUtils
try
{
HBaseAdmin admin = new HBaseAdmin(conf);
-
+
// create a table a pre-splits regions.
// The number of splits is set as:
// region servers * regions per region server).
@@ -107,7 +107,7 @@ public class HBaseUtils
HRegionLocation hloc = table.getRegionLocation(Bytes.toBytes(""));
return hloc.getServerAddress();
}
-
+
public static HBaseConfiguration getHBaseConfFromZkNode(String zkNodeName) {
Configuration c = new Configuration();
c.set("hbase.zookeeper.quorum", zkNodeName);
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/HdfsAppender.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/HdfsAppender.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/HdfsAppender.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/manual/utils/HdfsAppender.java Wed Mar 12 21:17:13 2014
@@ -43,7 +43,7 @@ public class HdfsAppender extends HasThr
final int minSize;
final int maxSize;
final HBaseConfiguration conf;
-
+
public HdfsAppender(HBaseConfiguration conf, int minSize, int maxSize) {
this.conf = conf;
this.minSize = minSize;
@@ -55,31 +55,31 @@ public class HdfsAppender extends HasThr
Random r = new Random();
byte[] t = new byte[] {'t','e','s','t'};
HLogKey key = new HLogKey(t, t, 0, 0);
-
+
try {
FileSystem fs = FileSystem.get(conf);
int fileCount = 0;
-
+
long blocksize = conf.getLong("hbase.regionserver.hlog.blocksize",
fs.getDefaultBlockSize());
// Roll at 95% of block size.
float multi = conf.getFloat("hbase.regionserver.logroll.multiplier", 0.95f);
long logrollsize = (long)(blocksize * multi);
-
+
while(true) {
Path p = new Path("/appendtest", Integer.toString(fileCount));
HLog.Writer writer = HLog.createWriter(fs, p, conf);
-
+
while (writer.getLength() < logrollsize) {
int rSize = r.nextInt(maxSize-minSize) + minSize;
WALEdit value = new WALEdit();
value.add(new KeyValue(t, t, t, 0, new byte[rSize]));
-
+
long now = System.currentTimeMillis();
writer.append(new HLog.Entry(key, value));
long took = System.currentTimeMillis() - now;
LOG.info(String.format("append time (%d) = %d ms", rSize, took));
-
+
now = System.currentTimeMillis();
writer.sync();
took = System.currentTimeMillis() - now;
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/NMapInputFormat.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/NMapInputFormat.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/NMapInputFormat.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/NMapInputFormat.java Wed Mar 12 21:17:13 2014
@@ -80,10 +80,10 @@ public class NMapInputFormat extends Inp
public void write(DataOutput out) throws IOException {
}
}
-
+
private static class SingleRecordReader<K, V>
extends RecordReader<K, V> {
-
+
private final K key;
private final V value;
boolean providedKey = false;
@@ -122,6 +122,6 @@ public class NMapInputFormat extends Inp
providedKey = true;
return true;
}
-
+
}
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java Wed Mar 12 21:17:13 2014
@@ -1,4 +1,4 @@
-/**
+/**
* Copyright 2009 The Apache Software Foundation
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,9 +19,9 @@
*/
package org.apache.hadoop.hbase.mapreduce;
+import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -105,9 +105,9 @@ public class TestHFileOutputFormat {
private static final byte[] TABLE_NAME = Bytes.toBytes("TestTable");
private static final String oldValue = "valAAAAA";
private static final String newValue = "valBBBBB";
-
+
private HBaseTestingUtility util = new HBaseTestingUtility();
-
+
private static Log LOG = LogFactory.getLog(TestHFileOutputFormat.class);
/**
@@ -116,7 +116,7 @@ public class TestHFileOutputFormat {
static class RandomKVGeneratingMapper
extends Mapper<NullWritable, NullWritable,
ImmutableBytesWritable, KeyValue> {
-
+
private int keyLength;
private static final int KEYLEN_DEFAULT=10;
private static final String KEYLEN_CONF="randomkv.key.length";
@@ -124,12 +124,12 @@ public class TestHFileOutputFormat {
private int valLength;
private static final int VALLEN_DEFAULT=10;
private static final String VALLEN_CONF="randomkv.val.length";
-
+
@Override
protected void setup(Context context) throws IOException,
InterruptedException {
super.setup(context);
-
+
Configuration conf = context.getConfiguration();
keyLength = conf.getInt(KEYLEN_CONF, KEYLEN_DEFAULT);
valLength = conf.getInt(VALLEN_CONF, VALLEN_DEFAULT);
@@ -144,7 +144,7 @@ public class TestHFileOutputFormat {
{
byte keyBytes[] = new byte[keyLength];
byte valBytes[] = new byte[valLength];
-
+
int taskId = context.getTaskAttemptID().getTaskID().getId();
assert taskId < Byte.MAX_VALUE : "Unit tests dont support > 127 tasks!";
@@ -178,9 +178,9 @@ public class TestHFileOutputFormat {
Mapper<NullWritable, NullWritable, ImmutableBytesWritable, RowMutation> {
@Override
protected void map(
- NullWritable n1, NullWritable n2,
- Mapper<NullWritable, NullWritable,
- ImmutableBytesWritable, RowMutation>.Context context)
+ NullWritable n1, NullWritable n2,
+ Mapper<NullWritable, NullWritable,
+ ImmutableBytesWritable, RowMutation>.Context context)
throws IOException ,InterruptedException
{
byte[] row = Bytes.toBytes("row1");
@@ -296,33 +296,33 @@ public class TestHFileOutputFormat {
* @throws Exception on job, sorting, IO or fs errors
*/
@Test
- public void testRowSortReducer()
+ public void testRowSortReducer()
throws Exception {
Configuration conf = new Configuration(this.util.getConfiguration());
conf.setInt("io.sort.mb", 20);
conf.setInt("mapred.map.tasks", 1);
Path dir = util.getTestDir("testRowSortReducer");
-
+
try {
Job job = new Job(conf);
-
+
job.setInputFormatClass(NMapInputFormat.class);
job.setOutputFormatClass(HFileOutputFormat.class);
-
+
job.setNumReduceTasks(1);
job.setMapperClass(RowSorterMapper.class); // local
job.setReducerClass(RowMutationSortReducer.class);
-
+
job.setOutputKeyClass(ImmutableBytesWritable.class);
job.setOutputValueClass(KeyValue.class);
-
+
job.setMapOutputKeyClass(ImmutableBytesWritable.class);
- job.setMapOutputValueClass(RowMutation.class);
+ job.setMapOutputValueClass(RowMutation.class);
FileOutputFormat.setOutputPath(job, dir);
-
+
assertTrue(job.waitForCompletion(false));
FileSystem fs = dir.getFileSystem(conf);
@@ -340,12 +340,12 @@ public class TestHFileOutputFormat {
scanner.seekTo();
int index = 0;
-
+
// check things for info-A
if (Bytes.toString(TestHFileOutputFormat.FAMILIES[0]).equals(cf)) {
do {
++index;
-
+
KeyValue kv = scanner.getKeyValue();
long ts = kv.getTimestamp();
@@ -437,7 +437,7 @@ public class TestHFileOutputFormat {
dir.getFileSystem(conf).delete(dir, true);
}
}
-
+
/**
* Test that {@link HFileOutputFormat} RecordWriter amends timestamps if
* passed a keyvalue whose timestamp is {@link HConstants#LATEST_TIMESTAMP}.
@@ -491,22 +491,22 @@ public class TestHFileOutputFormat {
Configuration conf = util.getConfiguration();
Path testDir = util.getTestDir("testWritingPEData");
FileSystem fs = testDir.getFileSystem(conf);
-
+
// Set down this value or we OOME in eclipse.
conf.setInt("io.sort.mb", 20);
// Write a few files.
conf.setLong("hbase.hregion.max.filesize", 64 * 1024);
-
+
Job job = new Job(conf, "testWritingPEData");
setupRandomGeneratorMapper(job);
// This partitioner doesn't work well for number keys but using it anyways
// just to demonstrate how to configure it.
byte[] startKey = new byte[RandomKVGeneratingMapper.KEYLEN_DEFAULT];
byte[] endKey = new byte[RandomKVGeneratingMapper.KEYLEN_DEFAULT];
-
+
Arrays.fill(startKey, (byte)0);
Arrays.fill(endKey, (byte)0xff);
-
+
job.setPartitionerClass(SimpleTotalOrderPartitioner.class);
// Set start and end rows for partitioner.
SimpleTotalOrderPartitioner.setStartKey(job.getConfiguration(), startKey);
@@ -514,13 +514,13 @@ public class TestHFileOutputFormat {
job.setReducerClass(KeyValueSortReducer.class);
job.setOutputFormatClass(HFileOutputFormat.class);
job.setNumReduceTasks(4);
-
+
FileOutputFormat.setOutputPath(job, testDir);
assertTrue(job.waitForCompletion(false));
FileStatus [] files = fs.listStatus(testDir);
assertTrue(files.length > 0);
}
-
+
@Test
public void testJobConfiguration() throws Exception {
Job job = new Job();
@@ -540,26 +540,26 @@ public class TestHFileOutputFormat {
}
return ret;
}
-
+
@Test
public void testMRIncrementalLoad() throws Exception {
LOG.info("\nStarting test testMRIncrementalLoad\n");
doIncrementalLoadTest(false);
}
-
+
@Test
public void testMRIncrementalLoadWithSplit() throws Exception {
LOG.info("\nStarting test testMRIncrementalLoadWithSplit\n");
doIncrementalLoadTest(true);
}
-
+
private void doIncrementalLoadTest(
boolean shouldChangeRegions) throws Exception {
util = new HBaseTestingUtility();
Configuration conf = util.getConfiguration();
Path testDir = util.getTestDir("testLocalMRIncrementalLoad");
byte[][] startKeys = generateRandomStartKeys(5);
-
+
try {
util.startMiniCluster();
HBaseAdmin admin = new HBaseAdmin(conf);
@@ -606,10 +606,10 @@ public class TestHFileOutputFormat {
LOG.info("Waiting for new region assignment to happen");
}
}
-
+
// Perform the actual load
new LoadIncrementalHFiles(conf).doBulkLoad(testDir, table);
-
+
// Ensure data shows up
int expectedRows = conf.getInt("mapred.map.tasks", 1) * ROWSPERSPLIT;
assertEquals("LoadIncrementalHFiles should put expected data in table",
@@ -626,16 +626,16 @@ public class TestHFileOutputFormat {
}
results.close();
String tableDigestBefore = util.checksumRows(table);
-
+
// Cause regions to reopen
admin.disableTable(TABLE_NAME);
while (table.getRegionsInfo().size() != 0) {
Thread.sleep(1000);
- LOG.info("Waiting for table to disable");
+ LOG.info("Waiting for table to disable");
}
admin.enableTable(TABLE_NAME);
util.waitTableAvailable(TABLE_NAME, 30000);
-
+
assertEquals("Data should remain after reopening of regions",
tableDigestBefore, util.checksumRows(table));
} finally {
@@ -643,7 +643,7 @@ public class TestHFileOutputFormat {
util.shutdownMiniCluster();
}
}
-
+
private void runIncrementalPELoad(
Configuration conf, HTable table, Path outDir)
throws Exception {
@@ -651,10 +651,10 @@ public class TestHFileOutputFormat {
setupRandomGeneratorMapper(job);
HFileOutputFormat.configureIncrementalLoad(job, table);
FileOutputFormat.setOutputPath(job, outDir);
-
+
assertEquals(table.getRegionsInfo().size(),
job.getNumReduceTasks());
-
+
assertTrue(job.waitForCompletion(true));
}
@@ -711,7 +711,7 @@ public class TestHFileOutputFormat {
* Test for
* {@link HFileOutputFormat#createFamilyCompressionMap(Configuration)}. Tests
* that the compression map is correctly deserialized from configuration
- *
+ *
* @throws IOException
*/
@Test
@@ -777,7 +777,7 @@ public class TestHFileOutputFormat {
}
return familyToCompression;
}
-
+
/**
* Test that {@link HFileOutputFormat} RecordWriter uses compression settings
* from the column family descriptor
@@ -827,7 +827,7 @@ public class TestHFileOutputFormat {
// Make sure that a directory was created for every CF
FileSystem fileSystem = dir.getFileSystem(conf);
-
+
// commit so that the filesystem has one directory per column family
hof.getOutputCommitter(context).commitTask(context);
for (byte[] family : FAMILIES) {
@@ -1239,13 +1239,13 @@ public class TestHFileOutputFormat {
}
}
}
-
+
public static void main(String args[]) throws Exception {
new TestHFileOutputFormat().manualTest(args);
}
-
+
public void manualTest(String args[]) throws Exception {
- Configuration conf = HBaseConfiguration.create();
+ Configuration conf = HBaseConfiguration.create();
util = new HBaseTestingUtility(conf);
if ("newtable".equals(args[0])) {
byte[] tname = args[1].getBytes();
@@ -1293,10 +1293,10 @@ public class TestHFileOutputFormat {
ImmutableBytesWritable someWritable = new ImmutableBytesWritable();
for (int i = 0; i < 100; i++) {
KeyValue kv = new KeyValue(
- Bytes.add(row, Bytes.toBytes(i)),
- family,
- qualifier,
- Bytes.add(value, Bytes.toBytes(i)));
+ Bytes.add(row, Bytes.toBytes(i)),
+ family,
+ qualifier,
+ Bytes.add(value, Bytes.toBytes(i)));
writer.write(someWritable, kv);
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java Wed Mar 12 21:17:13 2014
@@ -44,7 +44,7 @@ public class TestImportTsv {
assertBytesEquals(Bytes.toBytes("qual"), parser.getQualifier(1));
assertNull(parser.getFamily(2));
assertNull(parser.getQualifier(2));
-
+
byte[] line = Bytes.toBytes("val_a\tval_b\tval_c\tval_d");
ParsedLine parsed = parser.parse(line, line.length);
checkParsing(parsed, Splitter.on("\t").split(Bytes.toString(line)));
@@ -60,11 +60,11 @@ public class TestImportTsv {
parsed.getColumnLength(i)));
}
if (!Iterables.elementsEqual(parsedCols, expected)) {
- fail("Expected: " + Joiner.on(",").join(expected) + "\n" +
+ fail("Expected: " + Joiner.on(",").join(expected) + "\n" +
"Got:" + Joiner.on(",").join(parsedCols));
}
}
-
+
private void assertBytesEquals(byte[] a, byte[] b) {
assertEquals(Bytes.toStringBinary(a), Bytes.toStringBinary(b));
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatNMappersPerRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatNMappersPerRegion.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatNMappersPerRegion.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatNMappersPerRegion.java Wed Mar 12 21:17:13 2014
@@ -51,7 +51,7 @@ import static org.junit.Assert.assertEqu
* Tests TableInputFormat with varying numbers of mappers per region.
*/
public class TestTableInputFormatNMappersPerRegion {
-
+
static final String SPECULATIVE_EXECUTION = "mapred.map.tasks.speculative.execution";
static final Log LOG = LogFactory.getLog(TestTableInputFormatScan.class);
static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
@@ -109,13 +109,13 @@ public class TestTableInputFormatNMapper
}
}
}
-
+
}
-
+
/**
* Tests whether TableInputFormat works correctly when number of mappers
* per region is set to 1.
- *
+ *
* @throws IOException
* @throws InterruptedException
* @throws ClassNotFoundException
@@ -125,10 +125,10 @@ public class TestTableInputFormatNMapper
throws IOException, InterruptedException, ClassNotFoundException {
testScan("testOneMapperPerRegion", 1, 25);
}
-
+
/**
- * Tests when number of mappers is set to 3.
- *
+ * Tests when number of mappers is set to 3.
+ *
* @throws IOException
* @throws InterruptedException
* @throws ClassNotFoundException
@@ -138,11 +138,11 @@ public class TestTableInputFormatNMapper
throws IOException, InterruptedException, ClassNotFoundException {
testScan("testThreeMappersPerRegion", 3, 25);
}
-
+
/**
* Tests the scenario where there is only one region. Expecting resumption to
* one mapper per region.
- *
+ *
* @throws IOException
* @throws InterruptedException
* @throws ClassNotFoundException
@@ -152,11 +152,11 @@ public class TestTableInputFormatNMapper
throws IOException, InterruptedException, ClassNotFoundException {
testScan("testOnTableWithOneRegion", 5, 1);
}
-
+
/**
* Tests the scenario where there is only two regions. Expecting resumption to
* one mapper per region.
- *
+ *
* @throws IOException
* @throws InterruptedException
* @throws ClassNotFoundException
@@ -166,10 +166,10 @@ public class TestTableInputFormatNMapper
throws IOException, InterruptedException, ClassNotFoundException {
testScan("testOnTableWithTwoRegions", 5, 2);
}
-
+
/**
* Tests whether the framework correctly detects illegal inputs.
- *
+ *
* @throws IOException
* @throws InterruptedException
* @throws ClassNotFoundException
@@ -192,7 +192,7 @@ public class TestTableInputFormatNMapper
// Expected
}
}
-
+
// If numRegions > 2, this creates 25 regions, rather than numRegions regions.
private void testScan(String tableName, int numMappersPerRegion, int numRegions)
throws IOException, InterruptedException, ClassNotFoundException {
@@ -235,10 +235,10 @@ public class TestTableInputFormatNMapper
long totalRowCount = counters
.findCounter(RowCounterMapper.Counters.ROWS).getValue();
int actualNumMappersPerRegion = (numRegions > 2) ? numMappersPerRegion : 1;
- assertEquals("Tried to open " + actualNumMappersPerRegion * regionsOpened +
- " maps but got " + totalMapCount,
+ assertEquals("Tried to open " + actualNumMappersPerRegion * regionsOpened +
+ " maps but got " + totalMapCount,
actualNumMappersPerRegion * regionsOpened, totalMapCount);
- assertEquals("Supposed to find " + rowsLoaded + " rows but got " + totalRowCount,
+ assertEquals("Supposed to find " + rowsLoaded + " rows but got " + totalRowCount,
rowsLoaded, totalRowCount);
}
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java Wed Mar 12 21:17:13 2014
@@ -249,7 +249,7 @@ public class TestDistributedLogSplitting
long curt = System.currentTimeMillis();
long endt = curt + 30000;
while (curt < endt) {
- if ((tot_wkr_task_resigned.get() + tot_wkr_task_err.get() +
+ if ((tot_wkr_task_resigned.get() + tot_wkr_task_err.get() +
tot_wkr_final_transistion_failed.get()) == 0) {
Thread.yield();
curt = System.currentTimeMillis();
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java Wed Mar 12 21:17:13 2014
@@ -84,7 +84,7 @@ public class TestMaster {
tableRegions.get(0).getFirst().getEndKey());
// Now trigger a split and stop when the split is in progress
-
+
CountDownLatch aboutToOpen = new CountDownLatch(1);
CountDownLatch proceed = new CountDownLatch(1);
RegionOpenListener list = new RegionOpenListener(aboutToOpen, proceed);
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestROOTAssignment.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestROOTAssignment.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestROOTAssignment.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestROOTAssignment.java Wed Mar 12 21:17:13 2014
@@ -86,7 +86,7 @@ public class TestROOTAssignment {
private boolean done = false;
private final HServerAddress rootServerAddress;
private final HMaster master;
-
+
PostponeShutdownProcessing(final HMaster master,
final HServerAddress rootServerAddress) {
this.master = master;
@@ -138,7 +138,7 @@ public class TestROOTAssignment {
* If the split of the log for the regionserver hosting ROOT doesn't go off
* smoothly, if the process server shutdown gets added to the delayed queue
* of events to process, then ROOT was not being allocated, ever.
- * @see <a href="https://issues.apache.org/jira/browse/HBASE-2707">HBASE-2707</a>
+ * @see <a href="https://issues.apache.org/jira/browse/HBASE-2707">HBASE-2707</a>
*/
@Test (timeout=300000) public void testROOTDeployedThoughProblemSplittingLog()
throws Exception {
@@ -148,7 +148,7 @@ public class TestROOTAssignment {
byte [] rootRegion = Bytes.toBytes("-ROOT-,,0");
int rootIndex = cluster.getServerWith(rootRegion);
final HRegionServer rootHRS = cluster.getRegionServer(rootIndex);
-
+
// Add our RegionServerOperationsListener
PostponeShutdownProcessing listener = new PostponeShutdownProcessing(master,
rootHRS.getHServerInfo().getServerAddress());
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java Wed Mar 12 21:17:13 2014
@@ -84,7 +84,7 @@ public class TestRegionPlacement {
// Enable the favored nodes based load balancer
conf.set("hbase.loadbalancer.impl",
"org.apache.hadoop.hbase.master.RegionManager$AssignmentLoadBalancer");
-
+
conf.setInt("hbase.master.meta.thread.rescanfrequency", 5000);
conf.setInt("hbase.regionserver.msginterval", 1000);
conf.setLong("hbase.regionserver.transientAssignment.regionHoldPeriod", 2000);
@@ -167,10 +167,10 @@ public class TestRegionPlacement {
AssignmentPlan currentPlan;
// ONLY meta regions, ROOT and META, are assigned at beginning.
verifyRegionMovementNum(META_REGION_NUM);
-
+
// Create a table with REGION_NUM regions.
createTable("testRegionAssignment", REGION_NUM);
-
+
// Test case1: Verify the region assignment for the exiting table
// is consistent with the assignment plan and all the region servers get
// correctly favored nodes updated.
@@ -190,24 +190,24 @@ public class TestRegionPlacement {
// Verify all the region server are update with the latest favored nodes
verifyRegionServerUpdated(currentPlan);
RegionPlacement.printAssignmentPlan(currentPlan);
- // Test Case 2: To verify whether the region placement tools can
+ // Test Case 2: To verify whether the region placement tools can
// correctly update the new assignment plan to META and Region Server.
// The new assignment plan is generated by shuffle the existing assignment
// plan by switching PRIMARY, SECONDARY and TERTIARY nodes.
// Shuffle the plan by switching the secondary region server with
// the tertiary.
-
+
// Shuffle the secondary with tertiary favored nodes
AssignmentPlan shuffledPlan = this.shuffleAssignmentPlan(currentPlan,
AssignmentPlan.POSITION.SECONDARY, AssignmentPlan.POSITION.TERTIARY);
// Let the region placement update the META and Region Servers
rp.updateAssignmentPlan(shuffledPlan);
-
+
// Verify the region assignment. There are supposed to no region reassignment
// All the regions are still on the primary regio region server
verifyRegionAssignment(shuffledPlan,0, REGION_NUM);
-
+
// Shuffle the plan by switching the primary with secondary and
// verify the region reassignment is consistent with the plan.
shuffledPlan = this.shuffleAssignmentPlan(currentPlan,
@@ -216,8 +216,8 @@ public class TestRegionPlacement {
// Let the region placement update the META and Region Servers
rp.updateAssignmentPlan(shuffledPlan);
verifyRegionAssignment(shuffledPlan, REGION_NUM, REGION_NUM);
-
- // Test Case 3: Kill the region server with META region and verify the
+
+ // Test Case 3: Kill the region server with META region and verify the
// region movements and region on primary region server are expected.
HRegionServer meta = this.getRegionServerWithMETA();
// Get the expected the num of the regions on the its primary region server
@@ -227,14 +227,14 @@ public class TestRegionPlacement {
META_REGION_OVERHEAD;
verifyKillRegionServerWithMetaOrRoot(meta, expectedRegionOnPrimaryRS);
RegionPlacement.printAssignmentPlan(currentPlan);
- // Test Case 4: Kill the region sever with ROOT and verify the
+ // Test Case 4: Kill the region sever with ROOT and verify the
// region movements and region on primary region server are expected.
HRegionServer root = this.getRegionServerWithROOT();
// Get the expected the num of the regions on the its primary region server
Collection<HRegion> regionOnRootRegionServer = root.getOnlineRegions();
expectedRegionOnPrimaryRS = lastRegionOnPrimaryRSCount -
regionOnRootRegionServer.size() + ROOT_REGION_OVERHEAD;
-
+
// Adjust the number by removing the regions just moved to the ROOT region server
for (HRegion region : regionOnRootRegionServer) {
if (regionOnMetaRegionServer.contains(region))
@@ -249,12 +249,12 @@ public class TestRegionPlacement {
* region servers.
* Also it will verify weather the number of region movement and
* the number regions on the primary region server are expected
- *
+ *
* @param plan
* @param regionMovementNum
* @param numRegionsOnPrimaryRS
- * @throws InterruptedException
- * @throws IOException
+ * @throws InterruptedException
+ * @throws IOException
*/
private void verifyRegionAssignment(AssignmentPlan plan,
int regionMovementNum, int numRegionsOnPrimaryRS)
@@ -288,19 +288,19 @@ public class TestRegionPlacement {
// Verify this region server with META is also hosting user regions
int expectedRegionMovement = server.getOnlineRegions().size();
assertTrue("All the user regions are assigned to this region server: " +
- server.getServerInfo().getHostnamePort(),
+ server.getServerInfo().getHostnamePort(),
(expectedRegionMovement < REGION_NUM));
assertTrue("NO the user region is assigned to this region server: " +
- server.getServerInfo().getHostnamePort(),
+ server.getServerInfo().getHostnamePort(),
(expectedRegionMovement > 1) );
// Kill the region server;
server.kill();
-
+
// Verify the user regions previously on the killed rs are reassigned.
verifyRegionMovementNum(expectedRegionMovement);
-
- // Verify only expectedRegionOnPrimary of the user regions are assigned
+
+ // Verify only expectedRegionOnPrimary of the user regions are assigned
// to the primary region server based on the plan.
verifyRegionOnPrimaryRS(expectedRegionOnPrimary);
}
@@ -321,7 +321,7 @@ public class TestRegionPlacement {
}
return null;
}
-
+
/**
* Get the region server who is currently hosting META
* @return
@@ -347,7 +347,7 @@ public class TestRegionPlacement {
throws InterruptedException {
MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
HMaster m = cluster.getMaster();
-
+
int retry = 10;
long sleep = 3 * TEST_UTIL.getConfiguration().
getInt("hbase.regionserver.msginterval", 1000);
@@ -357,13 +357,13 @@ public class TestRegionPlacement {
currentRegionOpened = m.getMetrics().getRegionsOpened();
regionMovement= currentRegionOpened - lastRegionOpenedCount;
LOG.debug("There are " + regionMovement + "/" + expected +
- " regions moved after " + attempt + " attempts");
+ " regions moved after " + attempt + " attempts");
Thread.sleep((++attempt) * sleep);
} while (regionMovement != expected && attempt <= retry);
// update the lastRegionOpenedCount
lastRegionOpenedCount = currentRegionOpened;
-
+
assertEquals("There are only " + regionMovement + " instead of "
+ expected + " region movement for " + attempt + " attempts",
regionMovement, expected);
@@ -399,7 +399,7 @@ public class TestRegionPlacement {
}
/**
- * Verify the number of user regions is assigned to the primary
+ * Verify the number of user regions is assigned to the primary
* region server based on the plan is expected
* @param expectedNum.
* @throws IOException
@@ -536,7 +536,7 @@ public class TestRegionPlacement {
" region servers" );
return regionOnPrimaryNum.intValue() ;
}
-
+
/**
* Create a table with specified table name and region number.
* @param table
@@ -636,3 +636,4 @@ public class TestRegionPlacement {
}
}
}
+
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestRegionServerOperationQueue.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestRegionServerOperationQueue.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestRegionServerOperationQueue.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestRegionServerOperationQueue.java Wed Mar 12 21:17:13 2014
@@ -41,7 +41,7 @@ public class TestRegionServerOperationQu
return false;
}
};
-
+
@Before
public void setUp() throws Exception {
this.conf = new Configuration();
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java Wed Mar 12 21:17:13 2014
@@ -321,7 +321,7 @@ public class TestSplitLogManager {
byte[] taskstate = zkw.getData("", tasknode);
assertTrue(Arrays.equals(TaskState.TASK_UNASSIGNED.get("dummy-master"),
taskstate));
-
+
waitForCounter(tot_mgr_rescan_deleted, 0, 1, 1000);
} else {
LOG.warn("Could not run test. Lost ZK connection?");
@@ -430,7 +430,7 @@ public class TestSplitLogManager {
// now all the nodes are unassigned. manager should post another rescan
waitForCounter(tot_mgr_resubmit_unassigned, 0, 1, 2 * to + 500);
}
-
+
@Test
public void testDeadWorker() throws Exception {
LOG.info("testDeadWorker");
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedCloseRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedCloseRegion.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedCloseRegion.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedCloseRegion.java Wed Mar 12 21:17:13 2014
@@ -82,7 +82,7 @@ public class TestZKBasedCloseRegion {
// Need at least two servers.
LOG.info("Started new server=" +
TEST_UTIL.getHBaseCluster().startRegionServer());
-
+
}
}
@@ -99,16 +99,16 @@ public class TestZKBasedCloseRegion {
LOG.debug("Asking RS to close region " + region.getRegionNameAsString());
AtomicBoolean closeEventProcessed = new AtomicBoolean(false);
- RegionServerOperationListener listener =
+ RegionServerOperationListener listener =
new CloseRegionEventListener(region.getRegionNameAsString(), closeEventProcessed);
HMaster master = TEST_UTIL.getHBaseCluster().getMaster();
master.getRegionServerOperationQueue().registerRegionServerOperationListener(listener);
- HMsg closeRegionMsg = new HMsg(HMsg.Type.MSG_REGION_CLOSE,
+ HMsg closeRegionMsg = new HMsg(HMsg.Type.MSG_REGION_CLOSE,
region.getRegionInfo(),
Bytes.toBytes("Forcing close in test")
);
TEST_UTIL.getHBaseCluster().addMessageToSendRegionServer(rsIdx, closeRegionMsg);
-
+
synchronized(closeEventProcessed) {
// wait for 3 minutes
closeEventProcessed.wait(3*60*1000);
@@ -120,9 +120,9 @@ public class TestZKBasedCloseRegion {
LOG.info("Done with test, RS informed master successfully.");
}
}
-
+
public static class CloseRegionEventListener implements RegionServerOperationListener {
-
+
private static final Log LOG = LogFactory.getLog(CloseRegionEventListener.class);
String regionToClose;
AtomicBoolean closeEventProcessed;
@@ -157,9 +157,9 @@ public class TestZKBasedCloseRegion {
}
}
}
-
+
}
-
+
private static void waitUntilAllRegionsAssigned(final int countOfRegions)
throws IOException {
@@ -180,7 +180,7 @@ public class TestZKBasedCloseRegion {
// If I get to here and all rows have a Server, then all have been assigned.
if (rows == countOfRegions) break;
LOG.info("Found=" + rows);
- Threads.sleep(1000);
+ Threads.sleep(1000);
}
}
@@ -228,14 +228,14 @@ public class TestZKBasedCloseRegion {
private static byte [] getTestQualifier() {
return getTestFamily();
}
-
+
public static void main(String args[]) throws Exception {
TestZKBasedCloseRegion.beforeAllTests();
-
+
TestZKBasedCloseRegion test = new TestZKBasedCloseRegion();
test.setup();
test.testCloseRegion();
-
+
TestZKBasedCloseRegion.afterAllTests();
}
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedReopenRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedReopenRegion.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedReopenRegion.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedReopenRegion.java Wed Mar 12 21:17:13 2014
@@ -83,7 +83,7 @@ public class TestZKBasedReopenRegion {
// Need at least two servers.
LOG.info("Started new server=" +
TEST_UTIL.getHBaseCluster().startRegionServer());
-
+
}
}
@@ -100,18 +100,18 @@ public class TestZKBasedReopenRegion {
AtomicBoolean closeEventProcessed = new AtomicBoolean(false);
AtomicBoolean reopenEventProcessed = new AtomicBoolean(false);
- RegionServerOperationListener listener =
- new ReopenRegionEventListener(region.getRegionNameAsString(),
+ RegionServerOperationListener listener =
+ new ReopenRegionEventListener(region.getRegionNameAsString(),
closeEventProcessed,
reopenEventProcessed);
HMaster master = TEST_UTIL.getHBaseCluster().getMaster();
master.getRegionServerOperationQueue().registerRegionServerOperationListener(listener);
- HMsg closeRegionMsg = new HMsg(HMsg.Type.MSG_REGION_CLOSE,
+ HMsg closeRegionMsg = new HMsg(HMsg.Type.MSG_REGION_CLOSE,
region.getRegionInfo(),
Bytes.toBytes("Forcing close in test")
);
TEST_UTIL.getHBaseCluster().addMessageToSendRegionServer(rsIdx, closeRegionMsg);
-
+
synchronized(closeEventProcessed) {
closeEventProcessed.wait(3*60*1000);
}
@@ -124,19 +124,19 @@ public class TestZKBasedReopenRegion {
}
if(!reopenEventProcessed.get()) {
throw new Exception("Timed out, open event not called on master after region close.");
- }
-
+ }
+
LOG.info("Done with test, RS informed master successfully.");
}
-
+
public static class ReopenRegionEventListener implements RegionServerOperationListener {
-
+
private static final Log LOG = LogFactory.getLog(ReopenRegionEventListener.class);
String regionToClose;
AtomicBoolean closeEventProcessed;
AtomicBoolean reopenEventProcessed;
- public ReopenRegionEventListener(String regionToClose,
+ public ReopenRegionEventListener(String regionToClose,
AtomicBoolean closeEventProcessed,
AtomicBoolean reopenEventProcessed) {
this.regionToClose = regionToClose;
@@ -180,13 +180,13 @@ public class TestZKBasedReopenRegion {
synchronized(reopenEventProcessed) {
reopenEventProcessed.notifyAll();
}
- }
+ }
}
-
+
}
-
+
}
-
+
private static void waitUntilAllRegionsAssigned(final int countOfRegions)
throws IOException {
@@ -207,7 +207,7 @@ public class TestZKBasedReopenRegion {
// If I get to here and all rows have a Server, then all have been assigned.
if (rows == countOfRegions) break;
LOG.info("Found=" + rows);
- Threads.sleep(1000);
+ Threads.sleep(1000);
}
}
@@ -255,14 +255,14 @@ public class TestZKBasedReopenRegion {
private static byte [] getTestQualifier() {
return getTestFamily();
}
-
+
public static void main(String args[]) throws Exception {
TestZKBasedReopenRegion.beforeAllTests();
-
+
TestZKBasedReopenRegion test = new TestZKBasedReopenRegion();
test.setup();
test.testOpenRegion();
-
+
TestZKBasedReopenRegion.afterAllTests();
}
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/monitoring/TestTaskMonitor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/monitoring/TestTaskMonitor.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/monitoring/TestTaskMonitor.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/monitoring/TestTaskMonitor.java Wed Mar 12 21:17:13 2014
@@ -32,40 +32,40 @@ public class TestTaskMonitor {
TaskMonitor tm = new TaskMonitor();
assertTrue("Task monitor should start empty",
tm.getTasks().isEmpty());
-
+
// Make a task and fetch it back out
MonitoredTask task = tm.createStatus("Test task");
MonitoredTask taskFromTm = tm.getTasks().get(0);
-
+
// Make sure the state is reasonable.
assertEquals(task.getDescription(), taskFromTm.getDescription());
assertEquals(-1, taskFromTm.getCompletionTimestamp());
assertEquals(MonitoredTask.State.RUNNING, taskFromTm.getState());
-
+
// Mark it as finished
task.markComplete("Finished!");
assertEquals(MonitoredTask.State.COMPLETE, task.getState());
-
+
// It should still show up in the TaskMonitor list
assertEquals(1, tm.getTasks().size());
-
+
// If we mark its completion time back a few minutes, it should get gced
task.expireNow();
assertEquals(0, tm.getTasks().size());
}
-
+
@Test
public void testTasksGetAbortedOnLeak() throws InterruptedException {
final TaskMonitor tm = new TaskMonitor();
assertTrue("Task monitor should start empty",
tm.getTasks().isEmpty());
-
+
final AtomicBoolean threadSuccess = new AtomicBoolean(false);
// Make a task in some other thread and leak it
Thread t = new Thread() {
@Override
public void run() {
- MonitoredTask task = tm.createStatus("Test task");
+ MonitoredTask task = tm.createStatus("Test task");
assertEquals(MonitoredTask.State.RUNNING, task.getState());
threadSuccess.set(true);
}
@@ -74,17 +74,17 @@ public class TestTaskMonitor {
t.join();
// Make sure the thread saw the correct state
assertTrue(threadSuccess.get());
-
+
// Make sure the leaked reference gets cleared
System.gc();
System.gc();
System.gc();
-
- // Now it should be aborted
+
+ // Now it should be aborted
MonitoredTask taskFromTm = tm.getTasks().get(0);
assertEquals(MonitoredTask.State.ABORTED, taskFromTm.getState());
}
-
+
@Test
public void testTaskLimit() throws Exception {
TaskMonitor tm = new TaskMonitor();
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java Wed Mar 12 21:17:13 2014
@@ -12,7 +12,6 @@ import org.apache.hadoop.hbase.HBaseConf
import org.apache.hadoop.hbase.HBaseTestCase;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.HColumnDescriptor;
-import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.KeyValue;
@@ -46,7 +45,7 @@ public class TestBlocksRead extends HBas
}
HRegion region = null;
-
+
private final HBaseTestingUtility testUtil = new HBaseTestingUtility();
private final String DIR = testUtil.getTestDir() + "/TestHRegion/";
@@ -447,7 +446,6 @@ public class TestBlocksRead extends HBas
for (KeyValue kv : results) {
System.out.println(kv.toString());
}
- System.out.println("======");
for (int i = 1; i < 8; i++) {
for (int j = 1; j < 6; j++) {
if (i == 1 && j == 5) {
@@ -458,7 +456,6 @@ public class TestBlocksRead extends HBas
kvs = getData(FAMILY, "row", Arrays.asList("col" + i), j, 1);
verifyData(kvs[0], "row", "col" + i, j);
assertEquals(1, kvs.length);
- System.out.println("=====");
} else {
/**
* We first go on the KV with max timestamp, then land on the actual
@@ -479,7 +476,6 @@ public class TestBlocksRead extends HBas
assertEquals(7 * 3 * 5, optimizedSeeks);
}
-
@Test
public void testDeleteColBloomFilterWithDeletesWithoutFlushCache() throws IOException{
HRegionServer.numOptimizedSeeks.set(0);
@@ -505,10 +501,10 @@ public class TestBlocksRead extends HBas
kvs = getData(FAMILY, "row", Arrays.asList("col2"), 5, 0);
assertTrue(kvs.length == 0);
- kvs = getData(FAMILY, "row", Arrays.asList("col3"), 3, 0);
+ kvs = getData(FAMILY, "row", Arrays.asList("col3"), 3, 0);
verifyData(kvs[0], "row", "col3", 3);
assertEquals(1, kvs.length);
- kvs = getData(FAMILY, "row", Arrays.asList("col6"), 4, 0 );
+ kvs = getData(FAMILY, "row", Arrays.asList("col6"), 4, 0 );
verifyData(kvs[0], "row", "col6", 4);
assertEquals(1, kvs.length);
kvs = getData(FAMILY, "row", Arrays.asList("col7"), 5, 0);
@@ -613,13 +609,11 @@ public class TestBlocksRead extends HBas
kvs = getData(FAMILY, "row", Arrays.asList("col" + i), j, 1);
verifyData(kvs[0], "row", "col" + i, j);
assertEquals(1, kvs.length);
- System.out.println("=====");
} else {
/**
* We first go on the KV with max timestamp, then land on the actual
* KV, which is 2 blocks read
*/
- System.out.println("i: "+ i + "j: "+ j);
kvs = getData(FAMILY, "row", Arrays.asList("col" + i), j, 2);
verifyData(kvs[0], "row", "col" + i, j);
assertEquals(1, kvs.length);
@@ -639,7 +633,8 @@ public class TestBlocksRead extends HBas
* since there are no deletes, the additional gets for puts which are not
* flushed will be counted as optimized too
**/
- assertEquals((7 * 5 * 3 + 4 *3 * 4), optimizedSeeks);
+ int actualSeeks = 7 * 5 * 3 + (2 * 3 + 1) * 4 * 3;
+ assertEquals(actualSeeks, optimizedSeeks);
}
/**
@@ -685,4 +680,89 @@ public class TestBlocksRead extends HBas
assertEquals(2 * BLOOM_TYPE.length, blocksEnd - blocksStart);
}
+
+ @Test
+ public void testDeleteColBloomFilterWithoutDeletesWithFlushCacheOneColumn() throws IOException{
+ HRegionServer.numOptimizedSeeks.set(0);
+ byte[] TABLE = Bytes.toBytes("testDeleteColBloomFilterWithoutDeletesWithFlushCacheOneColumn");
+ String FAMILY = "cf1";
+ String col = "";
+ KeyValue kvs[];
+ HBaseConfiguration conf = getConf();
+ conf.setBoolean("io.storefile.delete.column.bloom.enabled", true);
+ initHRegion(TABLE, getName(), conf, FAMILY, true);
+ if (!conf.getBoolean(BloomFilterFactory.IO_STOREFILE_DELETECOLUMN_BLOOM_ENABLED, false)) {
+ System.out.println("ignoring this test since the delete bloom filter is not enabled...");
+ return;
+ }
+ for (int i = 1; i < 100; i++) {
+ putData(FAMILY, "row", col, i);
+ }
+ region.flushcache();
+ for (int i = 1; i < 100; i++) {
+ if (i == 99) {
+ kvs = getData(FAMILY, "row", Arrays.asList(col), i, 1);
+ } else if (i == 98){
+ kvs = getData(FAMILY, "row", Arrays.asList(col), i, 2);
+ } else {
+ kvs = getData(FAMILY, "row", Arrays.asList(col), i, 3);
+ }
+ verifyData(kvs[0], "row", col, i);
+ assertEquals(1, kvs.length);
+ }
+ }
+
+ /**
+ * One row, two columns, adding data for both columns, afterwards deleting the
+ * second column. We should not get any data and optimized seeks should not
+ * changed when we try to do get against the deleted column
+ *
+ * @throws IOException
+ */
+ @Test
+ public void testOptimizedSeeksWithAndWithoutDeletes() throws IOException {
+ HRegionServer.numOptimizedSeeks.set(0);
+ byte[] TABLE = Bytes.toBytes("testOptimizedSeeksWithAndWithoutDeletes");
+ String FAMILY = "cf1";
+ HBaseConfiguration conf = getConf();
+ KeyValue kvs[];
+ conf.setBoolean("io.storefile.delete.column.bloom.enabled", true);
+ initHRegion(TABLE, getName(), conf, FAMILY, true);
+ if (!conf.getBoolean(
+ BloomFilterFactory.IO_STOREFILE_DELETECOLUMN_BLOOM_ENABLED, false)) {
+ System.out
+ .println("ignoring this test since the delete bloom filter is not enabled...");
+ return;
+ }
+ for (int col = 1; col < 2; col++) {
+ for (int i = 1; i < 5; i++) {
+ putData(FAMILY, "row", "col" + col, i);
+ }
+ }
+ deleteColumn(FAMILY, "col2", "row");
+ region.flushcache();
+
+ int previousOptimizedSeeks = 0;
+ for (int col = 1; col < 2; col++) {
+ for (int i = 1; i < 5; i++) {
+ if (col == 2) {
+ if (previousOptimizedSeeks != HRegionServer.numOptimizedSeeks.get()) {
+ assertFalse("num optimized seeks increased during querying deleted column!", false);
+ }
+ kvs = getData(FAMILY, "row", Arrays.asList("col2"), i, 0);
+ assertTrue(kvs.length == 0);
+ } else {
+ if (i == 4) {
+ kvs = getData(FAMILY, "row", Arrays.asList("col" + col), i, 1);
+ } else {
+ kvs = getData(FAMILY, "row", Arrays.asList("col" + col), i, 2);
+ }
+ verifyData(kvs[0], "row", "col"+col, i);
+ assertEquals(1, kvs.length);
+ }
+ previousOptimizedSeeks = HRegionServer.numOptimizedSeeks.get();
+ }
+ }
+ assertEquals(4 * 3, HRegionServer.numOptimizedSeeks.get());
+ }
}
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java Wed Mar 12 21:17:13 2014
@@ -103,7 +103,7 @@ public class TestFSErrorsExposed {
}
fail("Scanner didn't throw after faults injected");
} catch (IOException ioe) {
- LOG.info("Got expected exception", ioe);
+ LOG.info("Got expected exception", ioe);
assertTrue(ioe.getMessage().contains("Fault"));
}
reader.close(true); // end of test so evictOnClose
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionCloseRetry.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionCloseRetry.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionCloseRetry.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionCloseRetry.java Wed Mar 12 21:17:13 2014
@@ -1,5 +1,21 @@
/**
+ * Copyright 2014 The Apache Software Foundation
*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.hadoop.hbase.regionserver;
@@ -21,17 +37,18 @@ import org.apache.hadoop.hbase.client.HT
import org.apache.hadoop.hbase.executor.HBaseEventHandler.HBaseEventType;
import org.apache.hadoop.hbase.executor.RegionTransitionEventData;
import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.TagRunner;
+import org.apache.hadoop.hbase.util.TestTag;
import org.apache.hadoop.hbase.util.Writables;
import org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper;
import org.apache.zookeeper.data.Stat;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.junit.runner.RunWith;
-/**
- * @author pritam
- */
+@RunWith(TagRunner.class)
public class TestHRegionCloseRetry {
final Log LOG = LogFactory.getLog(getClass());
private static final Configuration conf = HBaseConfiguration.create();
@@ -52,7 +69,8 @@ public class TestHRegionCloseRetry {
TEST_UTIL.shutdownMiniCluster();
}
- @Test
+ @Test(timeout = 300000)
+ @TestTag({ "unstable" })
public void testCloseHRegionRetry() throws Exception {
// Build some data.
@@ -66,11 +84,10 @@ public class TestHRegionCloseRetry {
// Pick a regionserver.
HRegionServer server = null;
HRegionInfo regionInfo = null;
- Configuration conf = TEST_UTIL.getConfiguration();
for (int i = 0; i < 3; i++) {
server = TEST_UTIL.getHBaseCluster().getRegionServer(i);
- // Some initialiation relevant to zk.
+ // Some initialization relevant to zk.
HRegion[] region = server.getOnlineRegionsAsArray();
for (int j = 0; j < region.length; j++) {
if (!region[j].getRegionInfo().isRootRegion()
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java?rev=1576909&r1=1576908&r2=1576909&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java Wed Mar 12 21:17:13 2014
@@ -70,7 +70,7 @@ public class TestMultiColumnScanner {
LogFactory.getLog(TestMultiColumnScanner.class);
private static final String TABLE_NAME = "TestMultiColumnScanner";
-
+
// These fields are used in other unit tests
static final String FAMILY = "CF";
static final byte[] FAMILY_BYTES = Bytes.toBytes(FAMILY);
@@ -135,11 +135,11 @@ public class TestMultiColumnScanner {
schemaMetrics = SchemaMetrics.getInstance(TABLE_NAME, FAMILY);
}
-
+
@Parameters
public static final Collection<Object[]> parameters() {
List<Object[]> parameters = new ArrayList<Object[]>();
- for (Object[] bloomAndCompressionParams :
+ for (Object[] bloomAndCompressionParams :
HBaseTestingUtility.BLOOM_AND_COMPRESSION_COMBINATIONS) {
for (boolean useDataBlockEncoding : new boolean[]{false, true}) {
parameters.add(ArrayUtils.add(bloomAndCompressionParams,