From commits-return-61102-archive-asf-public=cust-asf.ponee.io@beam.apache.org Wed Mar 14 23:06:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E1334180718 for ; Wed, 14 Mar 2018 23:06:03 +0100 (CET) Received: (qmail 55843 invoked by uid 500); 14 Mar 2018 22:06:02 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 55828 invoked by uid 99); 14 Mar 2018 22:06:02 -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; Wed, 14 Mar 2018 22:06:02 +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 7DBE4C0143 for ; Wed, 14 Mar 2018 22:06:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id B98ZBWd5YSsy for ; Wed, 14 Mar 2018 22:06:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EFE845F2ED for ; Wed, 14 Mar 2018 22:06:00 +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 6333DE0142 for ; Wed, 14 Mar 2018 22:06:00 +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 236A62148F for ; Wed, 14 Mar 2018 22:06:00 +0000 (UTC) Date: Wed, 14 Mar 2018 22:06:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (BEAM-3500) JdbcIO: Improve connection management MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BEAM-3500?focusedWorklogId=3D8= 0609&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpane= l#worklog-80609 ] ASF GitHub Bot logged work on BEAM-3500: ---------------------------------------- Author: ASF GitHub Bot Created on: 14/Mar/18 22:05 Start Date: 14/Mar/18 22:05 Worklog Time Spent: 10m=20 Work Description: jkff commented on a change in pull request #4461: [= BEAM-3500] "Attach" JDBC connection to the bundle and add DataSourceFactory= allowing full control of the way the DataSource is created URL: https://github.com/apache/beam/pull/4461#discussion_r174624327 =20 =20 ########## File path: sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/Jdb= cIO.java ########## @@ -423,7 +444,9 @@ public void populateDisplayData(DisplayData.Builder bu= ilder) { builder.add(DisplayData.item("query", getQuery())); builder.add(DisplayData.item("rowMapper", getRowMapper().getClass().= getName())); builder.add(DisplayData.item("coder", getCoder().getClass().getName(= ))); - getDataSourceConfiguration().populateDisplayData(builder); + if (getDataSourceConfiguration() !=3D null) { =20 Review comment: It can't be null, as per the check at line 422 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 80609) Time Spent: 5h 10m (was: 5h) > JdbcIO: Improve connection management > ------------------------------------- > > Key: BEAM-3500 > URL: https://issues.apache.org/jira/browse/BEAM-3500 > Project: Beam > Issue Type: Improvement > Components: io-java-jdbc > Affects Versions: 2.2.0 > Reporter: Pawel Bartoszek > Assignee: Jean-Baptiste Onofr=C3=A9 > Priority: Major > Time Spent: 5h 10m > Remaining Estimate: 0h > > JdbcIO write DoFn acquires connection in {{@Setup}} and release it in {{@= Teardown}} methods, which means that connection might stay opened for days = in streaming job case. Keeping single connection open for so long might be = very risky as it's exposed to database, network etc issues. > *Taking connection from the pool when it is actually needed* > I suggest that connection would be taken from the connection pool in {{ex= ecuteBatch}} method and released when the batch is flushed. This will allow= the pool to take care of any returned unhealthy connections etc. > *Make JdbcIO accept data source factory* > It would be nice if JdbcIO accepted DataSourceFactory rather than DataSo= urce itself. I am saying that because sink checks if DataSource implements = `Serializable` interface, which make it impossible to pass BasicDataSource(= used internally by sink) as it doesn=E2=80=99t implement this interface. So= mething like: > {code:java} > interface DataSourceFactory extends Serializable{ > DataSource create(); > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)