summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-05-23 09:03:03 +0200
committerJon Bratseth <bratseth@oath.com>2018-05-23 09:03:03 +0200
commit5db3df1e1c76922c8f9c66f2036f32bf0808012f (patch)
treed221868f1a673429e12dfa01aeb905622989ea55 /vespaclient-container-plugin
parent5db7b3494a981aeb457dc107966018f6e66f5f42 (diff)
JSON feed validation WIP
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java
index 5f1c96d000f..0d8cde234eb 100644
--- a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java
+++ b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java
@@ -40,6 +40,8 @@ import static com.yahoo.messagebus.ErrorCode.SEND_QUEUE_FULL;
* The implementation is based on the code from V2, but the object model is rewritten to simplify the logic and
* avoid using a threadpool that has no effect with all the extra that comes with it. V2 has one instance per thread
* on the client, while this is one instance for all threads.
+ *
+ * @author dybis
*/
class ClientFeederV3 {
@@ -109,7 +111,7 @@ class ClientFeederV3 {
ongoingRequests.incrementAndGet();
try {
FeederSettings feederSettings = new FeederSettings(request);
- /**
+ /*
* The gateway handle overload from clients in different ways.
*
* If the backend is overloaded, but not the gateway, it will fill the backend, messagebus throttler
@@ -132,7 +134,7 @@ class ClientFeederV3 {
}
InputStream inputStream = StreamReaderV3.unzipStreamIfNeeded(request);
- final BlockingQueue<OperationStatus> replies = new LinkedBlockingQueue<>();
+ BlockingQueue<OperationStatus> replies = new LinkedBlockingQueue<>();
try {
feed(feederSettings, inputStream, replies, threadsAvailableForFeeding);
synchronized (monitor) {
@@ -171,7 +173,7 @@ class ClientFeederV3 {
private Optional<DocumentOperationMessageV3> pullMessageFromRequest(
FeederSettings settings, InputStream requestInputStream, BlockingQueue<OperationStatus> repliesFromOldMessages) {
while (true) {
- final Optional<String> operationId;
+ Optional<String> operationId;
try {
operationId = streamReaderV3.getNextOperationId(requestInputStream);
} catch (IOException ioe) {
@@ -183,7 +185,7 @@ class ClientFeederV3 {
if (! operationId.isPresent()) {
return Optional.empty();
}
- final DocumentOperationMessageV3 msg;
+ DocumentOperationMessageV3 msg;
try {
msg = getNextMessage(operationId.get(), requestInputStream, settings);
} catch (Exception e) {
@@ -235,7 +237,7 @@ class ClientFeederV3 {
}
setMessageParameters(msg.get(), settings);
- final Result result;
+ Result result;
try {
result = sendMessage(settings, msg.get(), threadsAvailableForFeeding);
@@ -286,6 +288,7 @@ class ClientFeederV3 {
}
DocumentOperationMessageV3 msg = DocumentOperationMessageV3.create(operation, operationId, metric);
+ xxx
if (msg == null) {
// typical end of feed
return null;