CQLdriver.cqlbatchwrite
— Methodfunction cqlbatchwrite(session, table, data; retries, update, counter)
Write a set of rows to a table as a prepared batch
Arguments
session::Ptr{CassSession}
: pointer to the active sessiontable::String
: the name of the table you want to write todata::DataFrame
: a DataFrame with named columnsretries::Int=5
: number of retries per batch insertupdate::DataFrame
: the arguments for WHERE during an UPDATEcounter::Bool
: for updating the counter datatype
Return
err::UInt16
: status of the batch insert
CQLdriver.cqlclose
— Methodfunction cqlclose(session, cluster) Decommission a connection and free its resources
Arguments
session::Ptr{CassSession}
: the current active sessioncluster::Ptr{CassCluster}
: the cluster associated with the active session
Return
Void
:
CQLdriver.cqlexec
— Methodfunction cqlexec(session, statement)
Execute arbitrary command to the CQL database
Arguments
session::Ptr{CassSession}
: pointer to the active sessionstatement::String
: a valid CQL command
Return
err::UInt16
: status of the command
CQLdriver.cqlfuturecheck
— Functionfunction cql_future_check(future, caller)
Check if a future contains any errors
Arguments
future::Ptr{CassFuture}
: a pointer to a futurecaller::String
: a string to help identify where this function is called from
Return
err::UInt
: a 16 bit integer with an error code. No error returns 0
CQLdriver.cqlgetvalue
— Methodfunction cqlgetvalue(val, t, strlen)
retrieve value using the correct type
Arguments
val::Ptr{CassValue}
: a returned value from a queryt::DataType
: the type of the value being extractedstrlen::Int
: for string values specify max-length of output
Return
out
: the return value, can by of any type
CQLdriver.cqlinit
— Methodfunction cqlinit(hosts; username, password, threads, connections, queuesize, bytelimit, requestlimit)
Change the performance characteristics of your CQL driver
Arguments
hosts::String
: a string with ipv4 addreses of hostsusername::String
: provide username for authenticated connectionspassword::String
: provide password for authenticated connectionsthreads::Int64
: set number of IO threads that handle query requests (default 1)connections::Int64
: set number of connections per thread (default 2)queuesize::Int64
: set queuesize that stores pending requests (default 4096)bytelimit::Int64
: set max number of bytes pending on connection (default 65536 - 64KB)requestlimit::Int64
: set max number of requests pending on connection (default 128 * connections)whitelist::String
: set whiteslist of hosts - will only connect to these hosts and all other connections will be ignored
Return
session::Ptr{CassSession}
: a pointer to the active sessioncluster::Ptr{CassCluster}
: a pointer to the clustererr::UInt
: a 16 bit integer with an error code. No error returns 0
CQLdriver.cqlread
— Methodfunction cqlread(session, query; pgsize, retries, strlen)
function cqlread(session, queries, concurrency; strlen)
Query the server for the contents of a table
session::Ptr{CassSession}
: pointer to the active sessionquery::String
: a valid SELECT queryqueries::Array{String}
: an array of valid queriesconcurrency::Int=500
: how many queries to executepgsize::Int=10000
: how many lines to pull at a timeretries::Int=5
: number of times to retry pulling a page of datatimeout::Int=10000
: time to wait for response in millisecondsstrlen::Int=128
: the maximum number of characters in a string
Return
err::UInt16
: status of the queryoutput::DataFrame
: a dataframe with named columnsoutputs::Array{DataFrame}
: an array of dataframe results
CQLdriver.cqlstatementbind
— Methodfunction cqlstatementbind(statement, pos, typ, data)
Bind data to a column in a statement for use with batch inserts
Arguments
statement::Ptr{CassStatement}
: pointer to a statementpos::Int
: what column to put data intotyp::DataType, data)
: the datatype of the data
Return
Void
:
CQLdriver.cqlstrprep
— Methodfunction cqlstrprep(table, data)
create a prepared query string for use with batch inserts
Arguments
table::String
: name of the table on the servercolumns::Array{String}
: name of the columns on the serverdata::Array{Any,1}
: an array of data to be inserted
Return
out::String
: a valid INSERT or UPDATE query
CQLdriver.cqlvaltype
— Methodcql_val_type(result, idx)
Takes a CassResult and returns the type in a given column
Arguments
result::Ptr{CassResult}
: a valid result from a queryidx::Int64
: the column to check
Return
typ
: the type of the value in the specified column
CQLdriver.cqlwrite
— Methodfunction cqlwrite(session, table, data; batchsize, retries, update, counter)
Write to a table
Arguments
session::Ptr{CassSession}
: pointer to the active sessiontable::String
: the name of the table you want to write todata::DataFrame
: a DataFrame with named columnsretries::Int=5
: number of retries per batch insertbatchsize::Int=1000
: number of rows to write per batchupdate::DataFrame
: the arguments for WHERE during an UPDATEcounter::Bool
: for updating the counter datatype
Return
err::UInt16
: status of the insert