Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 91207 invoked from network); 5 May 2010 17:38:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 May 2010 17:38:18 -0000 Received: (qmail 6874 invoked by uid 500); 5 May 2010 17:38:17 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 6848 invoked by uid 500); 5 May 2010 17:38:17 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 6837 invoked by uid 99); 5 May 2010 17:38:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 May 2010 17:38:17 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zsongbo@gmail.com designates 209.85.160.172 as permitted sender) Received: from [209.85.160.172] (HELO mail-gy0-f172.google.com) (209.85.160.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 May 2010 17:38:08 +0000 Received: by gyh4 with SMTP id 4so2455628gyh.31 for ; Wed, 05 May 2010 10:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=C83GFoYdNcAzODthNkePCy7w4Dlm0D3xfzdJ9z0U27w=; b=JmiXZXKyJHIsjYwkB83S+3xltKS0UzRdIZypE3/QKvnzV21NvWmbENtFEmjE67RxRz wqBFmya5IQ08EgPpigJLFu2hSTZ36VJGeP0yTe8N87AKEBJKcqvRq89K9TmQ1Bhrj+Ja D+u8avCktvBkBa9xc8Q4j8u65knVXfXRU2mCk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gyYPFdThPnxqErFfMXM+l9eLC1O+4lQfatBILGP8AH2LKss7rCTgLKLbrsH3FyibRi kQcOg4w0o5jHta8ylxtSt48VRByMm9gLDFYc2aiy7qF5Cz0igLgJitfzZjtCXSISF9l6 hJy94x2s57MCyCKq97OdiNAX/20zVgKjt4iCE= MIME-Version: 1.0 Received: by 10.229.91.16 with SMTP id k16mr4634645qcm.40.1273081066798; Wed, 05 May 2010 10:37:46 -0700 (PDT) Received: by 10.229.91.137 with HTTP; Wed, 5 May 2010 10:37:46 -0700 (PDT) In-Reply-To: References: Date: Thu, 6 May 2010 01:37:46 +0800 Message-ID: Subject: Re: About SStable Writer From: Schubert Zhang To: user@cassandra.apache.org, dev@cassandra.apache.org Content-Type: multipart/alternative; boundary=001636aa2c18c20ed60485dc487e X-Virus-Checked: Checked by ClamAV on apache.org --001636aa2c18c20ed60485dc487e Content-Type: text/plain; charset=ISO-8859-1 Hi Jonathan, Could you please have a check this? On Wed, May 5, 2010 at 6:19 PM, Schubert Zhang wrote: > Include dev@cassandra.apache.org > > > On Wed, May 5, 2010 at 3:09 PM, Anty wrote: > >> HI:All >> >> In source code of 0.6.1 ,in SSTableWriter, >> private void afterAppend(DecoratedKey decoratedKey, long dataPosition, int >> dataSize) throws IOException >> { >> String diskKey = partitioner.convertToDiskFormat(decoratedKey); >> bf.add(diskKey); >> lastWrittenKey = decoratedKey; >> long indexPosition = indexFile.getFilePointer(); >> indexFile.writeUTF(diskKey); >> indexFile.writeLong(dataPosition); >> if (logger.isTraceEnabled()) >> logger.trace("wrote " + decoratedKey + " at " + dataPosition); >> if (logger.isTraceEnabled()) >> logger.trace("wrote index of " + decoratedKey + " at " + >> indexPosition); >> >> indexSummary.maybeAddEntry(decoratedKey, dataPosition, dataSize, >> indexPosition, indexFile.getFilePointer()); >> } >> the value of "dataSize" is the length of value( column family) ,not >> including the length of key. >> >> but in the method loadIndexFile() of SStableReader >> ... >> else >> { >> input.readUTF(); >> nextDataPosition = input.readLong(); >> input.seek(nextIndexPosition); >> } >> indexSummary.maybeAddEntry(decoratedKey, dataPosition, nextDataPosition >> - dataPosition, indexPosition, nextIndexPosition); >> } >> indexSummary.complete(); >> >> >> the value of nextDataPosition - dataPosition is the length of key and >> value ,not just the length of value . >> >> >> the values above two are different, is it a bug? >> >> -- >> Best Regards >> Anty Rao >> > > --001636aa2c18c20ed60485dc487e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Jonathan,
Could you please have a check this?

On Wed, May 5, 2010 at 6:19 PM, Schubert Zhang <zsongbo@gmail.com>= wrote:
Include dev@cassandra.apache= .org


On Wed, May= 5, 2010 at 3:09 PM, Anty <anty.rao@gmail.com> wrote:
HI:All

In = source code of 0.6.1 ,in SSTableWriter,
private void afterAppend(DecoratedKey decoratedKey, lon= g dataPosition, int dataSize) throws IOException
=A0=A0=A0 {
=A0=A0=A0=A0=A0=A0=A0 String diskKey =3D partitioner.convertToDiskFormat(de= coratedKey);
=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 index= Position =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 lo= gger.trace("wrote " + decoratedKey + " at " + dataPosit= ion);
=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 " = + decoratedKey + " at " + indexPosition);

=A0=A0=A0=A0=A0= =A0=A0 indexSummary.maybeAddEntry(decoratedKey, dataPosition, dataSize, indexPosition, indexF= ile.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 loadInde= xFile() 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 nextDataPosition = =3D input.readLong();
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 input.seek(nextIndexPosition);
= =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, dataPosit= ion, nextDataPosition - d= ataPosition, indexPosition, nextIndexPosition);
= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 i= ndexSummary.complete();


the value of nex= tDataPosition -=20 dataPosition is the length of key and value ,not just the length of = value .


the values above two are different,=A0=A0 is it a bug?
--
Best Regards
Anty Rao=


--001636aa2c18c20ed60485dc487e--