<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>DataStax Support Forums &#187; Topic: Question with integer type key of cassandra, different from where I inserted by Java.</title>
		<link>http://www.datastax.com/support-forums/topic/question-with-integer-type-key-of-cassandra-different-from-where-i-inserted-by-java</link>
		<description>Software, Support, and Training for Apache Cassandra</description>
		<language>en-US</language>
		<pubDate>Wed, 19 Jun 2013 04:50:18 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.3</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.datastax.com/support-forums/search.php</link>
		</textInput>
		<atom:link href="http://www.datastax.com/support-forums/rss/topic/question-with-integer-type-key-of-cassandra-different-from-where-i-inserted-by-java" rel="self" type="application/rss+xml" />

		<item>
			<title>Anonymous on "Question with integer type key of cassandra, different from where I inserted by Java."</title>
			<link>http://www.datastax.com/support-forums/topic/question-with-integer-type-key-of-cassandra-different-from-where-i-inserted-by-java#post-1388</link>
			<pubDate>Mon, 19 Mar 2012 09:26:13 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1388@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Thanks a lot. Yes, I use thrift directly. Because it is faster than hector as we tested.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>nickmbailey on "Question with integer type key of cassandra, different from where I inserted by Java."</title>
			<link>http://www.datastax.com/support-forums/topic/question-with-integer-type-key-of-cassandra-different-from-where-i-inserted-by-java#post-1140</link>
			<pubDate>Tue, 14 Feb 2012 20:32:03 +0000</pubDate>
			<dc:creator>nickmbailey</dc:creator>
			<guid isPermaLink="false">1140@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Are you just using thrift directly? You should almost certainly be using a high level client instead. See &#60;a href=&#34;https://github.com/rantav/hector&#34; rel=&#34;nofollow&#34;&#62;https://github.com/rantav/hector&#60;/a&#62; for a good java client.&#60;/p&#62;
&#60;p&#62;To answer your question, yes the problem is you are inserting the string &#34;1&#34; rather than the integer 1. In your example your java code would be something like:&#60;/p&#62;
&#60;p&#62;ByteBuffer b = ByteBuffer.allocate(4)&#60;br /&#62;
b.putInt(4)&#60;br /&#62;
client.insert(b.....)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Question with integer type key of cassandra, different from where I inserted by Java."</title>
			<link>http://www.datastax.com/support-forums/topic/question-with-integer-type-key-of-cassandra-different-from-where-i-inserted-by-java#post-1138</link>
			<pubDate>Tue, 14 Feb 2012 02:53:14 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1138@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;In short the key, get from console if different from which I wrote in Java.&#60;/p&#62;
&#60;p&#62;Detail:&#60;br /&#62;
Schema of the CF:&#60;/p&#62;
&#60;p&#62;create column family books&#60;br /&#62;
  with column_type = 'Standard'&#60;br /&#62;
  and comparator = 'IntegerType'&#60;br /&#62;
  and default_validation_class = 'IntegerType'&#60;br /&#62;
  and key_validation_class = 'IntegerType'&#60;br /&#62;
  and rows_cached = 0.0&#60;br /&#62;
  and row_cache_save_period = 0&#60;br /&#62;
  and row_cache_keys_to_save = 2147483647&#60;br /&#62;
  and keys_cached = 200000.0&#60;br /&#62;
  and key_cache_save_period = 14400&#60;br /&#62;
  and read_repair_chance = 1.0&#60;br /&#62;
  and gc_grace = 864000&#60;br /&#62;
  and min_compaction_threshold = 4&#60;br /&#62;
  and max_compaction_threshold = 32&#60;br /&#62;
  and replicate_on_write = true&#60;br /&#62;
  and row_cache_provider = 'SerializingCacheProvider'&#60;br /&#62;
  and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy';&#60;/p&#62;
&#60;p&#62;In Java I wrote:&#60;br /&#62;
nameColumn.setTimestamp(System.currentTimeMillis());&#60;br /&#62;
lastColumn.setTimestamp(System.currentTimeMillis());&#60;br /&#62;
ageColumn.setTimestamp(System.currentTimeMillis());&#60;/p&#62;
&#60;p&#62;nameColumn.setValue((&#34;fullName&#34; + i).getBytes(UTF8));&#60;br /&#62;
lastColumn.setValue((&#34;address&#34; + i).getBytes(UTF8));&#60;br /&#62;
ageColumn.setValue((&#34;password&#34; + i).getBytes(UTF8));&#60;/p&#62;
&#60;p&#62;client.insert(ByteBuffer.wrap(&#34;1&#34;.getBytes(UTF8)),columnParent, lastColumn, ConsistencyLevel.ONE);&#60;br /&#62;
client.insert(ByteBuffer.wrap(&#34;1&#34;.getBytes(UTF8)),columnParent, ageColumn, ConsistencyLevel.ONE);&#60;br /&#62;
client.insert(ByteBuffer.wrap(&#34;1&#34;.getBytes(UTF8)),columnParent, nameColumn, ConsistencyLevel.ONE);&#60;/p&#62;
&#60;p&#62;And I get the result from command line:&#60;/p&#62;
&#60;p&#62;[default@twissandra] list books;&#60;br /&#62;
Using default limit of 100&#60;br /&#62;
-------------------&#60;br /&#62;
RowKey: 49&#60;br /&#62;
=&#38;gt; (column=27413455319692147, value=7017844561841189680, timestamp=1329187533008)&#60;br /&#62;
=&#38;gt; (column=7382926377107942757, value=1890029152402194392368, timestamp=1329187533008)&#60;br /&#62;
=&#38;gt; (column=8097880544751088228, value=2073057419456278586416, timestamp=1329187533008)&#60;/p&#62;
&#60;p&#62;While the RowKey is 49? Because it is convert from String &#34;1&#34;, how can I make the two value consistent?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
