use of herddb.core.HerdDBInternalException in project herddb by diennea.
the class JMXUtils method registerDBManagerStatsMXBean.
public static void registerDBManagerStatsMXBean(DBManagerStatsMXBean bean) {
if (platformMBeanServer == null) {
throw new HerdDBInternalException("PlatformMBeanServer not available", mBeanServerLookupError);
}
try {
ObjectName name = new ObjectName("herddb.server:type=Server");
LOG.log(Level.FINE, "Publishing stats for server at {2}", new Object[] { name });
if (platformMBeanServer.isRegistered(name)) {
try {
platformMBeanServer.unregisterMBean(name);
} catch (InstanceNotFoundException noProblem) {
}
}
platformMBeanServer.registerMBean(bean, name);
} catch (MalformedObjectNameException | InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {
throw new HerdDBInternalException("Could not register MXBean " + e);
}
}
use of herddb.core.HerdDBInternalException in project herddb by diennea.
the class JMXUtils method registerTableManagerStatsMXBean.
public static void registerTableManagerStatsMXBean(String tableSpaceName, String tableName, TableManagerStatsMXBean bean) {
if (platformMBeanServer == null) {
throw new HerdDBInternalException("PlatformMBeanServer not available", mBeanServerLookupError);
}
String safeTableSpaceName = safeName(tableSpaceName);
String safeTableName = safeName(tableName);
try {
ObjectName name = new ObjectName("herddb.server:type=Table,Name=" + safeTableSpaceName + "." + safeTableName);
LOG.log(Level.FINE, "Publishing stats for table {0}.{1} at {2}", new Object[] { tableSpaceName, tableName, name });
if (platformMBeanServer.isRegistered(name)) {
try {
platformMBeanServer.unregisterMBean(name);
} catch (InstanceNotFoundException noProblem) {
}
}
platformMBeanServer.registerMBean(bean, name);
} catch (MalformedObjectNameException | InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {
throw new HerdDBInternalException("Could not register MXBean " + e);
}
}
use of herddb.core.HerdDBInternalException in project herddb by diennea.
the class JMXUtils method unregisterTableManagerStatsMXBean.
public static void unregisterTableManagerStatsMXBean(String tableSpaceName, String tableName) {
if (platformMBeanServer == null) {
return;
}
String safeTableSpaceName = safeName(tableSpaceName);
String safeTableName = safeName(tableName);
try {
ObjectName name = new ObjectName("herddb.server:type=Table,Name=" + safeTableSpaceName + "." + safeTableName);
if (platformMBeanServer.isRegistered(name)) {
try {
platformMBeanServer.unregisterMBean(name);
} catch (InstanceNotFoundException noProblem) {
}
}
} catch (MalformedObjectNameException | MBeanRegistrationException e) {
throw new HerdDBInternalException("Could not unregister MXBean " + e);
}
}
use of herddb.core.HerdDBInternalException in project herddb by diennea.
the class FileDataStorageManager method fullTableScan.
@Override
public void fullTableScan(String tableSpace, String tableName, FullTableScanConsumer consumer) throws DataStorageManagerException {
try {
TableStatus status = getLatestTableStatus(tableSpace, tableName);
fullTableScan(tableSpace, tableName, status, consumer);
} catch (HerdDBInternalException err) {
throw new DataStorageManagerException(err);
}
}
use of herddb.core.HerdDBInternalException in project herddb by diennea.
the class FileDataStorageManager method fullTableScan.
@Override
public void fullTableScan(String tableSpace, String tableUuid, LogSequenceNumber sequenceNumber, FullTableScanConsumer consumer) throws DataStorageManagerException {
try {
TableStatus status = getTableStatus(tableSpace, tableUuid, sequenceNumber);
fullTableScan(tableSpace, tableUuid, status, consumer);
} catch (HerdDBInternalException err) {
throw new DataStorageManagerException(err);
}
}
Aggregations