Package org.lilyproject.indexer.derefmap

Examples of org.lilyproject.indexer.derefmap.DerefMap


    }

    @Test
    @Ignore
    public void testClearDerefMap() throws Exception {
        DerefMap derefMap = DerefMapHbaseImpl
                .create(REPO_NAME, INDEX_NAME, lilyProxy.getHBaseProxy().getConf(), null, repository.getIdGenerator());

        Record linkedRecord = table.recordBuilder()
                .id("deref-test-linkedrecord")
                .recordType(rt1.getName())
                .field(ft1.getName(), "deref test linkedrecord")
                .create();

        Record record = table.recordBuilder()
                .id("deref-test-main")
                .recordType(rt1.getName())
                .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

TOP

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

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.