You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@giraph.apache.org by Carmen Manzulli <ca...@gmail.com> on 2014/07/16 11:19:24 UTC

string parameter from command line

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?

Re: string parameter from command line

Posted by Carmen Manzulli <ca...@gmail.com>.
ok, sorry it was a dummy error in my code...your suggestion fixs my
problem!!!thanks a lot!!! :D


2014-07-16 16:49 GMT+02:00 Carmen Manzulli <ca...@gmail.com>:

> every kind of suggestions will be appreciated
>
>
> 2014-07-16 13:32 GMT+02:00 Carmen Manzulli <ca...@gmail.com>:
>
> yes...this i would obtain...but there is a unknown error (for me) in the
>> code:
>>
>> public final StrConfOption SOURCE_ID = new
>> StrConfOption("Selection.sourceId",null,"select source id");
>>       public final Text subject=new
>> Text(getConf().get("Selection.sourceId"));
>>
>> and from command line: hadoop jar.....-vip....-ca
>> Selection.sourceId="string"
>>
>> i would use <subject> to compare vertex ID values ( defined as Text in my
>> inputFormat)
>>
>>
>> 2014-07-16 12:15 GMT+02:00 Sundara Raghavan Sankaran <
>> sundar@crayondata.com>:
>>
>> 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 <
>>> 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 StrConfOption...when
>>>> running i get NPE because it seems to set the value of this string to
>>>> null...
>>>>
>>>> how can i fix this problem?
>>>>
>>>
>>>
>>
>

Re: string parameter from command line

Posted by Carmen Manzulli <ca...@gmail.com>.
every kind of suggestions will be appreciated


2014-07-16 13:32 GMT+02:00 Carmen Manzulli <ca...@gmail.com>:

> yes...this i would obtain...but there is a unknown error (for me) in the
> code:
>
> public final StrConfOption SOURCE_ID = new
> StrConfOption("Selection.sourceId",null,"select source id");
>       public final Text subject=new
> Text(getConf().get("Selection.sourceId"));
>
> and from command line: hadoop jar.....-vip....-ca
> Selection.sourceId="string"
>
> i would use <subject> to compare vertex ID values ( defined as Text in my
> inputFormat)
>
>
> 2014-07-16 12:15 GMT+02:00 Sundara Raghavan Sankaran <
> sundar@crayondata.com>:
>
> 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 <
>> 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 StrConfOption...when
>>> running i get NPE because it seems to set the value of this string to
>>> null...
>>>
>>> how can i fix this problem?
>>>
>>
>>
>

Re: string parameter from command line

Posted by Carmen Manzulli <ca...@gmail.com>.
yes...this i would obtain...but there is a unknown error (for me) in the
code:

public final StrConfOption SOURCE_ID = new
StrConfOption("Selection.sourceId",null,"select source id");
      public final Text subject=new
Text(getConf().get("Selection.sourceId"));

and from command line: hadoop jar.....-vip....-ca
Selection.sourceId="string"

i would use <subject> to compare vertex ID values ( defined as Text in my
inputFormat)


2014-07-16 12:15 GMT+02:00 Sundara Raghavan Sankaran <su...@crayondata.com>
:

> 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 <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 StrConfOption...when
>> running i get NPE because it seems to set the value of this string to
>> null...
>>
>> how can i fix this problem?
>>
>
>

Re: string parameter from command line

Posted by Sundara Raghavan Sankaran <su...@crayondata.com>.
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 <ca...@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 StrConfOption...when
> running i get NPE because it seems to set the value of this string to
> null...
>
> how can i fix this problem?
>