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:
IntegrationTestTimeBoundedRequestsWithRegionReplicas.TimeBoundedMultiThreadedReader.TimeBoundedMultiThreadedReaderThread
,MultiThreadedReaderWithACL.HBaseReaderThreadWithACL
- Enclosing class:
- MultiThreadedReader
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Modifier and TypeFieldDescriptionprivate long
The "current" key being read.private boolean
protected final int
private boolean
If we are ahead of the writer and reading a random key.protected long
Time when the thread startedprotected final org.apache.hadoop.hbase.client.Table
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected org.apache.hadoop.hbase.client.Get
createGet
(long keyToRead) protected org.apache.hadoop.hbase.client.Table
protected long
private long
Should only be used for the concurrent writer/reader workload.void
queryKey
(org.apache.hadoop.hbase.client.Get[] gets, boolean verify, long[] keysToRead) void
queryKey
(org.apache.hadoop.hbase.client.Get get, boolean verify, long keyToRead) private org.apache.hadoop.hbase.client.Get[]
readKey
(long[] keysToRead) void
run()
private void
protected void
verifyResultsAndUpdateMetrics
(boolean verify, org.apache.hadoop.hbase.client.Get[] gets, long elapsedNano, org.apache.hadoop.hbase.client.Result[] results, org.apache.hadoop.hbase.client.Table table, boolean isNullExpected) protected void
verifyResultsAndUpdateMetrics
(boolean verify, org.apache.hadoop.hbase.client.Get get, long elapsedNano, org.apache.hadoop.hbase.client.Result result, org.apache.hadoop.hbase.client.Table table, boolean isNullExpected) private void
verifyResultsAndUpdateMetricsOnAPerGetBasis
(boolean verify, org.apache.hadoop.hbase.client.Get get, org.apache.hadoop.hbase.client.Result result, org.apache.hadoop.hbase.client.Table table, boolean isNullExpected) Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, 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.numThreads
will 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
public void queryKey(org.apache.hadoop.hbase.client.Get[] gets, boolean verify, long[] keysToRead) throws IOException - Throws:
IOException
-
queryKey
public void queryKey(org.apache.hadoop.hbase.client.Get get, boolean verify, long keyToRead) throws IOException - Throws:
IOException
-
verifyResultsAndUpdateMetrics
protected void verifyResultsAndUpdateMetrics(boolean verify, org.apache.hadoop.hbase.client.Get[] gets, long elapsedNano, org.apache.hadoop.hbase.client.Result[] results, org.apache.hadoop.hbase.client.Table table, boolean isNullExpected) throws IOException - Throws:
IOException
-
verifyResultsAndUpdateMetrics
protected void verifyResultsAndUpdateMetrics(boolean verify, org.apache.hadoop.hbase.client.Get get, long elapsedNano, org.apache.hadoop.hbase.client.Result result, org.apache.hadoop.hbase.client.Table table, boolean isNullExpected) throws IOException - Throws:
IOException
-
verifyResultsAndUpdateMetricsOnAPerGetBasis
private void verifyResultsAndUpdateMetricsOnAPerGetBasis(boolean verify, org.apache.hadoop.hbase.client.Get get, org.apache.hadoop.hbase.client.Result result, org.apache.hadoop.hbase.client.Table table, boolean isNullExpected) throws IOException - Throws:
IOException
-