This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Cluster = require 'resty.cassandra.cluster' | |
local Auth = require 'cassandra.auth' | |
local Socket = require 'cassandra.socket' | |
Socket.force_luasocket("timer", true) | |
-- For performance reasons, the cluster variable | |
-- should live in an upvalue at the main chunk level of your | |
-- modules to avoid creating it on every request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- To run: | |
-- # cd <some-path>/lua-cassandra | |
-- # LUA_PATH="lib/?/init.lua;lib/?.lua" resty --errlog-level info --shdict 'cassandra 1m' cloud.lua | |
local Cluster = require 'resty.cassandra.cluster' | |
local Auth = require 'cassandra.auth' | |
local Socket = require 'cassandra.socket' | |
-- Use luasocket | |
Socket.force_luasocket("timer", true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'NetworkTopologyStrategy', 'dc1': '1'}; | |
CREATE TYPE IF NOT EXISTS test.mytype(a int, b text); | |
CREATE TABLE IF NOT EXISTS test.table_nulls (key text, s set<int>, m map<text, int>, l list<text>, t tuple<int, text>, u mytype, PRIMARY KEY(key)); | |
// set | |
INSERT INTO test.table_nulls (key, s) VALUES ('set_null', {null}) ; | |
// list | |
INSERT INTO test.table_nulls (key, l) VALUES ('list_null', {null}) ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdbool.h> | |
#include <stdio.h> /* FIXME: Remove header */ | |
#include <string.h> /* FIXME: Remove header */ | |
#define CASS_INET_V6_LENGTH 16 | |
#define CASS_VALUE_TYPE_MAPPING(XX) \ | |
XX(CASS_VALUE_TYPE_CUSTOM, 0x0000, "", "") \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gen_rootCa_cert.conf | |
[ req ] | |
distinguished_name = req_distinguished_name | |
prompt = no | |
output_password = password | |
default_bits = 2048 | |
[ req_distinguished_name ] | |
C = US | |
O = Datastax |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <exception> | |
#include <functional> | |
#include <future> | |
namespace datastax { | |
class StringRef { | |
public: | |
StringRef(const char* str) {} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) DataStax, Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <memory> | |
#include <tuple> | |
class Allocated {}; | |
class Callback : public Allocated { | |
public: | |
virtual ~Callback() {} | |
virtual void run() = 0; |