Task

Ultipa tasks can be divided into 2 categories:

  • Runtime uQL Process
    • Real-time tasks or operations excluding those algorithmic tasks, such as queries, insertions or modifications.
  • Algorithm Task
    • Algorithm tasks that are usually time-consuming, such as Louvain community detection, triangle counting, etc.

9.1 Runtime uQL Process

  • Top runtime uQL process

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.top()
    print(ret.toJSON())
    
  • Kill runtime uQL process

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret =  conn.kill(ULTIPA_REQUEST.Kill('1'))
    print(ret.toJSON())
    

9.2 Algorithm Task

  • Show algorithm task

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.showTask(ULTIPA_REQUEST.ShowTask(limit=10))
    print(ret.toJSON())
    
  • Clear algorithm task list

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    # clear task by specifying task id and setting 'all' to 'False':
    ret = conn.clearTask(ULTIPA_REQUEST.ClearTask(id=1,all=False))
    print(ret.toJSON())
    # clear all tasks in the list:
    ret = conn.clearTask(ULTIPA_REQUEST.ClearTask())
    print(ret.toJSON())
    
  • Stop algorithm task

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.stopTask(ULTIPA_REQUEST.StopTask(id=1))
    print(ret.toJSON())