hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: Coding conventions
Date Mon, 21 Feb 2011 15:52:05 GMT
Reading source code would answer most of your questions.

Below is a snippet from HTable:

 * <p>{@link HConnection} will read most of the
 * configuration it needs from the passed {@link Configuration} on initial
 * construction.  Thereafter, for settings such as
 * <code>hbase.client.pause</code>,
<code>hbase.client.retries.number</code>,
 * and <code>hbase.client.rpc.maxattempts</code> updating their values in
the
 * passed {@link Configuration} subsequent to {@link HConnection}
construction
 * will go unnoticed.  To run with changed values, make a new
 * {@link HTable} passing a new {@link Configuration} instance that has the
 * new configuration.

Parameter names should clearly identify whether the parameter is a server
side or client side one. Limit the number of dots to three, if possible.

Use Configuration to pass information.

It depends on how many strings you concatenate. If there are many, you
should use StringBuilder.

On Mon, Feb 21, 2011 at 7:26 AM, Ophir Cohen <ophchu@gmail.com> wrote:

> Hi All,
>
>
> I started to work on my first issue:
> https://issues.apache.org/jira/browse/HBASE-2965 <
> https://issues.apache.org/jira/browse/HBASE-2965> and I have few questions
> regarding coding conventions:
>
>
> 1. Do you have any convention for configuration paramters names (those that
> comes from the Configuration class)?
>
> 2. I saw few places that uses '+' to concat strings. Is that OK or you
> prefer other means (say StringBuilder)?
>
> 3. Generally do you prefer to pass between classes the Job class or the
> Configuration class (assuming, of course, that both of them holds the needed
> data)?
>
>
>
> Thanks for the answer,
>
> Ophir
>
>

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