lib/query.js
function drop_last_time_stamp_and_maybe_bridge_fetch(processed, size) {
        if (processed.eof) { return processed; }
        var last = _.last(processed.points);
        last_seen_timestamp = last && last.time;

        var non_simultaneous_points = processed.points.filter(function(pt) {
            return pt.time !== last_seen_timestamp;
        });

        if (non_simultaneous_points.length === 0 && processed.points.length !== 0) {
            should_execute_bridge_fetch = true;
            bridge_offset = 0;
            return bridge_fetch(size);
        } else {
            query_start = new JuttleMoment(last_seen_timestamp);
            processed.points = non_simultaneous_points;

            return processed;
        }
    }
function drop_last_time_stamp_and_maybe_bridge_fetch(processed, size) {
        if (processed.eof) { return processed; }
        var last = _.last(processed.points);
        last_seen_timestamp = last && last.time;

        var non_simultaneous_points = processed.points.filter(function(pt) {
            return pt.time !== last_seen_timestamp;
        });

        if (non_simultaneous_points.length === 0 && processed.points.length !== 0) {
            should_execute_bridge_fetch = true;
            bridge_offset = 0;
            return bridge_fetch(size);
        } else {
            query_start = new JuttleMoment(last_seen_timestamp);
            processed.points = non_simultaneous_points;

            return processed;
        }
    }
function drop_last_time_stamp_and_maybe_bridge_fetch ( processed , size ) { if ( processed . eof ) { return processed ; } var last = _ . last ( processed . points ) ; last_seen_timestamp = last && last . time ; var non_simultaneous_points = processed . points . filter ( function ( pt ) { return pt . time !== last_seen_timestamp ; } ) ; if ( non_simultaneous_points . length === 0 && processed . points . length !== 0 ) { should_execute_bridge_fetch = true ; bridge_offset = 0 ; return bridge_fetch ( size ) ; } else { query_start = new JuttleMoment ( last_seen_timestamp ) ; processed . points = non_simultaneous_points ; return processed ; } }
takes the output of points_and_eof_from_es_result and removes the points with the last timestamp, triggering a bridge fetch if all the points are simultaneous. This makes sure the next query, which starts at the last timestamp, won't return any duplicates
takes the output of points_and_eof_from_es_result and removes the points with the last timestamp triggering a bridge fetch if all the points are simultaneous . This makes sure the next query which starts at the last timestamp won t return any duplicates