lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [lucene-solr] msokolov commented on a change in pull request #657: LUCENE-8781: FST direct arc addressing
Date Fri, 03 May 2019 18:45:14 GMT
msokolov commented on a change in pull request #657: LUCENE-8781: FST direct arc addressing
URL: https://github.com/apache/lucene-solr/pull/657#discussion_r280887556
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/util/fst/FST.java
 ##########
 @@ -865,20 +939,32 @@ public int readNextArcLabel(Arc<T> arc, BytesReader in) throws
IOException {
       } else {
         in.setPosition(pos);
       }
+      // skip flags
+      in.readByte();
     } else {
       if (arc.bytesPerArc != 0) {
         //System.out.println("    nextArc real array");
-        // arcs are at fixed entries
-        in.setPosition(arc.posArcsStart);
-        in.skipBytes((1+arc.arcIdx)*arc.bytesPerArc);
+        // arcs are in an array
+        if (arc.arcIdx >= 0) {
+          in.setPosition(arc.posArcsStart);
+          // point at next arc, -1 to skip flags
+          in.skipBytes((1 + arc.arcIdx) * arc.bytesPerArc + 1);
+        } else {
+          in.setPosition(arc.nextArc);
+          byte flags = in.readByte();
+          // skip missing arcs
+          while (flag(flags, BIT_MISSING_ARC)) {
 
 Review comment:
   great idea - perhaps if we add some Arc abstractions that would provide a nice hook for
such tracking/counting

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


Mime
View raw message