[jira] [Commented] (NUTCH-2416) Fetcher to log thread ID

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] [Commented] (NUTCH-2416) Fetcher to log thread ID

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/NUTCH-2416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16160456#comment-16160456 ]

Sebastian Nagel commented on NUTCH-2416:

Good idea!

2.x already logs the thread number. The solution seems simpler:
    public FetcherThread(Context context, int num) {
      this.setName("FetcherThread" + num); // use an informative name
Then {{getName()}} contains also a unique thread number.

In 1.x we do not yet have a parameter {{num}} in the constructor of FetcherThread. Ev. we can use [getId()|https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getId--] already in the constructor.

> Fetcher to log thread ID
> ------------------------
>                 Key: NUTCH-2416
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2416
>             Project: Nutch
>          Issue Type: Improvement
>          Components: fetcher
>    Affects Versions: 1.13
>            Reporter: Markus Jelsma
>            Assignee: Markus Jelsma
>            Priority: Trivial
>             Fix For: 1.14
>         Attachments: NUTCH-2416.patch, NUTCH-2416.patch, NUTCH-2416.patch
> Better logging for the fetcher.

This message was sent by Atlassian JIRA