Skip to content

Commit 9c8d909

Browse files
Merge branch 'develop' of github.com:orientechnologies/orientdb into develop
2 parents 7d18f97 + c99c449 commit 9c8d909

88 files changed

Lines changed: 2587 additions & 1570 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
-Xmx${heapSize}
4646
-XX:MaxDirectMemorySize=512g
4747
-Dmemory.directMemory.trackMode=true
48-
-Djava.util.logging.manager=com.orientechnologies.common.log.OLogManager$ShutdownLogManager
48+
-Djava.util.logging.manager=com.orientechnologies.common.log.ShutdownLogManager
4949
-Dstorage.diskCache.checksumMode=storeAndThrow
5050
-Dstorage.diskCache.bufferSize=4096
5151
</argLine>

client/src/main/java/com/orientechnologies/orient/client/binary/OBinaryRequestExecutor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public interface OBinaryRequestExecutor {
1111

1212
OBinaryResponse executeDBReload(OReloadRequest request);
1313

14+
OBinaryResponse executeDBReload(OReloadRequest37 request);
15+
1416
OBinaryResponse executeCreateDatabase(OCreateDatabaseRequest request);
1517

1618
OBinaryResponse executeClose(OCloseRequest request);

client/src/main/java/com/orientechnologies/orient/client/remote/OEngineRemote.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
public class OEngineRemote extends OEngineAbstract {
3838
public static final String NAME = "remote";
3939
public static final String PREFIX = NAME + ":";
40-
protected volatile ORemoteConnectionManager connectionManager;
4140

4241
public OEngineRemote() {
4342
}
@@ -54,27 +53,18 @@ public void removeStorage(final OStorage iStorage) {
5453
public void startup() {
5554
super.startup();
5655

57-
connectionManager = new ORemoteConnectionManager(OGlobalConfiguration.NETWORK_LOCK_TIMEOUT.getValueAsLong());
5856
}
5957

6058
@Override
6159
public void shutdown() {
62-
try {
63-
connectionManager.close();
64-
} finally {
65-
super.shutdown();
66-
}
60+
super.shutdown();
6761
}
6862

6963
@Override
7064
public String getNameFromPath(String dbPath) {
7165
return dbPath;
7266
}
7367

74-
public ORemoteConnectionManager getConnectionManager() {
75-
return connectionManager;
76-
}
77-
7868
public String getName() {
7969
return NAME;
8070
}

client/src/main/java/com/orientechnologies/orient/client/remote/ORemoteConnectionPool.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class ORemoteConnectionPool implements OResourcePoolListener<String, OCha
1717
private OResourcePool<String, OChannelBinaryAsynchClient> pool;
1818

1919
public ORemoteConnectionPool(int iMaxResources) {
20-
pool = new OResourcePool<String, OChannelBinaryAsynchClient>(iMaxResources, this);
20+
pool = new OResourcePool<>(iMaxResources, this);
2121
}
2222

2323
protected OChannelBinaryAsynchClient createNetworkConnection(String iServerURL, final OContextConfiguration clientConfiguration)
@@ -89,4 +89,5 @@ public OChannelBinaryAsynchClient acquire(final String iServerURL, final long ti
8989
final OContextConfiguration clientConfiguration) {
9090
return pool.getResource(iServerURL, timeout, clientConfiguration);
9191
}
92+
9293
}

client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import com.orientechnologies.orient.core.Orient;
2727
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
2828
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
29+
import com.orientechnologies.orient.core.db.OrientDBRemote;
30+
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
31+
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTxInternal;
2932
import com.orientechnologies.orient.core.exception.OStorageException;
3033
import com.orientechnologies.orient.core.record.impl.ODocument;
3134
import com.orientechnologies.orient.core.security.OCredentialInterceptor;
@@ -62,10 +65,20 @@ public OServerAdmin(String iURL) throws IOException {
6265
if (!iURL.contains("/"))
6366
iURL += "/";
6467

65-
ORemoteConnectionManager connectionManager = ((OEngineRemote) Orient.instance().getRunningEngine("remote"))
66-
.getConnectionManager();
68+
OrientDBRemote remote = (OrientDBRemote) ODatabaseDocumentTxInternal.getOrCreateRemoteFactory(iURL);
6769

68-
storage = new OStorageRemote(iURL, null, "", connectionManager, OStorage.STATUS.OPEN) {
70+
storage = new OStorageRemote(iURL, null, "", remote.getConnectionManager(), OStorage.STATUS.OPEN) {
71+
@Override
72+
protected OStorageRemoteSession getCurrentSession() {
73+
return session;
74+
}
75+
};
76+
}
77+
78+
public OServerAdmin(OrientDBRemote remote, String url) throws IOException {
79+
ORemoteConnectionManager connectionManager = remote.getConnectionManager();
80+
81+
storage = new OStorageRemote(url, null, "", connectionManager, OStorage.STATUS.OPEN) {
6982
@Override
7083
protected OStorageRemoteSession getCurrentSession() {
7184
return session;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.orientechnologies.orient.client.remote;
2+
3+
import com.orientechnologies.orient.core.config.OStorageClusterConfiguration;
4+
5+
public class OStorageClusterConfigurationRemote implements OStorageClusterConfiguration {
6+
private int id;
7+
private String name;
8+
9+
public OStorageClusterConfigurationRemote(int id, String name) {
10+
this.id = id;
11+
this.name = name;
12+
}
13+
14+
@Override
15+
public int getId() {
16+
return id;
17+
}
18+
19+
@Override
20+
public String getName() {
21+
return name;
22+
}
23+
24+
@Override
25+
public String getLocation() {
26+
throw new UnsupportedOperationException();
27+
}
28+
29+
@Override
30+
public int getDataSegmentId() {
31+
throw new UnsupportedOperationException();
32+
}
33+
34+
@Override
35+
public STATUS getStatus() {
36+
throw new UnsupportedOperationException();
37+
}
38+
39+
@Override
40+
public void setStatus(STATUS iStatus) {
41+
throw new UnsupportedOperationException();
42+
}
43+
}

0 commit comments

Comments
 (0)