You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chukwa.apache.org by Eric Yang <ey...@yahoo-inc.com> on 2010/07/11 05:05:35 UTC

Enhance demux parsers

Hi all,

I am planning on modifying AbstractProcessor to have 2 additional methods:

Public String getTableName
Public String getColumnFamily

This allows HBaseWriter to validate the output schema and add data to
different Htable.  This should have no impact to existing demux.

Another approach is to use annotation and insert annotation to existing
parser class like:

Public class HadoopLogProcessor extends Abstract Processor {
  @Table
  public static final String recordType = ³HadoopLog²;
  @ColumnFamily
  public static final String nameNodeType = ³NameNode²;
  @ColumnFamily
  public static final String dataNodeType = ³DataNode²;
...
}

Which method makes more sense?

Regards,
Eric

Re: Enhance demux parsers

Posted by Bill Graham <bi...@gmail.com>.
Seems the annotation approach allows you to add HBase specific information
to the sub-classes of AbstractProcessor that are HBase aware without having
to modify AbstractProcessor itself.

+1 for annotations on subclasses.


On Sat, Jul 10, 2010 at 8:05 PM, Eric Yang <ey...@yahoo-inc.com> wrote:

> Hi all,
>
> I am planning on modifying AbstractProcessor to have 2 additional methods:
>
> Public String getTableName
> Public String getColumnFamily
>
> This allows HBaseWriter to validate the output schema and add data to
> different Htable.  This should have no impact to existing demux.
>
> Another approach is to use annotation and insert annotation to existing
> parser class like:
>
> Public class HadoopLogProcessor extends Abstract Processor {
>  @Table
>  public static final String recordType = ³HadoopLog²;
>  @ColumnFamily
>  public static final String nameNodeType = ³NameNode²;
>  @ColumnFamily
>  public static final String dataNodeType = ³DataNode²;
> ...
> }
>
> Which method makes more sense?
>
> Regards,
> Eric
>

Re: Enhance demux parsers

Posted by Jerome Boulon <jb...@netflix.com>.
+1 on using annotation at the parser level

 /Jerome

On Jul 11, 2010, at 20:35, Ariel Rabkin <as...@gmail.com> wrote:

> Hrm.
> 
> Is there a likely use for those methods, other than HBase?  If yes,
> they should be methods. Otherwise, annotations.
> 
> --Ari
> 
> On Sat, Jul 10, 2010 at 8:05 PM, Eric Yang <ey...@yahoo-inc.com> wrote:
>> Hi all,
>> 
>> I am planning on modifying AbstractProcessor to have 2 additional methods:
>> 
>> Public String getTableName
>> Public String getColumnFamily
>> 
>> This allows HBaseWriter to validate the output schema and add data to
>> different Htable.  This should have no impact to existing demux.
>> 
>> Another approach is to use annotation and insert annotation to existing
>> parser class like:
>> 
>> Public class HadoopLogProcessor extends Abstract Processor {
>>  @Table
>>  public static final String recordType = ³HadoopLog²;
>>  @ColumnFamily
>>  public static final String nameNodeType = ³NameNode²;
>>  @ColumnFamily
>>  public static final String dataNodeType = ³DataNode²;
>> ...
>> }
>> 
>> Which method makes more sense?
>> 
>> Regards,
>> Eric
>> 
> 
> 
> 
> -- 
> Ari Rabkin asrabkin@gmail.com
> UC Berkeley Computer Science Department
> 

Re: Enhance demux parsers

Posted by Ariel Rabkin <as...@gmail.com>.
Hrm.

Is there a likely use for those methods, other than HBase?  If yes,
they should be methods. Otherwise, annotations.

--Ari

On Sat, Jul 10, 2010 at 8:05 PM, Eric Yang <ey...@yahoo-inc.com> wrote:
> Hi all,
>
> I am planning on modifying AbstractProcessor to have 2 additional methods:
>
> Public String getTableName
> Public String getColumnFamily
>
> This allows HBaseWriter to validate the output schema and add data to
> different Htable.  This should have no impact to existing demux.
>
> Another approach is to use annotation and insert annotation to existing
> parser class like:
>
> Public class HadoopLogProcessor extends Abstract Processor {
>  @Table
>  public static final String recordType = ³HadoopLog²;
>  @ColumnFamily
>  public static final String nameNodeType = ³NameNode²;
>  @ColumnFamily
>  public static final String dataNodeType = ³DataNode²;
> ...
> }
>
> Which method makes more sense?
>
> Regards,
> Eric
>



-- 
Ari Rabkin asrabkin@gmail.com
UC Berkeley Computer Science Department