Package org.apache.hadoop.hbase.util
Class MultiThreadedReader.HBaseReaderThread
java.lang.Object
java.lang.Thread
org.apache.hadoop.hbase.util.MultiThreadedReader.HBaseReaderThread
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
MultiThreadedReaderWithACL.HBaseReaderThreadWithACL
- Enclosing class:
- MultiThreadedReader
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longThe "current" key being read.private booleanprotected final intprivate booleanIf we are ahead of the writer and reading a random key.protected longTime when the thread startedprotected final TableFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected GetcreateGet(long keyToRead) protected Tableprotected longprivate longShould only be used for the concurrent writer/reader workload.voidvoidprivate Get[]readKey(long[] keysToRead) voidrun()private voidprotected voidverifyResultsAndUpdateMetrics(boolean verify, Get[] gets, long elapsedNano, Result[] results, Table table, boolean isNullExpected) protected voidverifyResultsAndUpdateMetrics(boolean verify, Get get, long elapsedNano, Result result, Table table, boolean isNullExpected) private voidverifyResultsAndUpdateMetricsOnAPerGetBasis(boolean verify, Get get, Result result, Table table, boolean isNullExpected) Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
readerId
-
table
-
curKey
The "current" key being read. Increases from startKey to endKey. -
startTimeMs
Time when the thread started -
readingRandomKey
If we are ahead of the writer and reading a random key. -
printExceptionTrace
-
-
Constructor Details
-
HBaseReaderThread
- Parameters:
readerId- only the keys with this remainder from division byMultiThreadedAction.numThreadswill be read by this thread- Throws:
IOException
-
-
Method Details
-
createTable
- Throws:
IOException
-
run
-
closeTable
-
runReader
-
maxKeyWeCanRead
Should only be used for the concurrent writer/reader workload. The maximum key we are allowed to read, subject to the "key window" constraint. -
getNextKeyToRead
-
readKey
-
createGet
- Throws:
IOException
-
queryKey
- Throws:
IOException
-
queryKey
- Throws:
IOException
-
verifyResultsAndUpdateMetrics
protected void verifyResultsAndUpdateMetrics(boolean verify, Get[] gets, long elapsedNano, Result[] results, Table table, boolean isNullExpected) throws IOException - Throws:
IOException
-
verifyResultsAndUpdateMetrics
protected void verifyResultsAndUpdateMetrics(boolean verify, Get get, long elapsedNano, Result result, Table table, boolean isNullExpected) throws IOException - Throws:
IOException
-
verifyResultsAndUpdateMetricsOnAPerGetBasis
private void verifyResultsAndUpdateMetricsOnAPerGetBasis(boolean verify, Get get, Result result, Table table, boolean isNullExpected) throws IOException - Throws:
IOException
-