-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
[Rest Api Compatibility] Typed endpoint for bulk api #73571
Conversation
retrofits typed endpoint and type in request parsing the original types removal commit elastic#46983 relates elastic#51816
Pinging @elastic/es-core-infra (Team:Core/Infra) |
...p-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java
Show resolved
Hide resolved
@@ -398,7 +399,7 @@ public BulkProcessor add(BytesReference data, @Nullable String defaultIndex, | |||
try { | |||
ensureOpen(); | |||
bulkRequest.add(data, defaultIndex, null, null, defaultPipeline, null, | |||
true, xContentType); | |||
true, xContentType, RestApiVersion.current()); //TOASKONREVIEWis this only used in server, not from Rest? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can BulkProcessor be used from RestApi? I could not find usages. Should it support compatible API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from what we discussed on compatible-rest-api sync, BulkProcessor is not called from Rest layer, so should not need to care about the version from the RestRequest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some styling nits but LGTM otherwise
...p-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java
Show resolved
Hide resolved
@@ -15,6 +15,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE | |||
apply plugin: 'elasticsearch.yaml-rest-test' | |||
apply plugin: 'elasticsearch.internal-cluster-test' | |||
apply plugin: 'elasticsearch.internal-test-artifact-base' | |||
//apply plugin: 'elasticsearch.yaml-rest-compat-test' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: not necessary?
rest-api-spec/build.gradle
Outdated
'bulk/51_refresh_with_types/refresh=true immediately makes changes are visible in search', | ||
'bulk/51_refresh_with_types/refresh=wait_for waits until changes are visible in search', | ||
'bulk/81_cas_with_types/Compare And Swap Sequence Numbers', | ||
// 'bulk/11_basic_with_types/Array of objects', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be deleted rather than commented out?
@@ -64,6 +65,10 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws | |||
builder.field(STATUS, response.status().getStatus()); | |||
} else { | |||
builder.field(_INDEX, failure.getIndex()); | |||
if(builder.getRestApiVersion() == RestApiVersion.V_7){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spacing
@@ -313,6 +318,9 @@ public boolean isAborted() { | |||
@Override | |||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { | |||
builder.field(INDEX_FIELD, index); | |||
if(builder.getRestApiVersion() == RestApiVersion.V_7){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing here too
@@ -38,6 +41,7 @@ | |||
* Helper to parse bulk requests. This should be considered an internal class. | |||
*/ | |||
public final class BulkRequestParser { | |||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(BulkRequestParser.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra space?
retrofits typed endpoint and type in request parsing
the original types removal commit
#46983
relates #51816
gradle check
?