Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C70A0200CAA for ; Sat, 3 Jun 2017 06:48:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C628E160BDD; Sat, 3 Jun 2017 04:48:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 19748160BD2 for ; Sat, 3 Jun 2017 06:48:07 +0200 (CEST) Received: (qmail 84053 invoked by uid 500); 3 Jun 2017 04:48:07 -0000 Mailing-List: contact notifications-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list notifications@asterixdb.apache.org Received: (qmail 84043 invoked by uid 99); 3 Jun 2017 04:48:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jun 2017 04:48:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A25AEC0311 for ; Sat, 3 Jun 2017 04:48:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 8Z-JsyN28dHB for ; Sat, 3 Jun 2017 04:48:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 162C55F2AE for ; Sat, 3 Jun 2017 04:48:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5E8DDE05BF for ; Sat, 3 Jun 2017 04:48:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 12C5C2193A for ; Sat, 3 Jun 2017 04:48:04 +0000 (UTC) Date: Sat, 3 Jun 2017 04:48:04 +0000 (UTC) From: "Yingyi Bu (JIRA)" To: notifications@asterixdb.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ASTERIXDB-1929) Factor out isAntimatter from TupleWriter and TupleWriterFactory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 03 Jun 2017 04:48:09 -0000 [ https://issues.apache.org/jira/browse/ASTERIXDB-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16035813#comment-16035813 ] Yingyi Bu commented on ASTERIXDB-1929: -------------------------------------- OK, I see the point. The current implementation makes some sense to me now. Then, my only left concern is the usage of factory -- can we remove setAntimatter from the LSMTreeRefrencingTupleWriterFactory, and instead, only set/unset antimatter in the tuple writer ? {noformat} public class LSMTreeRefrencingTupleWriterFactory implements ITreeIndexTupleWriterFactory { private static final long serialVersionUID = 1L; private final ITreeIndexTupleWriterFactory factory; private transient ILSMTreeTupleWriter createdTupleWriter; public LSMTreeRefrencingTupleWriterFactory(ITreeIndexTupleWriterFactory factory) { this.factory = factory; } @Override public ITreeIndexTupleWriter createTupleWriter() { createdTupleWriter = (ILSMTreeTupleWriter) factory.createTupleWriter(); return createdTupleWriter; } public void setAntimatter(boolean isAntimatter) { if (this.createdTupleWriter != null) { this.createdTupleWriter.setAntimatter(isAntimatter); } } } {noformat} > Factor out isAntimatter from TupleWriter and TupleWriterFactory > --------------------------------------------------------------- > > Key: ASTERIXDB-1929 > URL: https://issues.apache.org/jira/browse/ASTERIXDB-1929 > Project: Apache AsterixDB > Issue Type: Improvement > Components: Storage > Reporter: Yingyi Bu > Assignee: Chen Luo > > isAntimatter is a property of the tuple that we're writing, but not a property of the Writer. Hence, we probably should remove setAntimatter(...) from the TupleWriter. > Currently, for each tuple write operation, we need to call setAntimatter() in both TupleWriterFactory and TupleWriter. This is painful and potentially buggy -- a XxxFactory typically is one per NC. > Instead, we can add a parameter to write tuple method: > public int writeTuple(ITupleReference tuple, byte[] targetBuf, int targetOff) > -> > public int writeTuple(ITupleReference tuple, byte[] targetBuf, int targetOff, boolean isDelete) -- This message was sent by Atlassian JIRA (v6.3.15#6346)