Skip to content

Commit c34b785

Browse files
smkniaziGautier Berthou
authored and
Gautier Berthou
committed
Revert "[HOPS-1625] RonDB 21.04.0"
This reverts commit cbde54d.
1 parent b90bba9 commit c34b785

File tree

6 files changed

+15
-41
lines changed

6 files changed

+15
-41
lines changed

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
<dependency>
2727
<groupId>com.mysql.ndb</groupId>
28-
<artifactId>clusterj-rondb</artifactId>
29-
<version>21.04.0</version>
28+
<artifactId>clusterj-hops-fix</artifactId>
29+
<version>8.0.21</version>
3030
</dependency>
3131

3232
<dependency>

src/main/java/io/hops/metadata/ndb/ClusterjConnector.java

-13
Original file line numberDiff line numberDiff line change
@@ -386,19 +386,6 @@ private boolean format(boolean transactional,
386386
Class<? extends EntityDataAccess>... das) throws StorageException {
387387

388388
final int RETRIES = 5; // in test
389-
390-
// we need to clear the cache objects
391-
if(!transactional) {
392-
// This calls the SQL truncate command which changes the schema ID.
393-
// After calling truncate we reload the schema to avoid schema ID change
394-
// exceptions. However, reloading the schema invalidates the
395-
// objects in the DTO cache in the ClusterJ causing NPEs.
396-
// Wipe the cache before we call truncate and reload the schema
397-
398-
// we clear the cache for all open sessions
399-
dbSessionProvider.clearCache();
400-
}
401-
402389
for (int i = 0; i < RETRIES; i++) {
403390
try {
404391
for (Class e : das) {

src/main/java/io/hops/metadata/ndb/DBSessionProvider.java

-9
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.apache.commons.logging.Log;
3131
import org.apache.commons.logging.LogFactory;
3232

33-
import java.util.Iterator;
3433
import java.util.NoSuchElementException;
3534
import java.util.Properties;
3635
import java.util.Random;
@@ -213,12 +212,4 @@ public void run() {
213212
}
214213
}
215214
}
216-
217-
public void clearCache() throws StorageException {
218-
Iterator<DBSession> itr = sessionPool.iterator();
219-
while(itr.hasNext()){
220-
DBSession session = itr.next();
221-
session.getSession().dropInstanceCache();
222-
}
223-
}
224215
}

src/main/java/io/hops/metadata/ndb/dalimpl/hdfs/LeaseCreationLocksClusterj.java

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public void createLockRows(int count) throws StorageException {
6464
dto.setID(i);
6565
session.savePersistent(dto);
6666
session.release(dto);
67+
LOG.debug("Added lease creation lock row with ID: "+i);
6768
}
6869
}
6970
}

src/main/java/io/hops/metadata/ndb/wrapper/HopsSession.java

+3-11
Original file line numberDiff line numberDiff line change
@@ -262,19 +262,11 @@ public String unloadSchema(Class<?> aClass) throws StorageException {
262262
throw HopsExceptionHelper.wrap(e);
263263
}
264264
}
265-
266-
public void dropInstanceCache() throws StorageException {
267-
try {
268-
session.dropInstanceCache();
269-
} catch (ClusterJException e) {
270-
throw HopsExceptionHelper.wrap(e);
271-
}
272-
}
273-
265+
274266
public <T> void release(T t) throws StorageException {
275267
try {
276268
if(t!=null){
277-
session.releaseCache(t, t.getClass());
269+
session.release(t);
278270
}
279271
} catch (ClusterJException e) {
280272
throw HopsExceptionHelper.wrap(e);
@@ -285,7 +277,7 @@ public <T> void release(Collection<T> t) throws StorageException {
285277
try {
286278
if(t!=null){
287279
for(T dto : t) {
288-
session.releaseCache(dto, dto.getClass());
280+
session.release(dto);
289281
}
290282
}
291283
} catch (ClusterJException e) {

src/main/resources/ndb-config.properties.template

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
com.mysql.clusterj.connectstring=localhost
2-
com.mysql.clusterj.database=hops_db
1+
#
2+
# Do not add spaces in the file. it is also used by some deployment scripts that fail if there are redundant spaces
3+
#
4+
com.mysql.clusterj.connectstring=cloud1.sics.se
5+
com.mysql.clusterj.database=hop_bram_vm
36
com.mysql.clusterj.connection.pool.size=1
47
com.mysql.clusterj.max.transactions=1024
5-
com.mysql.clusterj.max.cached.instances=1024
8+
#com.mysql.clusterj.connection.pool.nodeids=
69

710
io.hops.metadata.ndb.mysqlserver.data_source_class_name = com.mysql.cj.jdbc.MysqlDataSource
811

9-
io.hops.metadata.ndb.mysqlserver.host=localhost
12+
io.hops.metadata.ndb.mysqlserver.host=
1013
io.hops.metadata.ndb.mysqlserver.port=3306
11-
io.hops.metadata.ndb.mysqlserver.username=username
12-
io.hops.metadata.ndb.mysqlserver.password=password
14+
io.hops.metadata.ndb.mysqlserver.username=
15+
io.hops.metadata.ndb.mysqlserver.password=
1316
io.hops.metadata.ndb.mysqlserver.connection_pool_size=1
1417

1518
#size of the session pool. should be altreat as big as the number of active RPC handling Threads in the system

0 commit comments

Comments
 (0)