Return-Path: X-Original-To: apmail-giraph-user-archive@www.apache.org Delivered-To: apmail-giraph-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 227FA1127D for ; Wed, 16 Jul 2014 10:16:08 +0000 (UTC) Received: (qmail 54633 invoked by uid 500); 16 Jul 2014 10:16:07 -0000 Delivered-To: apmail-giraph-user-archive@giraph.apache.org Received: (qmail 54584 invoked by uid 500); 16 Jul 2014 10:16:07 -0000 Mailing-List: contact user-help@giraph.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@giraph.apache.org Delivered-To: mailing list user@giraph.apache.org Received: (qmail 54574 invoked by uid 99); 16 Jul 2014 10:16:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jul 2014 10:16:07 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sundar@crayondata.com designates 209.85.160.173 as permitted sender) Received: from [209.85.160.173] (HELO mail-yk0-f173.google.com) (209.85.160.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jul 2014 10:16:03 +0000 Received: by mail-yk0-f173.google.com with SMTP id 131so323362ykp.4 for ; Wed, 16 Jul 2014 03:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crayondata.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=DW/f6bAn29E9psr+jPTs5h7PyokMriyGparqRmxb4qQ=; b=SwBDSCysFvFKwOEi9+vSt8O1aIPCv+UsLk3qJipAX0DzMtH/AQNzqQRLI1+np+kl88 4c/13U7Z1+0tksaQ8SW6AMM84qe2Ch9OjDeAv6WlI74cQohq5jBowK9+j2c9nQKkWpI1 xFywfoGjMoA4rJNCfMn7tUPPJ+I3N01PsWrPg= 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=DW/f6bAn29E9psr+jPTs5h7PyokMriyGparqRmxb4qQ=; b=PuImOrL4IBxQwAuFkfKT3gwYsltw2vci97dli6MRoCS4zbeKC9MPkVgpZM7nPQYHfu 5aC8z/pyQQKil8fyAHi6DvYbHzLxI656si17JZYiV88lUQ3jurQQWPEsGNxoJehqkgBQ lMqOsrhKYGMd0XqUzMCu3vg1dTGjnc2kKbwv4Slbq1FjrxyldxABers1+7TC7jKap1v8 WrNuy6WviUyibKO/1D53GEl+X7kwnRkwLJCg+4l3elKuxD2KAblfuXwg7PZvrwa6Te2y Ayf0RUGqIEkEEFiG+QSNjwILpod9Szs+JiM84clGpPzjBnDebi+mJpQkbzuyQDXc5MNU nbIA== X-Gm-Message-State: ALoCoQm1J1Y3ezNIDwSGndrMJBw+yXf+q9kfo+eFqz5aAfzxes8/YGe60VMERkvbGEduqa8yW88s MIME-Version: 1.0 X-Received: by 10.236.148.98 with SMTP id u62mr35892436yhj.119.1405505742432; Wed, 16 Jul 2014 03:15:42 -0700 (PDT) Received: by 10.170.195.18 with HTTP; Wed, 16 Jul 2014 03:15:42 -0700 (PDT) In-Reply-To: References: Date: Wed, 16 Jul 2014 15:45:42 +0530 Message-ID: Subject: Re: string parameter from command line From: Sundara Raghavan Sankaran To: user@giraph.apache.org Content-Type: multipart/alternative; boundary=20cf303a338382036704fe4cce5a X-Virus-Checked: Checked by ClamAV on apache.org --20cf303a338382036704fe4cce5a Content-Type: text/plain; charset=UTF-8 I'm not sure of the use case here, but I'll give an example which might help you. The parameter is given in the command line with -ca (as you said). For example hadoop jar sample.jar -vip .... *-ca sample.option1=value1 -ca sample.option2=value2* You can then get this value from the configuration in your computation class *String option1 = getConf().get("sample.option1"); // will get "value1"* *String option2 = getConf().get("sample.option2"); // will get "value2"* On Wed, Jul 16, 2014 at 2:49 PM, Carmen Manzulli wrote: > Hi experts, > I'm trying to insert a string parameter from the command line with > "-ca"...so in my Computation code i've created a StrConfOption...when > running i get NPE because it seems to set the value of this string to > null... > > how can i fix this problem? > --20cf303a338382036704fe4cce5a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I'm not sure of the use case here, but I'll give a= n example which might help you.

The parameter is given i= n the command line with -ca (as you said). For example
hadoop jar= sample.jar -vip .... -ca sample.option1=3Dvalue1 -ca sample.option2=3Dv= alue2

You can then get this value from the configuration in y= our computation class

String option1 =3D getCon= f().get("sample.option1"); // will get "value1"
String option2 =3D getConf().get("sample.option2"); // wi= ll get "value2"



On Wed, Jul 16, 2014 at 2:49= PM, Carmen Manzulli <carmenmanzulli@gmail.com> wrote= :
Hi experts,
I'm trying to insert a string parameter from the command line with = "-ca"...so in my Computation code i've created a StrConfOptio= n...when running i get NPE because it seems to set the value of this string= to null...

how can i fix this problem?

--20cf303a338382036704fe4cce5a--