Search in sources :

Example 1 with HerdDBInternalException

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);
    }
}
Also used : MalformedObjectNameException(javax.management.MalformedObjectNameException) HerdDBInternalException(herddb.core.HerdDBInternalException) NotCompliantMBeanException(javax.management.NotCompliantMBeanException) InstanceNotFoundException(javax.management.InstanceNotFoundException) InstanceAlreadyExistsException(javax.management.InstanceAlreadyExistsException) MBeanRegistrationException(javax.management.MBeanRegistrationException) ObjectName(javax.management.ObjectName)

Example 2 with HerdDBInternalException

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);
    }
}
Also used : MalformedObjectNameException(javax.management.MalformedObjectNameException) HerdDBInternalException(herddb.core.HerdDBInternalException) NotCompliantMBeanException(javax.management.NotCompliantMBeanException) InstanceNotFoundException(javax.management.InstanceNotFoundException) InstanceAlreadyExistsException(javax.management.InstanceAlreadyExistsException) MBeanRegistrationException(javax.management.MBeanRegistrationException) ObjectName(javax.management.ObjectName)

Example 3 with HerdDBInternalException

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);
    }
}
Also used : MalformedObjectNameException(javax.management.MalformedObjectNameException) HerdDBInternalException(herddb.core.HerdDBInternalException) InstanceNotFoundException(javax.management.InstanceNotFoundException) MBeanRegistrationException(javax.management.MBeanRegistrationException) ObjectName(javax.management.ObjectName)

Example 4 with HerdDBInternalException

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);
    }
}
Also used : DataStorageManagerException(herddb.storage.DataStorageManagerException) HerdDBInternalException(herddb.core.HerdDBInternalException) TableStatus(herddb.storage.TableStatus)

Example 5 with HerdDBInternalException

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);
    }
}
Also used : DataStorageManagerException(herddb.storage.DataStorageManagerException) HerdDBInternalException(herddb.core.HerdDBInternalException) TableStatus(herddb.storage.TableStatus)

Aggregations

HerdDBInternalException (herddb.core.HerdDBInternalException)7 InstanceNotFoundException (javax.management.InstanceNotFoundException)4 MBeanRegistrationException (javax.management.MBeanRegistrationException)4 MalformedObjectNameException (javax.management.MalformedObjectNameException)4 ObjectName (javax.management.ObjectName)4 InstanceAlreadyExistsException (javax.management.InstanceAlreadyExistsException)3 NotCompliantMBeanException (javax.management.NotCompliantMBeanException)3 DataStorageManagerException (herddb.storage.DataStorageManagerException)2 TableStatus (herddb.storage.TableStatus)2 DDLStatementExecutionResult (herddb.model.DDLStatementExecutionResult)1 DMLStatementExecutionResult (herddb.model.DMLStatementExecutionResult)1 DataScannerException (herddb.model.DataScannerException)1 DuplicatePrimaryKeyException (herddb.model.DuplicatePrimaryKeyException)1 NotLeaderException (herddb.model.NotLeaderException)1 Record (herddb.model.Record)1 Statement (herddb.model.Statement)1 StatementExecutionException (herddb.model.StatementExecutionException)1 StatementExecutionResult (herddb.model.StatementExecutionResult)1 Table (herddb.model.Table)1 TableAwareStatement (herddb.model.TableAwareStatement)1