Commit Graph

11 Commits

Author SHA1 Message Date
Nik Everett f45d4b276e Cleanup reindex after picking up master
Tasks are now constructed in a simpler way.
Max line length of 140 is enforced.
2016-02-10 14:26:45 -05:00
Nik Everett 4642111bac Teach reindex to retry on rejection
And count it in the status too!
2016-02-10 13:59:17 -05:00
Nik Everett 35307054ea Add reindex progress indicator
Adds a progress indicator for reindex and update_by_query requests that you
can fetch like so:
```
curl 'localhost:9200/_tasks/*/*byquery*?pretty&detailed'
```

```
{
  "nodes" : {
    "r1A2WoRbTwKZ516z6NEs5A" : {
      "name" : "Tyrannus",
      "transport_address" : "127.0.0.1:9300",
      "host" : "127.0.0.1",
      "ip" : "127.0.0.1:9300",
      "attributes" : {
        "testattr" : "test",
        "portsfile" : "true"
      },
      "tasks" : [ {
        "node" : "r1A2WoRbTwKZ516z6NEs5A",
        "id" : 36619,
        "type" : "transport",
        "action" : "indices:data/write/update/byquery",
        "status" : {       <---------------------------- Status is this
          "total" : 6154,
          "updated" : 3500,
          "created" : 0,
          "deleted" : 0,
          "batches" : 36,
          "version_conflicts" : 0,
          "noops" : 0
        },
        "description" : "update-by-query [test][test]"
      } ]
    }
  }
}
```

The progress is just (updated + created + deleted) / total
2016-02-09 14:49:28 -05:00
Nik Everett c1d4478067 Merge branch 'master' into feature/reindex 2016-02-01 18:33:09 -05:00
Nik Everett ab79ff73af Log any errors in reindex task
Does so by introducing TaskListener which is just like ActionListener but
gets the Task as each parameter. Unlike ActionListener which is used
_everywhere_ you can only use TaskListener directly with TransportAction.
TransportAction under the covers uses an ActionListener implemetation that
closes over the task to call the TaskListener.
2016-01-29 10:33:08 -05:00
Nik Everett 0aeeef87d2 fixes from review 2016-01-29 10:26:18 -05:00
Nik Everett d483901434 Return task as nodeId:taskId 2016-01-28 14:37:54 -05:00
Nik Everett 6a2acd348a Default wait_for_completion to true 2016-01-28 12:39:37 -05:00
Nik Everett da42838cff Add wait_for_completion to reindex
It defaults to false and when false it returns a task identifier. Right
now all you can do is get the task to see if it is still running. Once
the task finishes it vanishes and you can't get any information about it.
2016-01-19 14:01:36 -05:00
Nik Everett 645b053061 Merge branch 'master' into feature/reindex 2016-01-15 14:04:37 -05:00
Nik Everett 85797aeb50 Basic reindex and update_by_query
This creates an reindex plugin with a very basic implementation that is
very like delete-by-query. New we'll integrate it with the task managament
work but for now this works.
2016-01-13 09:45:49 -05:00