Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-52

FSOrderedMapFile causes seek(-1) when searching for an entry less than the first.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0
    • Component/s: .structures
    • Labels:
      None

      Description

      FSOrderedMap file can perform a negative seek if you search for an entry which is lexographically less than the first entry in the Map.

        Attachments

          Activity

          Hide
          craigm Craig Macdonald added a comment -
          Seek pos=130 intpos=130
          Checking WT01-B01-100 cmp=-39
          high=1 low=0
          high=1 low=0
          i=0
          Seek pos=0 intpos=0
          Checking WT01-B01-1 cmp=-39
          high=-1 low=0
          Seek pos=-65 intpos=-65
          Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -65
                  at java.io.ByteArrayInputStream.read(ByteArrayInputStream.java:127)
                  at java.io.DataInputStream.readByte(DataInputStream.java:248)
                  at org.apache.hadoop.io.WritableUtils.readVLong(WritableUtils.java:324)
                  at org.apache.hadoop.io.WritableUtils.readVInt(WritableUtils.java:345)
                  at org.apache.hadoop.io.Text.readFields(Text.java:253)
                  at uk.ac.gla.terrier.structures.seralization.FixedSizeTextFactory$FixedSizeText.readFields(FixedSizeTextFactory.java:38)
                  at uk.ac.gla.terrier.structures.collections.FSOrderedMapFile.getEntry(FSOrderedMapFile.java:624)
                  at uk.ac.gla.terrier.structures.collections.FSOrderedMapFile.get(FSOrderedMapFile.java:640)
                  at uk.ac.gla.terrier.structures.collections.FSOrderedMapFile.get(FSOrderedMapFile.java:42)
                  at uk.ac.gla.terrier.structures.CompressingMetaIndex.getDocument(CompressingMetaIndex.java:790)
                  at uk.ac.gla.terrier.structures.CompressingMetaIndex.main(CompressingMetaIndex.java:1082)
          
          
          Show
          craigm Craig Macdonald added a comment - Seek pos=130 intpos=130 Checking WT01-B01-100 cmp=-39 high=1 low=0 high=1 low=0 i=0 Seek pos=0 intpos=0 Checking WT01-B01-1 cmp=-39 high=-1 low=0 Seek pos=-65 intpos=-65 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -65 at java.io.ByteArrayInputStream.read(ByteArrayInputStream.java:127) at java.io.DataInputStream.readByte(DataInputStream.java:248) at org.apache.hadoop.io.WritableUtils.readVLong(WritableUtils.java:324) at org.apache.hadoop.io.WritableUtils.readVInt(WritableUtils.java:345) at org.apache.hadoop.io.Text.readFields(Text.java:253) at uk.ac.gla.terrier.structures.seralization.FixedSizeTextFactory$FixedSizeText.readFields(FixedSizeTextFactory.java:38) at uk.ac.gla.terrier.structures.collections.FSOrderedMapFile.getEntry(FSOrderedMapFile.java:624) at uk.ac.gla.terrier.structures.collections.FSOrderedMapFile.get(FSOrderedMapFile.java:640) at uk.ac.gla.terrier.structures.collections.FSOrderedMapFile.get(FSOrderedMapFile.java:42) at uk.ac.gla.terrier.structures.CompressingMetaIndex.getDocument(CompressingMetaIndex.java:790) at uk.ac.gla.terrier.structures.CompressingMetaIndex.main(CompressingMetaIndex.java:1082)
          Hide
          craigm Craig Macdonald added a comment -

          Initial patch for this issue. Added a test suite for FSOrderedMapFile as well.

          Show
          craigm Craig Macdonald added a comment - Initial patch for this issue. Added a test suite for FSOrderedMapFile as well.
          Hide
          craigm Craig Macdonald added a comment -

          Resolved. TestCase have been moved to a separate source tree

          Show
          craigm Craig Macdonald added a comment - Resolved. TestCase have been moved to a separate source tree

            People

            • Assignee:
              craigm Craig Macdonald
              Reporter:
              craigm Craig Macdonald
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: