lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-5762) Disable old codecs as much as possible
Date Sun, 15 Jun 2014 14:41:01 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-5762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Robert Muir updated LUCENE-5762:
--------------------------------

    Attachment: LUCENE-5762.patch

Attached is a patch: 

Lucene42Norms is made read-only with a read-write version in test-framework.

Lucene45DocValues has a check like this that it does when it goes to write a field:
{code}
  void checkCanWrite(FieldInfo field) {
    if ((field.getDocValuesType() == DocValuesType.NUMERIC || 
        field.getDocValuesType() == DocValuesType.BINARY) && 
        field.getDocValuesGen() != -1) {
      // ok
    } else {
      throw new UnsupportedOperationException("this codec can only be used for reading");
    }
  }
{code}

And of course a read-write version in test-framework that just allows anything.

> Disable old codecs as much as possible
> --------------------------------------
>
>                 Key: LUCENE-5762
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5762
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-5762.patch
>
>
> Currently, because of updatable docvalues, ancient codecs are not really read-only...
this is a real problem because we can get confused about backwards compatibility or even introduce
bugs.
> Its only necessary to make BINARY and NUMERIC work here, we should throw UOE every other
possible place and prevent use of old codecs to the greatest extent possible.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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


Mime
View raw message