diff options
author | Olivier Lamy <olamy@apache.org> | 2014-03-24 03:18:00 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-03-24 03:18:00 +0000 |
commit | 6f7387447474cc3533534b635a0aa1cccc9ff6fe (patch) | |
tree | e420fe05349dbc1743ba9996bde64143f0d8a53b | |
parent | 8565793eed637237c99de7772a046b6ce368a0bc (diff) | |
download | archiva-6f7387447474cc3533534b635a0aa1cccc9ff6fe.tar.gz archiva-6f7387447474cc3533534b635a0aa1cccc9ff6fe.zip |
small optim as no need to continue querying here
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1580721 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java index 31e99150e..044cb0834 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java @@ -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() ) { |