Re: How to find out if similarity search is active - without doing a search

2018-11-20 Thread Vikas Saurabh
Hi Bertrand,

> Would it be possible for Oak to provide this capability information in
> a different way that does not require a JCR Session? I suppose the
> functionality is available if a specific version of the oak-lucene
> bundle is installed, so the following options come to mind:
>

Disclaimer: I've assumed that "similarity search is active" meant it's
being used in current system and not just the capability - if that
assumption is incorrect, then just ignore this mail.

While what Matt said could likely answer how to implement the
potential solution you mentioned. But, just having the capability to
support similarity search isn't enough for similarity search to be
active. You would have to have some index definition which is indexing
some data for similarity (what Tommaso's suggestion was looking for).

So, if an index def has {{useInSimilarity}} then that index definition
would be doing similarity search based indexiing and queries for some
property. I assume the index provisioning code would be aware of
"availability" of similarity search before it provisioned the
definition. So, I would probably lean towards Tommaso's suggestion -
although I think final check might have to cleaned up according to
what exactly you want to verify.

Thanks,
Vikas


Re: How to find out if similarity search is active - without doing a search

2018-11-20 Thread Matt Ryan
Hi Bertrand,

On Tue, Nov 20, 2018 at 8:00 AM Bertrand Delacretaz 
wrote:

> Hi,
>
> I need to find out whether the Oak similarity search functionality is
> active. I talked to Tommaso and he recommended doing a search under
> /oak:index [1].
>
> That works fine [2] but I need to use a service user to do that, which
> is suboptimal.
>
> Would it be possible for Oak to provide this capability information in
> a different way that does not require a JCR Session? I suppose the
> functionality is available if a specific version of the oak-lucene
> bundle is installed, so the following options come to mind:
>
> a) Adding an OSGi Provide-Capability header to that bundle, that's a
> trivial change to that bundle's build
>
> b) Providing that information in the JCR Repository object's Descriptors
>

This approach was discussed during the most recent Oakathon a couple of
weeks ago; you can see the notes at [0].  IIUC we had a successful outcome
from the prototypes which are linked in that same section.  Next step would
be to formalize the proposal for supporting this as an Oak feature I
believe.

Does this help?

[0] -
https://wiki.apache.org/jackrabbit/Oakathon%20November%202018#Oak_Capabilities


-MR


BUILD FAILURE: Jackrabbit Oak - Build # 1798 - Still Failing

2018-11-20 Thread Apache Jenkins Server
The Apache Jenkins build system has built Jackrabbit Oak (build #1798)

Status: Still Failing

Check console output at https://builds.apache.org/job/Jackrabbit%20Oak/1798/ to 
view the results.

Changes:
[mreutegg] OAK-7889: Test failure: Unable to start Docker container

Break circular dependency between MongoDockerRule and MongoUtils

 

Test results:
15 tests failed.
FAILED:  
oak.apache.jackrabbit.oak.segment.azure.tool.SegmentCopyAzureToTarTest.oak.apache.jackrabbit.oak.segment.azure.tool.SegmentCopyAzureToTarTest

Error Message:
Unable to start docker container: DockerConfig{name=oak-test-azurite}

Stack Trace:
java.lang.RuntimeException: Unable to start docker container: 
DockerConfig{name=oak-test-azurite}
at 
com.arakelian.docker.junit.DockerRule$StatementWithDockerRule.evaluate(DockerRule.java:79)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
at 
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
at 
org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
Caused by: com.spotify.docker.client.exceptions.ContainerNotFoundException: 
Container not found: oak-test-azurite
at 
com.spotify.docker.client.DefaultDockerClient.inspectContainer(DefaultDockerClient.java:1074)
at com.arakelian.docker.junit.Container.start(Container.java:238)
at 
com.arakelian.docker.junit.DockerRule$StatementWithDockerRule.evaluate(DockerRule.java:75)
... 10 more
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request 
error: GET unix://localhost:80/containers/oak-test-azurite/json: 404, body: 
{"message":"No such container: oak-test-azurite"}

at 
com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2820)
at 
com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2692)
at 
com.spotify.docker.client.DefaultDockerClient.inspectContainer(DefaultDockerClient.java:1070)
... 12 more
Caused by: com.spotify.docker.client.shaded.javax.ws.rs.NotFoundException: HTTP 
404 Not Found
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:1008)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:816)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.client.JerseyInvocation.access$700(JerseyInvocation.java:92)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.client.JerseyInvocation$5.completed(JerseyInvocation.java:773)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime.processResponse(ClientRuntime.java:198)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime.access$300(ClientRuntime.java:79)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:180)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
at 
com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:210)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)


FAILED:  
oak.apache.jackrabbit.oak.segment.azure.tool.SegmentCopyTarToAzureTest.oak.apache.jackrabbit.oak.segment.azure.tool.SegmentCopyTarToAzureTest

Error Message:
r

How to find out if similarity search is active - without doing a search

2018-11-20 Thread Bertrand Delacretaz
Hi,

I need to find out whether the Oak similarity search functionality is
active. I talked to Tommaso and he recommended doing a search under
/oak:index [1].

That works fine [2] but I need to use a service user to do that, which
is suboptimal.

Would it be possible for Oak to provide this capability information in
a different way that does not require a JCR Session? I suppose the
functionality is available if a specific version of the oak-lucene
bundle is installed, so the following options come to mind:

a) Adding an OSGi Provide-Capability header to that bundle, that's a
trivial change to that bundle's build

b) Providing that information in the JCR Repository object's Descriptors

Both would work fine for my use case - if a) is acceptable I'm happy
to provide a patch, for b) I would need more research.

-Bertrand

[1] /jcr:root/oak:index//* [@useInSimilarity = true]
[2] 
https://github.com/apache/sling-org-apache-sling-capabilities-jcr/blob/master/src/main/java/org/apache/sling/capabilities/jcr/SearchSource.java