You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jason Rutherglen (JIRA)" <ji...@apache.org> on 2008/09/15 23:31:44 UTC

[jira] Created: (LUCENE-1388) Add init method to CloseableThreadLocal

Add init method to CloseableThreadLocal
---------------------------------------

                 Key: LUCENE-1388
                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
             Project: Lucene - Java
          Issue Type: Improvement
          Components: Index
    Affects Versions: 2.3.2
            Reporter: Jason Rutherglen
            Priority: Trivial


Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1388) Add init method to CloseableThreadLocal

Posted by "Jason Rutherglen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Rutherglen updated LUCENE-1388:
-------------------------------------

    Attachment: LUCENE-1388.patch

Wrong test case in previous patch.

> Add init method to CloseableThreadLocal
> ---------------------------------------
>
>                 Key: LUCENE-1388
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.2
>            Reporter: Jason Rutherglen
>            Priority: Trivial
>         Attachments: LUCENE-1388.patch, LUCENE-1388.patch
>
>
> Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1388) Add init method to CloseableThreadLocal

Posted by "Jason Rutherglen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Rutherglen updated LUCENE-1388:
-------------------------------------

    Attachment: LUCENE-1388.patch

LUCENE-1388.patch

Added the initialValue method, and a test case.

> Add init method to CloseableThreadLocal
> ---------------------------------------
>
>                 Key: LUCENE-1388
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.2
>            Reporter: Jason Rutherglen
>            Priority: Trivial
>         Attachments: LUCENE-1388.patch
>
>
> Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1388) Add init method to CloseableThreadLocal

Posted by "Jason Rutherglen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631416#action_12631416 ] 

Jason Rutherglen commented on LUCENE-1388:
------------------------------------------

Should the null check in the get method by synchronized?  Or does it matter?

> Add init method to CloseableThreadLocal
> ---------------------------------------
>
>                 Key: LUCENE-1388
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.2
>            Reporter: Jason Rutherglen
>            Assignee: Michael McCandless
>            Priority: Trivial
>             Fix For: 2.4
>
>         Attachments: LUCENE-1388.patch, LUCENE-1388.patch, LUCENE-1388.patch
>
>
> Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1388) Add init method to CloseableThreadLocal

Posted by "robert engels (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631157#action_12631157 ] 

robert engels commented on LUCENE-1388:
---------------------------------------

The code is incorrect.

It needs to be in the get method, as each thread needs to have initialValue called on the first get().

> Add init method to CloseableThreadLocal
> ---------------------------------------
>
>                 Key: LUCENE-1388
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.2
>            Reporter: Jason Rutherglen
>            Priority: Trivial
>         Attachments: LUCENE-1388.patch, LUCENE-1388.patch
>
>
> Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1388) Add init method to CloseableThreadLocal

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631408#action_12631408 ] 

Michael McCandless commented on LUCENE-1388:
--------------------------------------------

Patch looks good; I'll commit shortly.  Thanks Jason!

> Add init method to CloseableThreadLocal
> ---------------------------------------
>
>                 Key: LUCENE-1388
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.2
>            Reporter: Jason Rutherglen
>            Priority: Trivial
>         Attachments: LUCENE-1388.patch, LUCENE-1388.patch, LUCENE-1388.patch
>
>
> Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-1388) Add init method to CloseableThreadLocal

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved LUCENE-1388.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.4
         Assignee: Michael McCandless

Sending        src/java/org/apache/lucene/util/CloseableThreadLocal.java
Adding         src/test/org/apache/lucene/index/TestCloseableThreadLocal.java
Transmitting file data ..
Committed revision 695899.


> Add init method to CloseableThreadLocal
> ---------------------------------------
>
>                 Key: LUCENE-1388
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.2
>            Reporter: Jason Rutherglen
>            Assignee: Michael McCandless
>            Priority: Trivial
>             Fix For: 2.4
>
>         Attachments: LUCENE-1388.patch, LUCENE-1388.patch, LUCENE-1388.patch
>
>
> Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1388) Add init method to CloseableThreadLocal

Posted by "Jason Rutherglen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Rutherglen updated LUCENE-1388:
-------------------------------------

    Attachment: LUCENE-1388.patch

LUCENE-1388.patch

Initvalue is summoned in the get method.  Includes a extraordinarily simple test case.

> Add init method to CloseableThreadLocal
> ---------------------------------------
>
>                 Key: LUCENE-1388
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.2
>            Reporter: Jason Rutherglen
>            Priority: Trivial
>         Attachments: LUCENE-1388.patch, LUCENE-1388.patch, LUCENE-1388.patch
>
>
> Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1388) Add init method to CloseableThreadLocal

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631155#action_12631155 ] 

Michael McCandless commented on LUCENE-1388:
--------------------------------------------

Normally initialValue is called from get() the first time get() is invoked (if set wasn't called).  But this patch calls it in the ctor, in which case I think we should simply pass in the initial value as an arg to the ctor?

> Add init method to CloseableThreadLocal
> ---------------------------------------
>
>                 Key: LUCENE-1388
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.2
>            Reporter: Jason Rutherglen
>            Priority: Trivial
>         Attachments: LUCENE-1388.patch, LUCENE-1388.patch
>
>
> Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1388) Add init method to CloseableThreadLocal

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631462#action_12631462 ] 

Michael McCandless commented on LUCENE-1388:
--------------------------------------------

bq. Should the null check in the get method by synchronized?

I don't think that's necessary.

> Add init method to CloseableThreadLocal
> ---------------------------------------
>
>                 Key: LUCENE-1388
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1388
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.2
>            Reporter: Jason Rutherglen
>            Assignee: Michael McCandless
>            Priority: Trivial
>             Fix For: 2.4
>
>         Attachments: LUCENE-1388.patch, LUCENE-1388.patch, LUCENE-1388.patch
>
>
> Java ThreadLocal has an init method that allows subclasses to easily instantiate an initial value.  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org