private boolean isStorageNodeOperation(ResourceOperationHistory operationHistory) { if (operationHistory == null) { return false; } ResourceType resourceType = operationHistory.getOperationDefinition().getResourceType(); return resourceType.getName().equals(STORAGE_NODE_TYPE_NAME) && resourceType.getPlugin().equals(STORAGE_NODE_PLUGIN_NAME); }
private void operationCanceled(StorageNode storageNode, ResourceOperationHistory operationHistory, String opType) { log.error(opType + " has been aborted due to canceled operation [" + operationHistory.getOperationDefinition().getDisplayName() + " on " + storageNode.getResource() + ": " + operationHistory.getErrorMessage()); storageNode.setErrorMessage(opType + " has been aborted due to canceled resource operation [" + operationHistory.getOperationDefinition().getDisplayName() + "]."); storageNode.setFailedOperation(operationHistory); }
private void operationFailed(StorageNode storageNode, ResourceOperationHistory operationHistory, String opType) { log.error(opType + " has been aborted due to failed operation [" + operationHistory.getOperationDefinition().getDisplayName() + "] on " + storageNode.getResource() + ": " + operationHistory.getErrorMessage()); storageNode.setErrorMessage(opType + " has been aborted due to failed resource operation [" + operationHistory.getOperationDefinition().getDisplayName() + "]."); storageNode.setFailedOperation(operationHistory); }
private void operationCanceled(StorageNode storageNode, ResourceOperationHistory operationHistory, StorageNode movingNode, String opType) { log.error(opType + " has been aborted due to canceled operation [" + operationHistory.getOperationDefinition().getDisplayName() + " on " + storageNode.getResource() + ": " + operationHistory.getErrorMessage()); movingNode.setErrorMessage(opType + " has been aborted due to canceled resource operation on " + storageNode.getAddress()); storageNode.setErrorMessage(opType + " of " + movingNode.getAddress() + " has been aborted due " + "to cancellation of resource operation [" + operationHistory.getOperationDefinition().getDisplayName() + "]."); storageNode.setFailedOperation(operationHistory); }
private void operationFailed(StorageNode storageNode, ResourceOperationHistory operationHistory, StorageNode movingNode, String opType) { log.error(opType + " has been aborted due to failed operation [" + operationHistory.getOperationDefinition().getDisplayName() + "] on " + storageNode.getResource() + ": " + operationHistory.getErrorMessage()); movingNode.setErrorMessage(opType + " has been aborted due to failed resource operation on " + storageNode.getAddress()); storageNode.setErrorMessage(opType + " of " + movingNode.getAddress() + " has been aborted due " + "to failed resource operation [" + operationHistory.getOperationDefinition().getDisplayName() + "]."); storageNode.setFailedOperation(operationHistory); }
public AlertConditionCacheStats checkConditions(OperationHistory operationHistory) { AlertConditionCacheStats stats = new AlertConditionCacheStats(); try { if (operationHistory instanceof ResourceOperationHistory) { ResourceOperationHistory resourceOperationHistory = (ResourceOperationHistory) operationHistory; Resource resource = resourceOperationHistory.getResource(); OperationDefinition operationDefinition = resourceOperationHistory.getOperationDefinition(); OperationRequestStatus operationStatus = resourceOperationHistory.getStatus(); List<ResourceOperationCacheElement> cacheElements = lookupResourceOperationHistoryCacheElements( resource.getId(), operationDefinition.getId()); processCacheElements(cacheElements, operationStatus, resourceOperationHistory.getModifiedTime(), stats); } else { if (log.isDebugEnabled()) log.debug(getClass().getSimpleName() + " does not support checking conditions against " + operationHistory.getClass().getSimpleName() + " types"); } AlertConditionCacheMonitor.getMBean().incrementOperationCacheElementMatches(stats.matched); AlertConditionCacheMonitor.getMBean().incrementOperationProcessingTime(stats.getAge()); if (log.isDebugEnabled()) log.debug("Check OperationHistory[size=1] - " + stats); } catch (Throwable t) { // don't let any exceptions bubble up to the calling SLSB layer log.error("Error during global cache processing: ", t); } return stats; }
List<ResourceOperationHistory> histories = query.getResultList(); for (ResourceOperationHistory history : histories) { long timeout = getOperationTimeout(history.getOperationDefinition(), history.getParameters());
if (resourceOperationHistory.getOperationDefinition().getName().equals("announce")) { try { storageNodeOperationsHandler.handleAnnounce(resourceOperationHistory);
hist.setResourceName(history.getResource().getName()); hist.setOperationName(history.getOperationDefinition().getName()); hist.lastModified(history.getModifiedTime()); if (history.getErrorMessage()!=null) {