diff options
author | Arnstein Ressem <aressem@gmail.com> | 2021-12-22 12:40:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-22 12:40:58 +0100 |
commit | 2f33978811aa66984b90aac2b6b5f1b73772fe16 (patch) | |
tree | 27d765e7e6301cb12381fbca539413b150664b1e /vespaclient-container-plugin | |
parent | 7ef261d471f4a11651811957b2f24bb7e0bcf4d5 (diff) |
Revert "Updatese with craete true should not increemeent not found metric"
Diffstat (limited to 'vespaclient-container-plugin')
2 files changed, 3 insertions, 7 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java index 3eac4ff5c5d..2a7e69a0bf4 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java @@ -468,7 +468,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { DocumentOperationParameters parameters = parametersFromRequest(request, ROUTE) .withResponseHandler(response -> { outstanding.decrementAndGet(); - updateUpdateMetrics(response.outcome(), update.getCreateIfNonExistent()); + updateUpdateMetrics(response.outcome()); handleFeedOperation(path, handler, response); }); return () -> dispatchOperation(() -> asyncSession.update(update, parameters)); @@ -1047,8 +1047,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { } } - private void updateUpdateMetrics(Outcome outcome, boolean create) { - if (create && outcome == Outcome.NOT_FOUND) outcome = Outcome.SUCCESS; // >_< + private void updateUpdateMetrics(Outcome outcome) { switch (outcome) { case SUCCESS: metric.add(MetricNames.SUCCEEDED, 1, null); break; case NOT_FOUND: metric.add(MetricNames.NOT_FOUND, 1, null); break; diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java index 3762d52ba19..b71b5d79520 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java @@ -2,7 +2,6 @@ package com.yahoo.vespa.http.server; import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol; -import com.yahoo.documentapi.messagebus.protocol.UpdateDocumentMessage; import com.yahoo.documentapi.messagebus.protocol.UpdateDocumentReply; import com.yahoo.documentapi.metrics.DocumentApiMetrics; import com.yahoo.documentapi.metrics.DocumentOperationStatus; @@ -69,9 +68,7 @@ public class FeedReplyReader implements ReplyHandler { } private static boolean updateNotFound(Reply reply) { - return reply instanceof UpdateDocumentReply - && ! ((UpdateDocumentReply) reply).wasFound() - && ! ((UpdateDocumentMessage) reply.getMessage()).getDocumentUpdate().getCreateIfNonExistent(); + return reply instanceof UpdateDocumentReply && ! ((UpdateDocumentReply) reply).wasFound(); } private void enqueue(ReplyContext context, String message, ErrorCode status, boolean isConditionNotMet, Trace trace) { |