public class CQLConnector extends java.lang.Object implements Connector
Modifier and Type | Field and Description |
---|---|
static int |
ACTION_COUNT |
static int |
ACTION_DELETE |
static int |
ACTION_LIST |
static int |
ACTION_SELECT |
static int |
ACTION_UPDATE |
static java.lang.String |
FS |
protected java.lang.String |
hostname |
protected boolean |
isConnected |
protected java.lang.String |
keyspace |
protected java.lang.String |
password |
protected int |
port |
static java.lang.String |
RS |
protected com.datastax.driver.core.Session |
session |
protected int |
timeout |
protected java.lang.String |
uri |
protected java.lang.String |
username |
Constructor and Description |
---|
CQLConnector(java.util.Map props)
Creates new CQLConnector
|
Modifier and Type | Method and Description |
---|---|
void |
close()
closes and shutdown the Cassandra cluster
|
static java.lang.String |
doSearchReplace(java.lang.String s,
java.lang.String r,
java.lang.String text) |
static java.lang.String |
escapeJSON(java.lang.String text) |
static java.lang.String |
escapeXML(java.lang.String text) |
static java.lang.StringBuffer |
getResult(int type,
com.datastax.driver.core.ResultSet rset,
int[] rc)
It gets all the rows from the ReseulSet and packs them into a
StringBuffer according to the ResultType.
|
static java.lang.StringBuffer |
getResult(java.util.List<com.datastax.driver.core.ColumnMetadata> list,
int[] rc)
It gets all the rows from the list of ColumnMetadata and packs them into
a StringBuffer according to the ResultType.
|
java.lang.String |
getURI() |
boolean |
isConnected() |
java.lang.StringBuffer |
list(java.lang.String table,
int[] rc)
returns a string buffer with info on all columns for a specific table
|
static void |
main(java.lang.String[] args)
tests Cassandra basic operations
|
java.lang.String |
reconnect()
It reconnects and returns null or error message upon failure
|
java.lang.StringBuffer |
select(int rt,
java.lang.String cqlStr,
int[] rc)
returns selected results in string buffer for the query
|
java.lang.String |
update(java.lang.String cqlStr)
returns null for success or error msg for failure otherwise
|
protected java.lang.String hostname
protected java.lang.String keyspace
protected java.lang.String username
protected java.lang.String password
protected java.lang.String uri
protected int port
protected int timeout
protected boolean isConnected
public static final int ACTION_LIST
public static final int ACTION_COUNT
public static final int ACTION_SELECT
public static final int ACTION_UPDATE
public static final int ACTION_DELETE
public static final java.lang.String FS
public static final java.lang.String RS
protected com.datastax.driver.core.Session session
public boolean isConnected()
isConnected
in interface Connector
public java.lang.String reconnect()
public java.lang.StringBuffer list(java.lang.String table, int[] rc) throws com.datastax.driver.core.exceptions.DriverException
com.datastax.driver.core.exceptions.DriverException
public java.lang.StringBuffer select(int rt, java.lang.String cqlStr, int[] rc) throws com.datastax.driver.core.exceptions.DriverException
com.datastax.driver.core.exceptions.DriverException
public java.lang.String update(java.lang.String cqlStr)
public void close()
public static java.lang.StringBuffer getResult(int type, com.datastax.driver.core.ResultSet rset, int[] rc) throws com.datastax.driver.core.exceptions.DriverException
com.datastax.driver.core.exceptions.DriverException
public static java.lang.StringBuffer getResult(java.util.List<com.datastax.driver.core.ColumnMetadata> list, int[] rc) throws com.datastax.driver.core.exceptions.DriverException
com.datastax.driver.core.exceptions.DriverException
public static java.lang.String escapeJSON(java.lang.String text)
public static java.lang.String escapeXML(java.lang.String text)
public static java.lang.String doSearchReplace(java.lang.String s, java.lang.String r, java.lang.String text)
public static void main(java.lang.String[] args)