nsmcp::accessIngestionCheckpoint (private)

 nsmcp::accessIngestionCheckpoint control

Defined in /usr/local/ns/tcl/nsmcp/examples/nsmcp-openacs-api-docs.tcl

Publish a committed ingestion checkpoint for status readers. @return Updated checkpoint state.

Parameters:
control (required)

Partial Call Graph (max 5 caller/called nodes):
nsmcp::UnifiedAccessAnalytics instproc refreshLocked nsmcp::UnifiedAccessAnalytics instproc refreshLocked (protected) nsmcp::accessIngestionCheckpoint nsmcp::accessIngestionCheckpoint nsmcp::UnifiedAccessAnalytics instproc refreshLocked->nsmcp::accessIngestionCheckpoint

Testcases:
No testcase defined.
Source code:
    foreach key {observedSize cursor caughtUp updatedAt} {
        if {![dict exists $control $key]} {
            return
        }
    }
    set snapshot [dict create available true observedSize [dict get $control observedSize]  cursor [dict get $control cursor] caughtUp [dict get $control caughtUp] updatedAt [dict get $control updatedAt]  backlogBytes [expr {max(0,[dict get $control observedSize]-[dict get $control cursor])}]  historicalKnown false historicalTotalBytes 0 historicalDoneBytes 0 historicalRemainingBytes 0  historicalFiles 0 historicalFilesComplete 0 historicalPassComplete false]
    dict set snapshot sourceCatchupPending [expr {[dict exists $control newSourcePaths] && [llength [dict get $control newSourcePaths]]>0}]
    dict set snapshot sourceCatchupFileCount [expr {[dict exists $control newSourcePaths] ? [llength [dict get $control newSourcePaths]] : 0}]
    foreach key {pending liveFiles unavailableLiveFiles unsupportedCompressed backfillAt lastBackfillError historyDeferred maintenancePressure partitionInterval partitionCount bootstrapFrom availableFrom historicalBackfillEnabled} {
        if {[dict exists $control $key]} {
            dict set snapshot $key [dict get $control $key]
        }
    }
    if {[dict exists $control backfill files]} {
        dict set snapshot historicalKnown true
        dict set snapshot historicalPassComplete [dict exists $control backfill ingestComplete]
        foreach file [dict get $control backfill files] {
            if {[dict get $file status] in {outside-window unsupported-compressed} || [dict get $file compressed]} {
                continue
            }
            set start [expr {[dict exists $file scanStart] ? [dict get $file scanStart] : 0}]
            set end [expr {[dict exists $file scanEnd] ? [dict get $file scanEnd] : [dict get $file size]}]
            set total [expr {max(0,$end-$start)}]
            set done [expr {min($total,max(0,[dict get $file offset]-$start))}]
            dict incr snapshot historicalTotalBytes $total
            dict incr snapshot historicalDoneBytes $done
            dict incr snapshot historicalRemainingBytes [expr {$total-$done}]
            dict incr snapshot historicalFiles
            if {[dict get $file status] eq "complete"} {
                dict incr snapshot historicalFilesComplete
            }
        }
    }
    dict set snapshot historicalRefreshPending [expr {[dict get $snapshot historicalPassComplete]
        && [dict exists $control historyUnreadBytes] && [dict get $control historyUnreadBytes]>0}]
    nsv_set nsmcp:access-store:[ns_info server] progressSnapshot $snapshot
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: