Skip to content

Instantly share code, notes, and snippets.

/**
* @file Defines the API for a QueryRewriter.
*/
namespace drizzled
{
namespace plugin
{
<service_bundle type='manifest' name='oracle-listener-instance'>
<service
name='application/oracle/listener'
type='service'
version='1'>
<!-- The SMF instance name MUST match the listener instance -->
<instance name='LISTENER' enabled='false'>
<method_context
working_directory='/u01/app/oracle/product/10.2.0/db_1'
<service_bundle type='manifest' name='oracle-database-instance'>
<service
name='application/oracle/database'
type='service'
version='1'>
<!-- The SMF instance name MUST match the database instance -->
<instance name='orcl1' enabled='false'>
<method_context
working_directory='/u01/app/oracle/product/10.2.0/db_1'
<!--
~ Addresses of hosts that are deemed contact points. Cassandra nodes
~ use this list of hosts to find each other and learn the topology of
~ the ring. You must change this if you are running multiple nodes!
-->
<Seeds>
<Seed>cass01</Seed>
<Seed>cass02</Seed>
<Seed>cass03</Seed>
</Seeds>
<!--
~ Directories: Specify where Cassandra should store different data on
~ disk. Keep the data disks and the CommitLog disks separate for best
~ performance
-->
<CommitLogDirectory>/u02/cassandra/commitlog</CommitLogDirectory>
<DataFileDirectories>
<DataFileDirectory>/u01/cassandra/data</DataFileDirectory>
</DataFileDirectories>
<CalloutLocation>/opt/cassandra/callouts</CalloutLocation>
try
{
/* check memcached first */
if (isMemcachedUsed())
{
getCache()->get(key, ret_val);
if (! ret_val.empty())
{
return true;
}
/* various ways to construct a memcached client */
memcache::Memcache first_client("server:11211");
memcache::Memcache second_client("server1:11211 server2:11211");
memcache::Memcache third_client("server", port_num);
/* basic operations */
first_client.set("key", some_vector_of_chars, time_to_live, flags);
first_client.get("key", some_vector_to_fill_with_data);
first_client.remove("key");
void setAllProducts(vector<Product> &products)
{
vector<char> raw_products(products.size() * sizeof(Product));
memcpy(&raw_products[0], &products[0], products.size() * sizeof(Product));
MyCache::singleton().set("AllProducts", raw_products);
}
vector<Product> getAllProducts()
{
vector<char> raw_products = MyCache::singleton().get("AllProducts");
#include <vector>
#include <string>
#include <algorithm>
#include <string.h>
#include <libmemcached/memcached.hpp>
class MyCache
{
posulliv@aghadoe:~/repos/drizzle/local-build$ ./debug.sh $PWD
Drizzle is not already running...
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb) break main