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:43 UTC

[14/16] incubator-spot git commit: Add functionality to reset scored connections (flow)

Add functionality to reset scored connections (flow)


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

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

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


http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/6628aeab/spot-oa/api/resources/flow.py
----------------------------------------------------------------------
diff --git a/spot-oa/api/resources/flow.py b/spot-oa/api/resources/flow.py
index 665d4cd..c4791df 100755
--- a/spot-oa/api/resources/flow.py
+++ b/spot-oa/api/resources/flow.py
@@ -908,3 +908,24 @@ def get_ctx_name(full_context):
     elif "FW" in full_context:
         ctx = "FW"
     return ctx
+
+"""
+--------------------------------------------------------------------------
+Reset scored connections.
+--------------------------------------------------------------------------
+"""
+def reset_scored_connections(date):
+
+    flow_storyboard =  "flow/hive/oa/storyboard"
+    flow_threat_investigation = "flow/hive/oa/threat_investigation"
+    flow_timeline = "flow/hive/oa/timeline"    
+    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,flow_storyboard,date.year,date.month,date.day) , "impala")
+    HDFSClient.delete_folder("{0}/{1}/y={2}/m={3}/d={4}/".format( \
+        app_path,flow_threat_investigation,date.year,date.month,date.day), "impala")
+    HDFSClient.delete_folder("{0}/{1}/y={2}/m={3}/d={4}/".format( \
+        app_path,flow_timeline,date.year,date.month,date.day), "impala")
+    ImpalaEngine.execute_query("invalidate metadata")
\ No newline at end of file