Return-Path: X-Original-To: apmail-apex-dev-archive@minotaur.apache.org Delivered-To: apmail-apex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F5D218638 for ; Fri, 15 Jan 2016 18:26:48 +0000 (UTC) Received: (qmail 40156 invoked by uid 500); 15 Jan 2016 18:26:48 -0000 Delivered-To: apmail-apex-dev-archive@apex.apache.org Received: (qmail 40097 invoked by uid 500); 15 Jan 2016 18:26:48 -0000 Mailing-List: contact dev-help@apex.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apex.incubator.apache.org Delivered-To: mailing list dev@apex.incubator.apache.org Received: (qmail 40085 invoked by uid 99); 15 Jan 2016 18:26:47 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jan 2016 18:26:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 42EBBC0E44 for ; Fri, 15 Jan 2016 18:26:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.999 X-Spam-Level: ** X-Spam-Status: No, score=2.999 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=datatorrent-com.20150623.gappssmtp.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id sxOGkWD4bcrC for ; Fri, 15 Jan 2016 18:26:38 +0000 (UTC) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 253DD43F5B for ; Fri, 15 Jan 2016 18:26:38 +0000 (UTC) Received: by mail-io0-f173.google.com with SMTP id 77so463585434ioc.2 for ; Fri, 15 Jan 2016 10:26:38 -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:date:message-id:subject:from:to :content-type; bh=OQH+NrL4XEflQDSElObC4gD8fRrEv56pj9omfp34rX4=; b=DV4sDbbEiC46qbMMOLIsYs5foVWyH1JJLfMUnkRwGvcFCPVqbuzRm/PF96riIoM2ni LY/ghyUXj7mLx2bqwYYk5w0cKP51iq5iNIZqpP0fz+qPaAOMJPMq6SGAxGnlwkYv3l+I YZXTWzwUIgb+euHTvqCtDhn5ev8Tgf4YJB2XAI0kN0BofZEVU0Z141VVvAvkGRHRd5cr MRPfF/clEFkSnj3DAxFA35QaxmdvODfXXWNyBACafm6AAdd0MFuVFHmiJfPORJ0lZQ7j ecdHtmhtD6qo9HCdTJ7LqqbFAF7qEmf413sfM3F0eFLhm87zjLyrwBsBKQjuiaxxivN9 ORbA== 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:date :message-id:subject:from:to:content-type; bh=OQH+NrL4XEflQDSElObC4gD8fRrEv56pj9omfp34rX4=; b=CJDnCjZGpdsgMJbb0da4u8MblEf7ipG3nWXPcfPqkVVi1piOXg6q1e57R1/8TmCG9r RxmRu/wyvdGs+EiS7vbhOy2irtWCW7N+tRn0oE8l0VujxVN0UgjsBaZy24aoEH3gpWol Z9F6tVW9S9UxDnYnZ1gM4TtmMIgH/AfqfLu9XCdW3QUEcD5bb69WM6gL6rxCdpU6lZkI 9jGKzJxfBjtlwyvd0/kUDMIOz2gPiTWOYzbEzFir92ixK+2yn6Dny5jQfjQFa4gIv0fA hJOzjDa8OPtwhwIC72y26F/dvT/CAWVV0/iYJXC50wDNjb//Np2xkUhfynOUNmg3xFwn FIAA== X-Gm-Message-State: ALoCoQnjCOECZc/sp9GqCiTuIf1KEIH2YEJQVau9dJdK9meyIp2AdBnEJqffMLL032kvqO/ALdm8imk2UFzs5EzfufGX2UIidArdcS3mwjZE2Cp05vK6IkY= MIME-Version: 1.0 X-Received: by 10.107.41.206 with SMTP id p197mr11689341iop.80.1452882397629; Fri, 15 Jan 2016 10:26:37 -0800 (PST) Received: by 10.107.44.66 with HTTP; Fri, 15 Jan 2016 10:26:37 -0800 (PST) In-Reply-To: References: Date: Fri, 15 Jan 2016 23:56:37 +0530 Message-ID: Subject: Re: Adding class to CLASSPATH in populateDAG From: Chinmay Kolhatkar To: dev@apex.incubator.apache.org Content-Type: multipart/alternative; boundary=001a1141ed18363e2d0529638b7e --001a1141ed18363e2d0529638b7e Content-Type: text/plain; charset=UTF-8 Hi All, I've create pull request for this: https://github.com/apache/incubator-apex-core/pull/208 Please review the pull request. Thanks, Chinmay. On Fri, Jan 15, 2016 at 11:40 PM, Chinmay Kolhatkar wrote: > Hi Everyone, > > If there are no further comments, I'll create the pull request for this > change. > > Tushar, About the 2 parts you've mentioned, 2nd part is taken care of by > this Jira. I'll log another Jira for 1st and address it there. > > I'll come back with pull request link soon. > > Thanks, > Chinmay. > > > > On Wed, Jan 13, 2016 at 12:18 AM, Tushar Gosavi > wrote: > >> One use case could be that if we want same application to work on >> different >> data (schema) without >> compiling the application again. In this case schema can be provided as a >> json description, >> with field name and their type. When application starts it will generate >> the classes using ASM >> and write it to the temp jar, and configure operators to use the >> classname. >> operators can do a Class.forName to load the class based on name and use >> those. This could enable to users to write generic applications and by >> providing schema definition and configuring operators based on field >> names. >> >> There are two parts >> 1) Generating classes based on schema definition. >> 2) Making generated class available to operators. >> >> - Tushar. >> >> >> >> On Tue, Jan 12, 2016 at 10:11 AM, Chinmay Kolhatkar < >> chinmay@datatorrent.com >> > wrote: >> >> > Hi Thomas, >> > >> > The module that I'm working on will have fields added to the POJO by >> > current operator as per requirement of further processing stage. >> > >> > The fields added may or may not directly go into the final output POJO. >> > Hence the intermediate stream is mean to carry the required data for >> > processing of next stage. >> > >> > Thanks, >> > Chinmay. >> > >> > >> > On Tue, Jan 12, 2016 at 9:47 AM, Thomas Weise >> > wrote: >> > >> > > Since the output POJO is defined by the user, why is there a need to >> > > generate additional classes for intermediate streams within the >> module? >> > > >> > > Can you give an example? >> > > >> > > >> > > On Mon, Jan 11, 2016 at 8:11 PM, Chinmay Kolhatkar < >> > > chinmay@datatorrent.com> >> > > wrote: >> > > >> > > > Hi Thomas/David, >> > > > >> > > > Here is the details of the usecase. >> > > > I'm writing a module which has following definition: >> > > > >> > > > -> O1 -> O2 -> O3 -> >> > > > >> > > > O1, O2 & O3 are the operators inside the module and module take >> certain >> > > > POJO as input and given certain type if POJO as output. >> > > > >> > > > The input and output POJO will be provide by user. >> > > > But the streams between O1 & O2 and O2 & O3 are supposed to carry >> POJO >> > > > whose definition is unknown to/does not concern user. >> > > > >> > > > These streams within the module is supposed to contain some >> > > intermediately >> > > > processed POJOs, the definition of which will be generated by >> > parameters >> > > > provided to the module. >> > > > >> > > > Here the way I'm trying to achieve this is to generate a class and >> jar >> > > for >> > > > the intermediate streams and want to add those class in classpath. >> > > > >> > > > I am able to generate the class and jar for the intermediate >> streams in >> > > > populateDAG but I could not find any way to dynamically add those >> > classes >> > > > to classpath. >> > > > Also, as these are temporary classes, they need to be deleted once >> its >> > > > utilized. >> > > > >> > > > Hence for this request. >> > > > >> > > > Please suggest if there is a better/cleaner approach to achieve >> this. >> > > > >> > > > Thanks, >> > > > Chinmay. >> > > > >> > > > >> > > > On Tue, Jan 12, 2016 at 5:21 AM, David Yan >> > > wrote: >> > > > >> > > > > If I remember correctly, all the necessary jar files, including >> the >> > > ones >> > > > > specified with -libjars (LIBJARS_CONF_KEY_NAME), are copied to >> HDFS >> > > when >> > > > > the launch command returns with an appid, so it should be safe to >> > > delete >> > > > > temporary jar files after the launch command returns. >> > > > > >> > > > > David >> > > > > >> > > > > On Thu, Jan 7, 2016 at 11:41 PM, Tushar Gosavi < >> > tushar@datatorrent.com >> > > > >> > > > > wrote: >> > > > > >> > > > > > +1 >> > > > > > In past we achieved this by writing generated class to a jar >> file >> > in >> > > > /tmp >> > > > > > directory and adding that jar in LIBJARS_CONF_KEY_NAME >> > > > > > conf.set(StramAppLauncher.LIBJARS_CONF_KEY_NAME, >> > > > > conf.get(StramAppLauncher. >> > > > > > LIBJARS_CONF_KEY_NAME) + "," + generatedPojoJar); >> > > > > > This is a kind of hack and generated jar file does not get >> cleaned >> > up >> > > > as >> > > > > we >> > > > > > don't get any callback after application is submitted in >> > > > > > StreamingApplication. It may be >> > > > > > good idea to provide a api to register temp jar which will get >> > copied >> > > > to >> > > > > > application directory, and deleted (optionally) from local >> machine >> > > > after >> > > > > > application is submitted. >> > > > > > >> > > > > > Regards, >> > > > > > -Tushar. >> > > > > > >> > > > > > >> > > > > > On Fri, Jan 8, 2016 at 12:07 PM, Chinmay Kolhatkar < >> > > > > > chinmay@datatorrent.com> >> > > > > > wrote: >> > > > > > >> > > > > > > Hi Everyone, >> > > > > > > >> > > > > > > I have a requirement where I need to add certain classes to >> > > classpath >> > > > > > > during application started (during initialization). >> > > > > > > >> > > > > > > I get to know the classes to be added to classpath only via >> > > property >> > > > of >> > > > > > > application i.e. populateDAG method is the first point where I >> > get >> > > to >> > > > > > know >> > > > > > > what need to be added to classpath. >> > > > > > > The class I want to add primary defines what a tuple would >> look >> > > like. >> > > > > > > Basically properties will have the field information, >> populateDAG >> > > > needs >> > > > > > to >> > > > > > > generate the class and add it to classpath for all the >> operators. >> > > > > > > >> > > > > > > Creating a class is not a problem, but adding to classpath is. >> > > > > > > Is there a hook present in Apex platform where I can add given >> > > .class >> > > > > > file >> > > > > > > to the classpath in populateDAG? >> > > > > > > >> > > > > > > If not, I was wondering if this will be a positive addition to >> > the >> > > > > > > platform. >> > > > > > > I have some code already created for this. If everyone agrees >> > this >> > > to >> > > > > be >> > > > > > a >> > > > > > > good addition to platform, I'll be happy to work on this and >> > > > contribute >> > > > > > to >> > > > > > > the platform. >> > > > > > > >> > > > > > > Please share your thoughts. >> > > > > > > >> > > > > > > Thanks, >> > > > > > > Chinmay. >> > > > > > > >> > > > > > >> > > > > >> > > > >> > > >> > >> > > --001a1141ed18363e2d0529638b7e--