Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ public void serializeRoundTrip_CurrentVersion()
entry.getOriginUrl(), entry.getPath(), entry.getEffect(), entry.getSize(),
entry.getMd5(), entry.getSha1(), entry.getSha256() );

test.setTimestamps( entry.getTimestamps() );

ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream( baos );
oos.writeObject( entry );
Expand Down
2 changes: 1 addition & 1 deletion embedder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
<configuration>
<startNativeTransport>true</startNativeTransport>
<cqlVersion>3.4.4</cqlVersion>
<maxMemory>1024</maxMemory>
<maxMemory>2048</maxMemory>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ protected int getTestTimeoutMultiplier()
public void stop()
throws IndyLifecycleException
{
dropKeyspace();
closeCacheProvider();
closeQuietly( fixture );
closeQuietly( client );
Expand All @@ -201,7 +202,6 @@ public void stop()
// TODO: this is a hack due to the "shutdown action not executed" issue. Once propulsor lifecycle shutdown is applied, this can be replaced.
private void closeCacheProvider()
{
dropKeyspace();
if ( cacheProvider != null )
{
cacheProvider.asAdminView().close();
Expand All @@ -225,6 +225,7 @@ private void dropKeyspace()
logger.warn( "Failed to drop keyspace: {}, reason: {}", keyspace, ex );
}
}
cassandraClient.close();
}

protected void sleepAndRunFileGC( long milliseconds )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class CassandraClient

private Session session;

private Cluster cluster;

public CassandraClient()
{
}
Expand Down Expand Up @@ -67,7 +69,9 @@ private void init()
logger.debug( "Build with credentials, user: {}, pass: ****", username );
builder.withCredentials( username, password );
}
Cluster cluster = builder.build();

cluster.getConfiguration().getSocketOptions().setConnectTimeoutMillis( 30000 );
cluster = builder.build();

logger.debug( "Connecting to Cassandra, host:{}, port:{}", host, port );
session = cluster.connect();
Expand All @@ -82,4 +86,19 @@ public Session getSession()
{
return session;
}

private volatile boolean closed;

public void close()
{
if ( !closed && cluster != null && session != null )
{
logger.debug( "Close cassandra client" );
session.close();
cluster.close();
session = null;
cluster = null;
closed = true;
}
}
}