private static class DropWhileConnectingTest.Report
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int[] |
accessCounts
The number of successful connections made by the worker threads.
|
private java.lang.Throwable[] |
exceptions
Any unexpected exceptions encountered by the worker threads.
|
private java.io.File |
failureFolder
Failure folder where any exceptions will be logged to file.
|
private boolean |
hasExceptions |
private boolean |
ready |
private java.lang.Object |
sync
Sync object used to start the threads.
|
private int |
threadsDone |
private java.io.PrintWriter |
writer
Writer used to log stack traces, lazily initialized.
|
Constructor and Description |
---|
Report(java.io.File failureFolder,
int accessThreads)
Creates a report object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allThreadsDone()
Tells if all the access threads have finished.
|
private void |
dumpToFile(int id,
java.lang.Throwable exception)
Dumps the exception to file.
|
java.lang.Object |
getSync() |
boolean |
hasUnexpectedExceptions() |
boolean |
ready()
Tells if the test is ready to start.
|
int |
remainingThreads() |
void |
reportAccessCount(int id,
int accessCount)
Reports the access count for the specified worker thread.
|
void |
reportError(int id,
int accessCount,
java.lang.Throwable error)
Reports an unexpected error and the access count for the specified
worker thread.
|
void |
start() |
java.lang.String |
toString() |
private final java.lang.Object sync
private boolean ready
private final java.io.File failureFolder
private java.io.PrintWriter writer
private final int[] accessCounts
private final java.lang.Throwable[] exceptions
private int threadsDone
private boolean hasExceptions
public Report(java.io.File failureFolder, int accessThreads)
failureFolder
- where to write exceptions toaccessThreads
- number of worker threadspublic boolean hasUnexpectedExceptions()
public void reportAccessCount(int id, int accessCount)
id
- worker thread id, must be in the range [0, threadCount>accessCount
- number of successful accesses made to the dbpublic void reportError(int id, int accessCount, java.lang.Throwable error)
id
- worker thread id, must be in the range [0, threadCount>accessCount
- number of successful accesses made to the dberror
- error to reportpublic boolean allThreadsDone()
true
if all threads have finished,
false
otherwise.public int remainingThreads()
public java.lang.Object getSync()
public boolean ready()
true
if the access threads can start.public void start()
public java.lang.String toString()
toString
in class java.lang.Object
private void dumpToFile(int id, java.lang.Throwable exception)
id
- internal id for the thread that got the exceptionexception
- the exception to dumpApache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.