diff options
-rw-r--r-- | archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java | 22 |
1 files changed, 16 insertions, 6 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 530477db1..f7525e61d 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 @@ -1992,15 +1992,25 @@ public class CassandraMetadataRepository throws MetadataRepositoryException { - String key = new ProjectVersionMetadataModel.KeyBuilder().withRepository( repoId ).withNamespace( - namespace ).withProjectId( projectId ).withId( projectVersion ).build(); - - this.projectVersionMetadataModelTemplate.deleteRow( key ); - Keyspace keyspace = cassandraArchivaManager.getKeyspace(); StringSerializer ss = StringSerializer.get(); + QueryResult<OrderedRows<String, String, String>> result = HFactory // + .createRangeSlicesQuery( keyspace, ss, ss, ss ) // + .setColumnFamily( cassandraArchivaManager.getProjectVersionMetadataFamilyName() ) // + .setColumnNames( "version" ) // + .addEqualsExpression( "repositoryName", repoId ) // + .addEqualsExpression( "namespaceId", namespace ) // + .addEqualsExpression( "projectId", projectId ) // + .addEqualsExpression( "projectVersion", projectVersion ) // + .execute(); + + for ( Row<String, String, String> row : result.get().getList() ) + { + this.projectVersionMetadataModelTemplate.deleteRow( row.getKey() ); + } + RangeSlicesQuery<String, String, String> query = HFactory // .createRangeSlicesQuery( keyspace, ss, ss, ss ) // .setColumnFamily( cassandraArchivaManager.getArtifactMetadataFamilyName() ) // @@ -2011,7 +2021,7 @@ public class CassandraMetadataRepository .addEqualsExpression( "project", projectId ) // .addEqualsExpression( "projectVersion", projectVersion ); - QueryResult<OrderedRows<String, String, String>> result = query.execute(); + result = query.execute(); for ( Row<String, String, String> row : result.get() ) { |