ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gna...@apache.org
Subject ambari git commit: AMBARI-20222. Hive View 2.0 LogAggregator prints lots of warning logs.(gauravn7)
Date Tue, 28 Feb 2017 13:30:24 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ba786d7f0 -> c405aacf5


AMBARI-20222. Hive View 2.0 LogAggregator prints lots of warning logs.(gauravn7)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c405aacf
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c405aacf
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c405aacf

Branch: refs/heads/trunk
Commit: c405aacf59e242faa3d3941448aeef7da6f94bbc
Parents: ba786d7
Author: Gaurav Nagar <grvngr@gmail.com>
Authored: Tue Feb 28 18:59:37 2017 +0530
Committer: Gaurav Nagar <grvngr@gmail.com>
Committed: Tue Feb 28 19:00:13 2017 +0530

----------------------------------------------------------------------
 .../org/apache/ambari/view/hive2/actor/JdbcConnector.java |  9 +++++++++
 .../java/org/apache/ambari/view/hive20/HiveViewImpl.java  |  5 +++++
 .../apache/ambari/view/hive20/actor/JdbcConnector.java    | 10 ++++++++++
 3 files changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c405aacf/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/JdbcConnector.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/JdbcConnector.java
b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/JdbcConnector.java
index d6d5d51..997c28a 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/JdbcConnector.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/JdbcConnector.java
@@ -269,6 +269,7 @@ public class JdbcConnector extends HiveActor {
     isFailure = true;
     this.failure = failure;
     if (isAsync() && jobId.isPresent()) {
+      stopStatementExecutor();
       if(isCancelCalled) {
         processCancel();
         return;
@@ -281,8 +282,16 @@ public class JdbcConnector extends HiveActor {
     }
   }
 
+  private void stopStatementExecutor() {
+    if (statementExecutor != null) {
+      statementExecutor.tell(PoisonPill.getInstance(), ActorRef.noSender());
+      statementExecutor = null;
+    }
+  }
+
   private void processResult(Optional<ResultSet> resultSetOptional) {
     executing = false;
+    stopStatementExecutor();
 
     LOG.info("Finished processing SQL statements for Job id : {}", jobId.or("SYNC JOB"));
     if (isAsync() && jobId.isPresent()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c405aacf/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/HiveViewImpl.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/HiveViewImpl.java
b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/HiveViewImpl.java
index aee7d03..4cadfac 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/HiveViewImpl.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/HiveViewImpl.java
@@ -23,9 +23,13 @@ import org.apache.ambari.view.ViewDefinition;
 import org.apache.ambari.view.ViewInstanceDefinition;
 import org.apache.ambari.view.hive20.utils.SharedObjectsFactory;
 import org.apache.ambari.view.utils.UserLocal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 public class HiveViewImpl implements View {
+  private final Logger LOG = LoggerFactory.getLogger(getClass());
+
   @Override
   public void onDeploy(ViewDefinition definition) {
 
@@ -45,6 +49,7 @@ public class HiveViewImpl implements View {
   @Override
   public void onUpdate(ViewInstanceDefinition definition) {
     //drop all cached connection for instance
+    LOG.info("Settings updated for instance '" + definition.getInstanceName() + "'");
     UserLocal.dropInstanceCache(definition.getInstanceName());
     SharedObjectsFactory.dropInstanceCache(definition.getInstanceName());
     ConnectionSystem.getInstance().removeOperationControllerFromCache(definition.getInstanceName());

http://git-wip-us.apache.org/repos/asf/ambari/blob/c405aacf/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java
b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java
index 61f0b66..45fc786 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/JdbcConnector.java
@@ -272,6 +272,7 @@ public class JdbcConnector extends HiveActor {
     isFailure = true;
     this.failure = failure;
     if (isAsync() && jobId.isPresent()) {
+      stopStatementExecutor();
       if(isCancelCalled) {
         processCancel();
         return;
@@ -284,9 +285,18 @@ public class JdbcConnector extends HiveActor {
     }
   }
 
+  private void stopStatementExecutor() {
+    if (statementExecutor != null) {
+      statementExecutor.tell(PoisonPill.getInstance(), ActorRef.noSender());
+      statementExecutor = null;
+    }
+  }
+
   private void processResult(Optional<ResultSet> resultSetOptional) {
     executing = false;
 
+    stopStatementExecutor();
+
     LOG.info("Finished processing SQL statements for Job id : {}", jobId.or("SYNC JOB"));
     if (isAsync() && jobId.isPresent()) {
       updateJobStatus(jobId.get(), Job.JOB_STATE_FINISHED);


Mime
View raw message