[ 
https://issues.apache.org/jira/browse/LUCENE-1654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714068#action_12714068
 ] 

Uwe Schindler edited comment on LUCENE-1654 at 5/28/09 10:50 AM:
-----------------------------------------------------------------

I found a bug for indexes with the string-based userdata:
{code}
      if (format <= FORMAT_USER_DATA) {
        if (format <= FORMAT_DIAGNOSTICS) {
          userData = input.readStringStringMap();
        } else {
          userData = Collections.EMPTY_MAP;
          if (0 != input.readByte()) {
            userData.put("userData", input.readString());
          }
        }
      } else {
        userData = Collections.EMPTY_MAP;
      }
{code}

But the empty maps of Collections are read-only, so put() throws UOE.

I fix this and commit: userData should be a singleton map, if 0!=readByte(), 
otherwise EMPTY_MAP. 

      was (Author: thetaphi):
    I found a bug for indexes with the string-based userdata:
{code}
      if (format <= FORMAT_USER_DATA) {
        if (format <= FORMAT_DIAGNOSTICS) {
          userData = input.readStringStringMap();
        } else {
          userData = Collections.EMPTY_MAP;
          if (0 != input.readByte()) {
            userData.put("userData", input.readString());
          }
        }
      } else {
        userData = Collections.EMPTY_MAP;
      }
{code}

I fix this and commit. userData should be a singleton map, if 0!=readByte() or 
EMPTY_MAP. But the empty maps of Collections are read-only, so put() throws UOE.
  
> Include diagnostics per-segment when writing a new segment
> ----------------------------------------------------------
>
>                 Key: LUCENE-1654
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1654
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 2.9
>
>         Attachments: LUCENE-1654.patch, LUCENE-1654.patch
>
>
> It would be very helpful if each segment in an index included
> diagnostic information, such as the current version of Lucene.
> EG, in LUCENE-1474 this would be very helpful to see if certain
> segments were written under 2.4.0.
> We can start with just the current version.
> We could also consider making this extensible, so you could provide
> your own arbitrary diagnostics, but SegmentInfo/s is not public so I
> think such an API would be "one-way" in that you'd have to use
> CheckIndex to check on it later.  Or we could wait on such extensibility
> until we provide some consistent way to access per-segment details
> in the index.

-- 
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-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to