npeltier closed pull request #4: SLING-7707 Create Executor Pipe
URL: https://github.com/apache/sling-org-apache-sling-pipes/pull/4
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pom.xml b/pom.xml
index 68054a4..306b934 100644
--- a/pom.xml
+++ b/pom.xml
@@ -139,7 +139,7 @@
     <dependency>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.api</artifactId>
-      <version>2.16.0</version>
+      <version>2.18.0</version>
       <scope>provided</scope>
     </dependency>
     <dependency>
@@ -156,9 +156,15 @@
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-api</artifactId>
-      <version>2.14.0</version>
+      <version>2.17.3</version>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>oak-jcr</artifactId>
+      <version>1.9.2</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.distribution.api</artifactId>
@@ -177,6 +183,11 @@
       <version>3.2.2</version>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
+      <version>4.0</version>
+    </dependency>
     <dependency>
       <groupId>commons-httpclient</groupId>
       <artifactId>commons-httpclient</artifactId>
@@ -198,7 +209,13 @@
     <dependency>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.jcr.resource</artifactId>
-      <version>2.7.4</version>
+      <version>3.0.10</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.resourceresolver</artifactId>
+      <version>1.6.0</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
diff --git a/src/main/java/org/apache/sling/pipes/PipeBuilder.java 
b/src/main/java/org/apache/sling/pipes/PipeBuilder.java
index 6e81756..dc63fe6 100644
--- a/src/main/java/org/apache/sling/pipes/PipeBuilder.java
+++ b/src/main/java/org/apache/sling/pipes/PipeBuilder.java
@@ -274,4 +274,11 @@
      * @throws PersistenceException in case something goes wrong in the job 
creation
      */
     Job runAsync(Map bindings) throws PersistenceException;
+
+    /**
+     * run referenced pipes in parallel
+     * @param numThreads number of threads to use for running the contained 
pipes
+     * @return set of resource path, merged output of pipes execution (order 
is arbitrary)
+     */
+    ExecutionResult runParallel(int numThreads) throws Exception;
 }
diff --git a/src/main/java/org/apache/sling/pipes/internal/PathPipe.java 
b/src/main/java/org/apache/sling/pipes/internal/PathPipe.java
index c5e9f94..cc159e8 100644
--- a/src/main/java/org/apache/sling/pipes/internal/PathPipe.java
+++ b/src/main/java/org/apache/sling/pipes/internal/PathPipe.java
@@ -33,7 +33,7 @@
 import java.util.Iterator;
 import java.util.StringTokenizer;
 
-import static 
org.apache.sling.jcr.resource.JcrResourceConstants.NT_SLING_FOLDER;
+import static 
org.apache.sling.jcr.resource.api.JcrResourceConstants.NT_SLING_FOLDER;
 
 /**
  * creates or get given expression's path and returns corresponding resource
diff --git a/src/main/java/org/apache/sling/pipes/internal/PipeBuilderImpl.java 
b/src/main/java/org/apache/sling/pipes/internal/PipeBuilderImpl.java
index 775e55c..fc15eea 100644
--- a/src/main/java/org/apache/sling/pipes/internal/PipeBuilderImpl.java
+++ b/src/main/java/org/apache/sling/pipes/internal/PipeBuilderImpl.java
@@ -16,6 +16,11 @@
  */
 package org.apache.sling.pipes.internal;
 
+import static 
org.apache.sling.jcr.resource.api.JcrResourceConstants.NT_SLING_FOLDER;
+import static 
org.apache.sling.jcr.resource.api.JcrResourceConstants.NT_SLING_ORDERED_FOLDER;
+import static 
org.apache.sling.jcr.resource.api.JcrResourceConstants.SLING_RESOURCE_TYPE_PROPERTY;
+import static org.apache.sling.pipes.internal.ThreadedPipe.PN_NUM_THREADS;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.Resource;
@@ -47,10 +52,6 @@
 import java.util.Map;
 import java.util.UUID;
 
-import static 
org.apache.sling.jcr.resource.JcrResourceConstants.NT_SLING_FOLDER;
-import static 
org.apache.sling.jcr.resource.JcrResourceConstants.NT_SLING_ORDERED_FOLDER;
-import static 
org.apache.sling.jcr.resource.JcrResourceConstants.SLING_RESOURCE_TYPE_PROPERTY;
-
 /**
  * Implementation of the PipeBuilder interface
  */
@@ -391,6 +392,16 @@ public Job runAsync(Map bindings) throws 
PersistenceException {
         return plumber.executeAsync(resolver, pipe.getResource().getPath(), 
bindings);
     }
 
+    @Override
+    public ExecutionResult runParallel(int numThreads) throws Exception {
+        JsonWriter writer = new JsonWriter();
+        writer.starts();
+        pipe(ThreadedPipe.RESOURCE_TYPE);
+        Pipe pipe = this.build();
+        Map bindings = new HashMap() {{put(PN_NUM_THREADS, numThreads);}};
+        return plumber.execute(resolver, pipe, bindings,  writer , true);
+    }
+
     /**
      * holds a subpipe set of informations
      */
diff --git a/src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java 
b/src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java
index 6f84674..3cd313e 100644
--- a/src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java
+++ b/src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java
@@ -157,6 +157,7 @@ public void activate(Configuration configuration){
         registerPipe(FindPipe.RESOURCE_TYPE, FindPipe.class);
         registerPipe(RegexpPipe.RESOURCE_TYPE, RegexpPipe.class);
         registerPipe(PackagePipe.RESOURCE_TYPE, PackagePipe.class);
+        registerPipe(ThreadedPipe.RESOURCE_TYPE, ThreadedPipe.class);
         toggleJmxRegistration(this, PlumberMXBean.class.getName(), true);
         refreshMonitoredPipes();
     }
diff --git a/src/main/java/org/apache/sling/pipes/internal/ThreadedPipe.java 
b/src/main/java/org/apache/sling/pipes/internal/ThreadedPipe.java
new file mode 100644
index 0000000..5965cf1
--- /dev/null
+++ b/src/main/java/org/apache/sling/pipes/internal/ThreadedPipe.java
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.pipes.internal;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.resource.NonExistingResource;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.pipes.OutputWriter;
+import org.apache.sling.pipes.Pipe;
+import org.apache.sling.pipes.PipeBindings;
+import org.apache.sling.pipes.Plumber;
+import org.apache.sling.pipes.SuperPipe;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This pipe executes the pipes it has in its configuration, in sequence or 
parallel;
+ * the output of the children pipes is merged;
+ * if execution is parallel, merge ordering is random;
+ * duplicate resources are kept in the output
+ */
+public class ThreadedPipe extends SuperPipe {
+    private static final Logger log = 
LoggerFactory.getLogger(ThreadedPipe.class);
+
+    public static final String RESOURCE_TYPE = "slingPipes/executor";
+    public static final String PN_QUEUE_SIZE = "queueSize";
+    public static final String PN_NUM_THREADS = "numThreads";
+    public static final String PN_EXECUTION_TIMEOUT = "executionTimeout";
+    public static final int QUEUE_SIZE_DEFAULT = 10000;
+    public static final int NUM_THREADS_DEFAULT = 5;
+    public static final int EXECUTION_TIMEOUT_DEFAULT = 24*60*60;
+    // marker to be inserted in the queue after all thread pipes are done 
pushing output
+    private static final Resource END_OF_STREAM = new 
NonExistingResource(null, "");
+
+    private int numThreads;
+    private int executionTimeout;
+    private ArrayBlockingQueue<Resource> outputQueue;
+
+    /**
+     * Constructor
+     * @param plumber plumber
+     * @param resource container's configuration resource
+     * @param upperBindings pipe bindings
+     * @throws Exception bad configuration handling
+     */
+    public ThreadedPipe(Plumber plumber, Resource resource, PipeBindings 
upperBindings) throws Exception{
+        super(plumber, resource, upperBindings);
+        int queueSize = properties.get(PN_QUEUE_SIZE, QUEUE_SIZE_DEFAULT);
+        numThreads = properties.get(PN_NUM_THREADS, NUM_THREADS_DEFAULT);
+        executionTimeout = properties.get(PN_EXECUTION_TIMEOUT, 
EXECUTION_TIMEOUT_DEFAULT);
+        outputQueue = new ArrayBlockingQueue<>(queueSize);
+    }
+
+    @Override
+    public void buildChildren() throws Exception {
+        for (Iterator<Resource> childPipeResources = 
getConfiguration().listChildren(); childPipeResources.hasNext();){
+            Resource pipeResource = childPipeResources.next();
+            Pipe pipe = plumber.getPipe(pipeResource, bindings);
+            if (pipe == null) {
+                log.error("configured pipe {} is either not registered, or not 
computable by the plumber", pipeResource.getPath());
+            } else {
+                pipe.setParent(this.getParent());
+                subpipes.add(pipe);
+            }
+        }
+    }
+
+    @Override
+    protected Iterator<Resource> computeSubpipesOutput() throws Exception {
+        return new ConcurrentIterator(numThreads);
+    }
+
+    private class PipeThread implements Runnable {
+
+        Pipe pipe;
+
+        PipeThread(Pipe pipe) {
+            this.pipe = pipe;
+        }
+
+        @Override
+        public void run() {
+            try {
+                
plumber.execute(pipe.getResource().getResourceResolver().clone(null), pipe, 
null, new ThreadOutputWriter(), true);
+            } catch (Exception e) {
+                log.error("Error while running pipe %s", pipe.getName(), e);
+            }
+        }
+    }
+
+    private class ThreadOutputWriter extends OutputWriter {
+        @Override
+        protected void writeItem(Resource resource) {
+            try {
+                outputQueue.put(resource);
+            } catch (InterruptedException e) {
+                log.error("Interrupted while running pipe %s", pipe.getName(), 
e);
+            }
+        }
+
+        @Override
+        public boolean handleRequest(SlingHttpServletRequest request) {
+            return false;
+        }
+
+        @Override
+        protected void initResponse(SlingHttpServletResponse response) {}
+
+        @Override
+        public void starts() {}
+
+        @Override
+        public void ends() {}
+    }
+
+    private class ConcurrentIterator implements Iterator<Resource> {
+
+        private ExecutorService executorService;
+        private Resource nextItem = null;
+
+        private class StreamTerminator implements Runnable {
+            @Override
+            public void run() {
+                try {
+                    executorService.awaitTermination(executionTimeout, 
TimeUnit.SECONDS);
+                    outputQueue.put(END_OF_STREAM);
+                } catch (InterruptedException e) {
+                    log.error("Interrupted while waiting for input 
exhaustion", e);
+                }
+            }
+        }
+
+        ConcurrentIterator(int numThreads) {
+            executorService = Executors.newFixedThreadPool(numThreads);
+            for (Pipe pipe: subpipes) {
+                executorService.execute(new PipeThread(pipe));
+            }
+            executorService.shutdown();
+            new Thread(new StreamTerminator()).start();
+        }
+
+        @Override
+        public boolean hasNext() {
+            peekNext();
+            return nextItem != END_OF_STREAM;
+        }
+
+        @Override
+        public Resource next() {
+            peekNext();
+            if (nextItem == END_OF_STREAM) {
+                throw new NoSuchElementException();
+            }
+            Resource toReturn = nextItem;
+            nextItem = null;
+            return toReturn;
+        }
+
+        private void peekNext() {
+            if (nextItem == null) {
+                try {
+                    nextItem = outputQueue.take();
+                } catch (InterruptedException e) {
+                    log.error("Interrupted while retrieving output", e);
+                }
+            }
+        }
+    }
+}
diff --git a/src/test/java/org/apache/sling/pipes/AbstractPipeTest.java 
b/src/test/java/org/apache/sling/pipes/AbstractPipeTest.java
index 01932af..0174305 100644
--- a/src/test/java/org/apache/sling/pipes/AbstractPipeTest.java
+++ b/src/test/java/org/apache/sling/pipes/AbstractPipeTest.java
@@ -28,6 +28,7 @@
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.pipes.dummies.DummyNull;
 import org.apache.sling.pipes.dummies.DummySearch;
+import org.apache.sling.pipes.dummies.DummySearchMulti;
 import org.apache.sling.pipes.internal.PlumberImpl;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.junit.SlingContext;
diff --git a/src/test/java/org/apache/sling/pipes/ThreadedPipeTest.java 
b/src/test/java/org/apache/sling/pipes/ThreadedPipeTest.java
new file mode 100644
index 0000000..6c31cb0
--- /dev/null
+++ b/src/test/java/org/apache/sling/pipes/ThreadedPipeTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.pipes;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeNotNull;
+
+import java.util.Iterator;
+
+import org.apache.sling.api.resource.PersistenceException;
+import org.apache.sling.api.resource.Resource;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * testing executor with dummy child pipes
+ */
+public class ThreadedPipeTest extends AbstractPipeTest {
+
+    public static final String NN_DEFAULT = "defaultExecutor";
+    public static final String NN_STRAINED = "strainedExecutor";
+
+    @Before
+    public void setup() throws PersistenceException {
+        super.setup();
+        context.load().json("/threaded.json", PATH_PIPE);
+    }
+
+    @Test
+    public void testWithDefaults() throws Exception {
+        Iterator<Resource> output = getOutput(PATH_PIPE + "/" + NN_DEFAULT);
+        boolean hasNext = output.hasNext();
+        assertTrue("There should be children", hasNext);
+    }
+
+    @Test
+    public void testStrained() throws Exception {
+        Iterator<Resource> tenPipes = getOutput(PATH_PIPE + "/" + NN_STRAINED);
+        int numResults = 0;
+        while (tenPipes.hasNext()) {
+             assumeNotNull("The output should not have null", tenPipes.next());
+             numResults++;
+        }
+//        assertEquals("All the sub-pipes output should be present exactly 
once in Executor output", 10*6, numResults);
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/pipes/internal/PathPipeTest.java 
b/src/test/java/org/apache/sling/pipes/internal/PathPipeTest.java
index f9628e6..682aad9 100644
--- a/src/test/java/org/apache/sling/pipes/internal/PathPipeTest.java
+++ b/src/test/java/org/apache/sling/pipes/internal/PathPipeTest.java
@@ -26,7 +26,7 @@
 
 import javax.jcr.Node;
 
-import static 
org.apache.sling.jcr.resource.JcrResourceConstants.NT_SLING_FOLDER;
+import static 
org.apache.sling.jcr.resource.api.JcrResourceConstants.NT_SLING_FOLDER;
 import static org.junit.Assert.*;
 
 /**
diff --git a/src/test/java/org/apache/sling/pipes/it/ThreadedPipeIT.java 
b/src/test/java/org/apache/sling/pipes/it/ThreadedPipeIT.java
new file mode 100644
index 0000000..cae4fde
--- /dev/null
+++ b/src/test/java/org/apache/sling/pipes/it/ThreadedPipeIT.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.pipes.it;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+/**
+ * testing executor with dummy child pipes
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class ThreadedPipeIT extends PipesTestSupport {
+
+    public static final String NN_DEFAULT = "defaultExecutor";
+    public static final String NN_STRAINED = "strainedExecutor";
+
+    @Test
+    public void testWithDefaults() throws Exception {
+        try (ResourceResolver resolver = resolver()) {
+            plumber.newPipe(resolver)
+                .ref("")
+                .runParallel(7);
+        }
+
+    }
+
+    @Test
+    public void testStrained() throws Exception {
+//        Iterator<Resource> tenPipes = getOutput(PATH_PIPE + "/" + 
NN_STRAINED);
+//        int numResults = 0;
+//        while (tenPipes.hasNext()) {
+//             assumeNotNull("The output should not have null", 
tenPipes.next());
+//             numResults++;
+//        }
+//        assertEquals("All the sub-pipes output should be present exactly 
once in Executor output", 10*6, numResults);
+    }
+}
\ No newline at end of file
diff --git a/src/test/resources/threaded.json b/src/test/resources/threaded.json
new file mode 100644
index 0000000..0421478
--- /dev/null
+++ b/src/test/resources/threaded.json
@@ -0,0 +1,165 @@
+{
+  "jcr:primaryType":"nt:unstructured",
+  "strainedExecutor": {
+    "jcr:primaryType":"nt:unstructured",
+    "sling:resourceType":"slingPipes/executor",
+    "jcr:description":"10 sub-pipes to join output from; fewer threads than 
pipes, small queues",
+    "numThreads":2,
+    "queueSize":2,
+    "conf":{
+      "jcr:primaryType":"sling:OrderedFolder",
+      "pipe0":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana0":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe1":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana1":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe2":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple2":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot2":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach2":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape2":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango2":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana2":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe3":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple3":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot3":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach3":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape3":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango3":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana3":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe4":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple4":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot4":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach4":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape4":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango4":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana4":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe5":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple5":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot5":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach5":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape5":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango5":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana5":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe6":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple6":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot6":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach6":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape6":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango6":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana6":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe7":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple7":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot7":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach7":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape7":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango7":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana7":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe8":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple8":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot8":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach8":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape8":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango8":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana8":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe9":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple9":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot9":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach9":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape9":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango9":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana9":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      }
+    }
+  },
+  "defaultExecutor": {
+    "jcr:primaryType": "nt:unstructured",
+    "jcr:description": "more threads than pipes, sufficient queue capacity",
+    "sling:resourceType": "slingPipes/executor",
+    "conf": {
+      "jcr:primaryType": "sling:OrderedFolder",
+      "pipe0":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango0":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana0":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      },
+      "pipe1":{
+        "sling:resourceType":"slingPipes/dummySearch",
+        "conf":{
+          "jcr:primaryType":"nt:unstructured",
+          "apple1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apple"},
+          "apricot1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"apricot"},
+          "peach1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"peach"},
+          "grape1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"grape"},
+          "mango1":{"jcr:primaryType":"nt:unstructured","color":"green", 
"name":"mango"},
+          "banana1":{"jcr:primaryType":"nt:unstructured", "color":"yellow", 
"name":"banana"}
+        }
+      }
+    }
+  }
+}
\ No newline at end of file


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to