Inlining some functions related to connection pool

pull/1838/head
René Cannaò 8 years ago
parent 96f179f943
commit 883d66a71f

@ -305,7 +305,7 @@ class MySrvConnList {
}
MySQL_Connection *remove(int);
MySQL_Connection * get_random_MyConn(MySQL_Session *sess, bool ff);
unsigned int conns_length();
unsigned int conns_length() { return conns->len; }
void drop_all_connections();
MySQL_Connection *index(unsigned int);
};
@ -364,12 +364,12 @@ class MySrvList { // MySQL Server List
int find_idx(MySrvC *);
public:
PtrArray *servers;
unsigned int cnt();
unsigned int cnt() { return servers->len; }
MySrvList(MyHGC *);
~MySrvList();
void add(MySrvC *);
void remove(MySrvC *);
MySrvC * idx(unsigned int);
MySrvC * idx(unsigned int i) {return (MySrvC *)servers->index(i); }
};
class MyHGC { // MySQL Host Group Container

@ -638,9 +638,11 @@ MySQL_Connection * MySrvConnList::remove(int _k) {
return (MySQL_Connection *)conns->remove_index_fast(_k);
}
/*
unsigned int MySrvConnList::conns_length() {
return conns->len;
}
*/
MySrvConnList::MySrvConnList(MySrvC *_mysrvc) {
mysrvc=_mysrvc;
@ -2211,11 +2213,11 @@ MySrvC *MyHGC::get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid) {
return NULL; // if we reach here, we couldn't find any target
}
unsigned int MySrvList::cnt() {
return servers->len;
}
//unsigned int MySrvList::cnt() {
// return servers->len;
//}
MySrvC * MySrvList::idx(unsigned int i) { return (MySrvC *)servers->index(i); }
//MySrvC * MySrvList::idx(unsigned int i) { return (MySrvC *)servers->index(i); }
MySQL_Connection * MySrvConnList::get_random_MyConn(MySQL_Session *sess, bool ff) {
MySQL_Connection * conn=NULL;

Loading…
Cancel
Save