Package com.ngdata.hbaseindexer.model.api

Examples of com.ngdata.hbaseindexer.model.api.IndexerDefinitionBuilder


        try {
            String lock = model.lockIndexer(indexName);
            try {
                IndexerDefinition index = model.getIndexer(indexName);
                IndexerDefinitionBuilder builder = new IndexerDefinitionBuilder()
                        .startFrom(index)
                        .batchIndexingState(IndexerDefinition.BatchIndexingState.BUILD_REQUESTED)
                        .batchIndexCliArguments(batchCliArgs);
                model.updateIndexer(builder.build(), lock);
            } finally {
                model.unlockIndexer(lock);
            }
        } catch (Exception e) {
            throw new Exception("Error launching batch index build.", e);
View Full Code Here


        Map<String, String> connectionParams = Maps.newHashMap();
        connectionParams.put(SolrConnectionParams.ZOOKEEPER, "localhost:2181/solr");
        connectionParams.put(SolrConnectionParams.COLLECTION, core);
        connectionParams.put(LResultToSolrMapper.REPO_KEY, repository.getRepositoryName());
        connectionParams.put(LResultToSolrMapper.ZOOKEEPER_KEY, "localhost:2181");
        indexerModel.addIndexer(new IndexerDefinitionBuilder()
                .name(name)
                .connectionType("solr")
                .connectionParams(connectionParams)
                .indexerComponentFactory(LilyIndexerComponentFactory.class.getName())
                .configuration(indexConf)
View Full Code Here

        connectionParams.put(SolrConnectionParams.COLLECTION, "core0");
        connectionParams.put(LResultToSolrMapper.ZOOKEEPER_KEY, "localhost:2181");
        connectionParams.put(LResultToSolrMapper.REPO_KEY, REPO_NAME);
        connectionParams.put(LResultToSolrMapper.TABLE_KEY, indexTableName);
        connectionParams.put(LResultToSolrMapper.ENABLE_DEREFMAP_KEY, Boolean.toString(enableDerefMap));
        IndexerDefinition indexDef = new IndexerDefinitionBuilder().name(indexName)
                .connectionType("solr")
                .connectionParams(connectionParams)
                .indexerComponentFactory(LilyIndexerComponentFactory.class.getName())
                .configuration(ByteStreams.toByteArray(IndexerTest.class.getResourceAsStream(confName)))
                        //.solrShards(Collections.singletonMap("shard1", "http://somewhere/"))
View Full Code Here

        if (indexerModel != null) {
            if (indexerModel.hasIndexer(indexName)) {
                System.out.println("doing the cleanup of " + indexName);
                String lock = indexerModel.lockIndexer(indexName);
                IndexerDefinition def = indexerModel.getIndexer(indexName);
                indexerModel.updateIndexer(new IndexerDefinitionBuilder()
                        .startFrom(def)
                        .lifecycleState(IndexerDefinition.LifecycleState.DELETE_REQUESTED).build(), lock);

                listener.waitForEvents(2);
                listener.verifyEvents(new IndexerModelEvent(IndexerModelEventType.INDEXER_DELETED, indexName),
View Full Code Here

        });

        //request the delete
        String lock = indexerModel.lockIndexer(indexName);
        try {
            indexerModel.updateIndexer(new IndexerDefinitionBuilder()
                    .startFrom(indexerModel.getIndexer(indexName))
                    .lifecycleState(IndexerDefinition.LifecycleState.DELETE_REQUESTED)
                    .build(), lock);
        } finally {
            indexerModel.unlockIndexer(lock, true);
View Full Code Here

        Map<String, String> connectionParams = Maps.newHashMap();
        connectionParams.put(SolrConnectionParams.ZOOKEEPER, "localhost:2181/solr");
        connectionParams.put(SolrConnectionParams.COLLECTION, "core0");
        connectionParams.put(LResultToSolrMapper.REPO_KEY, REPO_NAME);
        connectionParams.put(LResultToSolrMapper.ZOOKEEPER_KEY, "localhost:2181");
        IndexerDefinition index = new IndexerDefinitionBuilder()
                .name(INDEX_NAME)
                .connectionType("solr")
                .connectionParams(connectionParams)
                /*
                Map<String, String> solrShards = new HashMap<String, String>();
View Full Code Here

    private static void setBatchIndexConf(String[] defaultConf, String[] customConf, boolean buildNow) throws Exception {
        String lock = model.lockIndexer(INDEX_NAME);

        try {
            IndexerDefinitionBuilder index = new IndexerDefinitionBuilder().startFrom(model.getIndexer(INDEX_NAME));
            if (defaultConf != null) {
                index.defaultBatchIndexCliArguments(defaultConf);
            }
            if (customConf != null) {
                index.batchIndexCliArguments(customConf);
            }
            if (buildNow) {
                index.batchIndexingState(IndexerDefinition.BatchIndexingState.BUILD_REQUESTED);
            }

            model.updateIndexer(index.build(), lock);
        } finally {
            model.unlockIndexer(lock);
        }
    }
View Full Code Here

TOP

Related Classes of com.ngdata.hbaseindexer.model.api.IndexerDefinitionBuilder

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.