nsmcp::accessTimeIndexAdvance

 nsmcp::accessTimeIndexAdvance

Defined in

Partial Call Graph (max 5 caller/called nodes):
accessFileScan accessFileScan nsmcp::accessTimeIndexAdvance nsmcp::accessTimeIndexAdvance accessFileScan->nsmcp::accessTimeIndexAdvance instproc instproc instproc->nsmcp::accessTimeIndexAdvance nsmcp::LogCorrelation nsmcp::LogCorrelation nsmcp::LogCorrelation->nsmcp::accessTimeIndexAdvance nsmcp::accessScanProgress nsmcp::accessScanProgress nsmcp::accessTimeIndexAdvance->nsmcp::accessScanProgress nsmcp::accessScanRangeMature nsmcp::accessScanRangeMature nsmcp::accessTimeIndexAdvance->nsmcp::accessScanRangeMature nsmcp::accessTimeIndexEvidence nsmcp::accessTimeIndexEvidence nsmcp::accessTimeIndexAdvance->nsmcp::accessTimeIndexEvidence nsmcp::accessTimeIndexLoad nsmcp::accessTimeIndexLoad nsmcp::accessTimeIndexAdvance->nsmcp::accessTimeIndexLoad nsmcp::accessTimeIndexOutside nsmcp::accessTimeIndexOutside nsmcp::accessTimeIndexAdvance->nsmcp::accessTimeIndexOutside

Testcases:
No testcase defined.
Source code:
    upvar 1 $fileVar file $stateVar state $budgetVar budget
    set offset [dict get $file offset]
    if {[dict exists $file nativeTail] || [dict exists $file timeIndexRejected $offset]} {
        return false
    }
    set entry [accessTimeIndexLoad $file]
    if {$entry eq "" || ![dict exists $entry segments $offset]} {
        return false
    }
    set segment [dict get $entry segments $offset]
    set end [dict get $segment end]
    if {$end>$sourceSize || ![accessTimeIndexOutside $segment $options]} {
        return false
    }
    set bytes [expr {$end-$offset}]
    if {[dict get $segment stamp] ne [accessTimeIndexStamp $file]
        || ![dict exists $segment trusted] || ![dict get $segment trusted] || ![accessScanRangeMature $file $limits]} {
        if {$bytes>[dict get $limits bytes]-[dict get $state examinedBytes]} {
            return false
        }
        if {$bytes>$budget} {
            if {$bytes>[dict get $limits slice]+[dict get $limits line]} {
                return false
            }
            if {$budget<[dict get $limits slice]} {
                # Resume at this line boundary with a fresh worker slice rather
                # than reading a fragment that destroys the seek checkpoint.
                dict set file timeIndexYield true
                return false
            }
            # One final physical line may extend a cached range slightly past
            # a slice, just as the sequential reader can finish one long line.
        }
        accessScanProgress $publish validating-index $state $file $offset $sourceSize
        seek $channel $offset
        set data [read $channel $bytes]
        dict incr state examinedBytes [string length $data]
        dict incr file timeIndexValidationBytes [string length $data]
        incr budget -[string length $data]
        if {[string length $data]!=$bytes || [ns_crypto::md string -digest sha256 -- $data] ne [dict get $segment digest]} {
            dict set file timeIndexRejected $offset true
            return false
        }
        dict set segment stamp [accessTimeIndexStamp $file]
        dict set segment trusted [accessScanRangeMature $file $limits]
        dict set segment final [expr {$end==$sourceSize}]
        accessTimeIndexSave $file $segment
    }
    accessTimeIndexEvidence file $segment
    dict set file offset $end
    dict set file timeIndexHit true
    dict incr file timeIndexSkippedBytes $bytes
    dict set file rangeUncertain true
    # EOF is reached through verified exclusion, not physical examination.
    seek $channel $end
    accessScanProgress $publish seeking $state $file $end $sourceSize
    return true
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: