use of com.linkedin.databus2.producers.db.GGMonitoredSourceInfo in project databus by linkedin.
the class GoldenGateEventProducer method buildGGMonitoredSourceInfo.
public GGMonitoredSourceInfo buildGGMonitoredSourceInfo(LogicalSourceStaticConfig sourceConfig, PhysicalSourceStaticConfig pConfig) throws DatabusException, InvalidConfigException {
// udpate partition mapping
PartitionFunction partitionFunction = GGEventGenerationFactory.buildPartitionFunction(sourceConfig);
_partitionFunctionHashMap.put((int) sourceConfig.getId(), partitionFunction);
EventSourceStatistics statisticsBean = new EventSourceStatistics(sourceConfig.getName());
GGMonitoredSourceInfo sourceInfo = new GGMonitoredSourceInfo(sourceConfig.getId(), sourceConfig.getName(), statisticsBean);
registerMbeans(sourceInfo);
return sourceInfo;
}
use of com.linkedin.databus2.producers.db.GGMonitoredSourceInfo in project databus by linkedin.
the class GoldenGateEventProducer method registerMbeans.
// register each source with the mbeanServer
private void registerMbeans(GGMonitoredSourceInfo source) throws DatabusException {
try {
Hashtable<String, String> props = new Hashtable<String, String>();
props.put("type", "SourceStatistics");
props.put("name", source.getSourceName());
ObjectName objectName = new ObjectName(ServerContainer.JMX_DOMAIN, props);
if (_mbeanServer.isRegistered(objectName)) {
_log.warn("Unregistering old gg-source statistics mbean: " + objectName);
_mbeanServer.unregisterMBean(objectName);
}
_mbeanServer.registerMBean(source.getStatisticsBean(), objectName);
_log.info("Registered gg-source statistics mbean: " + objectName);
_registeredMbeans.add(objectName);
} catch (Exception ex) {
_log.error("Failed to register the gg-source statistics mbean for source (" + source.getSourceName() + ") due to an exception.", ex);
throw new DatabusException("Failed to initialize gg event statistics mbeans.", ex);
}
}
Aggregations