Module cloudi_service_db_cassandra_cql

CloudI DB Cassandra CQL Module

.

Copyright © 2014 Irina Guberman

Version: 1.0.0 06/12/2014 ------------------------------------------------------------------------

Behaviours: cloudi_service.

Authors: Irina Guberman (irina.guberman@gmail.com).

Description

CloudI DB Cassandra CQL Module

CloudI layer on top of erlcql from https://github.com/rpt/erlcql.git

NOTE: set service config count_process to desired pool size

erlcql_client results will be wrapped in cloudi:send_sync result: {ok, ErlcqlClientResult}

As a result all successful responses from erlcql_client will be of the form {ok, {ok, Response}} All failures from erlcql_client will be of the form {ok, {error, Reason}}

send_sync errors will be standard 'CloudI' errors

Data Types

args()

args() = [{service_name, ServiceName::service_name()} | {connection_options, ConnectionOptions::connection_options()} | {consistency, Consistency::consistency()}]

cloudi_cql_response()

cloudi_cql_response() = response() | {error, Reason::cloudi:error_reason_sync()}

connection_options()

connection_options() = {connection_options, [{host, Host::string()} | {port, Port::integer()} | {username, Username::binary()} | {password, Password::binary()} | {use, Keyspace::binary()} | {prepare, [query_definition()]} | {keepalive, Value::boolean()} | {auto_reconnect, Value::boolean()} | {reconnect_start, Value::integer()} | {reconnect_max, Value::integer()} | {cql_version, CqlVersion::binary()} | {event_fun, EventFun::pid() | function()} | {events, Events::[event()]} | {compression, Compression::compression()} | {tracing, Tracing::boolean()} | {parent, Parent::pid()}]}

cql_name()

cql_name() = atom()

dispatcher()

dispatcher() = cloudi_service:dispatcher() | cloudi:context()

query()

query() = binary() | string()

query_definition()

query_definition() = {QueryName::cql_name(), Query::query()}

service_name()

service_name() = {service_name, ServiceName::string()}

Function Index

cloudi_service_handle_info/3
cloudi_service_handle_request/11
cloudi_service_init/3
cloudi_service_terminate/2
execute_prepared_query/4
execute_prepared_query/5
execute_query/3
execute_query/4

Function Details

cloudi_service_handle_info/3

cloudi_service_handle_info(Request, State, X3) -> any()

cloudi_service_handle_request/11

cloudi_service_handle_request(Type, Name, Pattern, RequestInfo, Request, Timeout, Priority, TransId, Pid, State, Dispatcher) -> any()

cloudi_service_init/3

cloudi_service_init(Args::args(), Prefix::string(), Dispatcher::dispatcher()) -> {ok, #state{client = pid(), consistency = consistency()}}

cloudi_service_terminate/2

cloudi_service_terminate(X1, State) -> any()

execute_prepared_query/4

execute_prepared_query(Dispatcher::dispatcher(), Name::string(), QueryName::cql_name(), Values::values()) -> cloudi_cql_response()

execute_prepared_query/5

execute_prepared_query(Dispatcher::dispatcher(), Name::string(), QueryName::cql_name(), Values::values(), Consistency::consistency()) -> cloudi_cql_response()

execute_query/3

execute_query(Dispatcher::dispatcher(), Name::string(), Query::query()) -> cloudi_cql_response()

execute_query/4

execute_query(Dispatcher::dispatcher(), Name::string(), Query::query(), Consistency::consistency()) -> cloudi_cql_response()


Generated by EDoc, Sep 30 2014, 14:07:27.