ambari git commit: AMBARI-20847 - Remove Refresh Query Hint From Upgrade DAO (jonathanhurley)
Repository: ambari Updated Branches: refs/heads/branch-2.5 3c844cad8 -> 5a6b62004 AMBARI-20847 - Remove Refresh Query Hint From Upgrade DAO (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5a6b6200 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5a6b6200 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5a6b6200 Branch: refs/heads/branch-2.5 Commit: 5a6b62004d01ad2d4baebe4dd7f2b4824046 Parents: 3c844ca Author: Jonathan HurleyAuthored: Tue Apr 25 12:08:40 2017 -0400 Committer: Jonathan Hurley Committed: Tue Apr 25 17:31:55 2017 -0400 -- .../ambari/server/orm/dao/UpgradeDAO.java | 30 ++-- .../server/orm/entities/UpgradeEntity.java | 2 ++ 2 files changed, 5 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/5a6b6200/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java index 4666edf..716f5b5 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java @@ -27,8 +27,6 @@ import org.apache.ambari.server.orm.entities.UpgradeEntity; import org.apache.ambari.server.orm.entities.UpgradeGroupEntity; import org.apache.ambari.server.orm.entities.UpgradeItemEntity; import org.apache.ambari.server.state.stack.upgrade.Direction; -import org.eclipse.persistence.config.HintValues; -import org.eclipse.persistence.config.QueryHints; import com.google.inject.Inject; import com.google.inject.Provider; @@ -90,10 +88,10 @@ public class UpgradeDAO { @RequiresSession public UpgradeEntity findUpgradeByRequestId(Long requestId) { -TypedQuery query = entityManagerProvider.get().createQuery( -"SELECT p FROM UpgradeEntity p WHERE p.requestId = :requestId", UpgradeEntity.class); +TypedQuery query = entityManagerProvider.get().createNamedQuery( +"UpgradeEntity.findUpgradeByRequestId", UpgradeEntity.class); + query.setParameter("requestId", requestId); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); return daoUtils.selectSingle(query); } @@ -131,26 +129,10 @@ public class UpgradeDAO { TypedQuery query = entityManagerProvider.get().createQuery( "SELECT p FROM UpgradeGroupEntity p WHERE p.upgradeGroupId = :groupId", UpgradeGroupEntity.class); query.setParameter("groupId", groupId); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); - -return daoUtils.selectSingle(query); - } - - /** - * @param itemId the item id - * @return the upgrade item entity, or {@code null} if not found - */ - @RequiresSession - public UpgradeItemEntity findUpgradeItem(long itemId) { -TypedQuery query = entityManagerProvider.get().createQuery( -"SELECT p FROM UpgradeItemEntity p WHERE p.upgradeItemId = :itemId", UpgradeItemEntity.class); -query.setParameter("itemId", Long.valueOf(itemId)); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); return daoUtils.selectSingle(query); } - /** * @param requestId the request id * @param stageId the stage id @@ -164,8 +146,6 @@ public class UpgradeDAO { query.setParameter("requestId", requestId); query.setParameter("stageId", stageId); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); - return daoUtils.selectSingle(query); } @@ -184,8 +164,6 @@ public class UpgradeDAO { query.setParameter("clusterId", clusterId); query.setParameter("direction", direction); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); - return daoUtils.selectSingle(query); } @@ -200,8 +178,6 @@ public class UpgradeDAO { query.setMaxResults(1); query.setParameter("clusterId", clusterId); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); - return daoUtils.selectSingle(query); } http://git-wip-us.apache.org/repos/asf/ambari/blob/5a6b6200/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java index 89574bc..0b27e3b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java @@
ambari git commit: AMBARI-20847 - Remove Refresh Query Hint From Upgrade DAO (jonathanhurley)
Repository: ambari Updated Branches: refs/heads/trunk 35d7220af -> 09ca48579 AMBARI-20847 - Remove Refresh Query Hint From Upgrade DAO (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/09ca4857 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/09ca4857 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/09ca4857 Branch: refs/heads/trunk Commit: 09ca4857986eb734b93b5862620a85c8bff7b691 Parents: 35d7220 Author: Jonathan HurleyAuthored: Tue Apr 25 12:08:40 2017 -0400 Committer: Jonathan Hurley Committed: Tue Apr 25 17:31:00 2017 -0400 -- .../ambari/server/orm/dao/UpgradeDAO.java | 30 ++-- .../server/orm/entities/UpgradeEntity.java | 2 ++ 2 files changed, 5 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/09ca4857/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java index 4666edf..716f5b5 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java @@ -27,8 +27,6 @@ import org.apache.ambari.server.orm.entities.UpgradeEntity; import org.apache.ambari.server.orm.entities.UpgradeGroupEntity; import org.apache.ambari.server.orm.entities.UpgradeItemEntity; import org.apache.ambari.server.state.stack.upgrade.Direction; -import org.eclipse.persistence.config.HintValues; -import org.eclipse.persistence.config.QueryHints; import com.google.inject.Inject; import com.google.inject.Provider; @@ -90,10 +88,10 @@ public class UpgradeDAO { @RequiresSession public UpgradeEntity findUpgradeByRequestId(Long requestId) { -TypedQuery query = entityManagerProvider.get().createQuery( -"SELECT p FROM UpgradeEntity p WHERE p.requestId = :requestId", UpgradeEntity.class); +TypedQuery query = entityManagerProvider.get().createNamedQuery( +"UpgradeEntity.findUpgradeByRequestId", UpgradeEntity.class); + query.setParameter("requestId", requestId); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); return daoUtils.selectSingle(query); } @@ -131,26 +129,10 @@ public class UpgradeDAO { TypedQuery query = entityManagerProvider.get().createQuery( "SELECT p FROM UpgradeGroupEntity p WHERE p.upgradeGroupId = :groupId", UpgradeGroupEntity.class); query.setParameter("groupId", groupId); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); - -return daoUtils.selectSingle(query); - } - - /** - * @param itemId the item id - * @return the upgrade item entity, or {@code null} if not found - */ - @RequiresSession - public UpgradeItemEntity findUpgradeItem(long itemId) { -TypedQuery query = entityManagerProvider.get().createQuery( -"SELECT p FROM UpgradeItemEntity p WHERE p.upgradeItemId = :itemId", UpgradeItemEntity.class); -query.setParameter("itemId", Long.valueOf(itemId)); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); return daoUtils.selectSingle(query); } - /** * @param requestId the request id * @param stageId the stage id @@ -164,8 +146,6 @@ public class UpgradeDAO { query.setParameter("requestId", requestId); query.setParameter("stageId", stageId); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); - return daoUtils.selectSingle(query); } @@ -184,8 +164,6 @@ public class UpgradeDAO { query.setParameter("clusterId", clusterId); query.setParameter("direction", direction); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); - return daoUtils.selectSingle(query); } @@ -200,8 +178,6 @@ public class UpgradeDAO { query.setMaxResults(1); query.setParameter("clusterId", clusterId); -query.setHint(QueryHints.REFRESH, HintValues.TRUE); - return daoUtils.selectSingle(query); } http://git-wip-us.apache.org/repos/asf/ambari/blob/09ca4857/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java index de1454b..e5e2de3 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java @@ -59,6
ambari git commit: AMBARI-20616: Provide an optional attribute for custom commands to specify title used in operations window title (sangeetar)
Repository: ambari Updated Branches: refs/heads/trunk ec51e1663 -> 35d7220af AMBARI-20616: Provide an optional attribute for custom commands to specify title used in operations window title (sangeetar) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/35d7220a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/35d7220a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/35d7220a Branch: refs/heads/trunk Commit: 35d7220afb894565134dd1503d8f2dc08d7be59c Parents: ec51e16 Author: Sangeeta RavindranAuthored: Tue Apr 25 12:19:03 2017 -0700 Committer: Sangeeta Ravindran Committed: Tue Apr 25 12:58:22 2017 -0700 -- .../server/actionmanager/HostRoleCommand.java | 10 .../AmbariCustomCommandExecutionHelper.java | 3 ++ .../internal/TaskResourceProvider.java | 3 ++ .../orm/entities/HostRoleCommandEntity.java | 15 ++ .../server/state/CustomCommandDefinition.java | 5 ++ .../server/upgrade/UpgradeCatalog300.java | 15 ++ .../main/resources/Ambari-DDL-Derby-CREATE.sql | 1 + .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 1 + .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 1 + .../resources/Ambari-DDL-Postgres-CREATE.sql| 1 + .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 1 + .../resources/Ambari-DDL-SQLServer-CREATE.sql | 1 + .../src/main/resources/properties.json | 1 + .../internal/TaskResourceProviderTest.java | 8 .../orm/entities/HostRoleCommandEntityTest.java | 49 .../server/upgrade/UpgradeCatalog300Test.java | 8 .../app/controllers/wizard/step9_controller.js | 2 +- ambari-web/app/utils/ajax/ajax.js | 8 ++-- ambari-web/app/utils/helper.js | 7 ++- ambari-web/app/utils/host_progress_popup.js | 2 +- .../views/wizard/step9/hostLogPopupBody_view.js | 2 +- ambari-web/test/utils/helper_test.js| 5 ++ 22 files changed, 141 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/35d7220a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/HostRoleCommand.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/HostRoleCommand.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/HostRoleCommand.java index 87a6edf..bd354d9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/HostRoleCommand.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/HostRoleCommand.java @@ -69,6 +69,7 @@ public class HostRoleCommand { private String customCommandName; private ExecutionCommandWrapper executionCommandWrapper; private boolean isBackgroundCommand = false; + private String opsDisplayName; @Inject private ExecutionCommandDAO executionCommandDAO; @@ -179,6 +180,7 @@ public class HostRoleCommand { roleCommand = hostRoleCommandEntity.getRoleCommand(); event = new ServiceComponentHostEventWrapper(hostRoleCommandEntity.getEvent()); commandDetail = hostRoleCommandEntity.getCommandDetail(); +opsDisplayName = hostRoleCommandEntity.getOpsDisplayName(); customCommandName = hostRoleCommandEntity.getCustomCommandName(); isBackgroundCommand = hostRoleCommandEntity.isBackgroundCommand(); } @@ -202,6 +204,7 @@ public class HostRoleCommand { hostRoleCommandEntity.setAutoSkipOnFailure(autoSkipFailure); hostRoleCommandEntity.setRoleCommand(roleCommand); hostRoleCommandEntity.setCommandDetail(commandDetail); +hostRoleCommandEntity.setOpsDisplayName(opsDisplayName); hostRoleCommandEntity.setCustomCommandName(customCommandName); hostRoleCommandEntity.setBackgroundCommand(isBackgroundCommand); @@ -294,6 +297,13 @@ public class HostRoleCommand { this.commandDetail = commandDetail; } + public String getOpsDisplayName() { +return opsDisplayName; + } + + public void setOpsDisplayName(String opsDisplayName) { +this.opsDisplayName = opsDisplayName; + } public String getCustomCommandName() { return customCommandName; } http://git-wip-us.apache.org/repos/asf/ambari/blob/35d7220a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java index 17bc718..ab8b659 100644 ---
[1/2] ambari git commit: AMBARI-20823. Remove user input from invalid renderer error message (Attila Magyar via adoroszlai)
Repository: ambari Updated Branches: refs/heads/branch-2.5 2daa20e1f -> 3c844cad8 refs/heads/trunk 37ba33ffd -> ec51e1663 AMBARI-20823. Remove user input from invalid renderer error message (Attila Magyar via adoroszlai) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ec51e166 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ec51e166 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ec51e166 Branch: refs/heads/trunk Commit: ec51e16630debc6595d92a29690ce62fd719e2ca Parents: 37ba33f Author: Attila MagyarAuthored: Tue Apr 25 21:36:13 2017 +0200 Committer: Attila Doroszlai Committed: Tue Apr 25 21:36:13 2017 +0200 -- .../ambari/server/api/resources/BaseResourceDefinition.java | 3 +-- .../ambari/server/api/resources/BaseResourceDefinitionTest.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ec51e166/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java index 99bcd03..4983920 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java @@ -132,8 +132,7 @@ public abstract class BaseResourceDefinition implements ResourceDefinition { || name.contains("zero_padding")) { return new MetricsPaddingRenderer(name); } else { - throw new IllegalArgumentException("Invalid renderer name: " + name + - " for resource of type: " + m_type); + throw new IllegalArgumentException("Invalid renderer name for resource of type " + m_type); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/ec51e166/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java index e076268..8e83f56 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java @@ -141,7 +141,7 @@ public class BaseResourceDefinitionTest { resource.getRenderer("foo"); fail("Should have thrown an exception due to invalid renderer type"); } catch (IllegalArgumentException e) { - // expected + assertEquals("Invalid renderer name for resource of type Service", e.getMessage()); } }
[2/2] ambari git commit: AMBARI-20823. Remove user input from invalid renderer error message (Attila Magyar via adoroszlai)
AMBARI-20823. Remove user input from invalid renderer error message (Attila Magyar via adoroszlai) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3c844cad Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3c844cad Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3c844cad Branch: refs/heads/branch-2.5 Commit: 3c844cad8dafbb5b68a7d0c96ee64896ae492840 Parents: 2daa20e Author: Attila MagyarAuthored: Tue Apr 25 21:36:13 2017 +0200 Committer: Attila Doroszlai Committed: Tue Apr 25 21:36:45 2017 +0200 -- .../ambari/server/api/resources/BaseResourceDefinition.java | 3 +-- .../ambari/server/api/resources/BaseResourceDefinitionTest.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3c844cad/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java index aaeed43..a11b837 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java @@ -132,8 +132,7 @@ public abstract class BaseResourceDefinition implements ResourceDefinition { || name.contains("zero_padding")) { return new MetricsPaddingRenderer(name); } else { - throw new IllegalArgumentException("Invalid renderer name: " + name + - " for resource of type: " + m_type); + throw new IllegalArgumentException("Invalid renderer name for resource of type " + m_type); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/3c844cad/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java index 46f3ef7..7342411 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java @@ -140,7 +140,7 @@ public class BaseResourceDefinitionTest { resource.getRenderer("foo"); fail("Should have thrown an exception due to invalid renderer type"); } catch (IllegalArgumentException e) { - // expected + assertEquals("Invalid renderer name for resource of type Service", e.getMessage()); } }
ambari git commit: AMBARI-20845. Include cluster filter in every Log Search request in Ambari server. (rnettleton)
Repository: ambari Updated Branches: refs/heads/branch-2.5 8a7bba3e4 -> 2daa20e1f AMBARI-20845. Include cluster filter in every Log Search request in Ambari server. (rnettleton) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2daa20e1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2daa20e1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2daa20e1 Branch: refs/heads/branch-2.5 Commit: 2daa20e1f6f8a7101b569f0c59b8fe6f79c079bb Parents: 8a7bba3 Author: Bob NettletonAuthored: Tue Apr 25 14:33:15 2017 -0400 Committer: Bob Nettleton Committed: Tue Apr 25 14:33:15 2017 -0400 -- .../server/controller/logging/LoggingRequestHelperImpl.java | 6 ++ .../controller/logging/LoggingRequestHelperImplTest.java| 9 + 2 files changed, 15 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2daa20e1/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java index 0c47fc5..6cee4b7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java @@ -99,6 +99,8 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper { private static final int DEFAULT_LOGSEARCH_READ_TIMEOUT_IN_MILLISECONDS = 5000; + private static final String LOGSEARCH_CLUSTERS_QUERY_PARAMETER_NAME = "clusters"; + private static AtomicInteger errorLogCounterForLogSearchConnectionExceptions = new AtomicInteger(0); private final String hostName; @@ -382,6 +384,10 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper { URIBuilder uriBuilder = createBasicURI(scheme); uriBuilder.setPath(LOGSEARCH_QUERY_PATH); +// set the current cluster name, in case this LogSearch service supports data +// for multiple clusters +uriBuilder.addParameter(LOGSEARCH_CLUSTERS_QUERY_PARAMETER_NAME, cluster.getClusterName()); + // add any query strings specified for (String key : queryParameters.keySet()) { uriBuilder.addParameter(key, queryParameters.get(key)); http://git-wip-us.apache.org/repos/asf/ambari/blob/2daa20e1/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java index 2e7020f..c8157a4 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java @@ -154,6 +154,7 @@ public class LoggingRequestHelperImplTest { Capture captureURLConnectionForAuthentication = new Capture(); expect(clusterMock.getDesiredConfigByType("logsearch-admin-json")).andReturn(adminPropertiesConfigMock).atLeastOnce(); +expect(clusterMock.getClusterName()).andReturn("clusterone").atLeastOnce(); expect(adminPropertiesConfigMock.getProperties()).andReturn(testConfigProperties).atLeastOnce(); expect(networkConnectionMock.readQueryResponseFromServer(capture(captureURLConnection))).andReturn(new StringBuffer(TEST_JSON_INPUT_TWO_LIST_ENTRIES)).atLeastOnce(); @@ -181,6 +182,8 @@ public class LoggingRequestHelperImplTest { "http", httpURLConnection.getURL().getProtocol()); assertEquals("URLConnection did not have the expected method set", "GET", httpURLConnection.getRequestMethod()); +assertTrue("URLConnection's URL did not have the expected query parameter string", + httpURLConnection.getURL().getQuery().contains("clusters=clusterone")); assertSame("HttpUrlConnection instances passed into NetworkConnection mock should have been the same instance", httpURLConnection, captureURLConnectionForAuthentication.getValue()); @@ -426,6 +429,7 @@ public class LoggingRequestHelperImplTest { Capture captureURLConnectionForAuthentication = new Capture(); expect(clusterMock.getDesiredConfigByType("logsearch-admin-json")).andReturn(adminPropertiesConfigMock).atLeastOnce(); +
ambari git commit: AMBARI-20810. Roles page in Ambari UI shows extra rows in IE browser (alexantonenko)
Repository: ambari Updated Branches: refs/heads/trunk 1f68c6e84 -> 37ba33ffd AMBARI-20810. Roles page in Ambari UI shows extra rows in IE browser (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/37ba33ff Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/37ba33ff Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/37ba33ff Branch: refs/heads/trunk Commit: 37ba33ffd62b60959d0d880d599d6af33e10dde6 Parents: 1f68c6e Author: Alex AntonenkoAuthored: Tue Apr 25 20:54:58 2017 +0300 Committer: Alex Antonenko Committed: Tue Apr 25 20:55:07 2017 +0300 -- .../app/scripts/controllers/clusters/ClustersManageAccessCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/37ba33ff/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClustersManageAccessCtrl.js -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClustersManageAccessCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClustersManageAccessCtrl.js index e1b74aa..3a9ad67 100644 --- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClustersManageAccessCtrl.js +++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClustersManageAccessCtrl.js @@ -37,7 +37,7 @@ angular.module('ambariAdminConsole') }); var orderedRoles = Cluster.orderedRoles; var pms = []; - for (var key in orderedRoles) { + for (var key=0;key
ambari git commit: AMBARI-20845. Include cluster filter in every Log Search request in Ambari server. (rnettleton)
Repository: ambari Updated Branches: refs/heads/trunk 04a539279 -> 1f68c6e84 AMBARI-20845. Include cluster filter in every Log Search request in Ambari server. (rnettleton) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1f68c6e8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1f68c6e8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1f68c6e8 Branch: refs/heads/trunk Commit: 1f68c6e845a5f9b9909e539c6c3ffc4fda198c35 Parents: 04a5392 Author: Bob NettletonAuthored: Tue Apr 25 13:11:50 2017 -0400 Committer: Bob Nettleton Committed: Tue Apr 25 13:11:50 2017 -0400 -- .../server/controller/logging/LoggingRequestHelperImpl.java | 6 ++ .../controller/logging/LoggingRequestHelperImplTest.java| 9 + 2 files changed, 15 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1f68c6e8/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java index 2b1b04a..0db8853 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java @@ -100,6 +100,8 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper { private static final int DEFAULT_LOGSEARCH_READ_TIMEOUT_IN_MILLISECONDS = 5000; + private static final String LOGSEARCH_CLUSTERS_QUERY_PARAMETER_NAME = "clusters"; + private static AtomicInteger errorLogCounterForLogSearchConnectionExceptions = new AtomicInteger(0); private final String hostName; @@ -383,6 +385,10 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper { URIBuilder uriBuilder = createBasicURI(scheme); uriBuilder.setPath(LOGSEARCH_QUERY_PATH); +// set the current cluster name, in case this LogSearch service supports data +// for multiple clusters +uriBuilder.addParameter(LOGSEARCH_CLUSTERS_QUERY_PARAMETER_NAME, cluster.getClusterName()); + // add any query strings specified for (String key : queryParameters.keySet()) { uriBuilder.addParameter(key, queryParameters.get(key)); http://git-wip-us.apache.org/repos/asf/ambari/blob/1f68c6e8/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java index b24500f..1221518 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImplTest.java @@ -154,6 +154,7 @@ public class LoggingRequestHelperImplTest { Capture captureURLConnectionForAuthentication = EasyMock.newCapture(); expect(clusterMock.getDesiredConfigByType("logsearch-admin-json")).andReturn(adminPropertiesConfigMock).atLeastOnce(); +expect(clusterMock.getClusterName()).andReturn("clusterone").atLeastOnce(); expect(adminPropertiesConfigMock.getProperties()).andReturn(testConfigProperties).atLeastOnce(); expect(networkConnectionMock.readQueryResponseFromServer(capture(captureURLConnection))).andReturn(new StringBuffer(TEST_JSON_INPUT_TWO_LIST_ENTRIES)).atLeastOnce(); @@ -181,6 +182,8 @@ public class LoggingRequestHelperImplTest { "http", httpURLConnection.getURL().getProtocol()); assertEquals("URLConnection did not have the expected method set", "GET", httpURLConnection.getRequestMethod()); +assertTrue("URLConnection's URL did not have the expected query parameter string", + httpURLConnection.getURL().getQuery().contains("clusters=clusterone")); assertSame("HttpUrlConnection instances passed into NetworkConnection mock should have been the same instance", httpURLConnection, captureURLConnectionForAuthentication.getValue()); @@ -335,6 +338,7 @@ public class LoggingRequestHelperImplTest { Capture captureURLConnectionForAuthentication = EasyMock.newCapture(); expect(clusterMock.getDesiredConfigByType("logsearch-admin-json")).andReturn(adminPropertiesConfigMock).atLeastOnce(); +
ambari git commit: AMBARI-20822 Ambari Agent needs to handle custom version number like 1.2.3.4_Company in its Controller code (dili)
Repository: ambari Updated Branches: refs/heads/trunk 26484a8f7 -> 04a539279 AMBARI-20822 Ambari Agent needs to handle custom version number like 1.2.3.4_Company in its Controller code (dili) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/04a53927 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/04a53927 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/04a53927 Branch: refs/heads/trunk Commit: 04a5392791548a5341b705f869094adc0b5f58fa Parents: 26484a8 Author: Di LiAuthored: Tue Apr 25 12:01:01 2017 -0400 Committer: Di Li Committed: Tue Apr 25 12:01:01 2017 -0400 -- .../src/main/python/ambari_agent/Controller.py| 18 ++ .../test/python/ambari_agent/TestController.py| 14 ++ 2 files changed, 28 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/04a53927/ambari-agent/src/main/python/ambari_agent/Controller.py -- diff --git a/ambari-agent/src/main/python/ambari_agent/Controller.py b/ambari-agent/src/main/python/ambari_agent/Controller.py index 78b5c0c..0297f74 100644 --- a/ambari-agent/src/main/python/ambari_agent/Controller.py +++ b/ambari-agent/src/main/python/ambari_agent/Controller.py @@ -29,6 +29,7 @@ import threading import urllib2 import pprint from random import randint +import re import subprocess import functools @@ -587,7 +588,9 @@ class Controller(threading.Thread): Stack Upgrade. """ try: - if compare_versions(self.version, "2.1.2") >= 0: + version = self.get_version() + logger.debug("Ambari Agent version {0}".format(version)) + if compare_versions(version, "2.1.2") >= 0: source_file = "/etc/hadoop/conf/dfs_data_dir_mount.hist" destination_file = "/var/lib/ambari-agent/data/datanode/dfs_data_dir_mount.hist" if os.path.exists(source_file) and not os.path.exists(destination_file): @@ -601,9 +604,16 @@ class Controller(threading.Thread): return_code = subprocess.call(command, shell=True) logger.info("Return code: %d" % return_code) except Exception, e: - logger.info("Exception in move_data_dir_mount_file(). Error: {0}".format(str(e))) - - + logger.error("Exception in move_data_dir_mount_file(). Error: {0}".format(str(e))) + + def get_version(self): +version = self.version +matches = re.findall(r"[\d+.]+",version) +if not matches: + logger.warning("No version match result, use original version {0}".format(version)) + return version +else: + return matches[0] def main(argv=None): # Allow Ctrl-C http://git-wip-us.apache.org/repos/asf/ambari/blob/04a53927/ambari-agent/src/test/python/ambari_agent/TestController.py -- diff --git a/ambari-agent/src/test/python/ambari_agent/TestController.py b/ambari-agent/src/test/python/ambari_agent/TestController.py index 7f5d451..20da81f 100644 --- a/ambari-agent/src/test/python/ambari_agent/TestController.py +++ b/ambari-agent/src/test/python/ambari_agent/TestController.py @@ -416,6 +416,20 @@ class TestController(unittest.TestCase): exceptionMessage, str(e)) + def test_getVersion(self): +self.controller.version = "1.2.3.4_MyAgent" +version = self.controller.get_version() +self.assertEquals('1.2.3.4', version) +self.controller.version = "1.2.3-MyAgent" +version = self.controller.get_version() +self.assertEquals('1.2.3', version) +self.controller.version = "11.2.3-MyAgent" +version = self.controller.get_version() +self.assertEquals('11.2.3', version) +self.controller.version = "11.2.13.10_MyAgent" +version = self.controller.get_version() +self.assertEquals('11.2.13.10', version) + @patch.object(ExitHelper, "exit") @patch.object(threading._Event, "wait") @patch("time.sleep")
ambari git commit: AMBARI-20841. Pause Button Appears After Successful Downgrade (alexantonenko)
Repository: ambari Updated Branches: refs/heads/trunk e8e997a36 -> 26484a8f7 AMBARI-20841. Pause Button Appears After Successful Downgrade (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/26484a8f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/26484a8f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/26484a8f Branch: refs/heads/trunk Commit: 26484a8f72ab4f895e472e11fa69330ccaf6f5af Parents: e8e997a Author: Alex AntonenkoAuthored: Tue Apr 25 13:03:37 2017 +0300 Committer: Alex Antonenko Committed: Tue Apr 25 18:13:00 2017 +0300 -- ambari-web/app/app.js | 6 ++ .../main/admin/stack_and_upgrade_controller.js| 5 + .../admin/stack_upgrade/stack_upgrade_wizard.hbs | 18 +- 3 files changed, 20 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/26484a8f/ambari-web/app/app.js -- diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js index e32084c..6d02603 100644 --- a/ambari-web/app/app.js +++ b/ambari-web/app/app.js @@ -75,6 +75,12 @@ module.exports = Em.Application.create({ upgradeInProgress: Em.computed.equal('upgradeState', 'IN_PROGRESS'), /** + * Checks if update process is completed + * @type {boolean} + */ + upgradeCompleted: Em.computed.equal('upgradeState', 'COMPLETED'), + + /** * flag is true when upgrade process is waiting for user action * to proceed, retry, perform manual steps etc. * @returns {boolean} http://git-wip-us.apache.org/repos/asf/ambari/blob/26484a8f/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js -- diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js index 238b4bc..94cdf1c 100644 --- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js +++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js @@ -70,6 +70,11 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage, /** * @type {boolean} + */ + showPauseButton: Em.computed.and('!App.upgradeSuspended', '!App.upgradeCompleted'), + + /** + * @type {boolean} * @default true */ downgradeAllowed: true, http://git-wip-us.apache.org/repos/asf/ambari/blob/26484a8f/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs -- diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs index 6fceeb1..a5525be 100644 --- a/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs +++ b/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs @@ -39,15 +39,15 @@ {{#if view.isLoaded}} - {{#unless App.upgradeSuspended}} - {{#if isDowngrade}} -{{t admin.stackUpgrade.pauseDowngrade}} - {{else}} -{{t admin.stackUpgrade.pauseUpgrade}} - {{/if}} - {{/unless}} + {{#if showPauseButton}} +{{#if isDowngrade}} + {{t admin.stackUpgrade.pauseDowngrade}} +{{else}} + {{t admin.stackUpgrade.pauseUpgrade}} +{{/if}} + {{/if}} {{#if view.runningItem}}
ambari git commit: AMBARI-20807 Log Search REST API calls for configuration should send proper error responses (mgergely)
Repository: ambari Updated Branches: refs/heads/trunk 1b7c023d0 -> e8e997a36 AMBARI-20807 Log Search REST API calls for configuration should send proper error responses (mgergely) Change-Id: I23595470db557a5fa746fd02cb51caa35d96a44f Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e8e997a3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e8e997a3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e8e997a3 Branch: refs/heads/trunk Commit: e8e997a36e38a38ac7ca4695377ba800a8427f87 Parents: 1b7c023 Author: Miklos GergelyAuthored: Tue Apr 25 15:53:37 2017 +0200 Committer: Miklos Gergely Committed: Tue Apr 25 15:53:37 2017 +0200 -- .../ambari/logsearch/common/MessageEnums.java | 3 +- .../ambari/logsearch/conf/SecurityConfig.java | 15 +++ .../logsearch/manager/ShipperConfigManager.java | 19 .../logsearch/rest/ShipperConfigResource.java | 4 +- .../web/filters/LogSearchConfigStateFilter.java | 102 +++ .../scripts/logsearch_config_aggregator.py | 77 -- .../LOGSEARCH/0.5.0/package/scripts/params.py | 3 - 7 files changed, 121 insertions(+), 102 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e8e997a3/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/common/MessageEnums.java -- diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/common/MessageEnums.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/common/MessageEnums.java index 4f1725f..9dd8b34 100644 --- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/common/MessageEnums.java +++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/common/MessageEnums.java @@ -33,7 +33,8 @@ public enum MessageEnums { ZNODE_NOT_READY("logsearch.zk.znode.error", "ZNode is not available."), ZK_CONFIG_NOT_READY("logsearch.zk.config.error", "Collection configuration has not uploaded yet"), SOLR_COLLECTION_NOT_READY("logsearch.solr.collection.error", "Solr has not accessible yet for collection."), - + CONFIGURATION_NOT_AVAILABLE("logsearch.config.not_available", "Log Search configuration is not available"), + // Common Validations INVALID_PASSWORD("logsearch.validation.invalid_password", "Invalid password"), INVALID_INPUT_DATA("logsearch.validation.invalid_input_data", "Invalid input data"), http://git-wip-us.apache.org/repos/asf/ambari/blob/e8e997a3/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SecurityConfig.java -- diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SecurityConfig.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SecurityConfig.java index 2f9cba4..973dc4b 100644 --- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SecurityConfig.java +++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SecurityConfig.java @@ -19,6 +19,8 @@ package org.apache.ambari.logsearch.conf; import com.google.common.collect.Lists; + +import org.apache.ambari.logsearch.conf.global.LogSearchConfigState; import org.apache.ambari.logsearch.conf.global.SolrCollectionState; import org.apache.ambari.logsearch.web.authenticate.LogsearchAuthFailureHandler; import org.apache.ambari.logsearch.web.authenticate.LogsearchAuthSuccessHandler; @@ -26,6 +28,7 @@ import org.apache.ambari.logsearch.web.authenticate.LogsearchLogoutSuccessHandle import org.apache.ambari.logsearch.web.filters.LogsearchAuditLogsStateFilter; import org.apache.ambari.logsearch.web.filters.LogsearchAuthenticationEntryPoint; import org.apache.ambari.logsearch.web.filters.LogsearchCorsFilter; +import org.apache.ambari.logsearch.web.filters.LogSearchConfigStateFilter; import org.apache.ambari.logsearch.web.filters.LogsearchKRBAuthenticationFilter; import org.apache.ambari.logsearch.web.filters.LogsearchJWTFilter; import org.apache.ambari.logsearch.web.filters.LogsearchSecurityContextFormationFilter; @@ -82,6 +85,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Named("solrUserConfigState") private SolrCollectionState solrUserConfigState; + @Inject + private LogSearchConfigState logSearchConfigState; + @Override protected void configure(HttpSecurity http) throws Exception { http @@ -108,6 +114,7 @@ public class SecurityConfig extends
ambari git commit: AMBARI-20834. LogSearch: LogSearch UI support for viewing data from multiple clusters (akovalenko)
Repository: ambari Updated Branches: refs/heads/branch-2.5 9583ede2a -> 2bd95deb0 AMBARI-20834. LogSearch: LogSearch UI support for viewing data from multiple clusters (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2bd95deb Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2bd95deb Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2bd95deb Branch: refs/heads/branch-2.5 Commit: 2bd95deb0e4f3d433d8ba703f31ea288b842be32 Parents: 9583ede Author: Aleksandr KovalenkoAuthored: Mon Apr 24 18:59:27 2017 +0300 Committer: Aleksandr Kovalenko Committed: Tue Apr 25 15:29:19 2017 +0300 -- .../scripts/views/audit/AuditTabLayoutView.js | 7 +- .../views/common/SelectClusterDropdown.js | 102 +++ .../scripts/views/graphs/GraphLayoutView.js | 32 +- .../views/tabs/HierarchyTabLayoutView.js| 17 +++- .../src/main/webapp/styles/style.css| 20 +++- .../templates/common/DatePickerLayout_tmpl.html | 10 +- .../common/SelectClusterDropdown_tmpl.html | 32 ++ .../templates/graphs/GraphLayoutView_tmpl.html | 7 +- .../tabs/HierarchyTabLayoutView_tmpl.html | 7 +- 9 files changed, 212 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2bd95deb/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js -- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js index 7710156..e8f38ae 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js @@ -18,6 +18,7 @@ define(['require', 'backbone', + 'App', 'utils/Globals', 'utils/Utils', 'utils/ViewUtils', @@ -26,7 +27,7 @@ define(['require', 'models/VAuditLog', 'hbs!tmpl/audit/AuditTabLayoutView_tmpl', 'moment' -], function (require, Backbone, Globals, Utils, ViewUtils, VGroupList, VAuditLogList, VAuditLog, AuditTabLayoutViewTmpl, moment) { +], function (require, Backbone, App, Globals, Utils, ViewUtils, VGroupList, VAuditLogList, VAuditLog, AuditTabLayoutViewTmpl, moment) { 'use strict'; @@ -133,7 +134,9 @@ define(['require', params: that.defaultParams, viewType: Globals.graphType.MULTILINE.value, showDatePicker: true, -futureDate: false +futureDate: false, +showSelectClustersDropdown: true, +loadClustersUrl: App.baseUrl + 'audit/logs/clusters' })); }) }, http://git-wip-us.apache.org/repos/asf/ambari/blob/2bd95deb/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/SelectClusterDropdown.js -- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/SelectClusterDropdown.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/SelectClusterDropdown.js new file mode 100644 index 000..9bd78ef --- /dev/null +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/SelectClusterDropdown.js @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +define(['require', 'backbone', 'hbs!tmpl/common/SelectClusterDropdown_tmpl'], function (require, Backbone, SelectClusterDropdownTmpl) { + 'use strict'; + + var SelectClusterDropdown = Backbone.Marionette.ItemView.extend( + { + _viewName: "SelectClusterDropdown", + + template: SelectClusterDropdownTmpl, + templateHelpers :
ambari git commit: AMBARI-20818. Blueprint processor fails when StackAdvisor recommends unnecessary configuration types (magyari_sandor)
Repository: ambari Updated Branches: refs/heads/branch-2.5 7df0518f2 -> 9583ede2a AMBARI-20818. Blueprint processor fails when StackAdvisor recommends unnecessary configuration types (magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9583ede2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9583ede2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9583ede2 Branch: refs/heads/branch-2.5 Commit: 9583ede2aef55646dc2c11dc03648cee966258ba Parents: 7df0518 Author: Sandor MagyariAuthored: Fri Apr 21 18:50:38 2017 +0200 Committer: Sandor Magyari Committed: Tue Apr 25 14:03:55 2017 +0200 -- .../StackAdvisorBlueprintProcessor.java | 14 +++- .../BlueprintConfigurationProcessor.java| 88 ++-- .../ambari/server/topology/Blueprint.java | 8 ++ .../ambari/server/topology/BlueprintImpl.java | 15 .../topology/ClusterConfigurationRequest.java | 59 + .../StackAdvisorBlueprintProcessorTest.java | 4 + .../BlueprintConfigurationProcessorTest.java| 4 + .../ClusterConfigurationRequestTest.java| 18 ++-- .../ClusterDeployWithStartOnlyTest.java | 1 + ...InstallWithoutStartOnComponentLevelTest.java | 1 + .../ClusterInstallWithoutStartTest.java | 1 + 11 files changed, 120 insertions(+), 93 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9583ede2/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java index cc09ae8..b7b8770 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java @@ -40,6 +40,7 @@ import org.apache.ambari.server.controller.internal.Stack; import org.apache.ambari.server.orm.entities.BlueprintConfiguration; import org.apache.ambari.server.state.ValueAttributesInfo; import org.apache.ambari.server.topology.AdvisedConfiguration; +import org.apache.ambari.server.topology.Blueprint; import org.apache.ambari.server.topology.ClusterTopology; import org.apache.ambari.server.topology.ConfigRecommendationStrategy; import org.apache.ambari.server.topology.HostGroup; @@ -176,12 +177,17 @@ public class StackAdvisorBlueprintProcessor { Map recommendedConfigurations = response.getRecommendations().getBlueprint().getConfigurations(); +Blueprint blueprint = topology.getBlueprint(); + for (Map.Entry configEntry : recommendedConfigurations.entrySet()) { String configType = configEntry.getKey(); - BlueprintConfigurations blueprintConfig = filterBlueprintConfig(configType, configEntry.getValue(), - userProvidedConfigurations, topology); - topology.getAdvisedConfigurations().put(configType, new AdvisedConfiguration( -blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); + // add recommended config type only if related service is present in Blueprint + if (blueprint.isValidConfigType(configType)) { +BlueprintConfigurations blueprintConfig = filterBlueprintConfig(configType, configEntry.getValue(), +userProvidedConfigurations, topology); +topology.getAdvisedConfigurations().put(configType, new AdvisedConfiguration( +blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); + } } } http://git-wip-us.apache.org/repos/asf/ambari/blob/9583ede2/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java index e77d718..061cdf7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java @@ -412,7 +412,10 @@ public class BlueprintConfigurationProcessor { } } -
ambari git commit: AMBARI-20814 : hive view 2.0 upload table : handled partitions in the query (nitirajrathore)
Repository: ambari Updated Branches: refs/heads/trunk 64c9ef8a5 -> 1b7c023d0 AMBARI-20814 : hive view 2.0 upload table : handled partitions in the query (nitirajrathore) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1b7c023d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1b7c023d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1b7c023d Branch: refs/heads/trunk Commit: 1b7c023d09827692c47d25bcdecb37669d342035 Parents: 64c9ef8 Author: Nitiraj Singh RathoreAuthored: Tue Apr 25 17:15:39 2017 +0530 Committer: Nitiraj Singh Rathore Committed: Tue Apr 25 17:16:20 2017 +0530 -- .../generators/InsertFromQueryGenerator.java| 41 +--- .../uploads/query/InsertFromQueryInput.java | 24 .../databases/database/tables/upload-table.js | 16 +++- 3 files changed, 66 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1b7c023d/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java index 8e22fc7..19d4f06 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java @@ -18,7 +18,10 @@ package org.apache.ambari.view.hive20.internal.query.generators; +import com.google.common.base.Function; +import com.google.common.base.Joiner; import com.google.common.base.Optional; +import com.google.common.collect.FluentIterable; import org.apache.ambari.view.hive20.client.ColumnDescription; import org.apache.ambari.view.hive20.exceptions.ServiceException; import org.apache.ambari.view.hive20.internal.dto.ColumnInfo; @@ -26,6 +29,10 @@ import org.apache.ambari.view.hive20.resources.uploads.query.InsertFromQueryInpu import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nullable; +import java.util.LinkedList; +import java.util.List; + public class InsertFromQueryGenerator implements QueryGenerator{ protected final static Logger LOG = LoggerFactory.getLogger(InsertFromQueryGenerator.class); @@ -38,12 +45,34 @@ public class InsertFromQueryGenerator implements QueryGenerator{ @Override public Optional getQuery() throws ServiceException { -StringBuilder insertQuery = new StringBuilder("INSERT INTO TABLE `").append(insertFromQueryInput.getToDatabase()).append('`').append(".") -.append("`").append(insertFromQueryInput.getToTable()).append("`") -.append(" SELECT "); +StringBuilder insertQuery = new StringBuilder(); +//Dynamic partition strict mode requires at least one static partition column. To turn this off set hive.exec.dynamic.partition.mode=nonstrict +insertQuery.append("set hive.exec.dynamic.partition.mode=nonstrict").append("\n"); + +insertQuery.append(" FROM ").append("`").append(insertFromQueryInput.getFromDatabase()).append("`.`") +.append(insertFromQueryInput.getFromTable()).append("` tempTable"); + +insertQuery.append(" INSERT INTO TABLE `").append(insertFromQueryInput.getToDatabase()).append('`').append(".") +.append("`").append(insertFromQueryInput.getToTable()).append("`"); +// PARTITION (partcol1[=val1], partcol2[=val2] ...) +if(insertFromQueryInput.getPartitionedColumns() != null && insertFromQueryInput.getPartitionedColumns().size() > 0){ + insertQuery.append(" PARTITION ").append("("); + insertQuery.append(Joiner.on(",").join(FluentIterable.from(insertFromQueryInput.getPartitionedColumns()).transform(new Function () { +@Override +public String apply(ColumnInfo columnInfo) { + return "`" + columnInfo.getName() + "`"; +} + }))); + insertQuery.append(" ) "); +} + +insertQuery.append(" SELECT "); +List allColumns = new LinkedList<>(insertFromQueryInput.getNormalColumns()); +// this order matters or first normal columns and in the last partitioned columns matters. +allColumns.addAll(insertFromQueryInput.getPartitionedColumns()); boolean first = true; -for(ColumnInfo column : insertFromQueryInput.getHeader()){ +for(ColumnInfo column : allColumns){ String type = column.getType(); boolean
ambari git commit: AMBARI-20814 : hive view 2.0 upload table : handled partitions in the query (nitirajrathore)
Repository: ambari Updated Branches: refs/heads/branch-2.5 a76b3f061 -> 7df0518f2 AMBARI-20814 : hive view 2.0 upload table : handled partitions in the query (nitirajrathore) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7df0518f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7df0518f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7df0518f Branch: refs/heads/branch-2.5 Commit: 7df0518f2c54c9c27b435f9e477c2231832376bc Parents: a76b3f0 Author: Nitiraj Singh RathoreAuthored: Tue Apr 25 17:15:39 2017 +0530 Committer: Nitiraj Singh Rathore Committed: Tue Apr 25 17:15:39 2017 +0530 -- .../generators/InsertFromQueryGenerator.java| 41 +--- .../uploads/query/InsertFromQueryInput.java | 24 .../databases/database/tables/upload-table.js | 16 +++- 3 files changed, 66 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7df0518f/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java -- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java index 8e22fc7..19d4f06 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java @@ -18,7 +18,10 @@ package org.apache.ambari.view.hive20.internal.query.generators; +import com.google.common.base.Function; +import com.google.common.base.Joiner; import com.google.common.base.Optional; +import com.google.common.collect.FluentIterable; import org.apache.ambari.view.hive20.client.ColumnDescription; import org.apache.ambari.view.hive20.exceptions.ServiceException; import org.apache.ambari.view.hive20.internal.dto.ColumnInfo; @@ -26,6 +29,10 @@ import org.apache.ambari.view.hive20.resources.uploads.query.InsertFromQueryInpu import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nullable; +import java.util.LinkedList; +import java.util.List; + public class InsertFromQueryGenerator implements QueryGenerator{ protected final static Logger LOG = LoggerFactory.getLogger(InsertFromQueryGenerator.class); @@ -38,12 +45,34 @@ public class InsertFromQueryGenerator implements QueryGenerator{ @Override public Optional getQuery() throws ServiceException { -StringBuilder insertQuery = new StringBuilder("INSERT INTO TABLE `").append(insertFromQueryInput.getToDatabase()).append('`').append(".") -.append("`").append(insertFromQueryInput.getToTable()).append("`") -.append(" SELECT "); +StringBuilder insertQuery = new StringBuilder(); +//Dynamic partition strict mode requires at least one static partition column. To turn this off set hive.exec.dynamic.partition.mode=nonstrict +insertQuery.append("set hive.exec.dynamic.partition.mode=nonstrict").append("\n"); + +insertQuery.append(" FROM ").append("`").append(insertFromQueryInput.getFromDatabase()).append("`.`") +.append(insertFromQueryInput.getFromTable()).append("` tempTable"); + +insertQuery.append(" INSERT INTO TABLE `").append(insertFromQueryInput.getToDatabase()).append('`').append(".") +.append("`").append(insertFromQueryInput.getToTable()).append("`"); +// PARTITION (partcol1[=val1], partcol2[=val2] ...) +if(insertFromQueryInput.getPartitionedColumns() != null && insertFromQueryInput.getPartitionedColumns().size() > 0){ + insertQuery.append(" PARTITION ").append("("); + insertQuery.append(Joiner.on(",").join(FluentIterable.from(insertFromQueryInput.getPartitionedColumns()).transform(new Function () { +@Override +public String apply(ColumnInfo columnInfo) { + return "`" + columnInfo.getName() + "`"; +} + }))); + insertQuery.append(" ) "); +} + +insertQuery.append(" SELECT "); +List allColumns = new LinkedList<>(insertFromQueryInput.getNormalColumns()); +// this order matters or first normal columns and in the last partitioned columns matters. +allColumns.addAll(insertFromQueryInput.getPartitionedColumns()); boolean first = true; -for(ColumnInfo column : insertFromQueryInput.getHeader()){ +for(ColumnInfo column : allColumns){ String type = column.getType();
ambari git commit: AMBARI-20818. Blueprint processor fails when StackAdvisor recommends unnecessary configuration types (magyari_sandor)
Repository: ambari Updated Branches: refs/heads/trunk fa5447474 -> 64c9ef8a5 AMBARI-20818. Blueprint processor fails when StackAdvisor recommends unnecessary configuration types (magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/64c9ef8a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/64c9ef8a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/64c9ef8a Branch: refs/heads/trunk Commit: 64c9ef8a58717f00251e57ebc61870b39d63c692 Parents: fa54474 Author: Sandor MagyariAuthored: Fri Apr 21 18:50:38 2017 +0200 Committer: Sandor Magyari Committed: Tue Apr 25 13:38:32 2017 +0200 -- .../StackAdvisorBlueprintProcessor.java | 14 +++- .../BlueprintConfigurationProcessor.java| 87 ++-- .../ambari/server/topology/Blueprint.java | 8 ++ .../ambari/server/topology/BlueprintImpl.java | 15 .../topology/ClusterConfigurationRequest.java | 59 + .../StackAdvisorBlueprintProcessorTest.java | 4 + .../BlueprintConfigurationProcessorTest.java| 4 + .../ClusterConfigurationRequestTest.java| 18 ++-- .../ClusterDeployWithStartOnlyTest.java | 1 + ...InstallWithoutStartOnComponentLevelTest.java | 1 + .../ClusterInstallWithoutStartTest.java | 1 + 11 files changed, 119 insertions(+), 93 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/64c9ef8a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java index d306e25..7731b22 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java @@ -32,6 +32,7 @@ import org.apache.ambari.server.controller.internal.ConfigurationTopologyExcepti import org.apache.ambari.server.controller.internal.Stack; import org.apache.ambari.server.state.ValueAttributesInfo; import org.apache.ambari.server.topology.AdvisedConfiguration; +import org.apache.ambari.server.topology.Blueprint; import org.apache.ambari.server.topology.ClusterTopology; import org.apache.ambari.server.topology.ConfigRecommendationStrategy; import org.apache.ambari.server.topology.HostGroup; @@ -175,12 +176,17 @@ public class StackAdvisorBlueprintProcessor { Map recommendedConfigurations = response.getRecommendations().getBlueprint().getConfigurations(); +Blueprint blueprint = topology.getBlueprint(); + for (Map.Entry configEntry : recommendedConfigurations.entrySet()) { String configType = configEntry.getKey(); - BlueprintConfigurations blueprintConfig = filterBlueprintConfig(configType, configEntry.getValue(), - userProvidedConfigurations, topology); - topology.getAdvisedConfigurations().put(configType, new AdvisedConfiguration( -blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); + // add recommended config type only if related service is present in Blueprint + if (blueprint.isValidConfigType(configType)) { +BlueprintConfigurations blueprintConfig = filterBlueprintConfig(configType, configEntry.getValue(), +userProvidedConfigurations, topology); +topology.getAdvisedConfigurations().put(configType, new AdvisedConfiguration( +blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); + } } } http://git-wip-us.apache.org/repos/asf/ambari/blob/64c9ef8a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java index bb771a5..7381387 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java @@ -408,7 +408,10 @@ public class BlueprintConfigurationProcessor { } } -
ambari git commit: AMBARI-20690 : fixed Hive view holds the operational logs open and also fills tmp folder (nitirajrathore)
Repository: ambari Updated Branches: refs/heads/branch-2.5 8bc2048d2 -> a76b3f061 AMBARI-20690 : fixed Hive view holds the operational logs open and also fills tmp folder (nitirajrathore) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a76b3f06 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a76b3f06 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a76b3f06 Branch: refs/heads/branch-2.5 Commit: a76b3f061ca5ed47a9480e7449939dc9c5d5a1b5 Parents: 8bc2048 Author: Nitiraj Singh RathoreAuthored: Tue Apr 25 16:56:08 2017 +0530 Committer: Nitiraj Singh Rathore Committed: Tue Apr 25 16:56:08 2017 +0530 -- .../ambari/view/hive2/actor/HiveActor.java | 32 +--- .../ambari/view/hive2/actor/JdbcConnector.java | 8 + .../view/hive2/actor/OperationController.java | 2 +- .../ambari/view/hive20/actor/HiveActor.java | 32 +--- .../ambari/view/hive20/actor/JdbcConnector.java | 6 .../view/hive20/actor/OperationController.java | 2 +- 6 files changed, 31 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a76b3f06/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java index 36bc430..a71ca5c 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java @@ -25,26 +25,22 @@ import org.slf4j.LoggerFactory; public abstract class HiveActor extends UntypedActor { -private final Logger LOG = LoggerFactory.getLogger(getClass()); - -@Override -final public void onReceive(Object message) throws Exception { -HiveMessage hiveMessage = new HiveMessage(message); -if(LOG.isDebugEnabled()){ -LOG.debug("Received message: " + message.getClass().getName() + ", generated id: " + hiveMessage.getId() + -" sent by: " + sender() + ", recieved by" + self()); -} - -handleMessage(hiveMessage); - -if(LOG.isDebugEnabled()){ -LOG.debug("Message submitted: " + hiveMessage.getId()); - -} + private static final Logger LOG = LoggerFactory.getLogger(HiveActor.class); + + @Override + final public void onReceive(Object message) throws Exception { +HiveMessage hiveMessage = new HiveMessage(message); +if (LOG.isDebugEnabled()) { + LOG.debug("Received message: " + message.getClass().getName() + ", generated id: " + hiveMessage.getId() + + " sent by: " + sender() + ", recieved by" + self()); } -public abstract void handleMessage(HiveMessage hiveMessage); - +handleMessage(hiveMessage); +if (LOG.isDebugEnabled()) { + LOG.debug("Message submitted: " + hiveMessage.getId()); +} + } + public abstract void handleMessage(HiveMessage hiveMessage); } http://git-wip-us.apache.org/repos/asf/ambari/blob/a76b3f06/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 997c28a..f7746d9 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 @@ -77,7 +77,7 @@ import java.util.concurrent.TimeUnit; */ public class JdbcConnector extends HiveActor { - private final Logger LOG = LoggerFactory.getLogger(getClass()); + private static final Logger LOG = LoggerFactory.getLogger(JdbcConnector.class); public static final String SUFFIX = "validating the login"; @@ -527,12 +527,6 @@ public class JdbcConnector extends HiveActor { } private void checkTerminationInactivity() { -if (!isAsync()) { - // Should not terminate if job is sync. Will terminate after the job is finished. - stopTerminateInactivityScheduler(); - return; -} - LOG.debug("Termination check, executing status: {}", executing); if (executing) { keepAlive(); http://git-wip-us.apache.org/repos/asf/ambari/blob/a76b3f06/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java
ambari git commit: AMBARI-20690 : fixed Hive view holds the operational logs open and also fills tmp folder (nitirajrathore)
Repository: ambari Updated Branches: refs/heads/trunk 381a4b1a7 -> fa5447474 AMBARI-20690 : fixed Hive view holds the operational logs open and also fills tmp folder (nitirajrathore) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fa544747 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fa544747 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fa544747 Branch: refs/heads/trunk Commit: fa54474740cc859ad3b2b4236e18161a6e43fd20 Parents: 381a4b1 Author: Nitiraj Singh RathoreAuthored: Tue Apr 25 16:56:08 2017 +0530 Committer: Nitiraj Singh Rathore Committed: Tue Apr 25 16:57:17 2017 +0530 -- .../ambari/view/hive2/actor/HiveActor.java | 32 +--- .../ambari/view/hive2/actor/JdbcConnector.java | 8 + .../view/hive2/actor/OperationController.java | 2 +- .../ambari/view/hive20/actor/HiveActor.java | 32 +--- .../ambari/view/hive20/actor/JdbcConnector.java | 6 .../view/hive20/actor/OperationController.java | 2 +- 6 files changed, 31 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/fa544747/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java index 36bc430..a71ca5c 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java @@ -25,26 +25,22 @@ import org.slf4j.LoggerFactory; public abstract class HiveActor extends UntypedActor { -private final Logger LOG = LoggerFactory.getLogger(getClass()); - -@Override -final public void onReceive(Object message) throws Exception { -HiveMessage hiveMessage = new HiveMessage(message); -if(LOG.isDebugEnabled()){ -LOG.debug("Received message: " + message.getClass().getName() + ", generated id: " + hiveMessage.getId() + -" sent by: " + sender() + ", recieved by" + self()); -} - -handleMessage(hiveMessage); - -if(LOG.isDebugEnabled()){ -LOG.debug("Message submitted: " + hiveMessage.getId()); - -} + private static final Logger LOG = LoggerFactory.getLogger(HiveActor.class); + + @Override + final public void onReceive(Object message) throws Exception { +HiveMessage hiveMessage = new HiveMessage(message); +if (LOG.isDebugEnabled()) { + LOG.debug("Received message: " + message.getClass().getName() + ", generated id: " + hiveMessage.getId() + + " sent by: " + sender() + ", recieved by" + self()); } -public abstract void handleMessage(HiveMessage hiveMessage); - +handleMessage(hiveMessage); +if (LOG.isDebugEnabled()) { + LOG.debug("Message submitted: " + hiveMessage.getId()); +} + } + public abstract void handleMessage(HiveMessage hiveMessage); } http://git-wip-us.apache.org/repos/asf/ambari/blob/fa544747/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 997c28a..f7746d9 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 @@ -77,7 +77,7 @@ import java.util.concurrent.TimeUnit; */ public class JdbcConnector extends HiveActor { - private final Logger LOG = LoggerFactory.getLogger(getClass()); + private static final Logger LOG = LoggerFactory.getLogger(JdbcConnector.class); public static final String SUFFIX = "validating the login"; @@ -527,12 +527,6 @@ public class JdbcConnector extends HiveActor { } private void checkTerminationInactivity() { -if (!isAsync()) { - // Should not terminate if job is sync. Will terminate after the job is finished. - stopTerminateInactivityScheduler(); - return; -} - LOG.debug("Termination check, executing status: {}", executing); if (executing) { keepAlive(); http://git-wip-us.apache.org/repos/asf/ambari/blob/fa544747/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java
ambari git commit: AMBARI-20843. Client configs downloaded via Ambari are empty with non-root ambari-server (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-2.5 349cd4d8a -> 8bc2048d2 AMBARI-20843. Client configs downloaded via Ambari are empty with non-root ambari-server (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8bc2048d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8bc2048d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8bc2048d Branch: refs/heads/branch-2.5 Commit: 8bc2048d262304ed26eb8aee95a175d747733769 Parents: 349cd4d Author: Andrew OnishukAuthored: Tue Apr 25 14:23:22 2017 +0300 Committer: Andrew Onishuk Committed: Tue Apr 25 14:23:22 2017 +0300 -- .../libraries/script/script.py | 6 +-- .../internal/ClientConfigResourceProvider.java | 41 ++-- .../stacks/2.0.6/HDFS/test_hdfs_client.py | 10 ++--- 3 files changed, 28 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8bc2048d/ambari-common/src/main/python/resource_management/libraries/script/script.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py index e329236..5670afa 100644 --- a/ambari-common/src/main/python/resource_management/libraries/script/script.py +++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py @@ -890,19 +890,19 @@ class Script(object): for filename, dict in file_dict.iteritems(): XmlConfig(filename, conf_dir=conf_tmp_dir, -mode=0600, +mode=0644, **self.generate_configs_get_xml_file_content(filename, dict) ) for file_dict in env_configs_list: for filename,dicts in file_dict.iteritems(): File(os.path.join(conf_tmp_dir, filename), - mode=0600, + mode=0644, content=InlineTemplate(self.generate_configs_get_template_file_content(filename, dicts))) for file_dict in properties_configs_list: for filename, dict in file_dict.iteritems(): PropertiesFile(os.path.join(conf_tmp_dir, filename), - mode=0600, + mode=0644, properties=self.generate_configs_get_xml_file_dict(filename, dict) ) with closing(tarfile.open(output_filename, "w:gz")) as tar: http://git-wip-us.apache.org/repos/asf/ambari/blob/8bc2048d/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java index 446ca14..f803fcd 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java @@ -586,28 +586,27 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv throws SystemException { processExecutor.shutdown(); try { - if (!processExecutor.awaitTermination(timeout, TimeUnit.MILLISECONDS)) { -processExecutor.shutdownNow(); -for (CommandLineThreadWrapper commandLineThreadWrapper: pythonCmdThreads) { - CommandLineThread commandLineThread = commandLineThreadWrapper.getCommandLineThread(); - try { -Integer returnCode = commandLineThread.getReturnCode(); -if (returnCode == null) { - throw new TimeoutException(); -} else if (returnCode != 0) { - throw new ExecutionException(String.format("Execution of \"%s\" returned %d.", commandLineThreadWrapper.getCommandLine(), returnCode), -new Throwable(commandLineThreadWrapper.getLogStream().getOutput())); -} - } catch (TimeoutException e) { -LOG.error("Generate client configs script was killed due to timeout ", e); -throw new SystemException("Generate client configs script was killed due to timeout ", e); - } catch (ExecutionException e) { -LOG.error(e.getMessage(), e); -throw new SystemException(e.getMessage() + " " + e.getCause()); - } finally { -commandLineThreadWrapper.getProcess().destroy(); + processExecutor.awaitTermination(timeout, TimeUnit.MILLISECONDS);
ambari git commit: AMBARI-20327. HDP 3.0 TP - create Service Advisor for HBase.(vbrodetskyi)
Repository: ambari Updated Branches: refs/heads/trunk 7f53d1819 -> 381a4b1a7 AMBARI-20327. HDP 3.0 TP - create Service Advisor for HBase.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/381a4b1a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/381a4b1a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/381a4b1a Branch: refs/heads/trunk Commit: 381a4b1a751bd6428af919f78e33bb63a0b62c25 Parents: 7f53d18 Author: Vitaly BrodetskyiAuthored: Tue Apr 25 14:11:41 2017 +0300 Committer: Vitaly Brodetskyi Committed: Tue Apr 25 14:11:41 2017 +0300 -- .../HBASE/2.0.0.3.0/service_advisor.py | 675 +++ 1 file changed, 675 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/381a4b1a/ambari-server/src/main/resources/common-services/HBASE/2.0.0.3.0/service_advisor.py -- diff --git a/ambari-server/src/main/resources/common-services/HBASE/2.0.0.3.0/service_advisor.py b/ambari-server/src/main/resources/common-services/HBASE/2.0.0.3.0/service_advisor.py new file mode 100644 index 000..f9d1a59 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/HBASE/2.0.0.3.0/service_advisor.py @@ -0,0 +1,675 @@ +#!/usr/bin/env ambari-python-wrap +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# Python imports +import imp +import os +import traceback +import re +import socket +import fnmatch + + +from resource_management.core.logger import Logger + +SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) +STACKS_DIR = os.path.join(SCRIPT_DIR, '../../../stacks/') +PARENT_FILE = os.path.join(STACKS_DIR, 'service_advisor.py') + +try: + with open(PARENT_FILE, 'rb') as fp: +service_advisor = imp.load_module('service_advisor', fp, PARENT_FILE, ('.py', 'rb', imp.PY_SOURCE)) +except Exception as e: + traceback.print_exc() + print "Failed to load parent" + +class HBASEServiceAdvisor(service_advisor.ServiceAdvisor): + + def __init__(self, *args, **kwargs): +self.as_super = super(HBASEServiceAdvisor, self) +self.as_super.__init__(*args, **kwargs) + +# Always call these methods +self.modifyMastersWithMultipleInstances() +self.modifyCardinalitiesDict() +self.modifyHeapSizeProperties() +self.modifyNotValuableComponents() +self.modifyComponentsNotPreferableOnServer() +self.modifyComponentLayoutSchemes() + + def modifyMastersWithMultipleInstances(self): +""" +Modify the set of masters with multiple instances. +Must be overriden in child class. +""" +self.mastersWithMultipleInstances.add("HBASE_MASTER") + + def modifyCardinalitiesDict(self): +""" +Modify the dictionary of cardinalities. +Must be overriden in child class. +""" +self.cardinalitiesDict["HBASE_MASTER"] = {"min": 1} + + def modifyHeapSizeProperties(self): +""" +Modify the dictionary of heap size properties. +Must be overriden in child class. +""" +self.heap_size_properties = {"REGIONSERVER": + [{"config-name": "hbase-env", + "property": "hbase_regionserver_heapsize", + "default": "1024m"}], + "HBASE_MASTER": + [{"config-name": "hbase-env", + "property": "hbase_master_heapsize", + "default": "1024m"}]} + + def modifyNotValuableComponents(self): +""" +Modify the set of components whose host assignment is based on other services. +Must be overriden in child class. +""" +# Nothing to do +pass + + def modifyComponentsNotPreferableOnServer(self): +""" +Modify the set of components that are not preferable on the server. +Must be overriden in child class. +""" +# Nothing to do +pass + + def modifyComponentLayoutSchemes(self): +""" +Modify layout
ambari git commit: AMBARI-20837. Fix AmbariSolrCloudCLI package name in solr-client script (oleewere)
Repository: ambari Updated Branches: refs/heads/trunk 96d7bd02d -> 7f53d1819 AMBARI-20837. Fix AmbariSolrCloudCLI package name in solr-client script (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7f53d181 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7f53d181 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7f53d181 Branch: refs/heads/trunk Commit: 7f53d181909f805792ef35053606cafe3ff2c462 Parents: 96d7bd0 Author: oleewereAuthored: Mon Apr 24 21:04:52 2017 +0200 Committer: oleewere Committed: Tue Apr 25 11:12:08 2017 +0200 -- .../ambari-infra-solr-client/src/main/resources/solrCloudCli.sh| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7f53d181/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh -- diff --git a/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh b/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh index cd47f06..7bfa864 100644 --- a/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh +++ b/ambari-infra/ambari-infra-solr-client/src/main/resources/solrCloudCli.sh @@ -17,4 +17,4 @@ JVM="java" sdir="`dirname \"$0\"`" -PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$sdir:$sdir/libs/*" org.apache.ambari.logsearch.solr.AmbariSolrCloudCLI ${1+"$@"} \ No newline at end of file +PATH=$JAVA_HOME/bin:$PATH $JVM -classpath "$sdir:$sdir/libs/*" org.apache.ambari.infra.solr.AmbariSolrCloudCLI ${1+"$@"} \ No newline at end of file
ambari git commit: AMBARI-20793.Project manager window is not opening for the second time(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/branch-2.5 56c0e736d -> c09c5c41c AMBARI-20793.Project manager window is not opening for the second time(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c09c5c41 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c09c5c41 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c09c5c41 Branch: refs/heads/branch-2.5 Commit: c09c5c41c0f3fe73b18b86464c7e0356d275f68b Parents: 56c0e73 Author: Venkata SairamAuthored: Tue Apr 25 12:44:36 2017 +0530 Committer: Venkata Sairam Committed: Tue Apr 25 12:48:07 2017 +0530 -- .../src/main/resources/ui/app/components/drafts-wf.js| 1 - .../main/resources/ui/app/components/recent-projects.js | 11 --- 2 files changed, 8 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c09c5c41/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js index ed448d9..f6965f7 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js @@ -46,7 +46,6 @@ export default Ember.Component.extend({ }, set(key, value) { this.set('recentFiles', value); - var score = 0, condition = true, searchTxt = this.get("search").toLowerCase(), isWorkflow = this.get("isWorkflow"), isCoordinator = this.get("isCoordinator"), isBundle = this.get("isBundle"); return this.get("recentFiles").filter( (role) => { score = 0 http://git-wip-us.apache.org/repos/asf/ambari/blob/c09c5c41/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js index bbc51cc..8ed9e54 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js @@ -18,10 +18,15 @@ import Ember from 'ember'; export default Ember.Component.extend({ + rendered : function(){ +this.$("#projectsList").on("hidden.bs.modal", function () { + this.sendAction("close"); +}.bind(this)); + }.on('didInsertElement'), actions: { - close(){ - this.sendAction('close'); - }, +close() { + this.sendAction('close'); +}, editWorkflow ( path, type ) { this.sendAction('editWorkflow', path, type); }
ambari git commit: AMBARI-20793.Project manager window is not opening for the second time(Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/trunk ed612008a -> c3206b859 AMBARI-20793.Project manager window is not opening for the second time(Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c3206b85 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c3206b85 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c3206b85 Branch: refs/heads/trunk Commit: c3206b859fb82bad8c08f126ffa613b2314e6967 Parents: ed61200 Author: Venkata SairamAuthored: Tue Apr 25 12:44:36 2017 +0530 Committer: Venkata Sairam Committed: Tue Apr 25 12:46:00 2017 +0530 -- .../src/main/resources/ui/app/components/drafts-wf.js| 1 - .../main/resources/ui/app/components/recent-projects.js | 11 --- 2 files changed, 8 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c3206b85/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js index ed448d9..f6965f7 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js @@ -46,7 +46,6 @@ export default Ember.Component.extend({ }, set(key, value) { this.set('recentFiles', value); - var score = 0, condition = true, searchTxt = this.get("search").toLowerCase(), isWorkflow = this.get("isWorkflow"), isCoordinator = this.get("isCoordinator"), isBundle = this.get("isBundle"); return this.get("recentFiles").filter( (role) => { score = 0 http://git-wip-us.apache.org/repos/asf/ambari/blob/c3206b85/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js -- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js index bbc51cc..8ed9e54 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js @@ -18,10 +18,15 @@ import Ember from 'ember'; export default Ember.Component.extend({ + rendered : function(){ +this.$("#projectsList").on("hidden.bs.modal", function () { + this.sendAction("close"); +}.bind(this)); + }.on('didInsertElement'), actions: { - close(){ - this.sendAction('close'); - }, +close() { + this.sendAction('close'); +}, editWorkflow ( path, type ) { this.sendAction('editWorkflow', path, type); }
ambari git commit: AMBARI-20832. Desired configs fetched in loop via HostResourceProvider.getHosts
Repository: ambari Updated Branches: refs/heads/trunk acde08995 -> ed612008a AMBARI-20832. Desired configs fetched in loop via HostResourceProvider.getHosts Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ed612008 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ed612008 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ed612008 Branch: refs/heads/trunk Commit: ed612008ab664f59a06a5c609dfbe317c6a59948 Parents: acde089 Author: Attila DoroszlaiAuthored: Mon Apr 24 16:36:36 2017 +0200 Committer: Attila Doroszlai Committed: Tue Apr 25 09:11:19 2017 +0200 -- .../ambari/server/controller/internal/HostResourceProvider.java | 4 ++-- .../server/controller/internal/HostResourceProviderTest.java| 5 - 2 files changed, 6 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ed612008/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java index f604a7f..c244107 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java @@ -654,7 +654,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider { // retrieve the cluster desired configs once instead of per host Map desiredConfigs = null; if (null != cluster) { - cluster.getDesiredConfigs(); + desiredConfigs = cluster.getDesiredConfigs(); } for (Host h : hosts) { @@ -678,7 +678,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider { if (clustersForHost != null && clustersForHost.size() != 0) { Cluster clusterForHost = clustersForHost.iterator().next(); r.setClusterName(clusterForHost.getClusterName()); - r.setDesiredHostConfigs(h.getDesiredHostConfigs(clusterForHost, desiredConfigs)); + r.setDesiredHostConfigs(h.getDesiredHostConfigs(clusterForHost, null)); r.setMaintenanceState(h.getMaintenanceState(clusterForHost.getClusterId())); } http://git-wip-us.apache.org/repos/asf/ambari/blob/ed612008/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java index ac6ac1d..8772b24 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java @@ -1145,6 +1145,8 @@ public class HostResourceProviderTest extends EasyMockSupport { HostResponse response = createNiceMock(HostResponse.class); Set setCluster = Collections.singleton(cluster); +Map desiredConfigs = new HashMap<>(); +Map desiredHostConfigs = new HashMap<>(); // requests HostRequest request1 = new HostRequest("host1", "cluster1", Collections. emptyMap()); @@ -1160,7 +1162,8 @@ public class HostResourceProviderTest extends EasyMockSupport { expect(clusters.getClustersForHost("host1")).andReturn(setCluster); expect(clusters.getCluster("Cluster100")).andReturn(cluster).anyTimes(); expect(cluster.getClusterId()).andReturn(2L).anyTimes(); -expect(cluster.getDesiredConfigs()).andReturn(new HashMap ()).anyTimes(); +expect(cluster.getDesiredConfigs()).andReturn(desiredConfigs); +expect(host.getDesiredHostConfigs(cluster, desiredConfigs)).andReturn(desiredHostConfigs); expect(host.getHostName()).andReturn("host1").anyTimes(); expect(host.convertToResponse()).andReturn(response); response.setClusterName("cluster1");
ambari git commit: AMBARI-18387. Unable to delete Hive view. (Dipayan Bhowmick via gauravn7)
Repository: ambari Updated Branches: refs/heads/branch-2.4 ad40cd526 -> 60a6805d7 AMBARI-18387. Unable to delete Hive view. (Dipayan Bhowmick via gauravn7) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/60a6805d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/60a6805d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/60a6805d Branch: refs/heads/branch-2.4 Commit: 60a6805d7ad9807d66bcecd895d0e4290b8e6b07 Parents: ad40cd5 Author: Gaurav NagarAuthored: Tue Apr 25 12:03:01 2017 +0530 Committer: Gaurav Nagar Committed: Tue Apr 25 12:03:14 2017 +0530 -- .../ambari/view/hive2/ConnectionSystem.java | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/60a6805d/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java -- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java index e6e533f..d1a9eea 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java @@ -23,6 +23,8 @@ import akka.actor.ActorSystem; import akka.actor.Inbox; import akka.actor.PoisonPill; import akka.actor.Props; +import com.typesafe.config.Config; +import com.typesafe.config.ConfigFactory; import com.google.common.base.Optional; import org.apache.ambari.view.ViewContext; import org.apache.ambari.view.hive2.actor.DeathWatch; @@ -49,8 +51,9 @@ public class ConnectionSystem { private static Map credentialsMap = new ConcurrentHashMap<>(); private ConnectionSystem() { -this.actorSystem = ActorSystem.create(ACTOR_SYSTEM_NAME); -; +ClassLoader classLoader = getClass().getClassLoader(); +Config config = ConfigFactory.load(classLoader); +this.actorSystem = ActorSystem.create(ACTOR_SYSTEM_NAME, config, classLoader); } public static ConnectionSystem getInstance() { @@ -86,12 +89,12 @@ public class ConnectionSystem { String instanceName = context.getInstanceName(); ActorRef ref = null; Map stringActorRefMap = operationControllerMap.get(instanceName); -if(stringActorRefMap != null) { +if (stringActorRefMap != null) { ref = stringActorRefMap.get(context.getUsername()); } if (ref == null) { ref = createOperationController(context); - if(stringActorRefMap == null) { + if (stringActorRefMap == null) { stringActorRefMap = new HashMap<>(); stringActorRefMap.put(context.getUsername(), ref); operationControllerMap.put(instanceName, stringActorRefMap); @@ -116,9 +119,11 @@ public class ConnectionSystem { public void removeOperationControllerFromCache(String viewInstanceName) { Map refs = operationControllerMap.remove(viewInstanceName); -for (ActorRef ref : refs.values()) { - Inbox inbox = Inbox.create(getActorSystem()); - inbox.send(ref, PoisonPill.getInstance()); +if (refs != null) { + for (ActorRef ref : refs.values()) { +Inbox inbox = Inbox.create(getActorSystem()); +inbox.send(ref, PoisonPill.getInstance()); + } } }