gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Furkan KAMACI <furkankam...@gmail.com>
Subject Re: Logic Bug at LogAnalytics.java
Date Fri, 21 Aug 2015 15:51:07 GMT
It is OK for *run* method if you do not pass any data store. It uses
default data store for reading and writing. It may be nice to give same
behavior to main method.

On Fri, Aug 21, 2015 at 6:16 PM, Alfonso Nishikawa <
alfonso.nishikawa@gmail.com> wrote:

> Hi!
> I suppose that you can run the LogAnalytics from other places with
> mandatory arguments, but if you run it from Main it is mandatory to put 1
> argument. I don't find it inherently wrong if you don't consider the only
> execution being from main.
>
> I actually don't use it, so I don't know wether the default values in the
> else make sense or not.
>
> By the way, I believe that it is forced to 1 argument in the main to be
> shown the help in some way... (and not having to use a command "help").
>
> Regards,
>
> Alfonso Nishikawa
>
>
>
>
> 2015-08-21 13:46 GMT-01:00 Furkan KAMACI <furkankamaci@gmail.com>:
>
> > There is a piece of code at LogAnalytics:
> >
> > public static void main(String[] args) throws Exception {
> >   if(args.length < 2) {
> >     System.err.println(USAGE);
> >     System.exit(1);
> >   }
> >
> >   //run as any other MR job
> >   int ret = ToolRunner.run(new LogAnalytics(), args);
> >   System.exit(ret);
> >
> > }
> >
> > However at run method it says that:
> >
> > if(args.length > 0) {
> >
> >   String dataStoreClass = args[0];
> >   inStore = DataStoreFactory.
> >       getDataStore(dataStoreClass, Long.class, Pageview.class, conf);
> >   if(args.length > 1) {
> >     dataStoreClass = args[1];
> >   }
> >   outStore = DataStoreFactory.
> >       getDataStore(dataStoreClass, String.class, MetricDatum.class,
> conf);
> > } else {
> >  inStore = DataStoreFactory.getDataStore(Long.class, Pageview.class,
> conf);
> >  outStore = DataStoreFactory.getDataStore(String.class,
> > MetricDatum.class, conf);
> > }
> >
> > So, when you check *run* method after *main*, args do not need to be
> > greater or equal to 2?
> >
> > I can commit a patch for it?
> >
> > Kind Regards,
> >
> > Furkan KAMACI
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message