/** * {@inheritDoc} */ @Override protected DseCluster createCluster(ClusterIdentifier ci) { return DseUtils.newDseCluster(ci.hostsAndPorts, ci.username, ci.password, ci.authorizationId, getConfiguration()); }
/** * Create a {@link Cluster} instance. * * @param ci * @return * @since 0.4.0 */ protected Cluster createCluster(ClusterIdentifier ci) { return CqlUtils.newCluster(ci.hostsAndPorts, ci.username, ci.password, getConfiguration()); }
/** * Obtain a Cassandra session instance using {@link #defaultHostsAndPorts}, * {@link #defaultUsername}, {@link #defaultPassword} and {@link #defaultKeyspace}. * * @return * @since 0.4.0 */ public Session getSession() { return getSession(false); }
/** * Prepare a CQL query. * * <p> * The default session (obtained via {@link #getSession()} is used to prepare the CQL query. * </p> * * @param cql * @return * @since 0.4.0 */ public PreparedStatement prepareStatement(String cql) { return CqlUtils.prepareStatement(getSession(), cql); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param stm * @param bindValues * @return */ public static ResultSet execute(Session session, PreparedStatement stm, Object... bindValues) { return execute(session, stm, (ConsistencyLevel) null, bindValues); }
/** * Execute a SELECT query and returns just one row. * * @param session * @param stm * @return * @since 0.4.0.2 */ public static Row executeOne(Session session, Statement stm) { return executeOne(session, stm, null); }
/** * Bind values to a {@link PreparedStatement}. * * @param stm * @param values * @return * @since 0.4.0 */ public BoundStatement bindValues(PreparedStatement stm, Map<String, Object> values) { return CqlUtils.bindValues(stm, values); }
/** * Execute batches of statements. * * @param session * @param statements * @return * @since 0.3.1 */ public static ResultSet executeBatch(Session session, Statement... statements) { return executeBatch(session, null, null, statements); }
/** * Delegates to * {@link #setCoreConnectionsPerHost(HostDistance.REMOTE, value)} * * @param value * @return */ public BeanPoolingOptions setCoreConnectionsPerRemoteHost(int value) { setCoreConnectionsPerHost(HostDistance.REMOTE, value); return this; }
/** * Delegates to {@link #getMaxRequestsPerConnection(HostDistance.LOCAL)}. * * @return */ public int getMaxRequestsPerLocalConnection() { return getMaxRequestsPerConnection(HostDistance.LOCAL); }
/** * {@inheritDoc} */ @Override public DseSession getSession(String hostsAndPorts, String username, String password, String keyspace, boolean forceNew) { return getSession(hostsAndPorts, username, password, null, keyspace, forceNew); }
/** * Delegates to {@link #getCoreConnectionsPerHost(HostDistance.LOCAL)} * * @return */ public int getCoreConnectionsPerLocalHost() { return getCoreConnectionsPerHost(HostDistance.LOCAL); }
/** * Delegates to {@link #setMaxConnectionsPerHost(HostDistance.LOCAL, value)} * * @param value * @return */ public BeanPoolingOptions setMaxConnectionsPerLocalHost(int value) { setMaxConnectionsPerHost(HostDistance.LOCAL, value); return this; }
/** * Delegates to * {@link #setMaxRequestsPerConnection(HostDistance.LOCAL, value)}. * * @param value * @return */ public BeanPoolingOptions setMaxRequestsPerLocalConnection(int value) { setMaxRequestsPerConnection(HostDistance.LOCAL, value); return this; }
/** * Delegates to * {@link #setNewConnectionThreshold(HostDistance.REMOTE, value)} * * @param value * @return */ public BeanPoolingOptions setNewConnectionThresholdRemote(int value) { setNewConnectionThreshold(HostDistance.REMOTE, value); return this; } }
/** * Delegates to {@link #getNewConnectionThreshold(HostDistance.REMOTE)}. * * @return */ public int getNewConnectionThresholdRemote() { return getNewConnectionThreshold(HostDistance.REMOTE); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param cql * @param bindValues * @return * @since 0.3.0 */ public static ResultSet execute(Session session, String cql, Map<String, Object> bindValues) { return execute(session, cql, (ConsistencyLevel) null, bindValues); }
/** * Delegates to * {@link #setCoreConnectionsPerHost(HostDistance.LOCAL, value)} * * @param value * @return */ public BeanPoolingOptions setCoreConnectionsPerLocalHost(int value) { setCoreConnectionsPerHost(HostDistance.LOCAL, value); return this; }
/** * Delegates to {@link #getMaxRequestsPerConnection(HostDistance.REMOTE)}. * * @return */ public int getMaxRequestsPerRemoteConnection() { return getMaxRequestsPerConnection(HostDistance.REMOTE); }
/** * {@inheritDoc} */ @Override public DseSession getSession() { return getSession(false); }