Repository: ambari Updated Branches: refs/heads/branch-2.5 8a2bdfeaf -> 588e2ced1
Revert "AMBARI-18966. Add check to ensure we do not have @Transactional annotations on private methods. (Attila Doroszlai via stoader)" This reverts commit 8a2bdfeaf228ac9285ffe372e1327b04f8c6c155. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/588e2ced Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/588e2ced Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/588e2ced Branch: refs/heads/branch-2.5 Commit: 588e2ced18414413bceb7faf306a3df7ae364d2e Parents: 8a2bdfe Author: Toader, Sebastian <stoa...@hortonworks.com> Authored: Wed Dec 7 10:43:24 2016 +0100 Committer: Toader, Sebastian <stoa...@hortonworks.com> Committed: Wed Dec 7 10:43:24 2016 +0100 ---------------------------------------------------------------------- ambari-server/checkstyle.xml | 17 ----------------- ambari-server/pom.xml | 4 ---- .../internal/AlertTargetResourceProvider.java | 2 +- .../ClusterStackVersionResourceProvider.java | 4 ++-- .../internal/UpgradeResourceProvider.java | 2 +- .../apache/ambari/server/orm/dao/AlertsDAO.java | 6 +++--- .../apache/ambari/server/state/ServiceImpl.java | 2 +- .../ambari/server/state/cluster/ClustersImpl.java | 2 +- .../apache/ambari/server/state/host/HostImpl.java | 2 +- .../state/services/RetryUpgradeActionService.java | 2 +- .../svccomphost/ServiceComponentHostImpl.java | 2 +- .../ambari/server/upgrade/UpgradeCatalog240.java | 4 ++-- 12 files changed, 14 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/checkstyle.xml ---------------------------------------------------------------------- diff --git a/ambari-server/checkstyle.xml b/ambari-server/checkstyle.xml deleted file mode 100644 index 81f6380..0000000 --- a/ambari-server/checkstyle.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0"?> -<!-- Licensed 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. - See accompanying LICENSE file. --> -<!DOCTYPE module PUBLIC - "-//Puppy Crawl//DTD Check Configuration 1.3//EN" - "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> -<module name="Checker"> - <module name="TreeWalker"> - <module name="AvoidTransactionalOnPrivateMethodsCheck"/> - </module> -</module> http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index 08757a2..d1277c3 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -686,10 +686,6 @@ <artifactId>jetty-maven-plugin</artifactId> <version>${jetty.version}</version> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> <resources> <resource> http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java index 4010528..8e5674e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java @@ -374,7 +374,7 @@ public class AlertTargetResourceProvider extends */ @Transactional @SuppressWarnings("unchecked") - void updateAlertTargets(long alertTargetId, + private void updateAlertTargets(long alertTargetId, Map<String, Object> requestMap) throws AmbariException { http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java index d417ec2..42aae84 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java @@ -442,7 +442,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou } @Transactional - void createHostVersions(Cluster cluster, List<Host> hosts, StackId stackId, + private void createHostVersions(Cluster cluster, List<Host> hosts, StackId stackId, String desiredRepoVersion, RepositoryVersionState repoState) throws AmbariException, SystemException { final String clusterName = cluster.getClusterName(); @@ -482,7 +482,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou } @Transactional - RequestStageContainer createOrchestration(Cluster cluster, StackId stackId, + private RequestStageContainer createOrchestration(Cluster cluster, StackId stackId, List<Host> hosts, RepositoryVersionEntity repoVersionEnt, Map<String, Object> propertyMap) throws AmbariException, SystemException { final AmbariManagementController managementController = getManagementController(); http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java index a45ccff..fd38d17 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java @@ -956,7 +956,7 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider * @throws AmbariException */ @Transactional - UpgradeEntity createUpgradeInsideTransaction(Cluster cluster, + private UpgradeEntity createUpgradeInsideTransaction(Cluster cluster, RequestStageContainer request, UpgradeEntity upgradeEntity) throws AmbariException { http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java index e8c4b5f..d187947 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java @@ -1492,7 +1492,7 @@ public class AlertsDAO implements Cleanable { * @return a long representing the number of affected (deleted) records */ @Transactional - int cleanAlertNoticesForClusterBeforeDate(Long clusterId, long beforeDateMillis) { + private int cleanAlertNoticesForClusterBeforeDate(Long clusterId, long beforeDateMillis) { LOG.info("Deleting AlertNotice entities before date " + new Date(beforeDateMillis)); EntityManager entityManager = m_entityManagerProvider.get(); List<Integer> ids = findAllAlertHistoryIdsBeforeDate(clusterId, beforeDateMillis); @@ -1523,7 +1523,7 @@ public class AlertsDAO implements Cleanable { * @return a long representing the number of affected (deleted) records */ @Transactional - int cleanAlertCurrentsForClusterBeforeDate(long clusterId, long beforeDateMillis) { + private int cleanAlertCurrentsForClusterBeforeDate(long clusterId, long beforeDateMillis) { LOG.info("Deleting AlertCurrent entities before date " + new Date(beforeDateMillis)); EntityManager entityManager = m_entityManagerProvider.get(); List<Integer> ids = findAllAlertHistoryIdsBeforeDate(clusterId, beforeDateMillis); @@ -1553,7 +1553,7 @@ public class AlertsDAO implements Cleanable { */ @Transactional - int cleanAlertHistoriesForClusterBeforeDate(Long clusterId, long beforeDateMillis) { + private int cleanAlertHistoriesForClusterBeforeDate(Long clusterId, long beforeDateMillis) { return executeQuery("AlertHistoryEntity.removeInClusterBeforeDate", AlertHistoryEntity.class, clusterId, beforeDateMillis); } http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java index e223eed..f87b99c 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java @@ -451,7 +451,7 @@ public class ServiceImpl implements Service { } @Transactional - void persistEntities(ClusterServiceEntity serviceEntity) { + private void persistEntities(ClusterServiceEntity serviceEntity) { long clusterId = cluster.getClusterId(); ClusterEntity clusterEntity = clusterDAO.findById(clusterId); serviceEntity.setClusterEntity(clusterEntity); http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java index 1de10f9..8e5f37e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java @@ -183,7 +183,7 @@ public class ClustersImpl implements Clusters { */ @Inject @Transactional - void loadClustersAndHosts() { + private void loadClustersAndHosts() { List<HostEntity> hostEntities = hostDAO.findAll(); for (HostEntity hostEntity : hostEntities) { Host host = hostFactory.create(hostEntity); http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java index a444f5d..dd5e635 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java @@ -954,7 +954,7 @@ public class HostImpl implements Host { } @Transactional - void persistEntities(HostEntity hostEntity) { + private void persistEntities(HostEntity hostEntity) { hostDAO.create(hostEntity); if (!hostEntity.getClusterEntities().isEmpty()) { for (ClusterEntity clusterEntity : hostEntity.getClusterEntities()) { http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java index a92aa04..1ea5558 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java @@ -190,7 +190,7 @@ public class RetryUpgradeActionService extends AbstractScheduledService { * @param requestId Request Id to search tasks for. */ @Transactional - void retryHoldingCommandsInRequest(Long requestId) { + private void retryHoldingCommandsInRequest(Long requestId) { if (requestId == null) { return; } http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java index 5225598..c1655aa 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java @@ -1313,7 +1313,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost { } @Transactional - void persistEntities(HostEntity hostEntity, HostComponentStateEntity stateEntity, + private void persistEntities(HostEntity hostEntity, HostComponentStateEntity stateEntity, HostComponentDesiredStateEntity desiredStateEntity) { ServiceComponentDesiredStateEntity serviceComponentDesiredStateEntity = serviceComponentDesiredStateDAO.findByName( serviceComponent.getClusterId(), serviceComponent.getServiceName(), http://git-wip-us.apache.org/repos/asf/ambari/blob/588e2ced/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java index 063c295..25b6360 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java @@ -1553,7 +1553,7 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog { * @throws SQLException */ @Transactional - void updateServiceComponentDesiredStateTableDDL() throws SQLException { + private void updateServiceComponentDesiredStateTableDDL() throws SQLException { if (dbAccessor.tableHasPrimaryKey(SERVICE_COMPONENT_DS_TABLE, ID)) { LOG.info("Skipping {} table Primary Key modifications since the new {} column already exists", SERVICE_COMPONENT_DS_TABLE, ID); @@ -2755,7 +2755,7 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog { * instead of cluster_name */ @Transactional - void updateViewInstanceTable() throws SQLException { + private void updateViewInstanceTable() throws SQLException { try { if (Long.class.equals(dbAccessor.getColumnClass(VIEWINSTANCE_TABLE, CLUSTER_HANDLE_COLUMN))) { LOG.info(String.format("%s column is already numeric. Skipping an update of %s table.", CLUSTER_HANDLE_COLUMN, VIEWINSTANCE_TABLE));