[
https://issues.apache.org/jira/browse/OAK-7410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16519111#comment-16519111
]
Thomas Mueller commented on OAK-7410:
-------------------------------------
[~teofili] I have a question. I would like to like to get rid of the oak-lucene
ConfigUtil as that's in oak-search. But the one in oak-search has a difference
(in the last method) I don't understand, and I couldn't find out why it's
different. According to svn / git blame, the change was introduced when you
originally created the oak-search version of it... so, do you remember why you
changed it? oak-search version:
{noformat}
@CheckForNull
public static Blob getBlob(NodeState state, String resourceName){
NodeState contentNode = state.getChildNode(JcrConstants.JCR_CONTENT);
checkArgument(contentNode.exists(), "Was expecting to find jcr:content
node to read resource %s", resourceName);
PropertyState property = contentNode.getProperty(JcrConstants.JCR_DATA);
return property != null ? property.getValue(Type.BINARY) : null;
}
{noformat}
It is used in IndexDefinition, where interestingly there is no check for null:
{noformat}
public InputStream getTikaConfig(){
return ConfigUtil.getBlob(getTikaConfigNode(),
TIKA_CONFIG).getNewStream();
}
private NodeState getTikaConfigNode() {
return definition.getChildNode(TIKA).getChildNode(TIKA_CONFIG);
}
{noformat}
oak-lucene version:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/ConfigUtil.java?annotate=1714238
{noformat}
public static Blob getBlob(NodeState state, String resourceName){
NodeState contentNode = state.getChildNode(JcrConstants.JCR_CONTENT);
checkArgument(contentNode.exists(), "Was expecting to find jcr:content
node to read resource %s", resourceName);
return
contentNode.getProperty(JcrConstants.JCR_DATA).getValue(Type.BINARY);
}
{noformat}
> Define SPIs for Oak Search module
> ---------------------------------
>
> Key: OAK-7410
> URL: https://issues.apache.org/jira/browse/OAK-7410
> Project: Jackrabbit Oak
> Issue Type: Technical task
> Reporter: Tommaso Teofili
> Assignee: Tommaso Teofili
> Priority: Major
> Fix For: 1.9.3
>
> Attachments: AggregateGenerics.patch
>
>
> Abstract IndexEditor and QueryIndex implementations and SPIs should be
> created for Oak Search module.
> Those classes should be then reused / extended by implementors in and outside
> Oak .
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)