forked from thinkaurelius/titan
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since this is a feature, it has been moved to the titan0.1 branch.
This reverts commit 0d8b54a.
- Loading branch information
1 parent
11c0b78
commit 8b4caae
Showing
12 changed files
with
204 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 36 additions & 2 deletions
38
...java/com/thinkaurelius/titan/diskstorage/astyanax/ExternalAstyanaxKeyColumnValueTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,53 @@ | ||
package com.thinkaurelius.titan.diskstorage.astyanax; | ||
|
||
import org.junit.BeforeClass; | ||
|
||
import com.netflix.astyanax.AstyanaxContext; | ||
import com.netflix.astyanax.Cluster; | ||
import com.netflix.astyanax.connectionpool.NodeDiscoveryType; | ||
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException; | ||
import com.netflix.astyanax.connectionpool.impl.ConnectionPoolConfigurationImpl; | ||
import com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor; | ||
import com.netflix.astyanax.impl.AstyanaxConfigurationImpl; | ||
import com.netflix.astyanax.thrift.ThriftFamilyFactory; | ||
import com.thinkaurelius.titan.StorageSetup; | ||
import com.thinkaurelius.titan.diskstorage.KeyColumnValueStoreTest; | ||
import com.thinkaurelius.titan.diskstorage.StorageManager; | ||
import com.thinkaurelius.titan.testutil.CassandraUtil; | ||
|
||
public class ExternalAstyanaxKeyColumnValueTest extends KeyColumnValueStoreTest { | ||
|
||
private static Cluster cluster; | ||
|
||
@BeforeClass | ||
public static void connectToClusterForCleanup() { | ||
AstyanaxContext<Cluster> ctx = new AstyanaxContext.Builder() | ||
.forCluster(AstyanaxStorageManager.CLUSTER_DEFAULT) | ||
.withAstyanaxConfiguration( | ||
new AstyanaxConfigurationImpl() | ||
.setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)) | ||
.withConnectionPoolConfiguration( | ||
new ConnectionPoolConfigurationImpl("MyConnectionPool") | ||
.setPort(9160).setMaxConnsPerHost(16) | ||
.setSeeds("localhost")) | ||
.withConnectionPoolMonitor(new CountingConnectionPoolMonitor()) | ||
.buildCluster(ThriftFamilyFactory.getInstance()); | ||
|
||
cluster = ctx.getEntity(); | ||
ctx.start(); | ||
} | ||
|
||
@Override | ||
public StorageManager openStorageManager() { | ||
return new AstyanaxStorageManager(StorageSetup.getLocalStorageConfiguration()); | ||
} | ||
|
||
@Override | ||
public void cleanUp() { | ||
CassandraUtil.dropKeyspace(AstyanaxStorageManager.KEYSPACE_DEFAULT); | ||
try { | ||
cluster.dropKeyspace(AstyanaxStorageManager.KEYSPACE_DEFAULT); | ||
AstyanaxStorageManager.clearKeyspaces(); | ||
} catch (ConnectionException e) { | ||
// throw new RuntimeException(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.