diff options
author | Martin Stockhammer <martin_s@apache.org> | 2021-08-29 12:11:06 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2021-08-29 12:11:06 +0200 |
commit | 20918cb383892f8f79322fb2889262074efe0383 (patch) | |
tree | a98b87e9e49c8feb4c1c47cf721052d6f8044114 /archiva-modules | |
parent | 699920cb8958b4436cbb16d27616d30ca98ba59b (diff) | |
download | archiva-20918cb383892f8f79322fb2889262074efe0383.tar.gz archiva-20918cb383892f8f79322fb2889262074efe0383.zip |
Changing timeout parameter for cassandra driver
Diffstat (limited to 'archiva-modules')
3 files changed, 10 insertions, 6 deletions
diff --git a/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java b/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java index 085f3e205..720f1a912 100644 --- a/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java +++ b/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java @@ -129,6 +129,9 @@ public class DefaultCassandraArchivaManager @Value( "${cassandra.maxActive}" ) private int maxActive; + @Value( "${cassandra.driverTimeoutMs}" ) + private int driverTimeoutMs; + @Value( "${cassandra.readConsistencyLevel}" ) private String readConsistencyLevel; @@ -186,7 +189,7 @@ public class DefaultCassandraArchivaManager .withInt( DefaultDriverOption.CONNECTION_POOL_REMOTE_SIZE, maxActive ) //.withInt( DefaultDriverOption.CONNECTION_MAX_REQUESTS, maxActive ) .withString( DefaultDriverOption.REQUEST_CONSISTENCY, readConsistencyLevel ) - .withDuration( DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds( 10 ) ) + .withDuration( DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofMillis( driverTimeoutMs ) ) .build( ); { diff --git a/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/resources/default-archiva-cassandra.properties b/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/resources/default-archiva-cassandra.properties index e55a955b8..220e501a2 100644 --- a/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/resources/default-archiva-cassandra.properties +++ b/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/resources/default-archiva-cassandra.properties @@ -24,5 +24,6 @@ cassandra.writeConsistencyLevel=QUORUM cassandra.replicationFactor=1 cassandra.keyspace.name=ArchivaKeySpace cassandra.cluster.name=archiva +cassandra.driverTimeoutMs=20000 archiva.cassandra.configuration.file=./archiva-cassandra.properties
\ No newline at end of file diff --git a/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java b/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java index 491edc2f0..4ab388149 100644 --- a/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java +++ b/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java @@ -92,9 +92,9 @@ public class CassandraMetadataRepositoryTest throws Exception { cTime = System.currentTimeMillis( ); - System.err.println( "Setting up "+(testNum++) + " - " + testInfo.getDisplayName() ); + System.err.println( "Setting up - "+(testNum++) + " - " + testInfo.getDisplayName() + " - 0ms"); super.setUp(); - System.err.println( "Setting up 2 " + testInfo.getDisplayName( ) + " - " + (System.currentTimeMillis( ) - cTime) ); + System.err.println( "Setting up - " + testInfo.getDisplayName( ) + " - " + (System.currentTimeMillis( ) - cTime) +"ms"); assertMaxTries =1; assertRetrySleepMs=10; @@ -124,7 +124,7 @@ public class CassandraMetadataRepositoryTest clearReposAndNamespace( cassandraArchivaManager ); clearedTables.set( true ); } - System.err.println( "Finished setting up "+testInfo.getDisplayName() + " - " + (System.currentTimeMillis( ) - cTime) ); + System.err.println( "Finished setting up - "+testInfo.getDisplayName() + " - " + (System.currentTimeMillis( ) - cTime) +"ms"); } /** @@ -163,11 +163,11 @@ public class CassandraMetadataRepositoryTest public void shutdown(TestInfo testInfo) throws Exception { - System.err.println( "Shutting down " + testInfo.getDisplayName( ) + " - " + ( System.currentTimeMillis( ) - cTime ) ); + System.err.println( "Shutting down - " + (testNum-1) + " - " + testInfo.getDisplayName( ) + " - " + ( System.currentTimeMillis( ) - cTime ) +"ms"); clearReposAndNamespace( cassandraArchivaManager ); clearedTables.set( true ); super.tearDown(); - System.err.println( "Shutting down finished" + testInfo.getDisplayName( ) + " - " + ( System.currentTimeMillis( ) - cTime ) ); + System.err.println( "Shutting down finished - " + testInfo.getDisplayName( ) + " - " + ( System.currentTimeMillis( ) - cTime ) +"ms"); } static void clearReposAndNamespace( CassandraArchivaManager cassandraArchivaManager ) |