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
Nested ClassesModifier and TypeClassDescriptionprivate static enumstatic classstatic classNested classes/interfaces inherited from class org.apache.hadoop.hbase.test.IntegrationTestLoadAndVerify
IntegrationTestLoadAndVerify.LoadMapper, IntegrationTestLoadAndVerify.VerifyReducer, IntegrationTestLoadAndVerify.WALSearcherNested classes/interfaces inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.util.AbstractHBaseTool.OptionsOrderComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final charprivate static final Stringprivate static final Stringprivate static final String[]private static final charprivate static final longprivate static final Stringprivate longprivate longprivate longprivate longprivate longprivate longprivate longprivate longprivate static final charprivate static final Stringprivate static final Stringprivate static final intprivate static final Stringprivate static final byte[]private static final Stringprivate static final byte[]private static final Stringprivate static Stringprivate static org.apache.hadoop.hbase.security.Userprivate static org.apache.hadoop.hbase.security.Userprivate static Stringprivate static final String[]private static final intFields inherited from class org.apache.hadoop.hbase.test.IntegrationTestLoadAndVerify
FOUND_GROUP_KEY, SEARCHER_INPUTDIR_KEYFields inherited from class org.apache.hadoop.hbase.IntegrationTestBase
CHAOS_MONKEY_PROPS, monkey, MONKEY_LONG_OPT, monkeyProps, monkeyToUse, NO_CLUSTER_CLEANUP_LONG_OPT, noClusterCleanUp, utilFields inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
cmdLineArgs, conf, EXIT_FAILURE, EXIT_SUCCESS, LONG_HELP_OPTION, options, SHORT_HELP_OPTION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprotected voidprotected org.apache.hadoop.mapreduce.JobdoLoad(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) protected voiddoVerify(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) private org.apache.hadoop.mapreduce.JobdoVerify(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd, String... auths) static voidvoidprotected voidprocessOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) intprivate static voidsetJobScannerConf(org.apache.hadoop.mapreduce.Job job) protected voidsetMapperClass(org.apache.hadoop.mapreduce.Job job) voidMethods inherited from class org.apache.hadoop.hbase.test.IntegrationTestLoadAndVerify
cleanUpCluster, getColumnFamilies, getTablename, getTestDir, readKeysToSearch, swapLong, testLoadAndVerifyMethods inherited from class org.apache.hadoop.hbase.IntegrationTestBase
cleanUp, cleanUpMonkey, cleanUpMonkey, doWork, getConf, getDefaultMonkeyFactory, getTestingUtil, loadMonkeyProperties, processBaseOptions, setUp, setUpMonkey, startMonkeyMethods 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:
setUpClusterin classIntegrationTestLoadAndVerify- Throws:
Exception
-
addOptions
- Overrides:
addOptionsin 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:
doLoadin classIntegrationTestLoadAndVerify- Throws:
Exception
-
setMapperClass
- Overrides:
setMapperClassin classIntegrationTestLoadAndVerify
-
doVerify
protected void doVerify(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd) throws Exception - Overrides:
doVerifyin 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:
printUsagein classIntegrationTestLoadAndVerify
-
runTestFromCommandLine
- Overrides:
runTestFromCommandLinein classIntegrationTestLoadAndVerify- Throws:
Exception
-
processOptions
- Overrides:
processOptionsin classIntegrationTestLoadAndVerify
-
main
- Throws:
Exception
-