|
static void | main (String[] args) throws Exception |
|
|
static final Logger | logger = LoggerFactory.getLogger(CalciteViewsConcurrencyTest.class) |
|
static void com.mapd.tests.CalciteViewsConcurrencyTest.main |
( |
String[] |
args | ) |
throws Exception |
|
inlinestatic |
Definition at line 29 of file CalciteViewsConcurrencyTest.java.
30 CalciteViewsConcurrencyTest test =
new CalciteViewsConcurrencyTest();
31 test.testViewsResolutionConcurrency();
void com.mapd.tests.CalciteViewsConcurrencyTest.testViewsResolutionConcurrency |
( |
| ) |
throws Exception |
|
inline |
Definition at line 34 of file CalciteViewsConcurrencyTest.java.
References run.
35 logger.info(
"testViewsResolutionConcurrency()");
37 HeavyDBTestClient su = HeavyDBTestClient.getClient(
38 "localhost", 6274,
"heavyai",
"admin",
"HyperInteractive");
40 su.runSql(
"CREATE DATABASE db1;");
41 su.runSql(
"CREATE DATABASE db2;");
43 HeavyDBTestClient db1 = HeavyDBTestClient.getClient(
44 "localhost", 6274,
"db1",
"admin",
"HyperInteractive");
45 db1.runSql(
"create table table1 (id integer, description varchar(30));");
46 db1.runSql(
"create table table2 (id integer, description varchar(30));");
47 db1.runSql(
"insert into table1 values (1, 'hello');");
48 db1.runSql(
"insert into table2 values (1, 'db1');");
50 "create view v_goodview as select t1.id, t1.description, t2.description as tbl2Desc from db1.table1 t1, db1.table2 t2;");
52 HeavyDBTestClient db2 = HeavyDBTestClient.getClient(
53 "localhost", 6274,
"db2",
"admin",
"HyperInteractive");
54 db2.runSql(
"create table table1 (id integer, description varchar(30));");
55 db2.runSql(
"create table table2 (id integer, description varchar(30));");
56 db2.runSql(
"insert into table1 values (1, 'hello');");
57 db2.runSql(
"insert into table2 values (1, 'db2');");
59 "create view v_goodview as select t1.id, t1.description, t2.description as tbl2Desc from db2.table1 t1, db2.table2 t2;");
62 Exception exceptions[] =
new Exception[num_threads];
63 List<Thread> threads =
new ArrayList<>();
64 for (
int i = 0; i < num_threads; i++) {
65 final int threadId = i;
66 HeavyDBTestClient con1 = HeavyDBTestClient.getClient(
67 "localhost", 6274,
"db1",
"admin",
"HyperInteractive");
68 HeavyDBTestClient con2 = HeavyDBTestClient.getClient(
69 "localhost", 6274,
"db2",
"admin",
"HyperInteractive");
70 Thread t =
new Thread(
new Runnable() {
74 for (
int i = 0; i < 25; i++) {
75 con1.runSql(
"SELECT * FROM v_goodview;");
76 con2.runSql(
"SELECT * FROM v_goodview;");
78 }
catch (Exception e) {
80 exceptions[threadId] = e;
89 for (Thread t : threads) {
93 su.runSql(
"DROP DATABASE db1;");
94 su.runSql(
"DROP DATABASE db2;");
96 for (Exception e : exceptions) {
final Logger com.mapd.tests.CalciteViewsConcurrencyTest.logger = LoggerFactory.getLogger(CalciteViewsConcurrencyTest.class) |
|
staticpackage |
The documentation for this class was generated from the following file: