Package org.apache.hadoop.hbase.test
Class IntegrationTestWithCellVisibilityLoadAndVerify
java.lang.Object
org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.IntegrationTestBase
org.apache.hadoop.hbase.test.IntegrationTestLoadAndVerify
org.apache.hadoop.hbase.test.IntegrationTestWithCellVisibilityLoadAndVerify
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
A large test which loads a lot of data with cell visibility, and verifies the data. Test adds 2
users with different sets of visibility labels authenticated for them. Every row (so cells in
that) added with visibility expressions. In load step, 200 map tasks are launched, which in turn
write loadmapper.num_to_write (default 100K) rows to an hbase table. Rows are written in blocks,
for a total of 100 blocks. Verify step scans the table as both users with Authorizations. This
step asserts that user can see only those rows (and so cells) with visibility for which they have
label auth. This class can be run as a unit test, as an integration test, or from the command
line. Originally taken from Apache Bigtop. Issue user names as comma seperated list. ./hbase
IntegrationTestWithCellVisibilityLoadAndVerify -u usera,userb
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static enum
static class
static class
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.test.IntegrationTestLoadAndVerify
IntegrationTestLoadAndVerify.LoadMapper, IntegrationTestLoadAndVerify.VerifyReducer, IntegrationTestLoadAndVerify.WALSearcher
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.util.AbstractHBaseTool.OptionsOrderComparator
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final char
private static final String
private static final String
private static final String[]
private static final char
private static final long
private static final String
private long
private long
private long
private long
private long
private long
private long
private long
private static final char
private static final String
private static final String
private static final int
private static final String
private static final byte[]
private static final String
private static final byte[]
private static final String
private static String
private static org.apache.hadoop.hbase.security.User
private static org.apache.hadoop.hbase.security.User
private static String
private static final String[]
private static final int
Fields inherited from class org.apache.hadoop.hbase.test.IntegrationTestLoadAndVerify
FOUND_GROUP_KEY, SEARCHER_INPUTDIR_KEY
Fields inherited from class org.apache.hadoop.hbase.IntegrationTestBase
CHAOS_MONKEY_PROPS, monkey, MONKEY_LONG_OPT, monkeyProps, monkeyToUse, NO_CLUSTER_CLEANUP_LONG_OPT, noClusterCleanUp, util
Fields inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
cmdLineArgs, conf, EXIT_FAILURE, EXIT_SUCCESS, LONG_HELP_OPTION, options, SHORT_HELP_OPTION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
protected void
protected org.apache.hadoop.mapreduce.Job
doLoad
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) protected void
doVerify
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) private org.apache.hadoop.mapreduce.Job
doVerify
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd, String... auths) static void
void
protected void
processOptions
(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) int
private static void
setJobScannerConf
(org.apache.hadoop.mapreduce.Job job) protected void
setMapperClass
(org.apache.hadoop.mapreduce.Job job) void
Methods inherited from class org.apache.hadoop.hbase.test.IntegrationTestLoadAndVerify
cleanUpCluster, getColumnFamilies, getTablename, getTestDir, readKeysToSearch, swapLong, testLoadAndVerify
Methods inherited from class org.apache.hadoop.hbase.IntegrationTestBase
cleanUp, cleanUpMonkey, cleanUpMonkey, doWork, getConf, getDefaultMonkeyFactory, getTestingUtil, loadMonkeyProperties, processBaseOptions, setUp, setUpMonkey, startMonkey
Methods inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
addOption, addOptNoArg, addOptNoArg, addOptWithArg, addOptWithArg, addRequiredOption, addRequiredOptWithArg, addRequiredOptWithArg, doStaticMain, getOptionAsDouble, getOptionAsInt, getOptionAsInt, getOptionAsLong, getOptionAsLong, newParser, parseArgs, parseInt, parseLong, printUsage, processOldArgs, run, setConf
-
Field Details
-
ERROR_STR
- See Also:
-
NOT
- See Also:
-
OR
- See Also:
-
AND
- See Also:
-
TEST_NAME
- See Also:
-
CONFIDENTIAL
- See Also:
-
TOPSECRET
- See Also:
-
SECRET
- See Also:
-
PUBLIC
- See Also:
-
PRIVATE
- See Also:
-
LABELS
-
VISIBILITY_EXPS
-
VISIBILITY_EXPS_COUNT
-
TEST_FAMILY
-
TEST_QUALIFIER
-
NUM_TO_WRITE_KEY
- See Also:
-
NUM_TO_WRITE_DEFAULT
- See Also:
-
SCANNER_CACHING
- See Also:
-
USER_OPT
-
userNames
-
numRowsLoadedWithExp1
-
numRowsLoadedWithExp2
-
numRowsLoadWithExp3
-
numRowsLoadWithExp4
-
numRowsReadWithExp1
-
numRowsReadWithExp2
-
numRowsReadWithExp3
-
numRowsReadWithExp4
-
USER1
-
USER2
-
-
Constructor Details
-
IntegrationTestWithCellVisibilityLoadAndVerify
-
-
Method Details
-
setUpCluster
- Overrides:
setUpCluster
in classIntegrationTestLoadAndVerify
- Throws:
Exception
-
addOptions
- Overrides:
addOptions
in classIntegrationTestBase
-
addLabelsAndAuths
- Throws:
Exception
-
doLoad
protected org.apache.hadoop.mapreduce.Job doLoad(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) throws Exception - Overrides:
doLoad
in classIntegrationTestLoadAndVerify
- Throws:
Exception
-
setMapperClass
- Overrides:
setMapperClass
in classIntegrationTestLoadAndVerify
-
doVerify
protected void doVerify(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) throws Exception - Overrides:
doVerify
in classIntegrationTestLoadAndVerify
- Throws:
Exception
-
doVerify
private org.apache.hadoop.mapreduce.Job doVerify(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd, String... auths) throws IOException, InterruptedException, ClassNotFoundException -
setJobScannerConf
-
printUsage
- Overrides:
printUsage
in classIntegrationTestLoadAndVerify
-
runTestFromCommandLine
- Overrides:
runTestFromCommandLine
in classIntegrationTestLoadAndVerify
- Throws:
Exception
-
processOptions
- Overrides:
processOptions
in classIntegrationTestLoadAndVerify
-
main
- Throws:
Exception
-