use of com.emc.storageos.coordinator.client.service.DistributedQueueItemProcessedCallback in project coprhd-controller by CoprHD.
the class BlockMonitoringImpl method stopMonitoringStaleSystem.
/**
* 1.Find stale SMIS Provider from DB
* 2. Un-subscribe cimconnection to avoid indications.
* 3. Remove stale smisprovider URI from local CACHE
*/
@Override
public void stopMonitoringStaleSystem() {
_logger.debug("Entering {}", Thread.currentThread().getStackTrace()[1].getMethodName());
Iterator<Map.Entry<String, DistributedQueueItemProcessedCallback>> iter = SMIS_PROVIDERS_CACHE.entrySet().iterator();
StorageProvider smisprovider = null;
while (iter.hasNext()) {
Map.Entry<String, DistributedQueueItemProcessedCallback> entry = iter.next();
String smisProvoiderURI = entry.getKey();
_logger.debug("smisProvoiderURI :{}", smisProvoiderURI);
try {
smisprovider = _dbClient.queryObject(StorageProvider.class, URI.create(smisProvoiderURI));
} catch (final DatabaseException e) {
_logger.error(e.getMessage(), e);
}
if (null == smisprovider || smisprovider.getInactive()) {
_logger.info("Stale SMIS Provider {} has been removed from monitoring", smisProvoiderURI);
_connectionFactory.unsubscribeSMIProviderConnection(smisProvoiderURI);
try {
// Removes monitorinJob token from queue
entry.getValue().itemProcessed();
} catch (Exception e) {
_logger.error("Exception occurred while removing monitoringJob token from ZooKeeper queue", e);
} finally {
// Removes from CACHE
iter.remove();
ACTIVE_SMIS_PROVIDERS_CACHE.remove(smisProvoiderURI);
}
}
}
_logger.debug("Exiting {}", Thread.currentThread().getStackTrace()[1].getMethodName());
}
use of com.emc.storageos.coordinator.client.service.DistributedQueueItemProcessedCallback in project coprhd-controller by CoprHD.
the class IsilonMonitoringImpl method stopMonitoringStaleSystem.
@Override
public void stopMonitoringStaleSystem() {
_logger.debug("Entering {}", Thread.currentThread().getStackTrace()[1].getMethodName());
Iterator<Map.Entry<MonitoredDevice, DistributedQueueItemProcessedCallback>> iter = ISILON_CACHE.entrySet().iterator();
StorageSystem storageDeviceFromDB = null;
while (iter.hasNext()) {
Map.Entry<MonitoredDevice, DistributedQueueItemProcessedCallback> entry = iter.next();
MonitoredDevice monitoredDevice = entry.getKey();
URI isilonDeviceURI = monitoredDevice._storageSystemURI;
_logger.debug("storageDeviceURI :{}", isilonDeviceURI);
try {
storageDeviceFromDB = _dbClient.queryObject(StorageSystem.class, isilonDeviceURI);
} catch (DatabaseException e) {
_logger.error(e.getMessage(), e);
}
if (null == storageDeviceFromDB || storageDeviceFromDB.getInactive()) {
_logger.info("Stale isilon {} has been removed from monitoring", isilonDeviceURI);
try {
// Removes monitorinJob token from queue
entry.getValue().itemProcessed();
} catch (Exception e) {
_logger.error("Exception occurred while removing monitoringJob token from ZooKeeper queue", e);
} finally {
// Removes item from CACHE
iter.remove();
}
}
}
_logger.debug("Exiting {}", Thread.currentThread().getStackTrace()[1].getMethodName());
}
use of com.emc.storageos.coordinator.client.service.DistributedQueueItemProcessedCallback in project coprhd-controller by CoprHD.
the class VNXFileMonitoringImpl method stopMonitoringStaleSystem.
/**
* 1. Find stale vnxFile devices.
* 2. UNsubscribe existing subscription to avoid indications for the stale vnx devices.
* 3. Clear stale devices from zoo keeper queue and local CACHE.
*/
@Override
public void stopMonitoringStaleSystem() {
_logger.debug("Entering {}", Thread.currentThread().getStackTrace()[1].getMethodName());
Iterator<Map.Entry<String, DistributedQueueItemProcessedCallback>> iter = VNXFILE_CACHE.entrySet().iterator();
StorageSystem storageDevice = null;
while (iter.hasNext()) {
Map.Entry<String, DistributedQueueItemProcessedCallback> entry = iter.next();
String storageDeviceURI = entry.getKey();
_logger.debug("storageDeviceURI :{}", storageDeviceURI);
try {
storageDevice = _dbClient.queryObject(StorageSystem.class, URI.create(storageDeviceURI));
} catch (DatabaseException e) {
_logger.error(e.getMessage(), e);
}
if (null == storageDevice || storageDevice.getInactive() || !isSMISProviderConnected(storageDeviceURI)) {
_logger.info("Stale vnxfiler {} has been removed from monitoring", storageDeviceURI);
_connectionFactory.unsubscribeSMIProviderConnection(storageDeviceURI);
try {
// Removes monitorinJob token from queue
entry.getValue().itemProcessed();
} catch (Exception e) {
_logger.error("Exception occurred while removing monitoringJob token from ZooKeeper queue", e);
} finally {
// Removes from local CACHE
iter.remove();
FAILED_VNXFILE_SUBSCRIPTION.remove(storageDeviceURI);
}
}
}
_logger.debug("Exiting {}", Thread.currentThread().getStackTrace()[1].getMethodName());
}
Aggregations