1
1
/*
2
- Copyright (c) 2011, 2013 , Oracle and/or its affiliates. All rights reserved.
2
+ Copyright (c) 2011, 2017 , Oracle and/or its affiliates. All rights reserved.
3
3
4
4
This program is free software; you can redistribute it and/or modify
5
5
it under the terms of the GNU General Public License as published by
@@ -53,9 +53,7 @@ friend class Ndb_cluster_connection_impl;
53
53
54
54
/* * The private constructor is used only by ndb_cluster_connection.
55
55
It allocates and initializes an NdbWaitGroup with an initial array
56
- of Ndb objects.
57
- In the version 1 API, the initial size is the fixed maximum size.
58
- In the version 2 API, the array will grow as needed.
56
+ of Ndb objects. The array will grow beyond the initial size as needed.
59
57
*/
60
58
NdbWaitGroup (Ndb_cluster_connection *conn, int initial_size);
61
59
@@ -64,8 +62,6 @@ friend class Ndb_cluster_connection_impl;
64
62
65
63
public:
66
64
67
- /* ***** VERSION 2 API *******/
68
-
69
65
/* * Push an Ndb object onto the wait queue.
70
66
This is thread-safe: multiple threads can call push().
71
67
Returns 0 on success, non-zero on error.
@@ -99,55 +95,23 @@ friend class Ndb_cluster_connection_impl;
99
95
*/
100
96
Ndb * pop ();
101
97
102
-
103
-
104
- /* ***** COMMON API *********/
105
-
106
98
/* * Wake up the thread that is currently waiting on this group.
107
99
This can be used by other threads to signal a condition to the
108
100
waiting thread.
109
101
If no thread is currently waiting, then delivery is not guaranteed.
110
102
*/
111
103
void wakeup ();
112
104
113
-
114
- /* ***** VERSION 1 API *********/
115
-
116
- /* * Add an Ndb object to the group.
117
-
118
- Returns true on success, false on error. Error could be that the Ndb
119
- is created from the wrong Ndb_cluster_connection, or is already in the
120
- group, or that the group is full.
121
- */
122
- bool addNdb (Ndb *);
123
-
124
- /* * wait for Ndbs to be ready.
125
- arrayhead (OUT): on return will hold the list of ready Ndbs.
126
- The call will return when:
127
- (a) at least min_ready Ndbs are ready for polling, or
128
- (b) timeout milliseconds have elapsed, or
129
- (c) another thread has called NdbWaitGroup::wakeup()
130
-
131
- The return value is the number of Ndb objects ready for polling, or -1
132
- if a timeout occured.
133
-
134
- On return, arrayHead is set to point to the first element of
135
- the array of Ndb object pointers that are ready for polling, and those
136
- objects are implicitly no longer in the group. These Ndb *'s must be
137
- read from arrayHead before before any further calls to addNdb().
138
- */
139
- int wait (Ndb ** & arrayHead, Uint32 timeout_millis, int min_ready = 1 );
140
105
141
106
private: /* private instance variables */
142
107
Ndb **m_array;
143
- Int32 m_pos;
144
108
Uint32 m_array_size, m_pos_return;
145
109
Uint32 m_pos_new, m_pos_wait, m_pos_ready;
146
110
147
111
MultiNdbWakeupHandler *m_multiWaitHandler;
148
112
Ndb **m_overflow;
149
113
Int32 m_overflow_size, m_pos_overflow;
150
- Int32 m_nodeId, m_active_version ;
114
+ Int32 m_nodeId;
151
115
152
116
Ndb_cluster_connection *m_conn;
153
117
Ndb *m_wakeNdb;
0 commit comments