From fb5638fe12fdab0aa10c9c1f613855ef43b01368 Mon Sep 17 00:00:00 2001 From: Tglman Date: Mon, 24 Feb 2025 19:04:00 +0000 Subject: [PATCH] refactor: renamed the remote client implementation from storage to client --- .../remote/ODatabaseDocumentRemotePooled.java | 2 +- .../client/remote/ODatabaseImportRemote.java | 4 +- ...OStorageRemote.java => ORemoteClient.java} | 14 +- .../orient/client/remote/ORemoteURLs.java | 4 +- .../client/remote/OStorageRemoteSession.java | 2 +- .../orient/client/remote/OrientDBRemote.java | 32 ++-- .../db/document/ODatabaseDocumentRemote.java | 151 +++++++++--------- .../db/document/OLiveQueryMonitorRemote.java | 2 +- .../remote/message/OConnectRequest.java | 4 +- .../client/remote/message/OOpenRequest.java | 4 +- .../client/remote/message/OQueryRequest.java | 4 +- .../remote/message/OServerQueryRequest.java | 4 +- .../message/OSubscribeLiveQueryRequest.java | 4 +- .../remote/ORemoteLiveQueryPushTest.java | 4 +- .../SimpleConnectionStrategiesIT.java | 10 +- .../server/network/ORemoteImportTest.java | 4 +- .../server/query/RemoteTokenExpireTest.java | 4 +- .../CRUDObjectInheritanceTestSchemaFull.java | 12 +- .../CRUDObjectPhysicalTestSchemaFull.java | 8 +- .../orient/console/OConsoleDatabaseApp.java | 6 +- .../OStressTesterCommandLineParser.java | 4 +- .../stresstest/OStressTesterSettings.java | 6 +- .../stresstest/workload/OBaseWorkload.java | 6 +- .../stresstest/workload/OCRUDWorkload.java | 4 +- 24 files changed, 148 insertions(+), 151 deletions(-) rename client/src/main/java/com/orientechnologies/orient/client/remote/{OStorageRemote.java => ORemoteClient.java} (99%) diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/ODatabaseDocumentRemotePooled.java b/client/src/main/java/com/orientechnologies/orient/client/remote/ODatabaseDocumentRemotePooled.java index 8233a34a057..156207e3be0 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/ODatabaseDocumentRemotePooled.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/ODatabaseDocumentRemotePooled.java @@ -13,7 +13,7 @@ public class ODatabaseDocumentRemotePooled extends ODatabaseDocumentRemote { private ODatabasePoolInternal pool; public ODatabaseDocumentRemotePooled( - ODatabasePoolInternal pool, OStorageRemote storage, OSharedContext sharedContext) { + ODatabasePoolInternal pool, ORemoteClient storage, OSharedContext sharedContext) { super(storage, sharedContext); this.pool = pool; } diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/ODatabaseImportRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/ODatabaseImportRemote.java index 5909cf681ac..d8e3c061f4f 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/ODatabaseImportRemote.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/ODatabaseImportRemote.java @@ -40,8 +40,8 @@ public ODatabaseTool setOptions(String iOptions) { } public void importDatabase() throws ODatabaseImportException { - OStorageRemote storage = - (OStorageRemote) ((ODatabaseDocumentRemote) getDatabase()).getStorageRemote(); + ORemoteClient storage = + (ORemoteClient) ((ODatabaseDocumentRemote) getDatabase()).getRemoteClinet(); File file = new File(getFileName()); try { storage.importDatabase(options, new FileInputStream(file), file.getName(), getListener()); diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/ORemoteClient.java similarity index 99% rename from client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java rename to client/src/main/java/com/orientechnologies/orient/client/remote/ORemoteClient.java index e9aa298bf43..8011ad839a4 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/ORemoteClient.java @@ -184,8 +184,8 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; /** This object is bound to each remote ODatabase instances. */ -public class OStorageRemote implements ORemotePushHandler, OStorageInfo { - private static final OLogger logger = OLogManager.instance().logger(OStorageRemote.class); +public class ORemoteClient implements ORemotePushHandler, OStorageInfo { + private static final OLogger logger = OLogManager.instance().logger(ORemoteClient.class); @Deprecated public static final String PARAM_CONNECTION_STRATEGY = "connectionStrategy"; public static final String DRIVER_NAME = "OrientDB Java"; @@ -236,7 +236,7 @@ private static String buildUrl(String[] hosts, String name) { return String.join(ADDRESS_SEPARATOR, hosts) + "/" + name; } - public OStorageRemote( + public ORemoteClient( final ORemoteURLs hosts, String name, OrientDBRemote context, @@ -247,7 +247,7 @@ public OStorageRemote( this(hosts, name, context, iMode, connectionManager, null, config); } - public OStorageRemote( + public ORemoteClient( final ORemoteURLs hosts, String name, OrientDBRemote context, @@ -1384,7 +1384,7 @@ public boolean isRemote() { } public String getURL() { - return OStorageRemote.TYPE + ":" + url; + return ORemoteClient.TYPE + ":" + url; } public int getClusters() { @@ -1397,7 +1397,7 @@ public int getClusters() { } public String getType() { - return OStorageRemote.TYPE; + return ORemoteClient.TYPE; } public String getUserName() { @@ -1833,7 +1833,7 @@ public boolean isClosed() { return session.isClosed(); } - public OStorageRemote copy( + public ORemoteClient copy( final ODatabaseDocumentRemote source, final ODatabaseDocumentRemote dest) { ODatabaseDocumentInternal origin = null; if (ODatabaseRecordThreadLocal.instance() != null) diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/ORemoteURLs.java b/client/src/main/java/com/orientechnologies/orient/client/remote/ORemoteURLs.java index a3337cd4f11..f92252eef0c 100644 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/ORemoteURLs.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/ORemoteURLs.java @@ -4,7 +4,7 @@ import com.orientechnologies.common.log.OLogManager; import com.orientechnologies.common.log.OLogger; -import com.orientechnologies.orient.client.remote.OStorageRemote.CONNECTION_STRATEGY; +import com.orientechnologies.orient.client.remote.ORemoteClient.CONNECTION_STRATEGY; import com.orientechnologies.orient.core.config.OContextConfiguration; import com.orientechnologies.orient.core.config.OGlobalConfiguration; import com.orientechnologies.orient.core.exception.OConfigurationException; @@ -105,7 +105,7 @@ private static List parseAddressesFromUrl(String url) { // SHORT FORM addresses.add(url); } else { - for (String host : url.substring(0, dbPos).split(OStorageRemote.ADDRESS_SEPARATOR)) { + for (String host : url.substring(0, dbPos).split(ORemoteClient.ADDRESS_SEPARATOR)) { addresses.add(host); } } diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemoteSession.java b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemoteSession.java index a17d9a47973..364cb0da595 100644 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemoteSession.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemoteSession.java @@ -137,7 +137,7 @@ public void closeAllSessions( OChannelBinaryAsynchClient network = null; try { network = - OStorageRemote.getNetwork( + ORemoteClient.getNetwork( nodeSession.getServerURL(), connectionManager, clientConfiguration); OCloseRequest request = new OCloseRequest(); network.beginRequest(request.getCommand(), this); diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/OrientDBRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/OrientDBRemote.java index b68eef85f25..16c7a9b96a3 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/OrientDBRemote.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/OrientDBRemote.java @@ -20,7 +20,7 @@ package com.orientechnologies.orient.client.remote; -import static com.orientechnologies.orient.client.remote.OStorageRemote.ADDRESS_SEPARATOR; +import static com.orientechnologies.orient.client.remote.ORemoteClient.ADDRESS_SEPARATOR; import static com.orientechnologies.orient.core.config.OGlobalConfiguration.NETWORK_SOCKET_RETRY; import com.orientechnologies.common.exception.OException; @@ -28,7 +28,7 @@ import com.orientechnologies.common.log.OLogger; import com.orientechnologies.common.thread.OThreadPoolExecutors; import com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient; -import com.orientechnologies.orient.client.remote.OStorageRemote.CONNECTION_STRATEGY; +import com.orientechnologies.orient.client.remote.ORemoteClient.CONNECTION_STRATEGY; import com.orientechnologies.orient.client.remote.db.document.ODatabaseDocumentRemote; import com.orientechnologies.orient.client.remote.db.document.OSharedContextRemote; import com.orientechnologies.orient.client.remote.message.OConnect37Request; @@ -102,7 +102,7 @@ public class OrientDBRemote implements OrientDBInternal { private static final OLogger logger = OLogManager.instance().logger(OrientDBRemote.class); protected final Map sharedContexts = new HashMap<>(); - private final Map storages = new HashMap<>(); + private final Map storages = new HashMap<>(); private final Set pools = new HashSet<>(); private final String[] hosts; private final OrientDBConfig configurations; @@ -166,11 +166,11 @@ public ODatabaseDocumentInternal open( checkOpen(); OrientDBConfig resolvedConfig = solveConfig(config); try { - OStorageRemote storage; + ORemoteClient storage; synchronized (this) { storage = storages.get(name); if (storage == null) { - storage = new OStorageRemote(urls, name, this, "rw", connectionManager, resolvedConfig); + storage = new ORemoteClient(urls, name, this, "rw", connectionManager, resolvedConfig); storages.put(name, storage); } } @@ -228,13 +228,13 @@ public synchronized void create( public ODatabaseDocumentRemotePooled poolOpen( String name, String user, String password, ODatabasePoolInternal pool) { - OStorageRemote storage; + ORemoteClient storage; synchronized (this) { storage = storages.get(name); if (storage == null) { try { storage = - new OStorageRemote( + new ORemoteClient( urls, name, this, "rw", connectionManager, solveConfig(pool.getConfig())); storages.put(name, storage); } catch (Exception e) { @@ -249,7 +249,7 @@ public ODatabaseDocumentRemotePooled poolOpen( return db; } - public synchronized void closeStorage(OStorageRemote remote) { + public synchronized void closeStorage(ORemoteClient remote) { OSharedContext ctx = sharedContexts.get(remote.getName()); if (ctx != null) { ctx.close(); @@ -415,7 +415,7 @@ public void internalClose() { timer.cancel(); } - final List storagesCopy; + final List storagesCopy; synchronized (this) { // SHUTDOWN ENGINES AVOID OTHER OPENS open = false; @@ -423,7 +423,7 @@ public void internalClose() { storagesCopy = new ArrayList<>(storages.values()); } - for (OStorageRemote stg : storagesCopy) { + for (ORemoteClient stg : storagesCopy) { try { logger.info("- shutdown storage: %s ...", stg.getName()); stg.shutdown(); @@ -495,7 +495,7 @@ public Collection getStorages() { @Override public synchronized void forceDatabaseClose(String databaseName) { - OStorageRemote remote = storages.get(databaseName); + ORemoteClient remote = storages.get(databaseName); if (remote != null) closeStorage(remote); } @@ -515,7 +515,7 @@ public ODatabaseDocumentInternal openNoAuthorization(String name) { "impossible skip authentication and authorization in remote"); } - protected synchronized OSharedContext getOrCreateSharedContext(OStorageRemote storage) { + protected synchronized OSharedContext getOrCreateSharedContext(ORemoteClient storage) { OSharedContext result = sharedContexts.get(storage.getName()); if (result == null) { @@ -525,7 +525,7 @@ protected synchronized OSharedContext getOrCreateSharedContext(OStorageRemote st return result; } - private OSharedContext createSharedContext(OStorageRemote storage) { + private OSharedContext createSharedContext(ORemoteClient storage) { OSharedContextRemote context = new OSharedContextRemote(storage, this); storage.setSharedContext(context); return context; @@ -649,7 +649,7 @@ public T execute(OChannelBinaryAsynchClient network, OStorageRemoteSession sessi } T response = request.createResponse(); try { - OStorageRemote.beginResponse(network, session); + ORemoteClient.beginResponse(network, session); response.read(network, session); } finally { network.endResponse(); @@ -673,7 +673,7 @@ public T networkAdminOperation( urls.getNextAvailableServerURL(false, session, config, CONNECTION_STRATEGY.STICKY); do { try { - network = OStorageRemote.getNetwork(serverUrl, connectionManager, config); + network = ORemoteClient.getNetwork(serverUrl, connectionManager, config); } catch (OException e) { serverUrl = urls.removeAndGet(serverUrl); if (serverUrl == null) throw e; @@ -779,6 +779,6 @@ public void create( @Override public String getConnectionUrl() { - return "remote:" + String.join(OStorageRemote.ADDRESS_SEPARATOR, this.urls.getUrls()); + return "remote:" + String.join(ORemoteClient.ADDRESS_SEPARATOR, this.urls.getUrls()); } } diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/db/document/ODatabaseDocumentRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/db/document/ODatabaseDocumentRemote.java index 469b4b66800..8b3f80727c8 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/db/document/ODatabaseDocumentRemote.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/db/document/ODatabaseDocumentRemote.java @@ -29,8 +29,8 @@ import com.orientechnologies.common.log.OLogManager; import com.orientechnologies.common.log.OLogger; import com.orientechnologies.orient.client.remote.OLiveQueryClientListener; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.client.remote.ORemoteQueryResult; -import com.orientechnologies.orient.client.remote.OStorageRemote; import com.orientechnologies.orient.client.remote.OStorageRemoteSession; import com.orientechnologies.orient.client.remote.message.OLockRecordResponse; import com.orientechnologies.orient.client.remote.message.ORemoteResultSet; @@ -117,19 +117,19 @@ public class ODatabaseDocumentRemote extends ODatabaseDocumentAbstract { protected OStorageRemoteSession sessionMetadata; private OrientDBConfig config; - private OStorageRemote storage; + private ORemoteClient client; - public ODatabaseDocumentRemote(final OStorageRemote storage, OSharedContext sharedContext) { + public ODatabaseDocumentRemote(final ORemoteClient remoteClient, OSharedContext sharedContext) { activateOnCurrentThread(); try { status = STATUS.CLOSED; // OVERWRITE THE URL - url = storage.getURL(); - this.storage = storage; + url = remoteClient.getURL(); + this.client = remoteClient; this.sharedContext = sharedContext; - this.componentsFactory = storage.getComponentsFactory(); + this.componentsFactory = remoteClient.getComponentsFactory(); unmodifiableHooks = Collections.unmodifiableMap(hooks); @@ -156,8 +156,7 @@ public DB set(ATTRIBUTES iAttribute, Object iValue) { if ("clear".equalsIgnoreCase(stringValue)) { String query = "alter database CUSTOM 'clear'"; // Bypass the database command for avoid transaction management - ORemoteQueryResult result = - getStorageRemote().command(this, query, new Object[] {iValue}); + ORemoteQueryResult result = getRemoteClinet().command(this, query, new Object[] {iValue}); result.getResult().close(); } else throw new IllegalArgumentException( @@ -170,9 +169,9 @@ public DB set(ATTRIBUTES iAttribute, Object iValue) { } else { String query = "alter database " + iAttribute.name() + " ? "; // Bypass the database command for avoid transaction management - ORemoteQueryResult result = getStorageRemote().command(this, query, new Object[] {iValue}); + ORemoteQueryResult result = getRemoteClinet().command(this, query, new Object[] {iValue}); result.getResult().close(); - getStorageRemote().reload(); + getRemoteClinet().reload(); } return (DB) this; @@ -183,22 +182,22 @@ public DB setCustom(String name, Object iValue) { if ("clear".equals(name) && iValue == null) { String query = "alter database CUSTOM 'clear'"; // Bypass the database command for avoid transaction management - ORemoteQueryResult result = getStorageRemote().command(this, query, new Object[] {}); + ORemoteQueryResult result = getRemoteClinet().command(this, query, new Object[] {}); result.getResult().close(); } else { String query = "alter database CUSTOM " + name + " = ?"; // Bypass the database command for avoid transaction management - ORemoteQueryResult result = getStorageRemote().command(this, query, new Object[] {iValue}); + ORemoteQueryResult result = getRemoteClinet().command(this, query, new Object[] {iValue}); result.getResult().close(); - getStorageRemote().reload(); + getRemoteClinet().reload(); } return (DB) this; } public ODatabaseDocumentInternal copy() { - ODatabaseDocumentRemote database = new ODatabaseDocumentRemote(storage, this.sharedContext); - database.storage = storage.copy(this, database); - database.storage.addUser(); + ODatabaseDocumentRemote database = new ODatabaseDocumentRemote(client, this.sharedContext); + database.client = client.copy(this, database); + database.client.addUser(); database.status = STATUS.OPEN; database.applyAttributes(config); database.initAtFirstOpen(); @@ -213,7 +212,7 @@ public void internalOpen(String user, String password, OrientDBConfig config) { applyListeners(config); try { - storage.open(user, password, config.getConfigurations()); + client.open(user, password, config.getConfigurations()); status = STATUS.OPEN; @@ -250,7 +249,7 @@ private void initAtFirstOpen() { ORecordSerializerFactory serializerFactory = ORecordSerializerFactory.instance(); serializer = serializerFactory.getFormat(ORecordSerializerNetworkV37Client.NAME); localCache.startup(this); - componentsFactory = getStorageRemote().getComponentsFactory(); + componentsFactory = getRemoteClinet().getComponentsFactory(); user = null; loadMetadata(); @@ -324,13 +323,13 @@ public OStorage getStorage() { throw new UnsupportedOperationException(); } - public OStorageRemote getStorageRemote() { - return storage; + public ORemoteClient getRemoteClinet() { + return client; } @Override public OStorageInfo getStorageInfo() { - return storage; + return client; } @Override @@ -341,22 +340,22 @@ public void replaceStorage(OStorage iNewStorage) { private void checkAndSendTransaction() { if (this.currentTx.isActive() && ((OTransactionOptimistic) this.currentTx).isChanged()) { if (((OTransactionOptimistic) this.getTransaction()).isAlreadyCleared()) - storage.reBeginTransaction(this, (OTransactionOptimistic) this.currentTx); - else storage.beginTransaction(this, (OTransactionOptimistic) this.currentTx); + client.reBeginTransaction(this, (OTransactionOptimistic) this.currentTx); + else client.beginTransaction(this, (OTransactionOptimistic) this.currentTx); ((OTransactionOptimistic) this.currentTx).resetChangesTracking(); ((OTransactionOptimistic) this.currentTx).setSentToServer(true); } } private void fetchTransacion() { - storage.fetchTransaction(this); + client.fetchTransaction(this); } @Override public OResultSet query(String query, Object... args) { checkOpenness(); checkAndSendTransaction(); - ORemoteQueryResult result = storage.query(this, query, args); + ORemoteQueryResult result = client.query(this, query, args); if (result.isTransactionUpdated()) fetchTransacion(); if (result.isReloadMetadata()) reload(); return result.getResult(); @@ -366,7 +365,7 @@ public OResultSet query(String query, Object... args) { public OResultSet query(String query, Map args) { checkOpenness(); checkAndSendTransaction(); - ORemoteQueryResult result = storage.query(this, query, args); + ORemoteQueryResult result = client.query(this, query, args); if (result.isTransactionUpdated()) fetchTransacion(); if (result.isReloadMetadata()) reload(); return result.getResult(); @@ -384,7 +383,7 @@ public OResultSet indexQuery(String indexName, String query, Object... args) { checkAndSendTransaction(); } } - ORemoteQueryResult result = storage.command(this, query, args); + ORemoteQueryResult result = client.command(this, query, args); if (result.isReloadMetadata()) reload(); return result.getResult(); } @@ -393,7 +392,7 @@ public OResultSet indexQuery(String indexName, String query, Object... args) { public OResultSet command(String query, Object... args) { checkOpenness(); checkAndSendTransaction(); - ORemoteQueryResult result = storage.command(this, query, args); + ORemoteQueryResult result = client.command(this, query, args); if (result.isTransactionUpdated()) fetchTransacion(); if (result.isReloadMetadata()) reload(); return result.getResult(); @@ -403,7 +402,7 @@ public OResultSet command(String query, Object... args) { public OResultSet command(String query, Map args) { checkOpenness(); checkAndSendTransaction(); - ORemoteQueryResult result = storage.command(this, query, args); + ORemoteQueryResult result = client.command(this, query, args); if (result.isTransactionUpdated()) fetchTransacion(); if (result.isReloadMetadata()) reload(); return result.getResult(); @@ -414,7 +413,7 @@ public OResultSet execute(String language, String script, Object... args) throws OCommandExecutionException, OCommandScriptException { checkOpenness(); checkAndSendTransaction(); - ORemoteQueryResult result = storage.execute(this, language, script, args); + ORemoteQueryResult result = client.execute(this, language, script, args); if (result.isTransactionUpdated()) fetchTransacion(); if (result.isReloadMetadata()) reload(); return result.getResult(); @@ -425,37 +424,35 @@ public OResultSet execute(String language, String script, Map args) throws OCommandExecutionException, OCommandScriptException { checkOpenness(); checkAndSendTransaction(); - ORemoteQueryResult result = storage.execute(this, language, script, args); + ORemoteQueryResult result = client.execute(this, language, script, args); if (result.isTransactionUpdated()) fetchTransacion(); if (result.isReloadMetadata()) reload(); return result.getResult(); } public void closeQuery(String queryId) { - storage.closeQuery(this, queryId); + client.closeQuery(this, queryId); queryClosed(queryId); } public void fetchNextPage(ORemoteResultSet rs) { checkOpenness(); checkAndSendTransaction(); - storage.fetchNextPage(this, rs); + client.fetchNextPage(this, rs); } @Override public OLiveQueryMonitor live(String query, OLiveQueryResultListener listener, Object... args) { - return storage.liveQuery( - this, query, new OLiveQueryClientListener(this.copy(), listener), args); + return client.liveQuery(this, query, new OLiveQueryClientListener(this.copy(), listener), args); } @Override public OLiveQueryMonitor live( String query, OLiveQueryResultListener listener, Map args) { - return storage.liveQuery( - this, query, new OLiveQueryClientListener(this.copy(), listener), args); + return client.liveQuery(this, query, new OLiveQueryClientListener(this.copy(), listener), args); } - public static void updateSchema(OStorageRemote storage, ODocument schema) { + public static void updateSchema(ORemoteClient storage, ODocument schema) { // storage.get OSharedContext shared = storage.getSharedContext(); if (shared != null) { @@ -463,21 +460,21 @@ public static void updateSchema(OStorageRemote storage, ODocument schema) { } } - public static void updateIndexManager(OStorageRemote storage, ODocument indexManager) { + public static void updateIndexManager(ORemoteClient storage, ODocument indexManager) { OSharedContext shared = storage.getSharedContext(); if (shared != null) { ((OIndexManagerRemote) shared.getIndexManager()).update(indexManager); } } - public static void updateFunction(OStorageRemote storage) { + public static void updateFunction(ORemoteClient storage) { OSharedContext shared = storage.getSharedContext(); if (shared != null) { (shared.getFunctionLibrary()).update(); } } - public static void updateSequences(OStorageRemote storage) { + public static void updateSequences(ORemoteClient storage) { OSharedContext shared = storage.getSharedContext(); if (shared != null) { (shared.getSequenceLibrary()).update(); @@ -728,7 +725,7 @@ record = reload(record, null, true, true); "Error on retrieving record " + rid + " (cluster: " - + getStorageRemote().getPhysicalClusterNameById(rid.getClusterId()) + + getRemoteClinet().getPhysicalClusterNameById(rid.getClusterId()) + ")"), t); } finally { @@ -744,14 +741,14 @@ public String getClusterName(final ORecord record) { @Override public void internalLockRecord(OIdentifiable iRecord, OStorage.LOCKING_STRATEGY lockingStrategy) { checkAndSendTransaction(); - OStorageRemote remote = getStorageRemote(); + ORemoteClient remote = getRemoteClinet(); // -1 value means default timeout remote.lockRecord(iRecord, lockingStrategy, -1); } @Override public void internalUnlockRecord(OIdentifiable iRecord) { - OStorageRemote remote = getStorageRemote(); + ORemoteClient remote = getRemoteClinet(); remote.unlockRecord(iRecord.getIdentity()); } @@ -761,7 +758,7 @@ public RET lock(ORID recordId) throws OLockException { checkIfActive(); pessimisticLockChecks(recordId); checkAndSendTransaction(); - OStorageRemote remote = getStorageRemote(); + ORemoteClient remote = getRemoteClinet(); // -1 value means default timeout OLockRecordResponse response = remote.lockRecord(recordId, EXCLUSIVE_LOCK, -1); ORecord record = @@ -777,7 +774,7 @@ public RET lock(ORID recordId, long timeout, TimeUnit time checkIfActive(); pessimisticLockChecks(recordId); checkAndSendTransaction(); - OStorageRemote remote = getStorageRemote(); + ORemoteClient remote = getRemoteClinet(); OLockRecordResponse response = remote.lockRecord(recordId, EXCLUSIVE_LOCK, timeoutUnit.toMillis(timeout)); ORecord record = @@ -850,13 +847,13 @@ public ODatabaseDocumentAbstract delete(final ORecord record) { @Override public int addCluster(final String iClusterName, final Object... iParameters) { checkIfActive(); - return getStorageRemote().addCluster(iClusterName, iParameters); + return getRemoteClinet().addCluster(iClusterName, iParameters); } @Override public int addCluster(final String iClusterName, final int iRequestedId) { checkIfActive(); - return getStorageRemote().addCluster(iClusterName, iRequestedId); + return getRemoteClinet().addCluster(iClusterName, iRequestedId); } public ORecordConflictStrategy getConflictStrategy() { @@ -866,7 +863,7 @@ public ORecordConflictStrategy getConflictStrategy() { public ODatabaseDocumentAbstract setConflictStrategy(final String iStrategyName) { checkIfActive(); - getStorageRemote() + getRemoteClinet() .setConflictStrategy( Orient.instance().getRecordConflictStrategy().getStrategy(iStrategyName)); return this; @@ -874,7 +871,7 @@ public ODatabaseDocumentAbstract setConflictStrategy(final String iStrategyName) public ODatabaseDocumentAbstract setConflictStrategy(final ORecordConflictStrategy iResolver) { checkIfActive(); - getStorageRemote().setConflictStrategy(iResolver); + getRemoteClinet().setConflictStrategy(iResolver); return this; } @@ -882,14 +879,14 @@ public ODatabaseDocumentAbstract setConflictStrategy(final ORecordConflictStrate @Override public long countClusterElements(int iClusterId) { checkIfActive(); - return getStorageRemote().count(iClusterId); + return getRemoteClinet().count(iClusterId); } /** {@inheritDoc} */ @Override public long countClusterElements(int[] iClusterIds) { checkIfActive(); - return getStorageRemote().count(iClusterIds); + return getRemoteClinet().count(iClusterIds); } /** {@inheritDoc} */ @@ -900,14 +897,14 @@ public long countClusterElements(final String iClusterName) { final int clusterId = getClusterIdByName(iClusterName); if (clusterId < 0) throw new IllegalArgumentException("Cluster '" + iClusterName + "' was not found"); - return getStorageRemote().count(clusterId); + return getRemoteClinet().count(clusterId); } @Override public long getClusterRecordSizeByName(final String clusterName) { checkIfActive(); try { - return getStorageRemote().getClusterRecordsSizeByName(clusterName); + return getRemoteClinet().getClusterRecordsSizeByName(clusterName); } catch (Exception e) { throw OException.wrapException( new ODatabaseException("Error on reading records size for cluster '" + clusterName + "'"), @@ -925,7 +922,7 @@ public boolean dropCluster(final String iClusterName) { if (schema.getBlobClusters().contains(clusterId)) schema.removeBlobCluster(iClusterName); getLocalCache().freeCluster(clusterId); checkForClusterPermissions(iClusterName); - return getStorageRemote().dropCluster(iClusterName); + return getRemoteClinet().dropCluster(iClusterName); } @Override @@ -956,18 +953,18 @@ public boolean dropCluster(final int clusterId) { this.delete(document); } - return getStorageRemote().dropCluster(clusterId); + return getRemoteClinet().dropCluster(clusterId); } public boolean dropClusterInternal(int clusterId) { - return getStorageRemote().dropCluster(clusterId); + return getRemoteClinet().dropCluster(clusterId); } @Override public long getClusterRecordSizeById(final int clusterId) { checkIfActive(); try { - return getStorageRemote().getClusterRecordsSizeById(clusterId); + return getRemoteClinet().getClusterRecordsSizeById(clusterId); } catch (Exception e) { throw OException.wrapException( new ODatabaseException( @@ -979,7 +976,7 @@ public long getClusterRecordSizeById(final int clusterId) { @Override public long getSize() { checkIfActive(); - return getStorageRemote().getSize(); + return getRemoteClinet().getSize(); } @Override @@ -1011,13 +1008,13 @@ public String incrementalBackup(final String path) throws UnsupportedOperationEx checkIfActive(); checkSecurity(ORule.ResourceGeneric.DATABASE, "backup", ORole.PERMISSION_EXECUTE); - return getStorageRemote().incrementalBackup(path, null); + return getRemoteClinet().incrementalBackup(path, null); } @Override public ORecordMetadata getRecordMetadata(final ORID rid) { checkIfActive(); - return getStorageRemote().getRecordMetadata(rid); + return getRemoteClinet().getRecordMetadata(rid); } /** {@inheritDoc} */ @@ -1075,7 +1072,7 @@ public void restore( /** {@inheritDoc} */ public OSBTreeCollectionManager getSbTreeCollectionManager() { - return getStorageRemote().getSBtreeCollectionManager(); + return getRemoteClinet().getSBtreeCollectionManager(); } @Override @@ -1086,17 +1083,17 @@ public void reload() { throw new ODatabaseException("Cannot reload a closed db"); } metadata.reload(); - getStorageRemote().reload(); + getRemoteClinet().reload(); } @Override public void internalCommit(OTransactionInternal transaction) { - this.getStorageRemote().commit(transaction); + this.getRemoteClinet().commit(transaction); } @Override public boolean isClosed() { - return status == STATUS.CLOSED || getStorageRemote().isClosed(); + return status == STATUS.CLOSED || getRemoteClinet().isClosed(); } public void internalClose(boolean recycle) { @@ -1127,7 +1124,7 @@ public void internalClose(boolean recycle) { if (!recycle) { sharedContext = null; - if (getStorageRemote() != null) getStorageRemote().close(); + if (getRemoteClinet() != null) getRemoteClinet().close(); } } finally { @@ -1138,12 +1135,12 @@ public void internalClose(boolean recycle) { @Override public long[] getClusterDataRange(int currentClusterId) { - return getStorageRemote().getClusterDataRange(currentClusterId); + return getRemoteClinet().getClusterDataRange(currentClusterId); } @Override public void setDefaultClusterId(int addCluster) { - getStorageRemote().setDefaultClusterId(addCluster); + getRemoteClinet().setDefaultClusterId(addCluster); } @Override @@ -1219,37 +1216,37 @@ public void internalCommitPreallocate(OTransactionOptimistic oTransactionOptimis @Override public void remoteRollback(OTransactionOptimistic oTransactionOptimistic) { - storage.rollback(oTransactionOptimistic); + client.rollback(oTransactionOptimistic); } public OPhysicalPosition[] higherPhysicalPositions( int clusterId, OPhysicalPosition physicalPosition) { - return getStorageRemote().higherPhysicalPositions(clusterId, physicalPosition); + return getRemoteClinet().higherPhysicalPositions(clusterId, physicalPosition); } public OPhysicalPosition[] lowerPhysicalPositions( int clusterId, OPhysicalPosition physicalPosition) { - return getStorageRemote().lowerPhysicalPositions(clusterId, physicalPosition); + return getRemoteClinet().lowerPhysicalPositions(clusterId, physicalPosition); } public OPhysicalPosition[] ceilingPhysicalPositions( int clusterId, OPhysicalPosition physicalPosition) { - return getStorageRemote().ceilingPhysicalPositions(clusterId, physicalPosition); + return getRemoteClinet().ceilingPhysicalPositions(clusterId, physicalPosition); } public OPhysicalPosition[] floorPhysicalPositions( int clusterId, OPhysicalPosition physicalPosition) { - return getStorageRemote().floorPhysicalPositions(clusterId, physicalPosition); + return getRemoteClinet().floorPhysicalPositions(clusterId, physicalPosition); } @Override public long countRecords() { - return getStorageRemote().countRecords(); + return getRemoteClinet().countRecords(); } @Override public boolean isReusable() { - return !getStorageRemote().isClosed(); + return !getRemoteClinet().isClosed(); } @Override @@ -1259,12 +1256,12 @@ public OBonsaiCollectionPointer createSBTree(int clusterId, UUID ownerUUID) { public ORawBuffer directRead( ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) { - return getStorageRemote().readRecord(rid, fetchPlan, ignoreCache, ignoreCache); + return getRemoteClinet().readRecord(rid, fetchPlan, ignoreCache, ignoreCache); } public ORawBuffer readIfVersionIsNotLatest( ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) { - return getStorageRemote() + return getRemoteClinet() .readRecordIfVersionIsNotLatest(rid, fetchPlan, ignoreCache, recordVersion); } } diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/db/document/OLiveQueryMonitorRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/db/document/OLiveQueryMonitorRemote.java index 06cd2ae6310..7dcf401f1e6 100644 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/db/document/OLiveQueryMonitorRemote.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/db/document/OLiveQueryMonitorRemote.java @@ -15,7 +15,7 @@ public OLiveQueryMonitorRemote(ODatabaseDocumentRemote database, int monitorId) @Override public void unSubscribe() { - database.getStorageRemote().unsubscribeLive(database, this.monitorId); + database.getRemoteClinet().unsubscribeLive(database, this.monitorId); } @Override diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OConnectRequest.java b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OConnectRequest.java index 59a4a66e3ff..2c5ee1deca3 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OConnectRequest.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OConnectRequest.java @@ -3,7 +3,7 @@ import com.orientechnologies.orient.client.binary.OBinaryRequestExecutor; import com.orientechnologies.orient.client.remote.OBinaryRequest; import com.orientechnologies.orient.client.remote.OBinaryResponse; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.client.remote.OStorageRemoteSession; import com.orientechnologies.orient.core.OConstants; import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer; @@ -16,7 +16,7 @@ public class OConnectRequest implements OBinaryRequest { private String username; private String password; - private String driverName = OStorageRemote.DRIVER_NAME; + private String driverName = ORemoteClient.DRIVER_NAME; private String driverVersion = OConstants.getRawVersion(); private short protocolVersion = OChannelBinaryProtocol.CURRENT_PROTOCOL_VERSION; private String clientId = null; diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OOpenRequest.java b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OOpenRequest.java index 4f9950fe2a6..de4c936086f 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OOpenRequest.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OOpenRequest.java @@ -3,7 +3,7 @@ import com.orientechnologies.orient.client.binary.OBinaryRequestExecutor; import com.orientechnologies.orient.client.remote.OBinaryRequest; import com.orientechnologies.orient.client.remote.OBinaryResponse; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.client.remote.OStorageRemoteSession; import com.orientechnologies.orient.core.OConstants; import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer; @@ -14,7 +14,7 @@ import java.io.IOException; public class OOpenRequest implements OBinaryRequest { - private String driverName = OStorageRemote.DRIVER_NAME; + private String driverName = ORemoteClient.DRIVER_NAME; private String driverVersion = OConstants.getRawVersion(); private short protocolVersion = OChannelBinaryProtocol.CURRENT_PROTOCOL_VERSION; private String clientId = null; diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OQueryRequest.java b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OQueryRequest.java index 05ca78f24ec..d26fb484e38 100644 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OQueryRequest.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OQueryRequest.java @@ -22,7 +22,7 @@ import com.orientechnologies.orient.client.binary.OBinaryRequestExecutor; import com.orientechnologies.orient.client.remote.OBinaryRequest; import com.orientechnologies.orient.client.remote.OBinaryResponse; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.client.remote.OStorageRemoteSession; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer; @@ -101,7 +101,7 @@ public static OQueryRequest executeMap( } private static ODocument paramsDoc(Object[] params) { - HashMap pm = OStorageRemote.paramsArrayToParamsMap(params); + HashMap pm = ORemoteClient.paramsArrayToParamsMap(params); ODocument pd = new ODocument(); pd.field("params", pm); return pd; diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OServerQueryRequest.java b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OServerQueryRequest.java index 414926a741d..468ff6ac320 100644 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OServerQueryRequest.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OServerQueryRequest.java @@ -22,7 +22,7 @@ import com.orientechnologies.orient.client.binary.OBinaryRequestExecutor; import com.orientechnologies.orient.client.remote.OBinaryRequest; import com.orientechnologies.orient.client.remote.OBinaryResponse; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.client.remote.OStorageRemoteSession; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer; @@ -56,7 +56,7 @@ public OServerQueryRequest( int recordsPerPage) { this.language = language; this.statement = iCommand; - params = OStorageRemote.paramsArrayToParamsMap(positionalParams); + params = ORemoteClient.paramsArrayToParamsMap(positionalParams); namedParams = false; this.serializer = serializer; // this.recordsPerPage = recordsPerPage; diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OSubscribeLiveQueryRequest.java b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OSubscribeLiveQueryRequest.java index 27aa9b14348..0665222f2c8 100644 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/message/OSubscribeLiveQueryRequest.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/message/OSubscribeLiveQueryRequest.java @@ -3,7 +3,7 @@ import com.orientechnologies.orient.client.binary.OBinaryRequestExecutor; import com.orientechnologies.orient.client.remote.OBinaryRequest; import com.orientechnologies.orient.client.remote.OBinaryResponse; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.client.remote.OStorageRemoteSession; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer; @@ -29,7 +29,7 @@ public OSubscribeLiveQueryRequest(String query, Map params) { public OSubscribeLiveQueryRequest(String query, Object[] params) { this.query = query; - this.params = OStorageRemote.paramsArrayToParamsMap(params); + this.params = ORemoteClient.paramsArrayToParamsMap(params); this.namedParams = false; } diff --git a/client/src/test/java/com/orientechnologies/orient/client/remote/ORemoteLiveQueryPushTest.java b/client/src/test/java/com/orientechnologies/orient/client/remote/ORemoteLiveQueryPushTest.java index 557d02d8a67..b424dfc8d12 100644 --- a/client/src/test/java/com/orientechnologies/orient/client/remote/ORemoteLiveQueryPushTest.java +++ b/client/src/test/java/com/orientechnologies/orient/client/remote/ORemoteLiveQueryPushTest.java @@ -53,7 +53,7 @@ public void onEnd(ODatabaseDocument database) { } } - private OStorageRemote storage; + private ORemoteClient storage; @Mock private ORemoteConnectionManager connectionManager; @@ -63,7 +63,7 @@ public void onEnd(ODatabaseDocument database) { public void before() throws IOException { MockitoAnnotations.initMocks(this); storage = - new OStorageRemote( + new ORemoteClient( new ORemoteURLs(new String[] {}, new OContextConfiguration()), "none", null, diff --git a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/SimpleConnectionStrategiesIT.java b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/SimpleConnectionStrategiesIT.java index 350e8f56a00..0668043a7fc 100644 --- a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/SimpleConnectionStrategiesIT.java +++ b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/SimpleConnectionStrategiesIT.java @@ -5,7 +5,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.client.remote.db.document.ODatabaseDocumentRemote; import com.orientechnologies.orient.core.db.ODatabasePool; import com.orientechnologies.orient.core.db.ODatabaseSession; @@ -150,7 +150,7 @@ public void testConnectNoHostFetch() { OrientDBConfig.builder().addConfig(CLIENT_CONNECTION_FETCH_HOST_LIST, false).build()); ODatabaseSession session = remote.open(databaseName, "admin", "admin"); assertEquals( - ((OStorageRemote) ((ODatabaseDocumentRemote) session).getStorageRemote()) + ((ORemoteClient) ((ODatabaseDocumentRemote) session).getRemoteClinet()) .getServerURLs() .size(), 1); @@ -163,7 +163,7 @@ public void testConnectNoHostFetch() { OrientDBConfig.builder().addConfig(CLIENT_CONNECTION_FETCH_HOST_LIST, true).build()); ODatabaseSession session1 = remote1.open(databaseName, "admin", "admin"); assertTrue( - ((OStorageRemote) ((ODatabaseDocumentRemote) session1).getStorageRemote()) + ((ORemoteClient) ((ODatabaseDocumentRemote) session1).getRemoteClinet()) .getServerURLs() .size() > 1); @@ -181,7 +181,7 @@ public void testConnectNoHostFetchWithPool() { ODatabasePool pool = new ODatabasePool(remote, databaseName, "admin", "admin"); ODatabaseSession session = pool.acquire(); assertEquals( - ((OStorageRemote) ((ODatabaseDocumentRemote) session).getStorageRemote()) + ((ORemoteClient) ((ODatabaseDocumentRemote) session).getRemoteClinet()) .getServerURLs() .size(), 1); @@ -196,7 +196,7 @@ public void testConnectNoHostFetchWithPool() { ODatabasePool pool1 = new ODatabasePool(remote1, databaseName, "admin", "admin"); ODatabaseSession session1 = pool1.acquire(); assertTrue( - ((OStorageRemote) ((ODatabaseDocumentRemote) session1).getStorageRemote()) + ((ORemoteClient) ((ODatabaseDocumentRemote) session1).getRemoteClinet()) .getServerURLs() .size() > 1); diff --git a/server/src/test/java/com/orientechnologies/orient/server/network/ORemoteImportTest.java b/server/src/test/java/com/orientechnologies/orient/server/network/ORemoteImportTest.java index a1f1df5f58b..54dd157f5c0 100755 --- a/server/src/test/java/com/orientechnologies/orient/server/network/ORemoteImportTest.java +++ b/server/src/test/java/com/orientechnologies/orient/server/network/ORemoteImportTest.java @@ -2,7 +2,7 @@ import static org.junit.Assert.assertTrue; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.client.remote.db.document.ODatabaseDocumentRemote; import com.orientechnologies.orient.core.command.OCommandOutputListener; import com.orientechnologies.orient.server.BaseServerMemoryDatabase; @@ -18,7 +18,7 @@ public void testImport() throws UnsupportedEncodingException { String content = "{\"records\": [{\"@type\": \"d\", \"@rid\": \"#9:0\",\"@version\": 1,\"@class\": \"V\"}]}"; - OStorageRemote storage = ((ODatabaseDocumentRemote) db).getStorageRemote(); + ORemoteClient storage = ((ODatabaseDocumentRemote) db).getRemoteClinet(); final StringBuffer buff = new StringBuffer(); storage.importDatabase( "-merge=true", diff --git a/server/src/test/java/com/orientechnologies/orient/server/query/RemoteTokenExpireTest.java b/server/src/test/java/com/orientechnologies/orient/server/query/RemoteTokenExpireTest.java index d7402515cec..78f5cc3a9e5 100755 --- a/server/src/test/java/com/orientechnologies/orient/server/query/RemoteTokenExpireTest.java +++ b/server/src/test/java/com/orientechnologies/orient/server/query/RemoteTokenExpireTest.java @@ -3,7 +3,7 @@ import static com.orientechnologies.orient.core.config.OGlobalConfiguration.QUERY_REMOTE_RESULTSET_PAGE_SIZE; import com.orientechnologies.common.io.OFileUtils; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.core.Orient; import com.orientechnologies.orient.core.config.OGlobalConfiguration; import com.orientechnologies.orient.core.db.ODatabasePool; @@ -215,7 +215,7 @@ public void itShouldNotFailWithRoundRobin() { OrientDBConfig.builder() .addConfig( OGlobalConfiguration.CLIENT_CONNECTION_STRATEGY, - OStorageRemote.CONNECTION_STRATEGY.ROUND_ROBIN_CONNECT) + ORemoteClient.CONNECTION_STRATEGY.ROUND_ROBIN_CONNECT) .build()); ODatabaseSession session = pool.acquire(); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDObjectInheritanceTestSchemaFull.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDObjectInheritanceTestSchemaFull.java index 2eb754cfdea..3921bffc1d4 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDObjectInheritanceTestSchemaFull.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDObjectInheritanceTestSchemaFull.java @@ -16,7 +16,7 @@ package com.orientechnologies.orient.test.database.auto; import com.orientechnologies.orient.client.remote.ODatabaseImportRemote; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.core.command.OCommandOutputListener; import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal; import com.orientechnologies.orient.core.db.tool.ODatabaseExport; @@ -161,13 +161,13 @@ public void create() { database .getEntityManager() .registerEntityClasses("com.orientechnologies.orient.test.domain.business"); - if (url.startsWith(OStorageRemote.TYPE)) { + if (url.startsWith(ORemoteClient.TYPE)) { database.getMetadata().reload(); } database .getEntityManager() .registerEntityClasses("com.orientechnologies.orient.test.domain.base"); - if (url.startsWith(OStorageRemote.TYPE)) { + if (url.startsWith(ORemoteClient.TYPE)) { database.getMetadata().reload(); } startRecordNumber = database.countClass("Company"); @@ -311,7 +311,7 @@ public void testSchemaGeneration() { .getMetadata() .getSchema() .generateSchema("com.orientechnologies.orient.test.domain.base"); - if (url.startsWith(OStorageRemote.TYPE)) { + if (url.startsWith(ORemoteClient.TYPE)) { database.getMetadata().reload(); } OClass musicianClass = database.getMetadata().getSchema().getClass(Musician.class); @@ -331,7 +331,7 @@ public void testAutomaticSchemaGeneration() { database .getEntityManager() .registerEntityClasses("com.orientechnologies.orient.test.domain.schemageneration"); - if (url.startsWith(OStorageRemote.TYPE)) { + if (url.startsWith(ORemoteClient.TYPE)) { database.getMetadata().reload(); } OClass testSchemaClass = @@ -395,7 +395,7 @@ public void testMultipleSchemaGeneration() { database.getMetadata().getSchema().generateSchema(Musician.class); database.getMetadata().getSchema().generateSchema(JavaTestSchemaGeneration.class); database.getMetadata().getSchema().generateSchema(TestSchemaGenerationChild.class); - if (url.startsWith(OStorageRemote.TYPE)) { + if (url.startsWith(ORemoteClient.TYPE)) { database.getMetadata().reload(); } } catch (Exception e) { diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDObjectPhysicalTestSchemaFull.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDObjectPhysicalTestSchemaFull.java index ca34e0229fb..39eda9889b4 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDObjectPhysicalTestSchemaFull.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDObjectPhysicalTestSchemaFull.java @@ -17,7 +17,7 @@ import com.orientechnologies.common.log.OLogManager; import com.orientechnologies.common.log.OLogger; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal; import com.orientechnologies.orient.core.db.object.OLazyObjectSetInterface; import com.orientechnologies.orient.core.db.record.ORecordLazyList; @@ -116,20 +116,20 @@ public void create() { database .getEntityManager() .registerEntityClasses("com.orientechnologies.orient.test.domain.business"); - if (url.startsWith(OStorageRemote.TYPE)) { + if (url.startsWith(ORemoteClient.TYPE)) { database.getMetadata().reload(); } database .getEntityManager() .registerEntityClasses("com.orientechnologies.orient.test.domain.base"); - if (url.startsWith(OStorageRemote.TYPE)) { + if (url.startsWith(ORemoteClient.TYPE)) { database.getMetadata().reload(); } database.setAutomaticSchemaGeneration(false); database .getEntityManager() .registerEntityClasses("com.orientechnologies.orient.test.domain.whiz"); - if (url.startsWith(OStorageRemote.TYPE)) { + if (url.startsWith(ORemoteClient.TYPE)) { database.getMetadata().reload(); } diff --git a/tools/src/main/java/com/orientechnologies/orient/console/OConsoleDatabaseApp.java b/tools/src/main/java/com/orientechnologies/orient/console/OConsoleDatabaseApp.java index a8bab82023e..a4acfbb7525 100755 --- a/tools/src/main/java/com/orientechnologies/orient/console/OConsoleDatabaseApp.java +++ b/tools/src/main/java/com/orientechnologies/orient/console/OConsoleDatabaseApp.java @@ -34,7 +34,7 @@ import com.orientechnologies.common.log.OLogManager; import com.orientechnologies.common.log.OLogger; import com.orientechnologies.orient.client.remote.ODatabaseImportRemote; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.client.remote.OrientDBRemote; import com.orientechnologies.orient.client.remote.db.document.ODatabaseDocumentRemote; import com.orientechnologies.orient.core.OConstants; @@ -3277,7 +3277,7 @@ protected void dumpDistributedConfiguration(final boolean iForce) { if (currentDatabase == null) return; if (currentDatabase.isRemote()) { - final OStorageRemote stg = ((ODatabaseDocumentRemote) currentDatabase).getStorageRemote(); + final ORemoteClient stg = ((ODatabaseDocumentRemote) currentDatabase).getRemoteClinet(); final ODocument distributedCfg = stg.getClusterConfiguration(); if (distributedCfg != null && !distributedCfg.isEmpty()) { message("\n\nDISTRIBUTED CONFIGURATION:\n" + distributedCfg.toJSON("prettyPrint")); @@ -3289,7 +3289,7 @@ protected void dumpDistributedConfiguration(final boolean iForce) { protected ODocument getDistributedConfiguration() { if (currentDatabase != null) { final OStorage stg = currentDatabase.getStorage(); - if (stg instanceof OStorageRemote) return ((OStorageRemote) stg).getClusterConfiguration(); + if (stg instanceof ORemoteClient) return ((ORemoteClient) stg).getClusterConfiguration(); } return null; } diff --git a/tools/src/main/java/com/orientechnologies/orient/stresstest/OStressTesterCommandLineParser.java b/tools/src/main/java/com/orientechnologies/orient/stresstest/OStressTesterCommandLineParser.java index 18eb5bde421..1e8369d62fe 100755 --- a/tools/src/main/java/com/orientechnologies/orient/stresstest/OStressTesterCommandLineParser.java +++ b/tools/src/main/java/com/orientechnologies/orient/stresstest/OStressTesterCommandLineParser.java @@ -19,7 +19,7 @@ */ package com.orientechnologies.orient.stresstest; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.stresstest.workload.OWorkload; import java.io.Console; import java.io.File; @@ -160,7 +160,7 @@ public static OStressTester getStressTester(String[] args) throws Exception { settings.checkDatabase = Boolean.parseBoolean(options.get(OPTION_CHECK_DATABASE)); if (options.get(OPTION_LOAD_BALANCING) != null) settings.loadBalancing = - OStorageRemote.CONNECTION_STRATEGY.valueOf( + ORemoteClient.CONNECTION_STRATEGY.valueOf( options.get(OPTION_LOAD_BALANCING).toUpperCase(Locale.ENGLISH)); if (settings.plocalPath != null) { diff --git a/tools/src/main/java/com/orientechnologies/orient/stresstest/OStressTesterSettings.java b/tools/src/main/java/com/orientechnologies/orient/stresstest/OStressTesterSettings.java index 9c5e94b2a44..0e294dec934 100644 --- a/tools/src/main/java/com/orientechnologies/orient/stresstest/OStressTesterSettings.java +++ b/tools/src/main/java/com/orientechnologies/orient/stresstest/OStressTesterSettings.java @@ -19,7 +19,7 @@ */ package com.orientechnologies.orient.stresstest; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import java.io.File; /** @@ -42,8 +42,8 @@ public class OStressTesterSettings { public boolean keepDatabaseAfterTest; public int remotePort = 2424; public boolean checkDatabase = false; - public OStorageRemote.CONNECTION_STRATEGY loadBalancing = - OStorageRemote.CONNECTION_STRATEGY.ROUND_ROBIN_REQUEST; + public ORemoteClient.CONNECTION_STRATEGY loadBalancing = + ORemoteClient.CONNECTION_STRATEGY.ROUND_ROBIN_REQUEST; public String dbUser; public String dbPassword; diff --git a/tools/src/main/java/com/orientechnologies/orient/stresstest/workload/OBaseWorkload.java b/tools/src/main/java/com/orientechnologies/orient/stresstest/workload/OBaseWorkload.java index e9a041041ff..6d136db294f 100755 --- a/tools/src/main/java/com/orientechnologies/orient/stresstest/workload/OBaseWorkload.java +++ b/tools/src/main/java/com/orientechnologies/orient/stresstest/workload/OBaseWorkload.java @@ -24,7 +24,7 @@ import com.orientechnologies.common.log.OLogger; import com.orientechnologies.common.util.OCallable; import com.orientechnologies.common.util.OUncaughtExceptionHandler; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.core.db.OrientDB; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract; import com.orientechnologies.orient.core.record.impl.ODocument; @@ -41,8 +41,8 @@ */ public abstract class OBaseWorkload implements OWorkload { private static final OLogger logger = OLogManager.instance().logger(OBaseWorkload.class); - protected OStorageRemote.CONNECTION_STRATEGY connectionStrategy = - OStorageRemote.CONNECTION_STRATEGY.STICKY; + protected ORemoteClient.CONNECTION_STRATEGY connectionStrategy = + ORemoteClient.CONNECTION_STRATEGY.STICKY; public abstract class OBaseWorkLoadContext { public int threadId; diff --git a/tools/src/main/java/com/orientechnologies/orient/stresstest/workload/OCRUDWorkload.java b/tools/src/main/java/com/orientechnologies/orient/stresstest/workload/OCRUDWorkload.java index c7b6078d14c..f9cf88a41ce 100644 --- a/tools/src/main/java/com/orientechnologies/orient/stresstest/workload/OCRUDWorkload.java +++ b/tools/src/main/java/com/orientechnologies/orient/stresstest/workload/OCRUDWorkload.java @@ -21,7 +21,7 @@ import com.orientechnologies.common.listener.OProgressListener; import com.orientechnologies.common.util.OCallable; -import com.orientechnologies.orient.client.remote.OStorageRemote; +import com.orientechnologies.orient.client.remote.ORemoteClient; import com.orientechnologies.orient.core.db.ODatabase; import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal; import com.orientechnologies.orient.core.db.OrientDB; @@ -67,7 +67,7 @@ public class OCRUDWorkload extends OBaseDocumentWorkload implements OCheckWorklo private int scans; public OCRUDWorkload() { - connectionStrategy = OStorageRemote.CONNECTION_STRATEGY.ROUND_ROBIN_REQUEST; + connectionStrategy = ORemoteClient.CONNECTION_STRATEGY.ROUND_ROBIN_REQUEST; } @Override