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 Monitor monitor;
|
||||||
private boolean isChunk;
|
private boolean isChunk;
|
||||||
String backendType;
|
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){
|
public Operation(String[] server, String user, String pwd, String bucket, Monitor monitor, boolean isChunk, String backendType, String[] dbs){
|
||||||
this.server=server;
|
this.server=server;
|
||||||
|
@ -384,8 +384,7 @@ public abstract class Operation {
|
||||||
protected TransportManager getTransport(MyFile myFile) {
|
protected TransportManager getTransport(MyFile myFile) {
|
||||||
if(Objects.isNull(transport)) {
|
if(Objects.isNull(transport)) {
|
||||||
TransportManagerFactory tmf= new TransportManagerFactory(server, user, password);
|
TransportManagerFactory tmf= new TransportManagerFactory(server, user, password);
|
||||||
TransportManager tm=tmf.getTransport(backendType, myFile.getGcubeMemoryType(), dbNames, myFile.getWriteConcern(), myFile.getReadPreference());
|
transport=tmf.getTransport(backendType, myFile.getGcubeMemoryType(), dbNames, myFile.getWriteConcern(), myFile.getReadPreference());
|
||||||
return tm;
|
|
||||||
}
|
}
|
||||||
return transport;
|
return transport;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue