Package org.datanucleus.store.cassandra
Class ConnectionFactoryImpl
- java.lang.Object
-
- org.datanucleus.store.connection.AbstractConnectionFactory
-
- org.datanucleus.store.cassandra.ConnectionFactoryImpl
-
- All Implemented Interfaces:
org.datanucleus.store.connection.ConnectionFactory
public class ConnectionFactoryImpl extends org.datanucleus.store.connection.AbstractConnectionFactory
Connection factory for Cassandra datastores. Accepts a URL of the formcassandra:[host1:port[,host2[,host3]]]
Defaults to a server of "127.0.0.1" if no host/port specified. Defaults to a single Session per PMF/EMF, but can be overridden using "datanucleus.cassandra.sessionPerManager".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ConnectionFactoryImpl.ManagedConnectionImpl
-
Field Summary
Fields Modifier and Type Field Description static String
CASSANDRA_COMPRESSION
static String
CASSANDRA_CONNECTION_PER_MANAGER
static String
CASSANDRA_LOAD_BALANCING_POLICY
static String
CASSANDRA_LOAD_BALANCING_POLICY_TOKEN_AWARE_LOCAL_DC
static String
CASSANDRA_METRICS
static String
CASSANDRA_SOCKET_CONNECT_TIMEOUT_MILLIS
static String
CASSANDRA_SOCKET_READ_TIMEOUT_MILLIS
static String
CASSANDRA_SSL
-
Constructor Summary
Constructors Constructor Description ConnectionFactoryImpl(org.datanucleus.store.StoreManager storeMgr, String resourceType)
Constructor for a factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
org.datanucleus.store.connection.ManagedConnection
createManagedConnection(org.datanucleus.ExecutionContext ec, Map options)
Obtain a connection from the Factory.
-
-
-
Field Detail
-
CASSANDRA_CONNECTION_PER_MANAGER
public static final String CASSANDRA_CONNECTION_PER_MANAGER
- See Also:
- Constant Field Values
-
CASSANDRA_COMPRESSION
public static final String CASSANDRA_COMPRESSION
- See Also:
- Constant Field Values
-
CASSANDRA_METRICS
public static final String CASSANDRA_METRICS
- See Also:
- Constant Field Values
-
CASSANDRA_SSL
public static final String CASSANDRA_SSL
- See Also:
- Constant Field Values
-
CASSANDRA_SOCKET_READ_TIMEOUT_MILLIS
public static final String CASSANDRA_SOCKET_READ_TIMEOUT_MILLIS
- See Also:
- Constant Field Values
-
CASSANDRA_SOCKET_CONNECT_TIMEOUT_MILLIS
public static final String CASSANDRA_SOCKET_CONNECT_TIMEOUT_MILLIS
- See Also:
- Constant Field Values
-
CASSANDRA_LOAD_BALANCING_POLICY
public static final String CASSANDRA_LOAD_BALANCING_POLICY
- See Also:
- Constant Field Values
-
CASSANDRA_LOAD_BALANCING_POLICY_TOKEN_AWARE_LOCAL_DC
public static final String CASSANDRA_LOAD_BALANCING_POLICY_TOKEN_AWARE_LOCAL_DC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConnectionFactoryImpl
public ConnectionFactoryImpl(org.datanucleus.store.StoreManager storeMgr, String resourceType)
Constructor for a factory.- Parameters:
storeMgr
- StoreManagerresourceType
- Resource type (not of relevance since we use a single factory)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceorg.datanucleus.store.connection.ConnectionFactory
- Overrides:
close
in classorg.datanucleus.store.connection.AbstractConnectionFactory
-
createManagedConnection
public org.datanucleus.store.connection.ManagedConnection createManagedConnection(org.datanucleus.ExecutionContext ec, Map options)
Obtain a connection from the Factory. The connection will be enlisted within the transaction associated to the ExecutionContext- Parameters:
ec
- the pool that is bound the connection during its lifecycle (or null)options
- Any options for then creating the connection (currently ignored)- Returns:
- the
ManagedConnection
-
-