Return-Path: Delivered-To: apmail-cassandra-dev-archive@www.apache.org Received: (qmail 66057 invoked from network); 5 May 2010 22:56:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 May 2010 22:56:58 -0000 Received: (qmail 38821 invoked by uid 500); 5 May 2010 22:56:57 -0000 Delivered-To: apmail-cassandra-dev-archive@cassandra.apache.org Received: (qmail 38643 invoked by uid 500); 5 May 2010 22:56:57 -0000 Mailing-List: contact dev-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 dev@cassandra.apache.org Received: (qmail 38624 invoked by uid 99); 5 May 2010 22:56:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 May 2010 22:56:56 +0000 X-ASF-Spam-Status: No, hits=-0.2 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 May 2010 22:56:51 +0000 Received: by wwi17 with SMTP id 17so92205wwi.31 for ; Wed, 05 May 2010 15:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=4ipoIQKMUh1yi4IvOxrrLGyYfnH18z8NhgocmC6ZOOg=; b=oryWauioT51kccsef+1eycIq1cNHcfIkkm7f7/QJz8QNeJN+34dVi+jftvEFWg5wRw 9Uo5b3BpZp5SxlaCeE2eIwuwzzedn3fQsLBYHlNbGhcZaptJYtDi/K2IP0R5LBUxAYgg 2bdtvD5PlVR7M39JtIIf/UGEfnbOJdmzOk0iA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=rU2yKWS9TZyISv9tCoQ2hZtZ6hr3JEgwJhz6uf0SgwKIzMStu8VWAdFSmRtRE85R+w GxTTL7w5pwJd2Cd9RtrYsl33sB7M5BkB/yko4PvzMYEnzq5YEHUIsUPl1B3Blz87hWg0 JdseEGjSowX+KW0TaCrOECxgweL23rXdYEe8c= Received: by 10.216.86.20 with SMTP id v20mr3363441wee.122.1273100190246; Wed, 05 May 2010 15:56:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.22.10 with HTTP; Wed, 5 May 2010 15:56:10 -0700 (PDT) In-Reply-To: References: From: Jonathan Ellis Date: Wed, 5 May 2010 17:56:10 -0500 Message-ID: Subject: Re: About SStable Writer To: user@cassandra.apache.org Cc: dev@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yes, this is a bug. Patch attached to https://issues.apache.org/jira/browse/CASSANDRA-1056 On Wed, May 5, 2010 at 2:09 AM, Anty wrote: > HI:All > > In source code of 0.6.1 ,in SSTableWriter, > private void afterAppend(DecoratedKey decoratedKey, long dataPosition, in= t > dataSize) throws IOException > =A0=A0=A0 { > =A0=A0=A0=A0=A0=A0=A0 String diskKey =3D partitioner.convertToDiskFormat(= decoratedKey); > =A0=A0=A0=A0=A0=A0=A0 bf.add(diskKey); > =A0=A0=A0=A0=A0=A0=A0 lastWrittenKey =3D decoratedKey; > =A0=A0=A0=A0=A0=A0=A0 long indexPosition =3D indexFile.getFilePointer(); > =A0=A0=A0=A0=A0=A0=A0 indexFile.writeUTF(diskKey); > =A0=A0=A0=A0=A0=A0=A0 indexFile.writeLong(dataPosition); > =A0=A0=A0=A0=A0=A0=A0 if (logger.isTraceEnabled()) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 logger.trace("wrote " + decoratedKey + = " at " + dataPosition); > =A0=A0=A0=A0=A0=A0=A0 if (logger.isTraceEnabled()) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 logger.trace("wrote index of " + decora= tedKey + " at " + > indexPosition); > > =A0=A0=A0=A0=A0=A0=A0 indexSummary.maybeAddEntry(decoratedKey, dataPositi= on, dataSize, > indexPosition, indexFile.getFilePointer()); > =A0=A0=A0 } > the value of "dataSize" is the length of value( column family) ,not > including the length of key. > > but in=A0 the method=A0 loadIndexFile() of SStableReader > ... > =A0=A0=A0 else > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 { > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 input.readUTF()= ; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 nextDataPositio= n =3D input.readLong(); > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 input.seek(next= IndexPosition); > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 indexSummary.maybeAddEntry(= decoratedKey, dataPosition, > nextDataPosition - dataPosition, indexPosition, nextIndexPosition); > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 indexSummary.complete(); > > > the value of nextDataPosition - dataPosition is the length of key and val= ue > ,not just the length of value . > > > the values above two are different,=A0=A0 is it a bug? > > -- > Best Regards > Anty Rao > --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of Riptano, the source for professional Cassandra support http://riptano.com