1
1
diff --git a/storage/ndb/clusterj/clusterj-api/src/main/java/com/mysql/clusterj/DynamicObject.java b/storage/ndb/clusterj/clusterj-api/src/main/java/com/mysql/clusterj/DynamicObject.java
2
- index 6f2abce3..c03898ca 100644
2
+ index 70c2c4a8..ecb927b2 100644
3
3
--- a/storage/ndb/clusterj/clusterj-api/src/main/java/com/mysql/clusterj/DynamicObject.java
4
4
+++ b/storage/ndb/clusterj/clusterj-api/src/main/java/com/mysql/clusterj/DynamicObject.java
5
- @@ -49,13 +49,13 @@ public abstract class DynamicObject {
5
+ @@ -56,14 +56,14 @@ public abstract class DynamicObject {
6
6
return delegate.found();
7
7
}
8
8
9
+ - @SuppressWarnings("deprecation")
9
10
- protected void finalize() throws Throwable {
10
11
- try {
11
12
- if (delegate != null) {
@@ -15,21 +16,22 @@ index 6f2abce3..c03898ca 100644
15
16
- super.finalize();
16
17
- }
17
18
- }
18
- + // protected void finalize() throws Throwable {
19
- + // try {
20
- + // if (delegate != null) {
21
- + // delegate.release();
22
- + // }
23
- + // } finally {
24
- + // super.finalize();
25
- + // }
26
- + // }
19
+ + // @SuppressWarnings("deprecation")
20
+ + // protected void finalize() throws Throwable {
21
+ + // try {
22
+ + // if (delegate != null) {
23
+ + // delegate.release();
24
+ + // }
25
+ + // } finally {
26
+ + // super.finalize();
27
+ + // }
28
+ + // }
27
29
}
28
30
diff --git a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionFactoryImpl.java b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionFactoryImpl.java
29
- index ac4fcf73..13cb3e1a 100644
31
+ index 58f36b4c..5660d882 100644
30
32
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionFactoryImpl.java
31
33
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionFactoryImpl.java
32
- @@ -151 ,6 +151 ,7 @@ public class SessionFactoryImpl implements SessionFactory, Constants {
34
+ @@ -158 ,6 +158 ,7 @@ public class SessionFactoryImpl implements SessionFactory, Constants {
33
35
// if not using connection pooling, create a new session factory
34
36
result = new SessionFactoryImpl(props);
35
37
}
@@ -38,10 +40,10 @@ index ac4fcf73..13cb3e1a 100644
38
40
}
39
41
40
42
diff --git a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java
41
- index ddc926a8..70c0698d 100644
43
+ index 16fbbb0b..9cf6fde3 100644
42
44
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java
43
45
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java
44
- @@ -60 ,9 +60 ,9 @@ import java.util.Map;
46
+ @@ -64 ,9 +64 ,9 @@ import java.util.Map;
45
47
*/
46
48
public class DomainTypeHandlerImpl<T> extends AbstractDomainTypeHandlerImpl<T> {
47
49
@@ -55,19 +57,19 @@ index ddc926a8..70c0698d 100644
55
57
/** The domain class. */
56
58
Class<T> cls;
57
59
@@ -124,7 +124,7 @@ public class DomainTypeHandlerImpl<T> extends AbstractDomainTypeHandlerImpl<T> {
58
- // Create a proxy class for the domain class
59
- // Invoke the handler's finalizer method when the proxy is finalized
60
- proxyClass = (Class<T>)Proxy.getProxyClass(
61
- - cls.getClassLoader(), new Class[] {cls, Finalizable.class}) ;
62
- + cls.getClassLoader(), new Class[] {cls}) ;
63
- ctor = getConstructorForInvocationHandler (proxyClass);
60
+ throw new ClusterJUserException(local.message(
61
+ "ERR_Not_Persistence_Capable_Type", name));
62
+ }
63
+ - proxyInterfaces = new Class<?>[] {cls, Finalizable.class};
64
+ + proxyInterfaces = new Class<?>[] {cls};
65
+ // Get the table name from Persistence Capable annotation
64
66
persistenceCapable = cls.getAnnotation(PersistenceCapable.class);
65
67
if (persistenceCapable == null) {
66
68
diff --git a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/util/JDK14LoggerImpl.java b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/util/JDK14LoggerImpl.java
67
- index 833acfac..a26e0a3d 100644
69
+ index b762b229..0ebaabcd 100644
68
70
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/util/JDK14LoggerImpl.java
69
71
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/util/JDK14LoggerImpl.java
70
- @@ -46,39 +46,15 @@ public class JDK14LoggerImpl implements Logger {
72
+ @@ -53,66 +53,66 @@ public class JDK14LoggerImpl implements Logger {
71
73
}
72
74
73
75
public void detail(String message) {
@@ -77,6 +79,12 @@ index 833acfac..a26e0a3d 100644
77
79
- String className = element.getClassName();
78
80
- String methodName = element.getMethodName();
79
81
- delegate.logp(Level.FINEST, className, methodName, message);
82
+ + // Throwable t = new Throwable();
83
+ + // StackTraceElement[] stack = t.getStackTrace();
84
+ + // StackTraceElement element = stack[1];
85
+ + // String className = element.getClassName();
86
+ + // String methodName = element.getMethodName();
87
+ + // delegate.logp(Level.FINEST, className, methodName, message);
80
88
}
81
89
82
90
public void debug(String message) {
@@ -86,6 +94,12 @@ index 833acfac..a26e0a3d 100644
86
94
- String className = element.getClassName();
87
95
- String methodName = element.getMethodName();
88
96
- delegate.logp(Level.FINER, className, methodName, message);
97
+ + // Throwable t = new Throwable();
98
+ + // StackTraceElement[] stack = t.getStackTrace();
99
+ + // StackTraceElement element = stack[1];
100
+ + // String className = element.getClassName();
101
+ + // String methodName = element.getMethodName();
102
+ + // delegate.logp(Level.FINER, className, methodName, message);
89
103
}
90
104
91
105
public void trace(String message) {
@@ -95,6 +109,12 @@ index 833acfac..a26e0a3d 100644
95
109
- String className = element.getClassName();
96
110
- String methodName = element.getMethodName();
97
111
- delegate.logp(Level.FINE, className, methodName, message);
112
+ + // Throwable t = new Throwable();
113
+ + // StackTraceElement[] stack = t.getStackTrace();
114
+ + // StackTraceElement element = stack[1];
115
+ + // String className = element.getClassName();
116
+ + // String methodName = element.getMethodName();
117
+ + // delegate.logp(Level.FINE, className, methodName, message);
98
118
}
99
119
100
120
public void info(String message) {
@@ -104,64 +124,90 @@ index 833acfac..a26e0a3d 100644
104
124
- String className = element.getClassName();
105
125
- String methodName = element.getMethodName();
106
126
- delegate.logp(Level.INFO, className, methodName, message);
127
+ + // Throwable t = new Throwable();
128
+ + // StackTraceElement[] stack = t.getStackTrace();
129
+ + // StackTraceElement element = stack[1];
130
+ + // String className = element.getClassName();
131
+ + // String methodName = element.getMethodName();
132
+ + // delegate.logp(Level.INFO, className, methodName, message);
107
133
}
108
134
109
135
public void warn(String message) {
110
- diff --git a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterConnectionImpl.java b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterConnectionImpl.java
111
- index da573402..924d894a 100644
112
- --- a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterConnectionImpl.java
113
- +++ b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterConnectionImpl.java
114
- @@ -17,6 +17,9 @@
136
+ - Throwable t = new Throwable();
137
+ - StackTraceElement[] stack = t.getStackTrace();
138
+ - StackTraceElement element = stack[1];
139
+ - String className = element.getClassName();
140
+ - String methodName = element.getMethodName();
141
+ - delegate.logp(Level.WARNING, className, methodName, message);
142
+ + // Throwable t = new Throwable();
143
+ + // StackTraceElement[] stack = t.getStackTrace();
144
+ + // StackTraceElement element = stack[1];
145
+ + // String className = element.getClassName();
146
+ + // String methodName = element.getMethodName();
147
+ + // delegate.logp(Level.WARNING, className, methodName, message);
148
+ }
115
149
116
- package com.mysql.clusterj.tie;
150
+ public void error(String message) {
151
+ - Throwable t = new Throwable();
152
+ - StackTraceElement[] stack = t.getStackTrace();
153
+ - StackTraceElement element = stack[1];
154
+ - String className = element.getClassName();
155
+ - String methodName = element.getMethodName();
156
+ - delegate.logp(Level.SEVERE, className, methodName, message);
157
+ + // Throwable t = new Throwable();
158
+ + // StackTraceElement[] stack = t.getStackTrace();
159
+ + // StackTraceElement element = stack[1];
160
+ + // String className = element.getClassName();
161
+ + // String methodName = element.getMethodName();
162
+ + // delegate.logp(Level.SEVERE, className, methodName, message);
163
+ }
117
164
118
- + import java.net.InetAddress;
119
- + import java.net.UnknownHostException;
120
- +
121
- import java.util.IdentityHashMap;
122
- import java.util.Iterator;
123
- import java.util.Map;
124
- @@ -132,6 +135,11 @@ public class ClusterConnectionImpl
125
- byteBufferPoolForPartitionKey =
126
- new FixedByteBufferPoolImpl(PARTITION_KEY_BUFFER_SIZE, "PartitionKeyBufferPool");
127
- clusterConnection = Ndb_cluster_connection.create(connectString, nodeId);
128
- + try {
129
- + clusterConnection.set_name(InetAddress.getLocalHost().getHostName());
130
- + } catch (UnknownHostException e) {
131
- + e.printStackTrace();
132
- + }
133
- handleError(clusterConnection, connectString, nodeId);
134
- int timeoutError = clusterConnection.set_timeout(connectTimeoutMgm);
135
- handleError(timeoutError, connectString, nodeId, connectTimeoutMgm);
165
+ public void fatal(String message) {
166
+ - Throwable t = new Throwable();
167
+ - StackTraceElement[] stack = t.getStackTrace();
168
+ - StackTraceElement element = stack[1];
169
+ - String className = element.getClassName();
170
+ - String methodName = element.getMethodName();
171
+ - delegate.logp(Level.SEVERE, className, methodName, message);
172
+ + // Throwable t = new Throwable();
173
+ + // StackTraceElement[] stack = t.getStackTrace();
174
+ + // StackTraceElement element = stack[1];
175
+ + // String className = element.getClassName();
176
+ + // String methodName = element.getMethodName();
177
+ + // delegate.logp(Level.SEVERE, className, methodName, message);
178
+ }
179
+
180
+ }
136
181
diff --git a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java
137
- index ffb2b6a8..8f383525 100644
182
+ index ccedf03e..bf5aaba1 100644
138
183
--- a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java
139
184
+++ b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java
140
- @@ -119 ,6 +119 ,9 @@ class ClusterTransactionImpl implements ClusterTransaction {
185
+ @@ -127 ,6 +127 ,9 @@ class ClusterTransactionImpl implements ClusterTransaction {
141
186
142
187
private List<Operation> operationsToCheck = new ArrayList<Operation>();
143
188
144
- +
145
189
+ private boolean isPartitionKeySet = false;
146
190
+ private final boolean HOPS_PK_FIX = true;
191
+ +
147
192
public ClusterTransactionImpl(ClusterConnectionImpl clusterConnectionImpl,
148
193
DbImpl db, Dictionary ndbDictionary, String joinTransactionId) {
149
194
this.db = db;
150
- @@ -136 ,6 +139 ,7 @@ class ClusterTransactionImpl implements ClusterTransaction {
195
+ @@ -144 ,6 +147 ,7 @@ class ClusterTransactionImpl implements ClusterTransaction {
151
196
if (ndbTransaction != null) {
152
197
ndbTransaction.close();
153
198
ndbTransaction = null;
154
199
+ isPartitionKeySet = false;
155
200
}
156
201
}
157
202
158
- @@ -644 ,7 +648 ,14 @@ class ClusterTransactionImpl implements ClusterTransaction {
203
+ @@ -656 ,7 +660 ,14 @@ class ClusterTransactionImpl implements ClusterTransaction {
159
204
throw new ClusterJFatalInternalException(
160
205
local.message("ERR_Partition_Key_Null"));
161
206
}
207
+ - this.partitionKey = (PartitionKeyImpl)partitionKey;
162
208
+ if (HOPS_PK_FIX) {
163
209
+ if (!isPartitionKeySet) {
164
- this.partitionKey = (PartitionKeyImpl)partitionKey;
210
+ + this.partitionKey = (PartitionKeyImpl)partitionKey;
165
211
+ isPartitionKeySet = true;
166
212
+ }
167
213
+ } else {
@@ -171,28 +217,31 @@ index ffb2b6a8..8f383525 100644
171
217
172
218
public String getCoordinatedTransactionId() {
173
219
diff --git a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/DbImpl.java b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/DbImpl.java
174
- index f39cc103..162d449e 100644
220
+ index 6b1b396f..ee835930 100644
175
221
--- a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/DbImpl.java
176
222
+++ b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/DbImpl.java
177
- @@ -264 ,7 +264,9 @@ class DbImpl implements com.mysql.clusterj.core.store.Db {
223
+ @@ -271 ,7 +271,11 @@ class DbImpl implements com.mysql.clusterj.core.store.Db {
178
224
handleError (ndbTransaction, ndb);
179
225
return ndbTransaction;
180
226
}
181
227
- key_part_ptrArray = Key_part_ptrArray.create(keyPartsSize + 1);
182
- + while (key_part_ptrArray == null) {
183
- + key_part_ptrArray = Key_part_ptrArray.create(keyPartsSize + 1);
184
- + }
228
+ +
229
+ + while (key_part_ptrArray == null) {
230
+ + key_part_ptrArray = Key_part_ptrArray.create(keyPartsSize + 1);
231
+ + }
232
+ +
185
233
try {
186
234
// the key part pointer array has one entry for each key part
187
235
// plus one extra for "null-terminated array concept"
188
236
diff --git a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordSmartValueHandlerImpl.java b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordSmartValueHandlerImpl.java
189
- index 84e8f5f7..38c520ca 100644
237
+ index 44366a6e..c10d4ffa 100644
190
238
--- a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordSmartValueHandlerImpl.java
191
239
+++ b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordSmartValueHandlerImpl.java
192
- @@ -76,14 +76,14 @@ public class NdbRecordSmartValueHandlerImpl implements SmartValueHandler {
240
+ @@ -83,15 +83,15 @@ public class NdbRecordSmartValueHandlerImpl implements SmartValueHandler {
193
241
/** Finalize this object. This method is called by the garbage collector
194
242
* when the proxy that delegates to this object is no longer reachable.
195
243
*/
244
+ - @SuppressWarnings("deprecation")
196
245
- protected void finalize() throws Throwable {
197
246
- if (logger.isDetailEnabled()) logger.detail("NdbRecordSmartValueHandler.finalize");
198
247
- try {
@@ -201,34 +250,15 @@ index 84e8f5f7..38c520ca 100644
201
250
- super.finalize();
202
251
- }
203
252
- }
204
- + // protected void finalize() throws Throwable {
205
- + // if (logger.isDetailEnabled()) logger.detail("NdbRecordSmartValueHandler.finalize");
206
- + // try {
207
- + // release();
208
- + // } finally {
209
- + // super.finalize();
210
- + // }
211
- + // }
253
+ + // @SuppressWarnings("deprecation")
254
+ + // protected void finalize() throws Throwable {
255
+ + // if (logger.isDetailEnabled()) logger.detail("NdbRecordSmartValueHandler.finalize");
256
+ + // try {
257
+ + // release();
258
+ + // } finally {
259
+ + // super.finalize();
260
+ + // }
261
+ + // }
212
262
213
263
/** Release any resources associated with this object.
214
264
* This method is called by the owner of this object.
215
- diff --git a/storage/ndb/src/ndbjtie/NdbApiWrapper.hpp b/storage/ndb/src/ndbjtie/NdbApiWrapper.hpp
216
- index bc726f5a..88e296e2 100644
217
- --- a/storage/ndb/src/ndbjtie/NdbApiWrapper.hpp
218
- +++ b/storage/ndb/src/ndbjtie/NdbApiWrapper.hpp
219
- @@ -3517,7 +3517,15 @@ struct NdbApiWrapper {
220
- Ndb_cluster_connection__set_name
221
- ( Ndb_cluster_connection & obj, const char * p0 )
222
- {
223
- + fprintf(stdout,"\n\nLogical Clocks AB. Hops custom libndbclient.so vVERSION\n");
224
- + fprintf(stdout,"Set name called. Setting Name to: %s \n",p0);
225
- obj.set_name(p0);
226
- + //obj.set_recv_thread_activation_threshold(0);
227
- + //int th = obj.get_recv_thread_activation_threshold();
228
- + //fprintf(stderr,"Recv thread activation threshold is %d\n",th);
229
- + Uint16 cpu_array[1] = {0};
230
- + obj.set_recv_thread_cpu(cpu_array,1,0);
231
- + fprintf(stdout,"Set the cpu affinity for recv thread to CPU 0\n\n");
232
- }
233
-
234
- static void
0 commit comments