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 96927200B35 for ; Tue, 21 Jun 2016 07:10:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 95475160A65; Tue, 21 Jun 2016 05:10:03 +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 DAF51160A55 for ; Tue, 21 Jun 2016 07:10:02 +0200 (CEST) Received: (qmail 31598 invoked by uid 500); 21 Jun 2016 05:10:01 -0000 Mailing-List: contact dev-help@apex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apex.apache.org Delivered-To: mailing list dev@apex.apache.org Received: (qmail 31586 invoked by uid 99); 21 Jun 2016 05:10:01 -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; Tue, 21 Jun 2016 05:10:01 +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 DB034C0E26 for ; Tue, 21 Jun 2016 05:10:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] 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 Np3IBQOpG5Nk for ; Tue, 21 Jun 2016 05:10:00 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 13D865F472 for ; Tue, 21 Jun 2016 05:09:58 +0000 (UTC) Received: (qmail 31169 invoked by uid 99); 21 Jun 2016 05:09:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2016 05:09:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id EED732C14E1 for ; Tue, 21 Jun 2016 05:09:57 +0000 (UTC) Date: Tue, 21 Jun 2016 05:09:57 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@apex.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (APEXMALHAR-2119) Make DirectoryScanner in AbstractFileInputOperator inheritance friendly. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 21 Jun 2016 05:10:03 -0000 [ https://issues.apache.org/jira/browse/APEXMALHAR-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15341105#comment-15341105 ] ASF GitHub Bot commented on APEXMALHAR-2119: -------------------------------------------- Github user tushargosavi commented on a diff in the pull request: https://github.com/apache/apex-malhar/pull/318#discussion_r67808791 --- Diff: library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileInputOperator.java --- @@ -1110,6 +1116,16 @@ public String toString() return "DirectoryScanner [filePatternRegexp=" + filePatternRegexp + " partitionIndex=" + partitionIndex + " partitionCount=" + partitionCount + "]"; } + + protected void setPartitionIndex(int partitionIndex) + { + this.partitionIndex = partitionIndex; + } + + protected void setPartitionCount(int partitionCount) + { + this.partitionCount = partitionCount; + } --- End diff -- With the kryo.clone change in createPartition, it is getting set on the derived object from there. Initially createPartition was creating object of type DirectoryScanner, so derived class had no option to override it and create object of own type, and then set the count and index value, but it could not as those were private without setters in base class. > Make DirectoryScanner in AbstractFileInputOperator inheritance friendly. > ------------------------------------------------------------------------- > > Key: APEXMALHAR-2119 > URL: https://issues.apache.org/jira/browse/APEXMALHAR-2119 > Project: Apache Apex Malhar > Issue Type: Bug > Reporter: Tushar Gosavi > Assignee: Tushar Gosavi > > The DirectoryScanner has partitionIndex and partitionCount declared as private without any setters. Inherited DirectoryScanner can not set them and hence can not call most of the methods in DirectoryScanner which depends on these fields (acceptFile). > Also new DirectoryScanner has to implement createPartition as default one creates instance of DirectoryScanner by default. > Make the class inheritance friendly by adding setters and use kryo clone in createPartition. -- This message was sent by Atlassian JIRA (v6.3.4#6332)