Author: jbellis
Date: Sun Jan 16 22:54:09 2011
New Revision: 1059701
URL: http://svn.apache.org/viewvc?rev=1059701&view=rev
Log:
fix copy bounds for word Text in wordcount demo
patch by Jesse Shieh and jbellis for CASSANDRA-1993
Modified:
cassandra/branches/cassandra-0.7/CHANGES.txt
cassandra/branches/cassandra-0.7/contrib/word_count/src/WordCount.java
Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL:
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1059701&r1=1059700&r2=1059701&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Sun Jan 16 22:54:09 2011
@@ -21,6 +21,7 @@
* fix race condition in MessagingService.targets (CASSANDRA-1959)
* refuse to open sstables from a future version (CASSANDRA-1935)
* zero-copy reads (CASSANDRA-1714)
+ * fix copy bounds for word Text in wordcount demo (CASSANDRA-1993)
0.7.0-final
Modified: cassandra/branches/cassandra-0.7/contrib/word_count/src/WordCount.java
URL:
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/contrib/word_count/src/WordCount.java?rev=1059701&r1=1059700&r2=1059701&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/contrib/word_count/src/WordCount.java
(original)
+++ cassandra/branches/cassandra-0.7/contrib/word_count/src/WordCount.java Sun
Jan 16 22:54:09 2011
@@ -134,8 +134,7 @@ public class WordCount extends Configure
private static Mutation getMutation(Text word, int sum)
{
Column c = new Column();
- byte[] wordBytes = word.getBytes();
- c.name = ByteBuffer.wrap(Arrays.copyOf(wordBytes,
wordBytes.length));
+ c.name = ByteBuffer.wrap(Arrays.copyOf(word.getBytes(),
word.getLength()));
c.value = ByteBuffer.wrap(String.valueOf(sum).getBytes());
c.timestamp = System.currentTimeMillis() * 1000;