jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Parvulescu <alex.parvule...@gmail.com>
Subject Re: svn commit: r1402036 - in /jackrabbit/oak/trunk: oak-core/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ oak-core/src/main/java/org/apache/jackrabbit/oak/plu
Date Mon, 29 Oct 2012 09:33:07 GMT
Hi,

Good point, if you use this index alone, it will probably not work anymore.
But, all the index implementations make all the changes on the builder
param that is managed by the IndexHookManager.

In the end, the index impls will not extend CommitHook (but rather
IndexHook) and will only be used via the IndexHookManager.

best,
alex



On Mon, Oct 29, 2012 at 10:19 AM, Marcel Reutegger <mreutegg@adobe.com>wrote:

> Hi,
>
> I don't think below will work as expected. The PropertyIndexHook now
> simply returns the 'unmodified' after state. Instead it should return
> the state (from the builder) after it did the modifications. Basically what
> the code did in the previous version.
>
> Regards
>  Marcel
>
> > Modified: jackrabbit/oak/trunk/oak-
> > core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/Pro
> > pertyIndexHook.java
> > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-
> > core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/Pro
> > pertyIndexHook.java?rev=1402036&r1=1402035&r2=1402036&view=diff
> > ==========================================================
> > ====================
> > --- jackrabbit/oak/trunk/oak-
> > core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/Pro
> > pertyIndexHook.java (original)
> > +++ jackrabbit/oak/trunk/oak-
> > core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/Pro
> > pertyIndexHook.java Thu Oct 25 09:13:00 2012
> > @@ -22,27 +22,31 @@ import java.util.Map;
> >  import javax.annotation.Nonnull;
> >
> >  import org.apache.jackrabbit.oak.api.CommitFailedException;
> > -import org.apache.jackrabbit.oak.spi.commit.CommitHook;
> > +import org.apache.jackrabbit.oak.plugins.index.IndexHook;
> >  import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
> >  import org.apache.jackrabbit.oak.spi.state.NodeState;
> >
> >  import com.google.common.collect.Maps;
> >
> >  /**
> > - * {@link CommitHook} implementation that is responsible for keeping the
> > + * {@link IndexHook} implementation that is responsible for keeping the
> >   * {@link PropertyIndex} up to date
> >   *
> >   * @see PropertyIndex
> >   * @see PropertyIndexLookup
> >   *
> >   */
> > -public class PropertyIndexHook implements CommitHook {
> > +public class PropertyIndexHook implements IndexHook {
> > +
> > +    private final NodeBuilder builder;
> > +
> > +    public PropertyIndexHook(NodeBuilder builder) {
> > +        this.builder = builder;
> > +    }
> >
> >      @Override @Nonnull
> >      public NodeState processCommit(NodeState before, NodeState after)
> >              throws CommitFailedException {
> > -        NodeBuilder builder = after.builder();
> > -
> >          Map<String, List<PropertyIndexUpdate>> indexes =
> > Maps.newHashMap();
> >          PropertyIndexDiff diff = new PropertyIndexDiff(builder,
> indexes);
> >          after.compareAgainstBaseState(before, diff);
> > @@ -53,7 +57,7 @@ public class PropertyIndexHook implement
> >              }
> >          }
> >
> > -        return builder.getNodeState();
> > +        return after;
> >      }
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message