OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.tests.ConcurrencyTest.SqlCommandThread Class Reference
+ Inheritance diagram for com.mapd.tests.ConcurrencyTest.SqlCommandThread:
+ Collaboration diagram for com.mapd.tests.ConcurrencyTest.SqlCommandThread:

Public Member Functions

void run ()
 

Package Functions

 SqlCommandThread (final String threadName, final List< String > queries, int threadId, int port, int iterations, final List< String > exceptions, final List< String > cleanUpQueries)
 
 SqlCommandThread (final String threadName, final List< String > queries, int threadId, final List< String > exceptions, final List< String > cleanUpQueries)
 

Package Attributes

final List< String > queries
 
final List< String > expectedExceptionTexts
 
final List< String > cleanUpQueries
 
final String threadName
 
final int port
 
final int iterations
 
final int threadId
 

Detailed Description

Definition at line 230 of file ConcurrencyTest.java.

Constructor & Destructor Documentation

com.mapd.tests.ConcurrencyTest.SqlCommandThread.SqlCommandThread ( final String  threadName,
final List< String >  queries,
int  threadId,
int  port,
int  iterations,
final List< String >  exceptions,
final List< String >  cleanUpQueries 
)
inlinepackage
com.mapd.tests.ConcurrencyTest.SqlCommandThread.SqlCommandThread ( final String  threadName,
final List< String >  queries,
int  threadId,
final List< String >  exceptions,
final List< String >  cleanUpQueries 
)
inlinepackage

Member Function Documentation

void com.mapd.tests.ConcurrencyTest.SqlCommandThread.run ( )
inline

Definition at line 266 of file ConcurrencyTest.java.

References com.mapd.tests.ConcurrencyTest.db, com.mapd.tests.ConcurrencyTest.SqlCommandThread.expectedExceptionTexts, com.mapd.tests.ConcurrencyTest.SqlCommandThread.iterations, com.mapd.tests.ConcurrencyTest.localhost, com.mapd.tests.ConcurrencyTest.password, com.mapd.tests.ConcurrencyTest.SqlCommandThread.port, com.mapd.tests.ConcurrencyTest.SqlCommandThread.queries, com.mapd.tests.ConcurrencyTest.SqlCommandThread.threadName, and com.mapd.tests.ConcurrencyTest.userName.

266  {
267  logger.info(" Starting: " + threadName);
268  try {
269  HeavyDBTestClient user =
270  HeavyDBTestClient.getClient(localhost, port, db, userName, password);
271  barrier.await(); // Synch point.
272  for (int iteration = 0; iteration < iterations; ++iteration) {
273  for (String query : queries) {
274  logger.info(" " + threadName + "[" + iteration + "]: " + query);
275  try {
276  user.runSql(query);
277  } catch (TDBException e) {
278  boolean foundExpected = false;
279  for (String exceptionText : expectedExceptionTexts) {
280  if (e.error_msg.contains(exceptionText)) {
281  foundExpected = true;
282  }
283  }
284  if (!foundExpected) {
285  throw e;
286  }
287  }
288  }
289  }
290  } catch (TDBException e) {
291  logger.error(" " + threadName + ": caught exception - " + e.error_msg);
292  exceptionTexts.add(threadName + ": " + e.error_msg);
293  } catch (Exception e) {
294  logger.error(" " + threadName + ": caught exception - " + e.getMessage());
295  exceptionTexts.add(threadName + ": " + e.getMessage());
296  }
297  logger.info(" Finished: " + threadName);
298  }

Member Data Documentation

final List<String> com.mapd.tests.ConcurrencyTest.SqlCommandThread.cleanUpQueries
package
final List<String> com.mapd.tests.ConcurrencyTest.SqlCommandThread.expectedExceptionTexts
package
final int com.mapd.tests.ConcurrencyTest.SqlCommandThread.iterations
package
final int com.mapd.tests.ConcurrencyTest.SqlCommandThread.port
package
final List<String> com.mapd.tests.ConcurrencyTest.SqlCommandThread.queries
package
final int com.mapd.tests.ConcurrencyTest.SqlCommandThread.threadId
package
final String com.mapd.tests.ConcurrencyTest.SqlCommandThread.threadName
package

The documentation for this class was generated from the following file: