From 35396c1378adff83db8843dde17963043f14c2ca Mon Sep 17 00:00:00 2001 From: Tglman Date: Wed, 24 Jan 2024 12:14:25 +0100 Subject: [PATCH] fix: corrections on distributed configuration after core refactor --- .../agent/http/command/OServerCommandDistributedManager.java | 5 ++++- .../agent/services/metrics/OrientDBMetricsCommand.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/agent/src/main/java/com/orientechnologies/agent/http/command/OServerCommandDistributedManager.java b/agent/src/main/java/com/orientechnologies/agent/http/command/OServerCommandDistributedManager.java index d0c08271..d94ef4ce 100644 --- a/agent/src/main/java/com/orientechnologies/agent/http/command/OServerCommandDistributedManager.java +++ b/agent/src/main/java/com/orientechnologies/agent/http/command/OServerCommandDistributedManager.java @@ -28,6 +28,7 @@ import com.orientechnologies.orient.core.metadata.schema.OType; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.sql.executor.OResult; +import com.orientechnologies.orient.distributed.db.OrientDBDistributed; import com.orientechnologies.orient.server.OServer; import com.orientechnologies.orient.server.distributed.ODistributedConfiguration; import com.orientechnologies.orient.server.distributed.ODistributedRequest; @@ -321,7 +322,9 @@ private ODocument calculateDBStatus( private ODocument singleDBStatus(ODistributedServerManager manager, String database) { final ODocument entries = new ODocument(); - final ODistributedConfiguration dbCfg = manager.getDatabaseConfiguration(database, false); + final ODistributedConfiguration dbCfg = + ((OrientDBDistributed) manager.getServerInstance().getDatabases()) + .getExistingDistributedConfiguration(database); final Set servers = dbCfg.getAllConfiguredServers(); for (String serverName : servers) { final ODistributedServerManager.DB_STATUS databaseStatus = diff --git a/agent/src/main/java/com/orientechnologies/agent/services/metrics/OrientDBMetricsCommand.java b/agent/src/main/java/com/orientechnologies/agent/services/metrics/OrientDBMetricsCommand.java index 1367fdf5..89e659a3 100644 --- a/agent/src/main/java/com/orientechnologies/agent/services/metrics/OrientDBMetricsCommand.java +++ b/agent/src/main/java/com/orientechnologies/agent/services/metrics/OrientDBMetricsCommand.java @@ -13,6 +13,7 @@ import com.orientechnologies.common.log.OLogManager; import com.orientechnologies.enterprise.server.OEnterpriseServer; import com.orientechnologies.orient.core.record.impl.ODocument; +import com.orientechnologies.orient.distributed.db.OrientDBDistributed; import com.orientechnologies.orient.server.distributed.ODistributedConfiguration; import com.orientechnologies.orient.server.distributed.ODistributedServerManager; import com.orientechnologies.orient.server.network.protocol.http.OHttpRequest; @@ -89,7 +90,9 @@ private ODocument calculateDBStatus( private ODocument singleDBStatus(ODistributedServerManager manager, String database) { final ODocument entries = new ODocument(); - final ODistributedConfiguration dbCfg = manager.getDatabaseConfiguration(database, false); + final ODistributedConfiguration dbCfg = + ((OrientDBDistributed) manager.getServerInstance().getDatabases()) + .getExistingDistributedConfiguration(database); final Set servers = dbCfg.getAllConfiguredServers(); for (String serverName : servers) { final ODistributedServerManager.DB_STATUS databaseStatus =