Skip to content
Permalink
Browse files
Changing timeout parameter for cassandra driver
  • Loading branch information
effrafax committed Aug 29, 2021
1 parent 699920c commit 20918cb383892f8f79322fb2889262074efe0383
Showing 3 changed files with 10 additions and 6 deletions.
@@ -129,6 +129,9 @@
@Value( "${cassandra.maxActive}" )
private int maxActive;

@Value( "${cassandra.driverTimeoutMs}" )
private int driverTimeoutMs;

@Value( "${cassandra.readConsistencyLevel}" )
private String readConsistencyLevel;

@@ -186,7 +189,7 @@ public void initialize( )
.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( );

{
@@ -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
@@ -92,9 +92,9 @@ public void setUp( TestInfo testInfo )
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 void setUp( TestInfo testInfo )
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 void clean_dependant_tables()
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 )

0 comments on commit 20918cb

Please sign in to comment.