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 D810C200AEE for ; Wed, 4 May 2016 03:34:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D73D41609F5; Wed, 4 May 2016 03:34:18 +0200 (CEST) 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 2E5F71609F6 for ; Wed, 4 May 2016 03:34:18 +0200 (CEST) Received: (qmail 10546 invoked by uid 500); 4 May 2016 01:34:17 -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 10535 invoked by uid 99); 4 May 2016 01:34:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2016 01:34:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A25EA18028D for ; Wed, 4 May 2016 01:34:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id cdN-bqDTKBrZ for ; Wed, 4 May 2016 01:34:14 +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 E5B835F1B3 for ; Wed, 4 May 2016 01:34:13 +0000 (UTC) Received: (qmail 10333 invoked by uid 99); 4 May 2016 01:34:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2016 01:34:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DB6172C1F5C for ; Wed, 4 May 2016 01:34:12 +0000 (UTC) Date: Wed, 4 May 2016 01:34: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: Wed, 04 May 2016 01:34:19 -0000 [ https://issues.apache.org/jira/browse/GEARPUMP-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15269981#comment-15269981 ] ASF GitHub Bot commented on GEARPUMP-24: ---------------------------------------- Github user whjiang commented on the pull request: https://github.com/apache/incubator-gearpump/pull/7#issuecomment-216717101 Do we have HBase source? > 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)