[ 
https://issues.apache.org/jira/browse/BIGTOP-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13918952#comment-13918952
 ] 

Konstantin Boudnik commented on BIGTOP-952:
-------------------------------------------

Jay, a few comments:
- I don't see groovy file belonging to the puppet directory. That's a wrong 
place for it. Where do you plan to call it from? Similarly to {{init-hdfs.sh}} 
? I think we need to move it {{bigtop-utils}} or something. Anyone has a 
different opinion?
- file is missing ASL boiler plate
- is this a script or a compilable class? If the former then use correct 
shebang to point to bigtop's groovy interpreter
- don't use printlns for logging
- I don't like the fact that classpath needs to be constructed manually. Is 
there a better way?
- {{if(! args.length == 1) { }} should look like {{ if (args.length != 1) { }}
- {{ def v = new JsonSlurper(); }} isn't used
- there's a bunch of unused imports
- lines shouldn't be longer than 80 symbols. And definetely they shouldn't be 
669 chars long
- else if should be on the same line as '}' in here
{noformat}
}

else if(! new File(args[0]).exists()) { 
{noformat}
- what is {{   exit 1;}}? Are you referring to {{System.exit}} ? Please be 
explicit
- be consistent with indentations: it should be 2 and 4 for  continuous 
statements. This one is wrong;
{noformat}
dirs.each() { 
      System.out.println("here " + it);
{noformat}
- what's the point of keeping commented out lines?
- stationary paths like {{"/usr/lib/hadoop-mapreduce/"}} should be declared as 
named constants
- use safe Groovy casting in  cases lile {{def dirs = (List) 
parsedData.get("dir");}} It can be replaced with  {{parsedData.get("dir") as [] 
}}

> init-hdfs.sh is dog slow. Let's replace it with a single VM call and better 
> layout management
> ---------------------------------------------------------------------------------------------
>
>                 Key: BIGTOP-952
>                 URL: https://issues.apache.org/jira/browse/BIGTOP-952
>             Project: Bigtop
>          Issue Type: Improvement
>          Components: Deployment
>    Affects Versions: 0.5.0
>            Reporter: Konstantin Boudnik
>            Assignee: jay vyas
>            Priority: Blocker
>             Fix For: 0.8.0
>
>         Attachments: BIGTOP-952-tested-refined.patch, 
> BIGTOP-952-tested.patch, provision2.groovy, untar.groovy
>
>
> As has been proposed in [this 
> patch|https://issues.apache.org/jira/secure/attachment/12575644/untarHdfs.groovy]
>  by [~rvs] there's a very efficient way of creating layout in HDFS using a 
> tarfile and Groovy script with direct call into DFS APIs. 
> Let's making it happen.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to