lib/aerospike/task/execute_task.rb
def all_nodes_done?

      if @scan
        command = 'scan-list'
      else
        command = 'query-list'
      end

      nodes = @cluster.nodes
      done = false

      nodes.each do |node|
        conn = node.get_connection(0)
        responseMap, _ = Info.request(conn, command)
        node.put_connection(conn)

        response = responseMap[command]
        find = "job_id=#{@task_id}:"
        index = response.index(find)

        unless index
          # don't return on first check
          done = true
          next
        end

        b = index + find.length
        response = response[b, response.length]
        find = 'job_status='
        index = response.index(find)

        next unless index

        b = index + find.length
        response = response[b, response.length]
        e = response.index(':')
        status = response[0, e]

        case status
        when 'ABORTED'
          raise raise Aerospike::Exceptions::QueryTerminated
        when 'IN PROGRESS'
          return false
        when 'DONE'
          done = true
        end
      end

      done
    end
# IsDone queries all nodes for task completion status.
IsDone queries all nodes for task completion status.
IsDone queries all nodes for task completion status .
def all_nodes_done?
      if @scan
        command = 'scan-list'
      else
        command = 'query-list'
      end
      nodes = @cluster.nodes
      done = false
      nodes.each do |node|
        conn = node.get_connection(0)
        responseMap, _ = Info.request(conn, command)
        node.put_connection(conn)
        response = responseMap[command]
        find = "job_id=#{@task_id}:"
        index = response.index(find)
        unless index
          done = true
          next
        end
        b = index + find.length
        response = response[b, response.length]
        find = 'job_status='
        index = response.index(find)
        next unless index
        b = index + find.length
        response = response[b, response.length]
        e = response.index(':')
        status = response[0, e]
        case status
        when 'ABORTED'
          raise raise Aerospike::Exceptions::QueryTerminated
        when 'IN PROGRESS'
          return false
        when 'DONE'
          done = true
        end
      end
      done
    end
def all_nodes_done? if @scan command = 'scan-list' else command = 'query-list' end nodes = @cluster . nodes done = false nodes . each do | node | conn = node . get_connection ( 0 ) responseMap , _ = Info . request ( conn , command ) node . put_connection ( conn ) response = responseMap [ command ] find = "job_id=#{@task_id}:" index = response . index ( find ) unless index done = true next end b = index + find . length response = response [ b , response . length ] find = 'job_status=' index = response . index ( find ) next unless index b = index + find . length response = response [ b , response . length ] e = response . index ( ':' ) status = response [ 0 , e ] case status when 'ABORTED' raise raise Aerospike :: Exceptions :: QueryTerminated when 'IN PROGRESS' return false when 'DONE' done = true end end done end
IsDone queries all nodes for task completion status.
IsDone queries all nodes for task completion status .
# don't return on first check