Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 93DA6EB2F for ; Sat, 16 Feb 2013 00:12:37 +0000 (UTC) Received: (qmail 103 invoked by uid 500); 16 Feb 2013 00:09:03 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 91414 invoked by uid 500); 16 Feb 2013 00:08:54 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 76946 invoked by uid 99); 15 Feb 2013 22:52:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2013 22:52:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2013 22:52:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id BCEF523889D5; Fri, 15 Feb 2013 22:52:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1446798 - in /incubator/ambari/trunk: ./ ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ ambari-server/src/main/java/org/apache/ambari/server/controller/ ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ amb... Date: Fri, 15 Feb 2013 22:52:09 -0000 To: ambari-commits@incubator.apache.org From: mahadev@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130215225209.BCEF523889D5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mahadev Date: Fri Feb 15 22:52:08 2013 New Revision: 1446798 URL: http://svn.apache.org/r1446798 Log: AMBARI-1435. L2 Cache does not work due to Eclipse Link exception. (Sid Wagle via mahadev) Removed: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClearEntityManagerInterceptor.java Modified: incubator/ambari/trunk/CHANGES.txt incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ComponentConfigMappingDAO.java incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/DaoUtils.java incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KeyValueDAO.java incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StageDAO.java incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ExecutionCommandEntity.java incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java incubator/ambari/trunk/ambari-server/src/main/resources/META-INF/persistence.xml Modified: incubator/ambari/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/CHANGES.txt (original) +++ incubator/ambari/trunk/CHANGES.txt Fri Feb 15 22:52:08 2013 @@ -283,6 +283,9 @@ Trunk (unreleased changes): AMBARI-1433. Allow capacity scheduler to be configurable via the API's. (mahadev) + AMBARI-1435. L2 Cache does not work due to Eclipse Link exception. + (Sid Wagle via mahadev) + BUG FIXES AMBARI-1431. Hosts table no longer allows sorting. (yusaku) Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java (original) +++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java Fri Feb 15 22:52:08 2013 @@ -181,6 +181,8 @@ public class ActionDBAccessorImpl implem hostRoleCommand.setTaskId(hostRoleCommandEntity.getTaskId()); ExecutionCommandEntity executionCommandEntity = hostRoleCommand.constructExecutionCommandEntity(); executionCommandEntity.setHostRoleCommand(hostRoleCommandEntity); + + executionCommandEntity.setTaskId(hostRoleCommandEntity.getTaskId()); hostRoleCommandEntity.setExecutionCommand(executionCommandEntity); executionCommandDAO.create(hostRoleCommandEntity.getExecutionCommand()); Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java (original) +++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java Fri Feb 15 22:52:08 2013 @@ -17,17 +17,15 @@ */ package org.apache.ambari.server.controller; + import com.google.gson.Gson; import com.google.inject.Scopes; import com.google.inject.assistedinject.FactoryModuleBuilder; -import com.google.inject.matcher.Matchers; -import com.google.inject.persist.Transactional; import com.google.inject.persist.jpa.JpaPersistModule; import org.apache.ambari.server.actionmanager.*; import org.apache.ambari.server.api.services.AmbariMetaInfo; import org.apache.ambari.server.configuration.Configuration; import org.apache.ambari.server.orm.PersistenceType; -import org.apache.ambari.server.orm.dao.ClearEntityManagerInterceptor; import org.apache.ambari.server.state.*; import org.apache.ambari.server.state.cluster.ClusterFactory; import org.apache.ambari.server.state.cluster.ClusterImpl; @@ -45,14 +43,13 @@ import java.util.Properties; /** * Used for injection purposes. - * */ public class ControllerModule extends AbstractModule { private final Configuration configuration; private final AmbariMetaInfo ambariMetaInfo; private final HostsMap hostsMap; - + public ControllerModule() throws Exception { configuration = new Configuration(); ambariMetaInfo = new AmbariMetaInfo(configuration); @@ -67,13 +64,11 @@ public class ControllerModule extends Ab @Override protected void configure() { - bindInterceptors(); installFactories(); bind(Configuration.class).toInstance(configuration); bind(AmbariMetaInfo.class).toInstance(ambariMetaInfo); bind(HostsMap.class).toInstance(hostsMap); - bind(PasswordEncoder.class).toInstance(new StandardPasswordEncoder()); JpaPersistModule jpaPersistModule = new JpaPersistModule(configuration.getPersistenceType().getUnitName()); @@ -115,10 +110,4 @@ public class ControllerModule extends Ab install(new FactoryModuleBuilder().build(HostRoleCommandFactory.class)); } - private void bindInterceptors() { - ClearEntityManagerInterceptor clearEntityManagerInterceptor = new ClearEntityManagerInterceptor(); - requestInjection(clearEntityManagerInterceptor); - bindInterceptor(Matchers.any(), Matchers.annotatedWith(Transactional.class), clearEntityManagerInterceptor); - - } } Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ComponentConfigMappingDAO.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ComponentConfigMappingDAO.java?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ComponentConfigMappingDAO.java (original) +++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ComponentConfigMappingDAO.java Fri Feb 15 22:52:08 2013 @@ -49,6 +49,7 @@ public class ComponentConfigMappingDAO { return daoUtils.selectList(query, configTypes); } + @Transactional public List findByComponentAndType(long clusterId, String serviceName, String componentName, Collection configTypes) { if (configTypes.isEmpty()) { Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/DaoUtils.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/DaoUtils.java?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/DaoUtils.java (original) +++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/DaoUtils.java Fri Feb 15 22:52:08 2013 @@ -27,7 +27,7 @@ import java.util.Collections; import java.util.List; @Singleton -public class DaoUtils { +class DaoUtils { public List selectList(TypedQuery query, Object... parameters) { setParameters(query, parameters); Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KeyValueDAO.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KeyValueDAO.java?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KeyValueDAO.java (original) +++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KeyValueDAO.java Fri Feb 15 22:52:08 2013 @@ -39,6 +39,7 @@ public class KeyValueDAO { return entityManagerProvider.get().find(KeyValueEntity.class, key); } + @Transactional public Collection findAll() { TypedQuery query = entityManagerProvider.get().createQuery("SELECT keyValue FROM KeyValueEntity keyValue", KeyValueEntity.class); Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StageDAO.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StageDAO.java?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StageDAO.java (original) +++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StageDAO.java Fri Feb 15 22:52:08 2013 @@ -43,6 +43,7 @@ public class StageDAO { return entityManagerProvider.get().find(StageEntity.class, stageEntityPK); } + @Transactional public long getLastRequestId() { TypedQuery query = entityManagerProvider.get().createQuery("SELECT max(stage.requestId) FROM StageEntity stage", Long.class); Long result = daoUtils.selectSingle(query); Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ExecutionCommandEntity.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ExecutionCommandEntity.java?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ExecutionCommandEntity.java (original) +++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ExecutionCommandEntity.java Fri Feb 15 22:52:08 2013 @@ -19,13 +19,14 @@ package org.apache.ambari.server.orm.entities; import javax.persistence.*; +import java.util.Arrays; @Table(name = "execution_command", schema = "ambari", catalog = "") @Entity public class ExecutionCommandEntity { private Long taskId; - @Column(name = "task_id", insertable = false, updatable = false, nullable = false) + @Column(name = "task_id") @Id public Long getTaskId() { return taskId; @@ -55,7 +56,7 @@ public class ExecutionCommandEntity { ExecutionCommandEntity that = (ExecutionCommandEntity) o; - if (command != null ? !command.equals(that.command) : that.command != null) return false; + if (command != null ? !Arrays.equals(command, that.command) : that.command != null) return false; if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false; return true; @@ -64,14 +65,14 @@ public class ExecutionCommandEntity { @Override public int hashCode() { int result = taskId != null ? taskId.hashCode() : 0; - result = 31 * result + (command != null ? command.hashCode() : 0); + result = 31 * result + (command != null ? Arrays.hashCode(command) : 0); return result; } private HostRoleCommandEntity hostRoleCommand; @OneToOne - @JoinColumn(name = "task_id", referencedColumnName = "task_id", nullable = false) + @JoinColumn(name = "task_id", referencedColumnName = "task_id", nullable = false, insertable = false, updatable = false) public HostRoleCommandEntity getHostRoleCommand() { return hostRoleCommand; } Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java (original) +++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java Fri Feb 15 22:52:08 2013 @@ -23,6 +23,7 @@ import org.apache.ambari.server.RoleComm import org.apache.ambari.server.actionmanager.HostRoleStatus; import javax.persistence.*; +import java.util.Arrays; @Table(name = "host_role_command", schema = "ambari", catalog = "") @Entity @@ -218,8 +219,8 @@ public class HostRoleCommandEntity { if (stageId != null ? !stageId.equals(that.stageId) : that.stageId != null) return false; if (startTime != null ? !startTime.equals(that.startTime) : that.startTime != null) return false; if (status != null ? !status.equals(that.status) : that.status != null) return false; - if (stdError != null ? !stdError.equals(that.stdError) : that.stdError != null) return false; - if (stdOut != null ? !stdOut.equals(that.stdOut) : that.stdOut != null) return false; + if (stdError != null ? !Arrays.equals(stdError, that.stdError) : that.stdError != null) return false; + if (stdOut != null ? !Arrays.equals(stdOut, that.stdOut) : that.stdOut != null) return false; if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false; return true; @@ -235,8 +236,8 @@ public class HostRoleCommandEntity { result = 31 * result + (event != null ? event.hashCode() : 0); result = 31 * result + (exitcode != null ? exitcode.hashCode() : 0); result = 31 * result + (status != null ? status.hashCode() : 0); - result = 31 * result + (stdError != null ? stdError.hashCode() : 0); - result = 31 * result + (stdOut != null ? stdOut.hashCode() : 0); + result = 31 * result + (stdError != null ? Arrays.hashCode(stdError) : 0); + result = 31 * result + (stdOut != null ? Arrays.hashCode(stdOut) : 0); result = 31 * result + (startTime != null ? startTime.hashCode() : 0); result = 31 * result + (lastAttemptTime != null ? lastAttemptTime.hashCode() : 0); result = 31 * result + (attemptCount != null ? attemptCount.hashCode() : 0); Modified: incubator/ambari/trunk/ambari-server/src/main/resources/META-INF/persistence.xml URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/resources/META-INF/persistence.xml?rev=1446798&r1=1446797&r2=1446798&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-server/src/main/resources/META-INF/persistence.xml (original) +++ incubator/ambari/trunk/ambari-server/src/main/resources/META-INF/persistence.xml Fri Feb 15 22:52:08 2013 @@ -12,87 +12,58 @@ - + + org.eclipse.persistence.jpa.PersistenceProvider org.apache.ambari.server.orm.entities.ClusterEntity - org.apache.ambari.server.orm.entities.ClusterConfigEntity - - org.apache.ambari.server.orm.entities.ClusterServiceEntity - - org.apache.ambari.server.orm.entities.ClusterStateEntity - - org.apache.ambari.server.orm.entities.ComponentConfigMappingEntity - - org.apache.ambari.server.orm.entities.HostComponentConfigMappingEntity - - org.apache.ambari.server.orm.entities.HostComponentDesiredConfigMappingEntity - - org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity - - org.apache.ambari.server.orm.entities.HostComponentStateEntity - + org.apache.ambari.server.orm.entities.ClusterConfigEntity + org.apache.ambari.server.orm.entities.ClusterServiceEntity + org.apache.ambari.server.orm.entities.ClusterStateEntity + org.apache.ambari.server.orm.entities.ComponentConfigMappingEntity + org.apache.ambari.server.orm.entities.HostComponentConfigMappingEntity + org.apache.ambari.server.orm.entities.HostComponentDesiredConfigMappingEntity + org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity + org.apache.ambari.server.orm.entities.HostComponentStateEntity org.apache.ambari.server.orm.entities.HostEntity org.apache.ambari.server.orm.entities.HostStateEntity - org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity - - org.apache.ambari.server.orm.entities.ServiceConfigMappingEntity - - org.apache.ambari.server.orm.entities.ServiceDesiredStateEntity - + org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity + org.apache.ambari.server.orm.entities.ServiceConfigMappingEntity + org.apache.ambari.server.orm.entities.ServiceDesiredStateEntity org.apache.ambari.server.orm.entities.RoleEntity org.apache.ambari.server.orm.entities.UserEntity - org.apache.ambari.server.orm.entities.ExecutionCommandEntity - - org.apache.ambari.server.orm.entities.HostRoleCommandEntity - - org.apache.ambari.server.orm.entities.RoleSuccessCriteriaEntity - + org.apache.ambari.server.orm.entities.ExecutionCommandEntity + org.apache.ambari.server.orm.entities.HostRoleCommandEntity + org.apache.ambari.server.orm.entities.RoleSuccessCriteriaEntity org.apache.ambari.server.orm.entities.StageEntity org.apache.ambari.server.orm.entities.KeyValueEntity - - - - + - + + org.eclipse.persistence.jpa.PersistenceProvider org.apache.ambari.server.orm.entities.ClusterEntity - org.apache.ambari.server.orm.entities.ClusterConfigEntity - - org.apache.ambari.server.orm.entities.ClusterServiceEntity - - org.apache.ambari.server.orm.entities.ClusterStateEntity - - org.apache.ambari.server.orm.entities.ComponentConfigMappingEntity - - org.apache.ambari.server.orm.entities.HostComponentConfigMappingEntity - - org.apache.ambari.server.orm.entities.HostComponentDesiredConfigMappingEntity - - org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity - - org.apache.ambari.server.orm.entities.HostComponentStateEntity - + org.apache.ambari.server.orm.entities.ClusterConfigEntity + org.apache.ambari.server.orm.entities.ClusterServiceEntity + org.apache.ambari.server.orm.entities.ClusterStateEntity + org.apache.ambari.server.orm.entities.ComponentConfigMappingEntity + org.apache.ambari.server.orm.entities.HostComponentConfigMappingEntity + org.apache.ambari.server.orm.entities.HostComponentDesiredConfigMappingEntity + org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity + org.apache.ambari.server.orm.entities.HostComponentStateEntity org.apache.ambari.server.orm.entities.HostEntity org.apache.ambari.server.orm.entities.HostStateEntity - org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity - - org.apache.ambari.server.orm.entities.ServiceConfigMappingEntity - - org.apache.ambari.server.orm.entities.ServiceDesiredStateEntity - + org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity + org.apache.ambari.server.orm.entities.ServiceConfigMappingEntity + org.apache.ambari.server.orm.entities.ServiceDesiredStateEntity org.apache.ambari.server.orm.entities.RoleEntity org.apache.ambari.server.orm.entities.UserEntity - org.apache.ambari.server.orm.entities.ExecutionCommandEntity - - org.apache.ambari.server.orm.entities.HostRoleCommandEntity - - org.apache.ambari.server.orm.entities.RoleSuccessCriteriaEntity - + org.apache.ambari.server.orm.entities.ExecutionCommandEntity + org.apache.ambari.server.orm.entities.HostRoleCommandEntity + org.apache.ambari.server.orm.entities.RoleSuccessCriteriaEntity org.apache.ambari.server.orm.entities.StageEntity org.apache.ambari.server.orm.entities.KeyValueEntity @@ -102,11 +73,8 @@ - - - - - + +