Skip to content

Instantly share code, notes, and snippets.

View beltran's full-sized avatar

Jaume Marhuenda beltran

  • Google LLC
  • New York
View GitHub Profile
import re
import cassandra
from cassandra.protocol import cython_protocol_handler
def name_from_module(module):
return module.__name__.split(".")[1]
from cassandra.cluster import Cluster
from cassandra.concurrent import execute_concurrent, query_by_keys
from cassandra.policies import TokenAwarePolicy, DCAwareRoundRobinPolicy
from itertools import repeat, cycle
from collections import defaultdict
import time
import six
from bokeh.plotting import figure, output_file, show
cluster = Cluster(load_balancing_policy=TokenAwarePolicy(DCAwareRoundRobinPolicy(), shuffle_replicas=False))
import cProfile, pstats, StringIO
from itertools import cycle
from cassandra.concurrent import execute_concurrent
from cassandra.cluster import Cluster
concurrency = 50
TABLE = "testtable"
KEYSPACE = "testkeyspace"
from dse_graph import DseGraph, graph_traversal_row_factory
from dse_graph.serializers import IntegerSerializer
from dse.cluster import EXEC_PROFILE_GRAPH_DEFAULT, EXEC_PROFILE_GRAPH_ANALYTICS_DEFAULT
from gremlin_python.structure.io.graphson import GraphSONUtil
from dse.cluster import Cluster
cluster = Cluster()
import asyncore, socket
import time
_dispatcher_map = {}
def create_socket():
host = "127.0.0.1"
port = 5007
addresses = socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM)
sockerr = None
from cassandra.cluster import Cluster
cluster = Cluster()
def context():
session = cluster.connect(wait_for_all_pools=True)
context()
for connections in [o.get_connections() for o in cluster.get_connection_holders()]:
import time
import logging
from cassandra.cluster import Cluster
from cassandra.policies import RoundRobinPolicy
from tests.integration.simulacron.utils import SimulacronClient, PrimeOptions
from tests.integration.simulacron.utils import SimulacronServer, prime_cluster, NO_THEN
import asyncore, socket
from threading import Thread, Event
_dispatcher_map = {}
class Client(asyncore.dispatcher):
def __init__(self, host, port, message):
self._event = Event()
self.message = message
import time
from ccmlib.cluster import Cluster as CCMCluster
from cassandra.io.asyncorereactor import AsyncoreConnection
from cassandra.io.libevreactor import LibevConnection
from cassandra import ConsistencyLevel
from cassandra.protocol import QueryMessage
import logging
connection_class = AsyncoreConnection
import time
import concurrent.futures
import resource
from guppy import hpy
import weakref
class Object:
pass
class BigObject(object):