On Tue, Mar 8, 2016 at 8:39 PM, Jean Carlo <jean.jeancar...@gmail.com> wrote:
> Hi guys, > > I use cassandra stress to populate the next table > > CREATE TABLE cf1 ( > kvalue text, > ktype text, > prov text, > dname text, > dattrib blob, > dvalue text, > PRIMARY KEY (kvalue, ktype, prov, dname) > ) WITH bloom_filter_fp_chance = 0.01 > AND caching = '{"keys":"ALL", "rows_per_partition":"60"}' > AND comment = '' > AND compaction = {'class': > 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'} > AND compression = {'sstable_compression': > 'org.apache.cassandra.io.compress.SnappyCompressor'} > AND dclocal_read_repair_chance = 0.02 > AND default_time_to_live = 0 > AND gc_grace_seconds = 864000 > AND max_index_interval = 2048 > AND memtable_flush_period_in_ms = 0 > AND min_index_interval = 128 > AND read_repair_chance = 0.01 > AND speculative_retry = '99.0PERCENTILE'; > > And cassandra stress create the next string to the field kvalue of type > text: > > "P*d,xY\x03m\x1b\x10\x0b$\x04pt-G\x08\n`7\x1fs\x15kH\x02i1\x16jf%YM" > > what bothers me is that kvalue has control characters like \x03. do you > guys know any way to avoid creating this kind of characters while using > cassandra-stress? > > > > Thank you very much > > Jean Carlo > > "The best way to predict the future is to invent it" Alan Kay > There is no way to avoid the control characters (<32 and ==127), other than modifying the source code, which is located in tools/stress/src/org/apache/cassandra/stress/generate/values/Strings.java. Changing this line: chars[i++] = (char) (((v & 127) + 32) & 127); with this: chars[i++] = (char) (((v & 127) % 95) + 32); should work but I could not avoid the expensive modulo operation. You can rebuild cassandra-stress with ant stress-build. I wonder if the original intention was to avoid control characters however, given the +32 in the original line. For this reason I've copied this message to the dev mailing list. -- [image: datastax_logo.png] <http://www.datastax.com/> Stefania Alborghetti Apache Cassandra Software Engineer |+852 6114 9265| stefania.alborghe...@datastax.com