update to version 2.12.1-SNAPSHOT #21390
This commit is contained in:
parent
eb74e06cdf
commit
88fe3747f6
|
@ -1,5 +1,9 @@
|
||||||
# Changelog for storage-manager-core
|
# Changelog for storage-manager-core
|
||||||
|
|
||||||
|
## [v2.12.1-SNAPSHOT
|
||||||
|
* add check on transport layer instance: if the memory type is not the same, a new transportLayer is instatiated
|
||||||
|
* amove memoryType var from super class TransportManager
|
||||||
|
|
||||||
## [v2.12.0-SNAPSHOT]
|
## [v2.12.0-SNAPSHOT]
|
||||||
* One pool for every operation: static Operation class; no mongo close operation
|
* One pool for every operation: static Operation class; no mongo close operation
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -8,7 +8,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>org.gcube.contentmanagement</groupId>
|
<groupId>org.gcube.contentmanagement</groupId>
|
||||||
<artifactId>storage-manager-core</artifactId>
|
<artifactId>storage-manager-core</artifactId>
|
||||||
<version>2.12.0-SNAPSHOT</version>
|
<version>2.12.1-SNAPSHOT</version>
|
||||||
<!-- <properties> -->
|
<!-- <properties> -->
|
||||||
<!-- <distroDirectory>${project.basedir}/distro</distroDirectory> -->
|
<!-- <distroDirectory>${project.basedir}/distro</distroDirectory> -->
|
||||||
<!-- </properties> -->
|
<!-- </properties> -->
|
||||||
|
|
|
@ -23,7 +23,7 @@ import com.mongodb.MongoException;
|
||||||
public abstract class TransportManager {
|
public abstract class TransportManager {
|
||||||
|
|
||||||
|
|
||||||
|
protected MemoryType memoryType;
|
||||||
/**
|
/**
|
||||||
* This method specifies the type of the backend for dynamic loading
|
* This method specifies the type of the backend for dynamic loading
|
||||||
* For mongoDB, default backend, the name is MongoDB
|
* For mongoDB, default backend, the name is MongoDB
|
||||||
|
|
|
@ -27,9 +27,11 @@ public class TransportManagerFactory {
|
||||||
// private static final Logger logger = Logger.getLogger(OperationFactory.class);
|
// private static final Logger logger = Logger.getLogger(OperationFactory.class);
|
||||||
final Logger logger = LoggerFactory.getLogger(TransportManagerFactory.class);
|
final Logger logger = LoggerFactory.getLogger(TransportManagerFactory.class);
|
||||||
// TerrastoreClient client;
|
// TerrastoreClient client;
|
||||||
String[] server;
|
private String[] server;
|
||||||
String user;
|
private String user;
|
||||||
String password;
|
private String password;
|
||||||
|
private MemoryType memoryType;
|
||||||
|
private String dbNames;
|
||||||
TransportManager transport;
|
TransportManager transport;
|
||||||
|
|
||||||
public TransportManagerFactory(String server[], String user, String password){
|
public TransportManagerFactory(String server[], String user, String password){
|
||||||
|
@ -42,8 +44,12 @@ public class TransportManagerFactory {
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("getOperation(String) - start");
|
logger.debug("getOperation(String) - start");
|
||||||
}
|
}
|
||||||
if(Objects.isNull(transport))
|
// if we haven't any transport layer instantiated or the transport layer is istantiated on another memory type (persistent, volatile),
|
||||||
|
// then a new transport layer is needed
|
||||||
|
if(Objects.isNull(transport) || (!transport.memoryType.equals(memoryType))) {
|
||||||
|
logger.info("new transport layer instantiated for "+memoryType+" memory");
|
||||||
return load(backendType, memoryType, dbNames, writeConcern, readConcern);
|
return load(backendType, memoryType, dbNames, writeConcern, readConcern);
|
||||||
|
}
|
||||||
return transport;
|
return transport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class MongoOperationManager extends TransportManager{
|
||||||
// private MongoClient mongo;
|
// private MongoClient mongo;
|
||||||
private MongoIOManager mongoPrimaryInstance;
|
private MongoIOManager mongoPrimaryInstance;
|
||||||
private MongoIOManager mongoSecondaryInstance;
|
private MongoIOManager mongoSecondaryInstance;
|
||||||
private MemoryType memoryType;
|
// private MemoryType memoryType;
|
||||||
protected static String[] dbNames;
|
protected static String[] dbNames;
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ public class MongoOperationManager extends TransportManager{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initBackend(String[] server, String user, String pass, MemoryType memoryType , String[] dbNames, String writeConcern, String readConcern) {
|
public void initBackend(String[] server, String user, String pass, MemoryType memoryType , String[] dbNames, String writeConcern, String readConcern) {
|
||||||
|
logger.debug("init storage backend with "+memoryType+" memory");
|
||||||
try {
|
try {
|
||||||
this.memoryType=memoryType;
|
this.memoryType=memoryType;
|
||||||
MongoOperationManager.dbNames=dbNames;
|
MongoOperationManager.dbNames=dbNames;
|
||||||
|
|
Loading…
Reference in New Issue