[TR-52] FSOrderedMapFile causes seek(-1) when searching for an entry less than the first. Created: 21/Aug/09  Updated: 05/Mar/10  Resolved: 31/Aug/09

Status: Resolved
Project: Terrier Core
Component/s: .structures
Affects Version/s: 3.0
Fix Version/s: 3.0

Type: Bug Priority: Minor
Reporter: Craig Macdonald Assignee: Craig Macdonald
Resolution: Fixed  
Labels: None

Attachments: File TREC-55.v1.patch    

 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.

 Comments   
Comment by Craig Macdonald [ 21/Aug/09 ]
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)

Comment by Craig Macdonald [ 30/Aug/09 ]

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

Comment by Craig Macdonald [ 31/Aug/09 ]

Resolved. TestCase have been moved to a separate source tree

Generated at Thu Aug 06 02:45:33 BST 2020 using JIRA 7.1.1#71004-sha1:d6b2c0d9b7051e9fb5e4eb8ce177ca56d91d7bd8.