set to static the TransportManager field defined into Operation class.

In this way the backend used is always the same
This commit is contained in:
roberto cirillo 2020-11-19 15:15:09 +01:00
parent 1a7d79127b
commit a4532fcacd
1 changed files with 2 additions and 3 deletions

View File

@ -41,7 +41,7 @@ public abstract class Operation {
private Monitor monitor;
private boolean isChunk;
String backendType;
TransportManager transport;
protected static TransportManager transport;
public Operation(String[] server, String user, String pwd, String bucket, Monitor monitor, boolean isChunk, String backendType, String[] dbs){
this.server=server;
@ -384,8 +384,7 @@ public abstract class Operation {
protected TransportManager getTransport(MyFile myFile) {
if(Objects.isNull(transport)) {
TransportManagerFactory tmf= new TransportManagerFactory(server, user, password);
TransportManager tm=tmf.getTransport(backendType, myFile.getGcubeMemoryType(), dbNames, myFile.getWriteConcern(), myFile.getReadPreference());
return tm;
transport=tmf.getTransport(backendType, myFile.getGcubeMemoryType(), dbNames, myFile.getWriteConcern(), myFile.getReadPreference());
}
return transport;
}