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:
parent
1a7d79127b
commit
a4532fcacd
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue