You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spot.apache.org by le...@apache.org on 2017/04/17 16:37:37 UTC

[08/16] incubator-spot git commit: Add functionality to reset scored proxy

Add functionality to reset scored proxy


Project: http://git-wip-us.apache.org/repos/asf/incubator-spot/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spot/commit/97f01977
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spot/tree/97f01977
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spot/diff/97f01977

Branch: refs/heads/SPOT-35_graphql_api
Commit: 97f01977ff3e696562b9f3b91f944821ce9e667c
Parents: ae3ea15
Author: Everardo Lopez Sandoval (Intel) <el...@elopezsa-mac02.zpn.intel.com>
Authored: Fri Apr 7 17:14:09 2017 -0500
Committer: LedaLima <le...@apache.org>
Committed: Sun Apr 9 21:26:10 2017 -0500

----------------------------------------------------------------------
 spot-oa/api/resources/proxy.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/97f01977/spot-oa/api/resources/proxy.py
----------------------------------------------------------------------
diff --git a/spot-oa/api/resources/proxy.py b/spot-oa/api/resources/proxy.py
index 49f78a1..37a2828 100644
--- a/spot-oa/api/resources/proxy.py
+++ b/spot-oa/api/resources/proxy.py
@@ -404,3 +404,25 @@ def ingest_summary(start_date,end_date):
                 .format(db,start_date.year,end_date.year,start_date.month,end_date.month, start_date.day, end_date.day)
 
     return ImpalaEngine.execute_query_as_list(is_query)
+
+
+"""
+--------------------------------------------------------------------------
+Reset scored connections.
+--------------------------------------------------------------------------
+"""
+def reset_scored_connections(date):
+
+    proxy_storyboard =  "proxy/hive/oa/storyboard"
+    proxy_threat_investigation = "dns_threat_dendro/hive/oa/timeline"
+    proxy_timeline = "proxy/hive/oa/threat_investigation"    
+    app_path = Configuration.spot()   
+
+    # remove parquet files manually to allow the comments update.
+    HDFSClient.delete_folder("{0}/{1}/y={2}/m={3}/d={4}/".format( \
+        app_path,proxy_storyboard,date.year,date.month,date.day) , "impala")
+    HDFSClient.delete_folder("{0}/{1}/y={2}/m={3}/d={4}/".format( \
+        app_path,proxy_threat_investigation,date.year,date.month,date.day), "impala")
+    HDFSClient.delete_folder("{0}/{1}/y={2}/m={3}/d={4}/".format( \
+        app_path,proxy_timeline,date.year,date.month,date.day), "impala")
+    ImpalaEngine.execute_query("invalidate metadata")