You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

WIP from VB

Since Sqoop2 is primarily JAVA, we will be using the google JAVA coding standards for the most parts.

Google JAVA coding standards

http://www.infoq.com/news/2014/02/google-java-coding-standards

  • No wildcard imports.
  • Overloads appear sequentially.
  • Braces are used even when the body is empty or contains a single statement.
  • 2 spaces indentation.
  • Column limit can be 80 or 100 characters.
  • No C-style array declarations.
  • The default statement in switch statements are required.
  • Modifiers appear in the order recommended by the Java Language Specification.
  • Constants use CONSTANT_CASE. Note that every constant is a static final field, but not all static final fields are constants.

Wild card imports

Unless the entire set of imports are used in the file. For example in DerbySchemaUpgradeQuery.java every single constant in DerbySchemaConstants is used. In this case, it is ok to use wildcard. 

Column Limit and Line Wrapping

https://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s4.4-column-limit

We will use the 100 character limit. 

Import Order and Grouping 

  1. All static imports in a single group
  2. com.* imports (only if this source file is in the com.google package space)
  3. Third-party imports, one group per top-level package, in ASCII sort orderjava imports
    • for example: androidcomjunitorgsun
  4. java imports
  5. javax imports

 

Few more conventions in Sqoop

  • All test classes should be in the exact same package hierarchy as the source java class
  • All test classes should begin with Test for instance TestCSVInternmediateFormat.java instead of CSVIntermediateFormatTest
  • Naming a variable, a class, a method name should be self-explanatory, if not add sufficient comments explaining what the code does.

 

Before you get on to uploading the patch, also read this wiki that will help with getting through larger feature reviews quicker

Sqoop 2 Review Board Guidelines

  • No labels