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 A625A200BC2 for ; Thu, 17 Nov 2016 15:58:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A50BF160B0B; Thu, 17 Nov 2016 14:58:22 +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 D2C78160AFF for ; Thu, 17 Nov 2016 15:58:21 +0100 (CET) Received: (qmail 35190 invoked by uid 500); 17 Nov 2016 14:58:20 -0000 Mailing-List: contact users-help@apex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@apex.apache.org Delivered-To: mailing list users@apex.apache.org Received: (qmail 35178 invoked by uid 99); 17 Nov 2016 14:58:20 -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, 17 Nov 2016 14:58:20 +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 5E3361A06BE for ; Thu, 17 Nov 2016 14:58:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.48 X-Spam-Level: ** X-Spam-Status: No, score=2.48 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=datatorrent-com.20150623.gappssmtp.com 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 rKjMGIDHlxiE for ; Thu, 17 Nov 2016 14:58:18 +0000 (UTC) Received: from mail-vk0-f46.google.com (mail-vk0-f46.google.com [209.85.213.46]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 2629A5F295 for ; Thu, 17 Nov 2016 14:58:18 +0000 (UTC) Received: by mail-vk0-f46.google.com with SMTP id p9so143632167vkd.3 for ; Thu, 17 Nov 2016 06:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datatorrent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=sPw2/Hs+rgt+26zsFc3wuCwku0lVWtdFYKcXW+YcWcs=; b=D7RuGked8wXsgHp6cwWxMXz4z79EPZD1L1gn/nUAnh7PaV8xfzGzlhx6ambhjiwL2z wIZYA5MQ4jrCm/gizzfgyKNc70geo9Ggtx9fBRlZCbUKXdIg/B3YjYijED9EN9S1RMO/ 71WCScCmNPTtvSXc4zOea7WQk1jxuZ8fxi/Vkavi39/sbjeFVa/IOVJ+NZjDTJ2Mz4/V eD7uKzgp3QEEyIprroWNzzAgVzJKZaiwA4r41aLGDRCPNz9ggu8wH7WWK0GXdV75IiFf oXePBqBKlYgGrjfhxRJilvk84P1wmmQmVRgrq2LmxViIVVwb2S4rab5qCbzLVp1rwgMp pq3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=sPw2/Hs+rgt+26zsFc3wuCwku0lVWtdFYKcXW+YcWcs=; b=MrE3UXn/tCJSTGXirrsVD773lFNvwJPUMGTJvYMgjRoQbkMg0Y3nk7h9vzoBwec3Ob U5x/vOX4mJ7ZlxBqyZ6pim5+Y2usSleI9g+RsL/8WmNZXQCyKx6F2Q7LWxwnXr/U4bKf xg4GJL6oCdQze9u1na/IevwzLcDpX9MvH5/moabhARwQnHwUGzKFiJb/vbn2VBOZHB5P EtC0yyI3a+t8uFrvxAtuO8wj7BwovdD91Is88tczOehTMS2myYxnz+m2X2xDkcKQ/JZU j3csjFaKhuWF+bR6kTWivc4t9Z9WbyBGTD7QCO1gZmwuxHvTW6fTaBFwSDDNwxXH4Xtp b6cA== X-Gm-Message-State: AKaTC00r1HAisRjfnDptMSTFr8wc2rY6i2hNx0eRnl5KEJXusVHYIjq8zEaoTO/PI4obAIP9XAAIlC/NSNdaXpqA X-Received: by 10.31.189.14 with SMTP id n14mr1463749vkf.81.1479394693690; Thu, 17 Nov 2016 06:58:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.43.130 with HTTP; Thu, 17 Nov 2016 06:58:12 -0800 (PST) Received: by 10.103.43.130 with HTTP; Thu, 17 Nov 2016 06:58:12 -0800 (PST) In-Reply-To: References: From: Aniruddha Thombare Date: Thu, 17 Nov 2016 20:28:12 +0530 Message-ID: Subject: Re: how to connect to database having the DB properties file outside the resources folder or applcation To: users@apex.apache.org Content-Type: multipart/alternative; boundary=001a114db5b8334a6e0541806b1f archived-at: Thu, 17 Nov 2016 14:58:22 -0000 --001a114db5b8334a6e0541806b1f Content-Type: text/plain; charset=UTF-8 About req 3: AFAIK CDH does provide REST access to cluster health parameters among many other things. Not sure about ambari though Thanks, A _____________________________________ Sent with difficulty, I mean handheld ;) On 17 Nov 2016 8:25 pm, "Munagala Ramanath" wrote: > For Req1, a better approach might be to have a single "error reporting" > operator that connects to the DB; > all the other operators can send custom error tuples to it with > appropriate details of the type of error. > That way, if there are issues that are DB-related, you have 1 place to > debug them instead of 20. > > With that approach, your DB operator will need 20 input ports and a new > one added each time you add > an additional operator to the DAG; an alternative is to use the > OperatorRequest mechanism to > communicate with the DB operator instead of the normal ports-and-tuples > method. This is illustrated > in the example at https://github.com/DataTorrent/examples/tree/ > master/tutorials/throttle > where it is used to modulate the output data rate of the input operator > when the downstream operators > are unable to keep up. > > For Req2, you can put the DB properties in an HDFS location and read it in > the setup() callback of the > operator. The path to that location can be in your regular properties file > within the app package. > A similar, though more elaborate method is to run a service on a known > port which can be queried > for those properties; the operators will then connect to that service in > setup() to retrieve the info. > > For Req3, cluster-level issues are generally not made available to > user-level callbacks; you'll need > an external process(es) to monitor log files, invoke REST APIs etc. > > Ram > > > > On Thu, Nov 17, 2016 at 5:50 AM, Venky wrote: > >> Hi, >> >> Req1: I have around 20 operators. In every operator I want to connect to >> database to mark my processing as failed when there is an Io Exception or >> any cluster level exception. I wanted to use plain java class here, please >> let me know how we can implement it. If not suggest the better approach >> >> Req2: I don't want the DB properties file within the application package >> and wanted to maintain the DB properties outside in a properties file and >> able to use them while connecting to database to fulfill my Req1. Please >> let me know how we can maintain the DB properties file outside. >> >> Req3: How can I capture cluster level exceptions like RPC Failure and etc? >> >> Regards, >> Venkat. >> > > --001a114db5b8334a6e0541806b1f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

About req 3:
AFAIK CDH does provide REST access to cluster health parameters among many = other things.
Not sure about ambari though

Thanks,

A

_____________________________________
Sent with difficulty, I mean handheld ;)


On 17 Nov 2016 8:= 25 pm, "Munagala Ramanath" <ram@datatorrent.com> wrote:
For Req1, a better approach might be t= o have a single "error reporting" operator that connects to the D= B;
all the other operators can send custom error tuples to it with appr= opriate details of the type of error.
That way, if there are issu= es that are DB-related, you have 1 place to debug them instead of 20.
=

With that approach, your DB operator will need 20 input= ports and a new one added each time you add
an additional operat= or to the DAG; an alternative is to use the OperatorRequest mechanism to
communicate with the DB operator instead of the normal ports-and-tu= ples method. This is illustrated
where it is used to modulate the out= put data rate of the input operator when the downstream operators
are unable to keep up.

For Req2, you can put the = DB properties in an HDFS location and read it in the setup() callback of th= e
operator. The path to that location can be in your regular prop= erties file within the app package.
A similar, though more elabor= ate method is to run a service on a known port which can be queried
for those properties; the operators will then connect to that service in= setup() to retrieve the info.

For Req3, cluster-l= evel issues are generally not made available to user-level callbacks; you&#= 39;ll need
an external process(es) to monitor log files, invoke R= EST APIs etc.

Ram



On Thu, = Nov 17, 2016 at 5:50 AM, Venky <venkatesh.keetha@gmail.com>= ; wrote:
Hi,

Req1: I have around 20 oper= ators. In every operator I want to connect to database to mark my processin= g as failed when there is an Io Exception or any cluster level exception. I= wanted to use plain java class here, please let me know how we can impleme= nt it. If not suggest the better approach

Req2: I don't want the DB= properties file within the application package and wanted to maintain the = DB properties outside in a properties file and able to use them while conne= cting to database to fulfill my Req1. Please let me know how we can maintai= n the DB properties file outside.

=
Req3: How can I capture cluster level= exceptions like RPC Failure and etc?
=
Regards,
Venkat.

--001a114db5b8334a6e0541806b1f--