HBaseTestingUtility
public abstract class HBaseTestCase
extends TestCase
Modifier and Type | Class and Description |
---|---|
static class |
HBaseTestCase.ClientScannerIncommon
Deprecated.
|
static interface |
HBaseTestCase.FlushCache
Deprecated.
Implementors can flushcache.
|
static class |
HBaseTestCase.HRegionIncommon
Deprecated.
A class that makes a
HBaseTestCase.Incommon out of a HRegion |
static class |
HBaseTestCase.HTableIncommon
Deprecated.
A class that makes a
HBaseTestCase.Incommon out of a HTable |
static interface |
HBaseTestCase.Incommon
Deprecated.
Interface used by tests so can do common operations against an HTable
or an HRegion.
|
static class |
HBaseTestCase.InternalScannerIncommon
Deprecated.
|
static interface |
HBaseTestCase.ScannerIncommon
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
protected static byte[][] |
COLUMNS
Deprecated.
|
Configuration |
conf
Deprecated.
|
protected static byte[] |
fam1
Deprecated.
|
protected static byte[] |
fam2
Deprecated.
|
protected static byte[] |
fam3
Deprecated.
|
protected static char |
FIRST_CHAR
Deprecated.
|
protected FileSystem |
fs
Deprecated.
|
FSTableDescriptors |
fsTableDescriptors
Deprecated.
|
protected static char |
LAST_CHAR
Deprecated.
|
protected static int |
MAXVERSIONS
Deprecated.
|
protected HRegion |
meta
Deprecated.
|
protected static String |
PUNCTUATION
Deprecated.
|
protected String |
START_KEY
Deprecated.
|
protected static byte[] |
START_KEY_BYTES
Deprecated.
|
protected static Path |
testDir
Deprecated.
|
protected HBaseTestingUtility |
testUtil
Deprecated.
|
Constructor and Description |
---|
HBaseTestCase()
Deprecated.
constructor
|
HBaseTestCase(String name)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static long |
addContent(HBaseTestCase.Incommon updater,
String columnFamily)
Deprecated.
Add content to region
r on the passed column
column . |
static long |
addContent(HBaseTestCase.Incommon updater,
String columnFamily,
byte[] startKeyBytes,
byte[] endKey)
Deprecated.
Add content to region
r on the passed column
column . |
static long |
addContent(HBaseTestCase.Incommon updater,
String family,
String column)
Deprecated.
|
static long |
addContent(HBaseTestCase.Incommon updater,
String family,
String column,
byte[] startKeyBytes,
byte[] endKey)
Deprecated.
|
static long |
addContent(HBaseTestCase.Incommon updater,
String columnFamily,
String column,
byte[] startKeyBytes,
byte[] endKey,
long ts)
Deprecated.
Add content to region
r on the passed column
column . |
static long |
addContent(Region r,
byte[] columnFamily)
Deprecated.
|
static long |
addContent(Region r,
byte[] columnFamily,
byte[] column)
Deprecated.
Add content to region
r on the passed column
column . |
static void |
assertByteEquals(byte[] expected,
byte[] actual)
Deprecated.
|
static void |
assertEquals(byte[] expected,
byte[] actual)
Deprecated.
|
protected void |
assertResultEquals(HRegion region,
byte[] row,
byte[] family,
byte[] qualifier,
long timestamp,
byte[] value)
Deprecated.
|
protected void |
closeRootAndMeta()
Deprecated.
|
protected void |
createMetaRegion()
Deprecated.
You must call
closeRootAndMeta() when done after calling this
method. |
HRegion |
createNewHRegion(HTableDescriptor desc,
byte[] startKey,
byte[] endKey)
Deprecated.
You must call close on the returned region and then close on the log file
it created.
|
HRegion |
createNewHRegion(HTableDescriptor desc,
byte[] startKey,
byte[] endKey,
Configuration conf)
Deprecated.
|
protected HTableDescriptor |
createTableDescriptor(String name)
Deprecated.
Create a table of name
name with COLUMNS for
families. |
protected HTableDescriptor |
createTableDescriptor(String name,
int versions)
Deprecated.
Create a table of name
name with COLUMNS for
families. |
protected HTableDescriptor |
createTableDescriptor(String name,
int minVersions,
int versions,
int ttl,
KeepDeletedCells keepDeleted)
Deprecated.
Create a table of name
name with COLUMNS for
families. |
protected Path |
getUnitTestdir(String testName)
Deprecated.
|
protected HRegion |
openClosedRegion(HRegion closedRegion)
Deprecated.
|
protected void |
setUp()
Deprecated.
Note that this method must be called after the mini hdfs cluster has
started or we end up with a local file system.
|
static void |
shutdownDfs(MiniDFSCluster cluster)
Deprecated.
Common method to close down a MiniDFSCluster and the associated file system
|
protected void |
tearDown()
Deprecated.
|
protected static final byte[] fam1
protected static final byte[] fam2
protected static final byte[] fam3
protected static final byte[][] COLUMNS
protected static Path testDir
protected FileSystem fs
protected HRegion meta
protected static final char FIRST_CHAR
protected static final char LAST_CHAR
protected static final String PUNCTUATION
protected static final byte[] START_KEY_BYTES
protected String START_KEY
protected static final int MAXVERSIONS
protected final HBaseTestingUtility testUtil
public volatile Configuration conf
public final FSTableDescriptors fsTableDescriptors
public HBaseTestCase()
public HBaseTestCase(String name)
name
- protected void setUp() throws Exception
Exception
protected Path getUnitTestdir(String testName)
testName
- HBaseCommonTestingUtility.getBaseTestDir()
public HRegion createNewHRegion(HTableDescriptor desc, byte[] startKey, byte[] endKey) throws IOException
HRegion.close()
followed by HRegion.getWAL()
and on it call close.desc
- startKey
- endKey
- HRegion
IOException
public HRegion createNewHRegion(HTableDescriptor desc, byte[] startKey, byte[] endKey, Configuration conf) throws IOException
IOException
protected HRegion openClosedRegion(HRegion closedRegion) throws IOException
IOException
protected HTableDescriptor createTableDescriptor(String name)
name
with COLUMNS
for
families.name
- Name to give table.protected HTableDescriptor createTableDescriptor(String name, int versions)
name
with COLUMNS
for
families.name
- Name to give table.versions
- How many versions to allow per column.protected HTableDescriptor createTableDescriptor(String name, int minVersions, int versions, int ttl, KeepDeletedCells keepDeleted)
name
with COLUMNS
for
families.name
- Name to give table.versions
- How many versions to allow per column.public static long addContent(Region r, byte[] columnFamily, byte[] column) throws IOException
r
on the passed column
column
.
Adds data of the from 'aaa', 'aab', etc where key and value are the same.r
- columnFamily
- column
- IOException
public static long addContent(Region r, byte[] columnFamily) throws IOException
IOException
public static long addContent(HBaseTestCase.Incommon updater, String columnFamily) throws IOException
r
on the passed column
column
.
Adds data of the from 'aaa', 'aab', etc where key and value are the same.updater
- An instance of HBaseTestCase.Incommon
.columnFamily
- writeToWAL
- IOException
public static long addContent(HBaseTestCase.Incommon updater, String family, String column) throws IOException
IOException
public static long addContent(HBaseTestCase.Incommon updater, String columnFamily, byte[] startKeyBytes, byte[] endKey) throws IOException
r
on the passed column
column
.
Adds data of the from 'aaa', 'aab', etc where key and value are the same.updater
- An instance of HBaseTestCase.Incommon
.columnFamily
- startKeyBytes
- Where to start the rows insertedendKey
- Where to stop inserting rows.writeToWAL
- IOException
public static long addContent(HBaseTestCase.Incommon updater, String family, String column, byte[] startKeyBytes, byte[] endKey) throws IOException
IOException
public static long addContent(HBaseTestCase.Incommon updater, String columnFamily, String column, byte[] startKeyBytes, byte[] endKey, long ts) throws IOException
r
on the passed column
column
.
Adds data of the from 'aaa', 'aab', etc where key and value are the same.updater
- An instance of HBaseTestCase.Incommon
.column
- startKeyBytes
- Where to start the rows insertedendKey
- Where to stop inserting rows.ts
- Timestamp to write the content with.writeToWAL
- IOException
protected void assertResultEquals(HRegion region, byte[] row, byte[] family, byte[] qualifier, long timestamp, byte[] value) throws IOException
IOException
public static void shutdownDfs(MiniDFSCluster cluster)
cluster
- protected void createMetaRegion() throws IOException
closeRootAndMeta()
when done after calling this
method. It does cleanup.IOException
protected void closeRootAndMeta() throws IOException
IOException
public static void assertByteEquals(byte[] expected, byte[] actual)
public static void assertEquals(byte[] expected, byte[] actual)