Skip to content

Instantly share code, notes, and snippets.

@tgruben
tgruben / cass.py
Created October 16, 2014 16:04
Python Cassandra Test
from cassandra.cluster import Cluster
cluster = Cluster()
session = cluster.connect('hotbox')
stmt = session.prepare('INSERT INTO bitmap ( bitmap_id, db, frame, slice , filter, ChunkKey, BlockIndex, block) VALUES (?,?,?,?,?,?,?,?);')
data=[(8192,'007','b.n',0,0,0,0,1),
(8192,'007','b.n',0,0,-1,0,1),
(8192,'007','b.n',0,0,0,0,3),
(8192,'007','b.n',0,0,-1,0,2),
(8192,'007','b.n',0,0,0,0,7),
@tgruben
tgruben / cass.go
Created October 16, 2014 16:01
Go Cassandra Test
package main
import (
"fmt"
"github.com/gocql/gocql"
"time"
)
type bm struct {
id int64
@tgruben
tgruben / build notes
Created September 17, 2012 20:52
Issue with Parent Child counting
curl -XPOST http://localhost:9200/parent_child --data-binary @mapping.json
curl -XPOST http://localhost:9200/_bulk --data-binary @bulk.json
curl -XPOST http://localhost:9200/parent_child/profile/_search -d'{"query":{"has_child": {"query": {"term": {"tag": 110475388978628}}, "type": "segment"}}}'
curl -XPOST http://localhost:9200/parent_child/profile/_count -d'{"query":{"has_child": {"query": {"term": {"tag": 110475388978628}}, "type": "segment"}}}'