Commit 96d4d31d by Madhan Neethiraj

ATLAS-2213: Remove unused attributes from Hive hook

parent 32fa4be5
...@@ -37,6 +37,7 @@ import org.apache.hadoop.hive.conf.HiveConf; ...@@ -37,6 +37,7 @@ import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.TableType; import org.apache.hadoop.hive.metastore.TableType;
import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.ql.QueryPlan;
import org.apache.hadoop.hive.ql.hooks.Entity; import org.apache.hadoop.hive.ql.hooks.Entity;
import org.apache.hadoop.hive.ql.hooks.Entity.Type; import org.apache.hadoop.hive.ql.hooks.Entity.Type;
import org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext; import org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext;
...@@ -171,18 +172,20 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext { ...@@ -171,18 +172,20 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
// clone to avoid concurrent access // clone to avoid concurrent access
try { try {
final HiveEventContext event = new HiveEventContext(); final HiveEventContext event = new HiveEventContext();
event.setInputs(hookContext.getInputs()); event.setInputs(hookContext.getInputs());
event.setOutputs(hookContext.getOutputs()); event.setOutputs(hookContext.getOutputs());
event.setHookType(hookContext.getHookType()); event.setHookType(hookContext.getHookType());
final UserGroupInformation ugi = hookContext.getUgi() == null ? Utils.getUGI() : hookContext.getUgi(); final UserGroupInformation ugi = hookContext.getUgi() == null ? Utils.getUGI() : hookContext.getUgi();
final QueryPlan queryPlan = hookContext.getQueryPlan();
event.setUgi(ugi); event.setUgi(ugi);
event.setUser(getUser(hookContext.getUserName(), hookContext.getUgi())); event.setUser(getUser(hookContext.getUserName(), hookContext.getUgi()));
event.setOperation(OPERATION_MAP.get(hookContext.getOperationName())); event.setOperation(OPERATION_MAP.get(hookContext.getOperationName()));
event.setQueryId(hookContext.getQueryPlan().getQueryId()); event.setQueryId(queryPlan.getQueryId());
event.setQueryStr(hookContext.getQueryPlan().getQueryStr()); event.setQueryStr(queryPlan.getQueryStr());
event.setQueryStartTime(hookContext.getQueryPlan().getQueryStartTime()); event.setQueryStartTime(queryPlan.getQueryStartTime());
event.setQueryType(hookContext.getQueryPlan().getQueryPlan().getQueryType());
event.setLineageInfo(hookContext.getLinfo()); event.setLineageInfo(hookContext.getLinfo());
if (executor == null) { if (executor == null) {
...@@ -1088,8 +1091,6 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext { ...@@ -1088,8 +1091,6 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
private List<HookNotification.HookNotificationMessage> messages = new ArrayList<>(); private List<HookNotification.HookNotificationMessage> messages = new ArrayList<>();
private String queryType;
public void setInputs(Set<ReadEntity> inputs) { public void setInputs(Set<ReadEntity> inputs) {
this.inputs = inputs; this.inputs = inputs;
} }
...@@ -1126,10 +1127,6 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext { ...@@ -1126,10 +1127,6 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
this.queryStartTime = queryStartTime; this.queryStartTime = queryStartTime;
} }
public void setQueryType(String queryType) {
this.queryType = queryType;
}
public void setLineageInfo(LineageInfo lineageInfo){ public void setLineageInfo(LineageInfo lineageInfo){
try { try {
this.lineageInfo = ColumnLineageUtils.buildLineageMap(lineageInfo); this.lineageInfo = ColumnLineageUtils.buildLineageMap(lineageInfo);
...@@ -1175,10 +1172,6 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext { ...@@ -1175,10 +1172,6 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
return queryStartTime; return queryStartTime;
} }
public String getQueryType() {
return queryType;
}
public void addMessage(HookNotification.HookNotificationMessage message) { public void addMessage(HookNotification.HookNotificationMessage message) {
messages.add(message); messages.add(message);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment