diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-06-08 13:40:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 13:40:36 +0200 |
commit | 14ceb2e5596a30d63a0ae3ea6262f2f41bed93e7 (patch) | |
tree | aca4d958553771a589ec9c423f11725460a5d011 /application | |
parent | bba749743bc02b396298579fdf4e076bc8f8c196 (diff) | |
parent | c264cd1c50c81a46eaf11c52a144274bf8cc2f95 (diff) |
Merge pull request #22993 from vespa-engine/8
8 MERGEOK
Diffstat (limited to 'application')
10 files changed, 10 insertions, 58 deletions
diff --git a/application/abi-spec.json b/application/abi-spec.json index 21eacb152c0..2053eabd9ad 100644 --- a/application/abi-spec.json +++ b/application/abi-spec.json @@ -239,7 +239,6 @@ "public static java.lang.String getDefMd5()", "public static java.lang.String getDefName()", "public static java.lang.String getDefNamespace()", - "public static java.lang.String getDefVersion()", "public void <init>(com.yahoo.application.MockApplicationConfig$Builder)", "public com.yahoo.application.MockApplicationConfig$Mystruct mystruct()", "public java.util.List mystructlist()", @@ -255,7 +254,6 @@ "public static final java.lang.String CONFIG_DEF_MD5", "public static final java.lang.String CONFIG_DEF_NAME", "public static final java.lang.String CONFIG_DEF_NAMESPACE", - "public static final java.lang.String CONFIG_DEF_VERSION", "public static final java.lang.String[] CONFIG_DEF_SCHEMA" ] }, diff --git a/application/pom.xml b/application/pom.xml index 7e1b54a7904..b0036b3ca3e 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -6,12 +6,12 @@ <parent> <groupId>com.yahoo.vespa</groupId> <artifactId>parent</artifactId> - <version>7-SNAPSHOT</version> + <version>8-SNAPSHOT</version> <relativePath>../parent/pom.xml</relativePath> </parent> <artifactId>application</artifactId> <packaging>jar</packaging> - <version>7-SNAPSHOT</version> + <version>8-SNAPSHOT</version> <description>Runs an application directly from services.xml</description> <dependencies> <dependency> @@ -100,6 +100,10 @@ <artifactId>antlr4-runtime</artifactId> </dependency> <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.framework</artifactId> + </dependency> + <dependency> <groupId>org.apache.opennlp</groupId> <artifactId>opennlp-tools</artifactId> </dependency> diff --git a/application/src/main/java/com/yahoo/application/container/DocumentProcessing.java b/application/src/main/java/com/yahoo/application/container/DocumentProcessing.java index f0f85fb78dd..0c581357281 100644 --- a/application/src/main/java/com/yahoo/application/container/DocumentProcessing.java +++ b/application/src/main/java/com/yahoo/application/container/DocumentProcessing.java @@ -3,8 +3,8 @@ package com.yahoo.application.container; import com.yahoo.api.annotations.Beta; import com.yahoo.component.ComponentSpecification; -import com.yahoo.docproc.DocprocExecutor; -import com.yahoo.docproc.DocprocService; +import com.yahoo.docproc.impl.DocprocExecutor; +import com.yahoo.docproc.impl.DocprocService; import com.yahoo.docproc.DocumentProcessor; import com.yahoo.docproc.jdisc.DocumentProcessingHandler; import com.yahoo.document.DocumentType; @@ -59,13 +59,8 @@ public final class DocumentProcessing { * @return Progress.DONE or Progress.FAILED * @throws RuntimeException if one of the document processors in the chain throws, or if the calling thread is interrupted */ - @SuppressWarnings("removal") // TODO Vespa 8: remove public DocumentProcessor.Progress process(ComponentSpecification chain, com.yahoo.docproc.Processing processing) { DocprocExecutor executor = getExecutor(chain); - - // TODO Vespa 8: Remove statement (registry will be removed from Processing) - processing.setDocprocServiceRegistry(handler.getDocprocServiceRegistry()); - return executor.processUntilDone(processing); } @@ -82,17 +77,11 @@ public final class DocumentProcessing { * @return any Progress * @throws RuntimeException if one of the document processors in the chain throws */ - @SuppressWarnings("removal") // TODO Vespa 8: remove public DocumentProcessor.Progress processOnce(ComponentSpecification chain, com.yahoo.docproc.Processing processing) { DocprocExecutor executor = getExecutor(chain); - - // TODO Vespa 8: Remove statement (registry will be removed from Processing) - processing.setDocprocServiceRegistry(handler.getDocprocServiceRegistry()); - return executor.process(processing); } - @SuppressWarnings("removal") // TODO Vespa 8: remove private DocprocExecutor getExecutor(ComponentSpecification chain) { DocprocService service = handler.getDocprocServiceRegistry().getComponent(chain); if (service == null) { diff --git a/application/src/main/java/com/yahoo/application/container/SynchronousRequestResponseHandler.java b/application/src/main/java/com/yahoo/application/container/SynchronousRequestResponseHandler.java index 87d1eff05ab..d21b7af73a0 100644 --- a/application/src/main/java/com/yahoo/application/container/SynchronousRequestResponseHandler.java +++ b/application/src/main/java/com/yahoo/application/container/SynchronousRequestResponseHandler.java @@ -11,7 +11,6 @@ import com.yahoo.jdisc.handler.ResponseHandler; import com.yahoo.jdisc.service.CurrentContainer; import com.yahoo.jdisc.test.TestDriver; -import javax.annotation.concurrent.ThreadSafe; import java.net.URI; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -22,7 +21,6 @@ import java.util.concurrent.CountDownLatch; /** * @author Einar M R Rosenvinge */ -@ThreadSafe @Beta final class SynchronousRequestResponseHandler { @@ -121,7 +119,7 @@ final class SynchronousRequestResponseHandler { } } - @ThreadSafe + private static class BlockingResponseHandler implements ResponseHandler, ContentChannel { private volatile com.yahoo.jdisc.Response discResponse = null; private CountDownLatch closedLatch = new CountDownLatch(1); diff --git a/application/src/main/java/com/yahoo/application/container/handler/Headers.java b/application/src/main/java/com/yahoo/application/container/handler/Headers.java index 3e0c148bcc7..03b31e38659 100644 --- a/application/src/main/java/com/yahoo/application/container/handler/Headers.java +++ b/application/src/main/java/com/yahoo/application/container/handler/Headers.java @@ -4,7 +4,6 @@ package com.yahoo.application.container.handler; import com.yahoo.api.annotations.Beta; import com.yahoo.jdisc.HeaderFields; -import javax.annotation.concurrent.NotThreadSafe; import java.util.Collection; import java.util.List; import java.util.Map; @@ -18,7 +17,6 @@ import java.util.Set; * @author Einar M R Rosenvinge * @author Simon Thoresen Hult */ -@NotThreadSafe @Beta public class Headers implements Map<String, List<String>> { private final HeaderFields h = new HeaderFields(); diff --git a/application/src/main/java/com/yahoo/application/container/handler/Request.java b/application/src/main/java/com/yahoo/application/container/handler/Request.java index 1606af498fa..117737b8fee 100644 --- a/application/src/main/java/com/yahoo/application/container/handler/Request.java +++ b/application/src/main/java/com/yahoo/application/container/handler/Request.java @@ -2,7 +2,6 @@ package com.yahoo.application.container.handler; import com.yahoo.api.annotations.Beta; -import net.jcip.annotations.Immutable; import java.nio.charset.StandardCharsets; import java.security.Principal; @@ -16,7 +15,6 @@ import java.util.concurrent.ConcurrentHashMap; * @author Einar M R Rosenvinge * @see Response */ -@Immutable @Beta public class Request { diff --git a/application/src/main/java/com/yahoo/application/container/handler/Response.java b/application/src/main/java/com/yahoo/application/container/handler/Response.java index 91632068328..88f42a429ee 100644 --- a/application/src/main/java/com/yahoo/application/container/handler/Response.java +++ b/application/src/main/java/com/yahoo/application/container/handler/Response.java @@ -4,7 +4,6 @@ package com.yahoo.application.container.handler; import com.yahoo.api.annotations.Beta; import com.yahoo.jdisc.http.HttpHeaders; import com.yahoo.text.Utf8; -import net.jcip.annotations.Immutable; import java.nio.ByteBuffer; import java.nio.charset.CharacterCodingException; @@ -20,7 +19,6 @@ import java.util.regex.Pattern; * @author Einar M R Rosenvinge * @see Request */ -@Immutable @Beta public class Response { diff --git a/application/src/test/app-packages/searcher-app/components/com.yahoo.vespatest.ExtraHitSearcher.jar b/application/src/test/app-packages/searcher-app/components/com.yahoo.vespatest.ExtraHitSearcher.jar Binary files differindex 90845ab51f9..77f06e869ca 100644 --- a/application/src/test/app-packages/searcher-app/components/com.yahoo.vespatest.ExtraHitSearcher.jar +++ b/application/src/test/app-packages/searcher-app/components/com.yahoo.vespatest.ExtraHitSearcher.jar diff --git a/application/src/test/java/com/yahoo/application/ApplicationTest.java b/application/src/test/java/com/yahoo/application/ApplicationTest.java index 86873033b8a..3d3476cd99b 100644 --- a/application/src/test/java/com/yahoo/application/ApplicationTest.java +++ b/application/src/test/java/com/yahoo/application/ApplicationTest.java @@ -263,36 +263,6 @@ public class ApplicationTest { } @Test - public void client() throws Exception { - try (ApplicationFacade app = new ApplicationFacade(Application.fromBuilder(new Application.Builder() - .documentType("test", new String(this.getClass().getResourceAsStream("/test.sd").readAllBytes(), StandardCharsets.UTF_8)) - .container("default", new Application.Builder.Container() - .client("mbus://*/*", MockClient.class) - .documentProcessor(MockDispatchDocproc.class) - )) - )) { - - Map<String, DocumentType> typeMap = app.application().getJDisc("jdisc").documentProcessing().getDocumentTypes(); - assertNotNull(typeMap); - - DocumentType docType = typeMap.get("test"); - Document doc = new Document(docType, "id:foo:test::bar"); - doc.setFieldValue("title", "hello"); - - assertEquals(DocumentProcessor.Progress.DONE, app.process(new DocumentPut(doc))); - - MockClient client = (MockClient) app.getClientById(MockClient.class.getName()); - assertNotNull(client); - assertEquals(1, client.getCounter()); - - MockDispatchDocproc docproc = (MockDispatchDocproc) app.getComponentById(MockDispatchDocproc.class.getName() + "@default"); - assertNotNull(docproc); - assertEquals(1, docproc.getResponses().size()); - assertEquals(200, docproc.getResponses().get(0).getStatus()); - } - } - - @Test public void file_distribution() { try (Application application = Application.fromApplicationPackage(new File("src/test/app-packages/filedistribution/"), Networking.disable)) { // Deployment succeeded diff --git a/application/src/test/java/com/yahoo/application/container/ContainerTest.java b/application/src/test/java/com/yahoo/application/container/ContainerTest.java index f36237066b5..fda8e0c597a 100644 --- a/application/src/test/java/com/yahoo/application/container/ContainerTest.java +++ b/application/src/test/java/com/yahoo/application/container/ContainerTest.java @@ -64,11 +64,10 @@ public class ContainerTest { try (JDisc container = fromServicesXml("<services>" + // "<container version=\"1.0\" id=\"id1\" />" + // "<container version=\"1.0\" />" + // - "<jdisc version=\"1.0\"/>" + // "</services>", Networking.disable)) { fail("expected exception"); } catch (Exception e) { - assertTrue(e.getMessage().contains("container id='id1', container id='', jdisc id=''")); + assertTrue(e.getMessage().contains("container id='id1', container id=''")); } } |