You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Arun C Murthy (JIRA)" <ji...@apache.org> on 2008/07/21 20:03:33 UTC

[jira] Commented: (HADOOP-1480) pipes should be able to set user counters

    [ https://issues.apache.org/jira/browse/HADOOP-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615339#action_12615339 ] 

Arun C Murthy commented on HADOOP-1480:
---------------------------------------

Here is a proposal after discussions with Owen:

Implement a {{Counter}} class to the C++ layer in Pipes:

{code:title=Counter.cpp}
class Counter {
  private:
    int id;
  public:
    void increment(long increment);
    static Counter getCounter(std::string group, std::string name);
}
{code}

The 'getCounter' contacts the Java Pipes' Mapper/Reducer and registers the given counter (group/name). The registration goes ahead and issues an 'id' which is stored inside the C++ Counter and is then used for incrementing the value of the counter. 

Of course we'd need the getCounter/increment api in UpwardProtocol too... 
{code:title=UpwardProtocol.java}
interface UpwardProtocol {

  // ...
  // ...
  // ...

  /**
   * Register a counter with the given group and name.
   * @param group counter group
   * @param name counter name
   * @return the id for the registered counter.
   * @throws IOException
   */
  int getCounter(String group, String name) throws IOException;
  
  /**
   * Increment the value of a registered counter.
   * @param id counter id of the registered counter
   * @param amount increment for the counter value
   * @throws IOException
   */
  void incrCounter(int id, long amount) throws IOException;

}
{code}


We'd need to add a {{Counters.Counter getCounter(String group, String name)}} api to Reporter to facilitate the above registration protocol:
{code:title=Reporter.java}
  /**
   * Get the {@link Counter} of the given group with the given name.
   * 
   * @param group counter group
   * @param name counter name
   * @return the <code>Counter</code> of the given group/name.
   */
  public abstract Counter getCounter(String group, String name);
{code}

> pipes should be able to set user counters
> -----------------------------------------
>
>                 Key: HADOOP-1480
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1480
>             Project: Hadoop Core
>          Issue Type: New Feature
>          Components: pipes
>    Affects Versions: 0.14.0
>            Reporter: Owen O'Malley
>            Assignee: Arun C Murthy
>
> Pipes should expose the user defined counters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.