From commits-return-14859-apmail-cassandra-commits-archive=cassandra.apache.org@cassandra.apache.org Mon Jun 14 15:07:15 2010 Return-Path: Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: (qmail 84266 invoked from network); 14 Jun 2010 15:07:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Jun 2010 15:07:14 -0000 Received: (qmail 18525 invoked by uid 500); 14 Jun 2010 13:17:53 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 17937 invoked by uid 500); 14 Jun 2010 13:17:51 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 17914 invoked by uid 500); 14 Jun 2010 13:17:50 -0000 Delivered-To: apmail-incubator-cassandra-commits@incubator.apache.org Received: (qmail 17906 invoked by uid 99); 14 Jun 2010 13:17:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jun 2010 13:17:49 +0000 X-ASF-Spam-Status: No, hits=-1559.1 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jun 2010 13:17:49 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id C17B01761F; Mon, 14 Jun 2010 13:17:28 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Mon, 14 Jun 2010 13:17:28 -0000 Message-ID: <20100614131728.16995.56027@eos.apache.org> Subject: =?utf-8?q?=5BCassandra_Wiki=5D_Update_of_=22FAQ=22_by_JonathanEllis?= Dear Wiki user, You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for= change notification. The "FAQ" page has been changed by JonathanEllis. http://wiki.apache.org/cassandra/FAQ?action=3Ddiff&rev1=3D72&rev2=3D73 -------------------------------------------------- = * The main limitation on a column and super column size is that all the = data for a single key and column must fit (on disk) on a single machine(nod= e) in the cluster. Because keys alone are used to determine the nodes resp= onsible for replicating their data, the amount of data associated with a si= ngle key has this upper bound. This is an inherent limitation of the distri= bution model. = - * When large columns are created and retrieved, that columns data is loa= ded into RAM which can get resource intensive quickly. Consider, loading = 200 rows with columns that store 10Mb image files each into RAM. That sm= all result set would consume about 2Gb of RAM. Clearly as more and more la= rge columns are loaded, RAM would start to get consumed quickly. This can= be worked around, but will take some upfront planning and testing to get a= workable solution for most applications. You can find more information re= garding this behavior here: [[MemtableThresholds|memtables]], and a possibl= e solution in 0.7 here: [[https://issues.apache.org/jira/browse/CASSANDRA-1= 6|CASSANDRA-16 ]]. + * When large columns are created and retrieved, that columns data is loa= ded into RAM which can get resource intensive quickly. Consider, loading = 200 rows with columns that store 10Mb image files each into RAM. That sm= all result set would consume about 2Gb of RAM. Clearly as more and more la= rge columns are loaded, RAM would start to get consumed quickly. This can= be worked around, but will take some upfront planning and testing to get a= workable solution for most applications. You can find more information re= garding this behavior here: [[MemtableThresholds|memtables]], and a possibl= e solution in 0.7 here: [[https://issues.apache.org/jira/browse/CASSANDRA-1= 6|CASSANDRA-16]]. = * Please refer to the notes in the Cassandra limitations section for mor= e information: [[CassandraLimitations|Cassandra Limitations]] = @@ -258, +258 @@ <> = =3D=3D Insert operation throws InvalidRequestException with message "A lo= ng is exactly 8 bytes" =3D=3D - = You are propably using !LongType column sorter in your column family. !Lo= ngType assumes that the numbers stored into column names are exactly 64bit = (8 bytes) long and in big endian format. Example code how to pack and unpac= k an integer for storing into cassandra and unpacking it for php: = {{{ - /** + /** - * Takes php integer and packs it to 64bit (8 bytes) long big endian bin= ary representation. + * Takes php integer and packs it to 64bit (8 bytes) long big end= ian binary representation. - * @param $x integer + * @param $x integer - * @return string eight bytes long binary repersentation of the integer = in big endian order. + * @return string eight bytes long binary repersentation of the i= nteger in big endian order. - */ + */ - public static function pack_longtype($x) { + public static function pack_longtype($x) { - return pack('C8', ($x >> 56) & 0xff, ($x >> 48) & 0xff, ($x >> 40) & 0x= ff, ($x >> 32) & 0xff, + return pack('C8', ($x >> 56) & 0xff, ($x >> 48) & 0xff, (= $x >> 40) & 0xff, ($x >> 32) & 0xff, - ($x >> 24) & 0xff, ($x >> 16) & 0xff, ($x >> 8) & 0xff, $x & 0xff); + ($x >> 24) & 0xff, ($x >> 16) & 0xff, ($x= >> 8) & 0xff, $x & 0xff); - } + } = - /** + /** - * Takes eight bytes long big endian binary representation of an integer= and unpacks it to a php integer. + * Takes eight bytes long big endian binary representation of an = integer and unpacks it to a php integer. - * @param $x + * @param $x - * @return php integer + * @return php integer - */ + */ - public static function unpack_longtype($x) { + public static function unpack_longtype($x) { - $a =3D unpack('C8', $x); + $a =3D unpack('C8', $x); - return ($a[1] << 56) + ($a[2] << 48) + ($a[3] << 40) + ($a[4] << 32) + = ($a[5] << 24) + ($a[6] << 16) + ($a[7] << 8) + $a[8]; + return ($a[1] << 56) + ($a[2] << 48) + ($a[3] << 40) + ($= a[4] << 32) + ($a[5] << 24) + ($a[6] << 16) + ($a[7] << 8) + $a[8]; - } + } }}} - = <> = =3D=3D Cassandra says "ClusterName mismatch: oldClusterName !=3D newClust= erName" and refuses to start =3D=3D - = To prevent operator errors, Cassandra stores the name of the cluster in i= ts system table. If you need to rename a cluster for some reason, it is sa= fe to remove system/LocationInfo* after forcing a compaction on all ColumnF= amilies (with the old cluster name) if you've specified the node's token in= the config file, or if you don't care about preserving the node's token (f= or instance in single node clusters.) = <> + = =3D=3D Are batch_mutate operations atomic? =3D=3D - = - No. [[API#batch_mutate|batch_mutate]] is a way to group many operations = into a single call in order to save on the cost of network round-trips. If= `batch_mutate` fails in the middle of its list of mutations, no rollback o= ccurs and the mutations that have already been applied stay applied. = + No. [[API#batch_mutate|batch_mutate]] is a way to group many operations = into a single call in order to save on the cost of network round-trips. If= `batch_mutate` fails in the middle of its list of mutations, no rollback o= ccurs and the mutations that have already been applied stay applied. The cl= ient should typically retry the mutation. =20