airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata git commit: fixing bug in sharing registry
Date Tue, 18 Jul 2017 18:56:41 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 7307b317a -> f386e38fc


fixing bug in sharing registry


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

Branch: refs/heads/develop
Commit: f386e38fc200f515cf48c62ace4207494d94e615
Parents: 7307b31
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Tue Jul 18 14:56:37 2017 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Tue Jul 18 14:56:37 2017 -0400

----------------------------------------------------------------------
 .../sharing/registry/db/repositories/EntityRepository.java       | 4 ++--
 .../airavata/sharing/registry/SharingRegistryServiceTest.java    | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/f386e38f/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
index 6945f44..9b1bdbe 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
@@ -53,7 +53,7 @@ public class EntityRepository extends AbstractRepository<Entity, EntityEntity,
E
             groupIdString += groupId + "','";
         groupIdString = groupIdString.substring(0, groupIdString.length()-2);
 
-        String query = "SELECT E.* FROM ENTITY AS E INNER JOIN SHARING AS S ON (E.ENTITY_ID=S.ENTITY_ID
AND E.DOMAIN_ID=S.DOMAIN_ID) WHERE " +
+        String query = "SELECT ENTITY.* FROM ENTITY WHERE ENTITY.ENTITY_ID IN (SELECT DISTINCT
E.ENTITY_ID FROM ENTITY AS E INNER JOIN SHARING AS S ON (E.ENTITY_ID=S.ENTITY_ID AND E.DOMAIN_ID=S.DOMAIN_ID)
WHERE " +
                 "E.DOMAIN_ID = '" + domainId + "' AND " + "S.GROUP_ID IN(" + groupIdString
+ ") AND ";
 
         for(SearchCriteria searchCriteria : filters){
@@ -130,7 +130,7 @@ public class EntityRepository extends AbstractRepository<Entity, EntityEntity,
E
         }
 
         query = query.substring(0, query.length() - 5);
-        query += " ORDER BY E."+DBConstants.EntityTable.ORIGINAL_ENTITY_CREATION_TIME+" DESC";
+        query += ") ORDER BY ENTITY.CREATED_TIME DESC";
 
         final String nativeQuery = query;
         int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;

http://git-wip-us.apache.org/repos/asf/airavata/blob/f386e38f/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
index c0e0e03..21b8bf2 100644
--- a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
+++ b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
@@ -27,7 +27,6 @@ import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransport;
-import org.databene.contiperf.PerfTest;
 import org.databene.contiperf.junit.ContiPerfRule;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -54,7 +53,7 @@ public class SharingRegistryServiceTest {
 
 
     @Test
-    @PerfTest(invocations = 50, threads = 10)
+//    @PerfTest(invocations = 50, threads = 10)
     public void test() throws TException, InterruptedException {
         String serverHost = "localhost";
         int serverPort = 7878;


Mime
View raw message