Package org.apache.jackrabbit.oak.spi.state

Examples of org.apache.jackrabbit.oak.spi.state.ReadOnlyBuilder


class IndexNode {

    static IndexNode open(String indexPath, NodeState defnNodeState,@Nullable IndexCopier cloner)
            throws IOException {
        Directory directory = null;
        IndexDefinition definition = new IndexDefinition(new ReadOnlyBuilder(defnNodeState));
        NodeState data = defnNodeState.getChildNode(INDEX_DATA_CHILD_NAME);
        if (data.exists()) {
            directory = new OakDirectory(new ReadOnlyBuilder(data), definition);
            if (cloner != null){
                directory = cloner.wrap(indexPath, definition, directory);
            }
        } else if (PERSISTENCE_FILE.equalsIgnoreCase(defnNodeState.getString(PERSISTENCE_NAME))) {
            String path = defnNodeState.getString(PERSISTENCE_PATH);
View Full Code Here


    public ImmutableTree(@Nonnull ImmutableTree parent, @Nonnull String name, @Nonnull NodeState state) {
        this(new DefaultParentProvider(parent), name, state);
    }

    public ImmutableTree(@Nonnull ParentProvider parentProvider, @Nonnull String name, @Nonnull NodeState state) {
        super(name, new ReadOnlyBuilder(state));
        this.state = state;
        this.parentProvider = parentProvider;
    }
View Full Code Here

        if (type == null || PERSISTENCE_OAK.equalsIgnoreCase(type)) {
            NodeState index = getIndexDataNode(def);
            if (index == null) {
                return null;
            }
            return new OakDirectory(new ReadOnlyBuilder(index));
        }

        if (PERSISTENCE_FILE.equalsIgnoreCase(type)) {
            String fs = def.getString(PERSISTENCE_PATH);
            if (fs == null) {
View Full Code Here

    public Iterable<String> query(final Filter filter, final String indexName,
                                  final NodeState indexMeta, final String indexStorageNodeName,
                                  final PropertyRestriction pr) {
       
        final NodeState indexState = indexMeta.getChildNode(indexStorageNodeName);
        final NodeBuilder index = new ReadOnlyBuilder(indexState);

        if (pr.first != null && !pr.first.equals(pr.last)) {
            // '>' & '>=' and between use case
            ChildNodeEntry firstValueableItem;
            String firstValuableItemKey;
View Full Code Here

     *
     * @param nodeState the node state to inspect
     * @return the next value
     */
    static String getPropertyNext(@Nonnull final NodeState state, final int lane) {
        return getPropertyNext(new ReadOnlyBuilder(state), lane);
    }
View Full Code Here

    public void childNodeAdded(String name, NodeState after) {
        if (NodeStateUtils.isHidden(name)) {
            return;
        }
        for (LuceneIndexUpdate update : updates.values()) {
            update.insert(concat(getPath(), name), new ReadOnlyBuilder(after));
        }
        after.compareAgainstBaseState(MemoryNodeState.EMPTY_NODE, child(name));
    }
View Full Code Here

    }

    @Override
    public Cursor query(Filter filter, NodeState root) {

        NodeBuilder builder = new ReadOnlyBuilder(root);
        for (String name : elements(index.getPath())) {
            builder = builder.child(name);
        }
        if (!builder.hasChildNode(INDEX_DATA_CHILD_NAME)) {
            // index not initialized yet
            return Cursors.newPathCursor(Collections.<String> emptySet());
        }
        builder = builder.child(INDEX_DATA_CHILD_NAME);

        Directory directory = new ReadOnlyOakDirectory(builder);
        long s = System.currentTimeMillis();

        try {
View Full Code Here

        if (type == null || PERSISTENCE_OAK.equalsIgnoreCase(type)) {
            NodeState index = getIndexDataNode(def);
            if (index == null) {
                return null;
            }
            return new OakDirectory(new ReadOnlyBuilder(index));
        }

        if (PERSISTENCE_FILE.equalsIgnoreCase(type)) {
            String fs = def.getString(PERSISTENCE_PATH);
            if (fs == null) {
View Full Code Here

        if (type == null || PERSISTENCE_OAK.equalsIgnoreCase(type)) {
            NodeState index = getIndexDataNode(def);
            if (index == null) {
                return null;
            }
            return new OakDirectory(new ReadOnlyBuilder(index));
        }

        if (PERSISTENCE_FILE.equalsIgnoreCase(type)) {
            String fs = getString(def, PERSISTENCE_PATH);
            if (fs == null) {
View Full Code Here

        this(parentProvider, name, state, TreeTypeProvider.EMPTY);
    }

    public ImmutableTree(@Nonnull ParentProvider parentProvider, @Nonnull String name,
                         @Nonnull NodeState state, @Nonnull TreeTypeProvider typeProvider) {
        super(name, new ReadOnlyBuilder(state));
        this.state = state;
        this.parentProvider = parentProvider;
        this.typeProvider = typeProvider;
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.state.ReadOnlyBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.