flexAsynch只能本地连接,而且使用缺省的1186端口,这个真是情况下肯定不够用
diff flexAsynch.cpp.71 flexAsynch.cpp
198c198
< static Ndb_cluster_connection * g_cluster_connection = 0;
---
> static Ndb_cluster_connection *g_cluster_connection[1024];
264c264
< g_cluster_connection = new Ndb_cluster_connection [tConnections];
---
> // g_cluster_connection = new Ndb_cluster_connection [tConnections];
269a270
>
272,273c273,282
< if(g_cluster_connection[i].connect(12, 5, 1) != 0)
< return NDBT_ProgramExit(NDBT_FAILED);
---
> if (i % 2 == 0)
> {
> g_cluster_connection[i] = new Ndb_cluster_connection("db1:1186");
>
> }else
> {
> g_cluster_connection[i] = new Ndb_cluster_connection("db2:1186");
> }
> if(g_cluster_connection[i]->connect(12, 5, 1) != 0)
> return NDBT_ProgramExit(NDBT_FAILED);
281c290
< Ndb * pNdb = new Ndb(g_cluster_connection+0, "TEST_DB");
---
> Ndb * pNdb = new Ndb(g_cluster_connection[0], "TEST_DB");
636c645,651
< delete [] g_cluster_connection;
---
> // delete [] g_cluster_connection;
> for (int i = 0; i < tConnections; i++)
> {
> delete g_cluster_connection[i];
> }
>
>
656c671
< localNdb = new Ndb(g_cluster_connection+(threadNo % tConnections), "TEST_DB");
---
> localNdb = new Ndb(g_cluster_connection[threadNo % tConnections], "TEST_DB");
阅读(1854) | 评论(0) | 转发(0) |