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:32 UTC
[03/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/2b67248c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spot/tree/2b67248c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spot/diff/2b67248c
Branch: refs/heads/SPOT-35_graphql_api
Commit: 2b67248cc8981349c69cc427f1947e4ba6ea05dd
Parents: d6d4224
Author: Everardo Lopez Sandoval (Intel) <el...@elopezsa-mac02.zpn.intel.com>
Authored: Fri Apr 7 17:14:09 2017 -0500
Committer: Everardo Lopez Sandoval (Intel) <el...@elopezsa-mac02.zpn.intel.com>
Committed: Fri Apr 7 17:14:09 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/2b67248c/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")