Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 77C0A107BB for ; Mon, 2 Mar 2015 09:46:05 +0000 (UTC) Received: (qmail 61949 invoked by uid 500); 2 Mar 2015 09:46:05 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 61910 invoked by uid 500); 2 Mar 2015 09:46:05 -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 61898 invoked by uid 99); 2 Mar 2015 09:46:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2015 09:46:05 +0000 Date: Mon, 2 Mar 2015 09:46:05 +0000 (UTC) From: "Marcus Eriksson (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-8750) Ensure SSTableReader.last corresponds exactly with the file end MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-8750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14342982#comment-14342982 ] Marcus Eriksson commented on CASSANDRA-8750: -------------------------------------------- Could you explain this? {code} // buffer offset is always aligned bufferOffset = current & ~(buffer.length - 1); + if (bufferOffset + validBufferBytes > length()) + validBufferBytes = (int)(length() - bufferOffset); {code} are we not returning the valid byte count out of metadata.compressor().uncompress(..) ? > Ensure SSTableReader.last corresponds exactly with the file end > --------------------------------------------------------------- > > Key: CASSANDRA-8750 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8750 > Project: Cassandra > Issue Type: Improvement > Components: Core > Reporter: Benedict > Assignee: Benedict > Priority: Minor > Fix For: 2.1.4 > > > Following on from CASSANDRA-8744, CASSANDRA-8749 and CASSANDRA-8747, this patch attempts to make the whole opening early of compaction results more robust and with more clearly understood behaviour. The improvements of CASSANDRA-8747 permit is to easily align the last key with a summary boundary, and an index and data file end position. This patch modifies SegmentedFile to permit the provision of an explicit length, which is then provided to any readers, which enforce it, ensuring no code may accidentally see an end inconsistent with the one advertised. -- This message was sent by Atlassian JIRA (v6.3.4#6332)