Package org.lilyproject.indexer.derefmap

Examples of org.lilyproject.indexer.derefmap.DependantRecordIdsIterator


                .field(ft1.getName(), "deref test main")
                .field(ft2.getName(), new Link(linkedRecord.getId()))
                .create();

        SchemaId vtag = typeManager.getFieldTypeByName(VersionTag.LAST).getId();
        DependantRecordIdsIterator it = null;

        try {
            it = derefMap.findDependantsOf(absId(linkedRecord.getId()),
                    ft1.getId(), vtag);
            assertTrue(!it.hasNext());
        } finally {
            it.close();
        }

        setBatchIndexConf(getBatchCliArgs("batchIndexCliArgs-testClearDerefmap-false.txt"), null, false);

        buildAndCommit();

        QueryResponse response = solrServer.query(new SolrQuery("field1:deref\\ test\\ main"));
        assertEquals(1, response.getResults().size());

        try {
            it = derefMap.findDependantsOf(absId(linkedRecord.getId()), ft1.getId(), vtag);
            assertTrue(it.hasNext());
        } finally {
            it.close();
        }

        setBatchIndexConf(null, getBatchCliArgs("batchIndexCliArgs-testClearDerefmap-true.txt"), true);
        //waitForIndexAndCommit(BUILD_TIMEOUT);
        // remove when we can do this with hbase-indexer
        buildAndCommit();

        try {
            it = derefMap.findDependantsOf(absId(linkedRecord.getId()), ft1.getId(), vtag);
            assertTrue(!it.hasNext());
        } finally {
            it.close();
        }
    }
View Full Code Here


        // vtags of that other record are.
        for (SchemaId vtag : allVTags) {
            if ((changedVTagFields != null && changedVTagFields.contains(vtag)) || updatedFieldsByScope == null) {
                // changed vtags or delete: reindex regardless of fields
                AbsoluteRecordId absRecordId = new AbsoluteRecordIdImpl(table, recordId);
                DependantRecordIdsIterator dependants = derefMap.findDependantsOf(absRecordId);
                if (log.isDebugEnabled()) {
                    log.debug("changed vtag: dependants of " + recordId + ": " +
                            depIds(derefMap.findDependantsOf(absRecordId)));
                }
                while (dependants.hasNext()) {
                    referrersAndVTags.put(dependants.next(), vtag);
                }
            } else {
                // vtag didn't change, but some fields did change:
                Set<SchemaId> fields = new HashSet<SchemaId>();
                for (Scope scope : updatedFieldsByScope.keySet()) {
                    fields.addAll(toSchemaIds(updatedFieldsByScope.get(scope)));
                }
                AbsoluteRecordId absRecordId = new AbsoluteRecordIdImpl(table, recordId);
                final DependantRecordIdsIterator dependants = derefMap.findDependantsOf(absRecordId, fields, vtag);
                while (dependants.hasNext()) {
                    referrersAndVTags.put(dependants.next(), vtag);
                }
            }
        }

        if (log.isDebugEnabled()) {
View Full Code Here

TOP

Related Classes of org.lilyproject.indexer.derefmap.DependantRecordIdsIterator

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.