You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Schubert Zhang <zs...@gmail.com> on 2010/05/05 12:19:18 UTC

Re: About SStable Writer

Include dev@cassandra.apache.org

On Wed, May 5, 2010 at 3:09 PM, Anty <an...@gmail.com> 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
>

Re: About SStable Writer

Posted by Schubert Zhang <zs...@gmail.com>.
Hi Jonathan,
Could you please have a check this?

On Wed, May 5, 2010 at 6:19 PM, Schubert Zhang <zs...@gmail.com> wrote:

> Include dev@cassandra.apache.org
>
>
> On Wed, May 5, 2010 at 3:09 PM, Anty <an...@gmail.com> 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
>>
>
>

Re: About SStable Writer

Posted by Schubert Zhang <zs...@gmail.com>.
Hi Jonathan,
Could you please have a check this?

On Wed, May 5, 2010 at 6:19 PM, Schubert Zhang <zs...@gmail.com> wrote:

> Include dev@cassandra.apache.org
>
>
> On Wed, May 5, 2010 at 3:09 PM, Anty <an...@gmail.com> 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
>>
>
>