Hi,
I am using the setup() and cleanup() methods as follows:

@Override
protected void setup(Context context) throws IOException,
InterruptedException {
HBaseConfiguration conf = new
HBaseConfiguration(context.getConfiguration());
System.out.println("Opening table NwKeyword");
keywordTable = new HTable(conf, "NwKeyword");
System.out.println("Table opened");
}

@Override
protected void cleanup(Context context) throws IOException,
InterruptedException {
keywordTable.close();
System.out.println("Table closed");
}

@Override
public void reduce(Text key, Iterable<Text> values, Context context)
throws IOException, InterruptedException {
......

I know that the setup method is being called because I can use the
keywordTable in my reduce function, which I cannot do if I don't initialize
the table in setup(). But the System.out.println statement is not getting
printed. I checked the sysout as well as the job logs. Where does/should it
get printed?

Thanks,
hari

Search Discussions

  • Ken Goodhope at Dec 13, 2010 at 7:08 pm
    If you look in your logs directory, you will see a subdir called userlogs.
    Inside there you will see a directory for every task. Those directories
    contain stdout, stderr, and system.
    On Mon, Dec 13, 2010 at 9:26 AM, Hari Sreekumar wrote:

    Hi,
    I am using the setup() and cleanup() methods as follows:

    @Override
    protected void setup(Context context) throws IOException,
    InterruptedException {
    HBaseConfiguration conf = new
    HBaseConfiguration(context.getConfiguration());
    System.out.println("Opening table NwKeyword");
    keywordTable = new HTable(conf, "NwKeyword");
    System.out.println("Table opened");
    }

    @Override
    protected void cleanup(Context context) throws IOException,
    InterruptedException {
    keywordTable.close();
    System.out.println("Table closed");
    }

    @Override
    public void reduce(Text key, Iterable<Text> values, Context
    context) throws IOException, InterruptedException {
    ......

    I know that the setup method is being called because I can use the
    keywordTable in my reduce function, which I cannot do if I don't initialize
    the table in setup(). But the System.out.println statement is not getting
    printed. I checked the sysout as well as the job logs. Where does/should it
    get printed?

    Thanks,
    hari
  • Hari Sreekumar at Dec 14, 2010 at 4:25 am
    ah yeah.. was looking at the wrong log directory

    Thanks,
    Hari
    On Tue, Dec 14, 2010 at 12:37 AM, Ken Goodhope wrote:

    If you look in your logs directory, you will see a subdir called userlogs.
    Inside there you will see a directory for every task. Those directories
    contain stdout, stderr, and system.

    On Mon, Dec 13, 2010 at 9:26 AM, Hari Sreekumar wrote:

    Hi,
    I am using the setup() and cleanup() methods as follows:

    @Override
    protected void setup(Context context) throws IOException,
    InterruptedException {
    HBaseConfiguration conf = new
    HBaseConfiguration(context.getConfiguration());
    System.out.println("Opening table NwKeyword");
    keywordTable = new HTable(conf, "NwKeyword");
    System.out.println("Table opened");
    }

    @Override
    protected void cleanup(Context context) throws IOException,
    InterruptedException {
    keywordTable.close();
    System.out.println("Table closed");
    }

    @Override
    public void reduce(Text key, Iterable<Text> values, Context
    context) throws IOException, InterruptedException {
    ......

    I know that the setup method is being called because I can use the
    keywordTable in my reduce function, which I cannot do if I don't initialize
    the table in setup(). But the System.out.println statement is not getting
    printed. I checked the sysout as well as the job logs. Where does/should it
    get printed?

    Thanks,
    hari

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmapreduce-user @
categorieshadoop
postedDec 13, '10 at 5:26p
activeDec 14, '10 at 4:25a
posts3
users2
websitehadoop.apache.org...
irc#hadoop

2 users in discussion

Hari Sreekumar: 2 posts Ken Goodhope: 1 post

People

Translate

site design / logo © 2022 Grokbase