<commit_before>import time
import logging
import types
import pprint
import hashlib


from dtest import Tester
from tools import *
from assertions import *
from ccmlib.cluster import Cluster
from ccmlib import common as ccmcommon

from loadmaker import LoadMaker

import pycassa
import pycassa.system_manager as system_manager

# NOTE: with nosetests, use the --nologcapture flag to let logging get through.
# then set the logging level here.
# A logging-level of DEBUG will show the load being created.
logging.basicConfig(level=logging.INFO)
logging.info("Starting...")


class TestGlobalRowKeyCache(Tester):

    def __init__(self, *argv, **kwargs):
        super(TestGlobalRowKeyCache, self).__init__(*argv, **kwargs)
        # When a node goes down under load it prints an error in it's log. 
        # If we don't allow log errors, then the test will fail.
#        self.allow_log_errors = True

    def functional_test(self):
        """
        Test that save and load work in the situation when you write to
        different CFs. Read 2 or 3 times to make sure the page cache doesn't
        skew the results.
        """

        # create some rows to insert
        NUM_INSERTS = 1000
        NUM_UPDATES = 100
        NUM_DELETES = 10

        cluster = self.cluster
        cluster.set_cassandra_dir(git_branch='trunk')
#        cluster.set_cassandra_dir(cassandra_version='1.0.7')
        cluster.populate(3)
        node1 = cluster.nodelist()[0]

        for kcsim in (0, 10):
            for rcsim in (0, 10):
                setup_name = "%d_%d" % (kcsim, rcsim)
                ks_name = 'ks_' + setup_name
                cf_name = 'cf_' + setup_name

                print "setup", setup_name
                cluster.set_configuration_options(values={
                        'key_cache_size_in_mb': kcsim,
                        'row_cache_size_in_mb': rcsim,
                        'row_cache_save_period': 5,
                        'key_cache_save_period': 5,
                        })
                cluster.start()<commit_msg>set to use git branch cassandra-1.1<commit_after>import time
import logging
import types
import pprint
import hashlib


from dtest import Tester
from tools import *
from assertions import *
from ccmlib.cluster import Cluster
from ccmlib import common as ccmcommon

from loadmaker import LoadMaker

import pycassa
import pycassa.system_manager as system_manager

# NOTE: with nosetests, use the --nologcapture flag to let logging get through.
# then set the logging level here.
# A logging-level of DEBUG will show the load being created.
logging.basicConfig(level=logging.INFO)
logging.info("Starting...")


class TestGlobalRowKeyCache(Tester):

    def __init__(self, *argv, **kwargs):
        super(TestGlobalRowKeyCache, self).__init__(*argv, **kwargs)
        # When a node goes down under load it prints an error in it's log. 
        # If we don't allow log errors, then the test will fail.
#        self.allow_log_errors = True

    def functional_test(self):
        """
        Test that save and load work in the situation when you write to
        different CFs. Read 2 or 3 times to make sure the page cache doesn't
        skew the results.
        """

        # create some rows to insert
        NUM_INSERTS = 1000
        NUM_UPDATES = 100
        NUM_DELETES = 10

        cluster = self.cluster
        cluster.set_cassandra_dir(git_branch='cassandra-1.1')
#        cluster.set_cassandra_dir(cassandra_version='1.0.7')
        cluster.populate(3)
        node1 = cluster.nodelist()[0]

        for kcsim in (0, 10):
            for rcsim in (0, 10):
                setup_name = "%d_%d" % (kcsim, rcsim)
                ks_name = 'ks_' + setup_name
                cf_name = 'cf_' + setup_name

                print "setup", setup_name
                cluster.set_configuration_options(values={
                        'key_cache_size_in_mb': kcsim,
                        'row_cache_size_in_mb': rcsim,
                        'row_cache_save_period': 5,
                        'key_cache_save_period': 5,
                        })
                cluster.start()
{'fraction_non_alphanumeric': 0.07673745173745174, 'fraction_numerical': 0.013030888030888031, 'mean_word_length': 2.2032457496136013, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1754758', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1163, 'n_words': 382}