Skip to content

Commit

Permalink
fixing throwing exception at spark script removal in capp deployment …
Browse files Browse the repository at this point in the history
…in distributed setup. DAS-298
  • Loading branch information
inosh committed Oct 27, 2015
1 parent c4f7f5f commit 397fa4c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 397fa4c

Please sign in to comment.