]> source.dussan.org Git - archiva.git/commitdiff
small optim as no need to continue querying here
authorOlivier Lamy <olamy@apache.org>
Mon, 24 Mar 2014 03:18:00 +0000 (03:18 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 24 Mar 2014 03:18:00 +0000 (03:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1580721 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java

index 31e99150ef61b56dc4d9a93f0003041a74298694..044cb0834ef89e1f7e713f3b53c7208d033ff0a3 100644 (file)
@@ -1847,9 +1847,6 @@ public class CassandraMetadataRepository
             new ArtifactMetadataModel.KeyBuilder().withRepositoryId( repositoryId ).withNamespace( namespace ).withId(
                 id ).withProjectVersion( version ).withProject( project ).build();
 
-
-        Keyspace keyspace = cassandraArchivaManager.getKeyspace();
-
         this.artifactMetadataTemplate.deleteRow( key );
 
         key =
@@ -1858,6 +1855,7 @@ public class CassandraMetadataRepository
 
         this.projectVersionMetadataModelTemplate.deleteRow( key );
 
+
     }
 
     @Override
@@ -2019,9 +2017,14 @@ public class CassandraMetadataRepository
                 .addEqualsExpression( "projectVersion", projectVersion ) //
                 .execute();
 
+        if (result.get() == null || result.get().getCount() < 1)
+        {
+            return Collections.emptyList();
+        }
+
         List<ArtifactMetadata> artifactMetadatas = new ArrayList<ArtifactMetadata>( result.get().getCount() );
 
-        LongSerializer ls = LongSerializer.get();
+
 
         for ( Row<String, String, String> row : result.get() )
         {