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 0AF4C200AE3 for ; Thu, 5 May 2016 03:18:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 09589160A00; Thu, 5 May 2016 01:18:18 +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 50FB81609FF for ; Thu, 5 May 2016 03:18:17 +0200 (CEST) Received: (qmail 53353 invoked by uid 500); 5 May 2016 01:18:16 -0000 Mailing-List: contact dev-help@gearpump.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@gearpump.incubator.apache.org Delivered-To: mailing list dev@gearpump.incubator.apache.org Received: (qmail 53342 invoked by uid 99); 5 May 2016 01:18:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2016 01:18:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 1419E1A02F9 for ; Thu, 5 May 2016 01:18:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.021 X-Spam-Level: X-Spam-Status: No, score=-4.021 tagged_above=-999 required=6.31 tests=[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=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Q39uAajDWj_L for ; Thu, 5 May 2016 01:18:14 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id B1E035F3F5 for ; Thu, 5 May 2016 01:18:13 +0000 (UTC) Received: (qmail 51810 invoked by uid 99); 5 May 2016 01:18:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2016 01:18:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D97162C033A for ; Thu, 5 May 2016 01:18:12 +0000 (UTC) Date: Thu, 5 May 2016 01:18:12 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@gearpump.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GEARPUMP-24) refactor DataSource API MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 May 2016 01:18:18 -0000 [ https://issues.apache.org/jira/browse/GEARPUMP-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15271752#comment-15271752 ] ASF GitHub Bot commented on GEARPUMP-24: ---------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/incubator-gearpump/pull/7 > refactor DataSource API > ----------------------- > > Key: GEARPUMP-24 > URL: https://issues.apache.org/jira/browse/GEARPUMP-24 > Project: Apache Gearpump > Issue Type: Improvement > Components: streaming > Affects Versions: 0.8.0 > Reporter: Manu Zhang > Assignee: Manu Zhang > Fix For: 0.8.1 > > > From [https://github.com/gearpump/gearpump/issues/2013]: > The current DataSource API > {code} > trait DataSource extends java.io.Serializable { > /** > * open connection to data source > * invoked in onStart() method of [[io.gearpump.streaming.source.DataSourceTask]] > * @param context is the task context at runtime > * @param startTime is the start time of system > */ > def open(context: TaskContext, startTime: Option[TimeStamp]): Unit > /** > * read a number of messages from data source. > * invoked in each onNext() method of [[io.gearpump.streaming.source.DataSourceTask]] > * @param batchSize max number of messages to read > * @return a list of messages wrapped in [[io.gearpump.Message]] > */ > def read(batchSize: Int): List[Message] > /** > * close connection to data source. > * invoked in onStop() method of [[io.gearpump.streaming.source.DataSourceTask]] > */ > def close(): Unit > } > {code} > has several issues > 1. read returns a scala list of Message which is unfriendly to Java DataSources. Same for Option parameter in open > 2. the number of read messages may not be the same as the passed in batchSize which leaves uncertainty to users (users may access out of boundary list positions) > 3. to return a list an extra buffer could be needed in read (e.g. KafkaSource) which is not best for performance > Update: > I'd like to add a "getWatermark" interface that helps to fix GEARPUMP-32 -- This message was sent by Atlassian JIRA (v6.3.4#6332)