Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename seq# powered optimistic concurrency control parameters to ifSeqNo/ifPrimaryTerm #36757

Merged
merged 8 commits into from
Dec 18, 2018

Conversation

bleskes
Copy link
Contributor

@bleskes bleskes commented Dec 18, 2018

This PR renames the parameters previously introduce to the following:

URL Parameters

PUT twitter/_doc/1?if_seq_no=501&if_primary_term=1
{
    "user" : "kimchy",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch"
}

DELETE twitter/_doc/1?if_seq_no=501&if_primary_term=1

Bulk API

POST _bulk
{ "index" : { "_index" : "test", "_type" : "_doc", "_id" : "1", "if_seq_no": 501, "if_primary_term": 1 } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_type" : "_doc", "_id" : "2", "if_seq_no": 501, "if_primary_term": 1 } }

Java API

IndexRequest.ifSeqNo(long seqNo)
IndexRequest.ifPrimaryTerm(long primaryTerm)
DeleteRequest.ifSeqNo(long seqNo)
DeleteRequest.ifPrimaryTerm(long primaryTerm)

Relates #36148
Relates #10708

@bleskes bleskes added >enhancement :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. v7.0.0 v6.6.0 labels Dec 18, 2018
@bleskes bleskes requested a review from ywelsch December 18, 2018 10:23
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return this;
}

public long ifSeqNoMatch() {
return ifSeqNoMatch;
public long ifSeqNo() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add javadocs to the new getters and setters in IndexRequest and DeleteRequest?

@bleskes
Copy link
Contributor Author

bleskes commented Dec 18, 2018

run default distro tests

@bleskes
Copy link
Contributor Author

bleskes commented Dec 18, 2018

run gradle build tests 1

@bleskes
Copy link
Contributor Author

bleskes commented Dec 18, 2018

run gradle build tests 1

@bleskes
Copy link
Contributor Author

bleskes commented Dec 18, 2018

/cc @elastic/es-clients

Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename of a previously unreleased query string parameter is all good when back ported to 6.6.

@bleskes bleskes merged commit 5f76f39 into elastic:master Dec 18, 2018
@bleskes bleskes deleted the cas_rename branch December 18, 2018 13:35
bleskes added a commit that referenced this pull request Dec 18, 2018
…qNo/ifPrimaryTerm (#36757)

This PR renames the parameters previously introduce to the following:

### URL Parameters
```
PUT twitter/_doc/1?if_seq_no=501&if_primary_term=1
{
    "user" : "kimchy",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch"
}

DELETE twitter/_doc/1?if_seq_no=501&if_primary_term=1
```

### Bulk API
```
POST _bulk
{ "index" : { "_index" : "test", "_type" : "_doc", "_id" : "1", "if_seq_no": 501, "if_primary_term": 1 } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_type" : "_doc", "_id" : "2", "if_seq_no": 501, "if_primary_term": 1 } }
```

### Java API
```
IndexRequest.ifSeqNo(long seqNo)
IndexRequest.ifPrimaryTerm(long primaryTerm)
DeleteRequest.ifSeqNo(long seqNo)
DeleteRequest.ifPrimaryTerm(long primaryTerm)
```

Relates #36148
Relates #10708
seut added a commit to crate/crate that referenced this pull request Oct 25, 2019
mergify bot pushed a commit to crate/crate that referenced this pull request Oct 25, 2019
mergify bot pushed a commit to crate/crate that referenced this pull request Oct 25, 2019
mergify bot pushed a commit to crate/crate that referenced this pull request Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >enhancement v6.6.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants