From 397fa4c2fbd35aa8db59794c5710259276a48490 Mon Sep 17 00:00:00 2001 From: Inosh Date: Tue, 27 Oct 2015 07:44:57 +0530 Subject: [PATCH] fixing throwing exception at spark script removal in capp deployment in distributed setup. DAS-298 --- .../spark/core/internal/AnalyticsPersistenceManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/analytics-processors/org.wso2.carbon.analytics.spark.core/src/main/java/org/wso2/carbon/analytics/spark/core/internal/AnalyticsPersistenceManager.java b/components/analytics-processors/org.wso2.carbon.analytics.spark.core/src/main/java/org/wso2/carbon/analytics/spark/core/internal/AnalyticsPersistenceManager.java index 221e8954aac..84c7ec3cf0b 100644 --- a/components/analytics-processors/org.wso2.carbon.analytics.spark.core/src/main/java/org/wso2/carbon/analytics/spark/core/internal/AnalyticsPersistenceManager.java +++ b/components/analytics-processors/org.wso2.carbon.analytics.spark.core/src/main/java/org/wso2/carbon/analytics/spark/core/internal/AnalyticsPersistenceManager.java @@ -17,6 +17,8 @@ */ package org.wso2.carbon.analytics.spark.core.internal; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.analytics.spark.core.AnalyticsTask; import org.wso2.carbon.analytics.spark.core.util.AnalyticsScript; import org.wso2.carbon.analytics.spark.core.exception.AnalyticsPersistenceException; @@ -49,6 +51,7 @@ * the analytics scripts. */ public class AnalyticsPersistenceManager { + private static final Log log = LogFactory.getLog(AnalyticsPersistenceManager.class); private static AnalyticsPersistenceManager instance = new AnalyticsPersistenceManager(); private AnalyticsPersistenceManager() { @@ -220,8 +223,8 @@ public void deleteScript(int tenantId, String scriptName) throws AnalyticsPersis userRegistry.delete(scriptLocation); scheduleTask(tenantId, new AnalyticsScript(scriptName)); } else { - throw new AnalyticsPersistenceException("Script wasn't existing in :" + scriptLocation + - ". Cannot delete non existing script : " + scriptName + " for tenantId : " + tenantId + ". "); + log.info("Cannot delete non existing script : " + scriptName + " for tenantId : " + tenantId + ". " + + "It might have been deleted already." ); } } catch (RegistryException e) { throw new AnalyticsPersistenceException("Error while loading the registry for tenant : " + tenantId, e);