Package com.ngdata.hbaseindexer.model.api

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


    }
   
    @Test
    public void testEvaluateIndexingSpecification_PullSolrZkHostFromIndexerDefinition() throws Exception {
       
        IndexerDefinition indexerDef = new IndexerDefinitionBuilder()
                .name("customsolr")
                .configuration(Resources.toByteArray(Resources.getResource(getClass(), "user_indexer.xml")))
                .connectionParams(ImmutableMap.of(
                        "solr.zk", "myZkHost/solr",
                        "solr.collection", "mycollection"))
View Full Code Here


    }
   
    @Test
    public void testIndexingSpecification_PullSolrCollectionFromIndexerDefinition() throws Exception {

        IndexerDefinition indexerDef = new IndexerDefinitionBuilder()
                .name("customcollection")
                .configuration(Resources.toByteArray(Resources.getResource(getClass(), "user_indexer.xml")))
                .connectionParams(ImmutableMap.of(
                        "solr.zk", "myZkHost/solr",
                        "solr.collection", "mycollection"))
View Full Code Here


    @Test
    public void testEvaluateIndexingSpecification_AllFromZooKeeper() throws Exception {

        IndexerDefinition indexerDef = new IndexerDefinitionBuilder()
                .name("userindexer")
                .configuration(Resources.toByteArray(Resources.getResource(getClass(), "user_indexer.xml")))
                .connectionParams(ImmutableMap.of(
                        "solr.zk", "myZkHost/solr",
                        "solr.collection", "mycollection"))
View Full Code Here

    @Test
    public void testEvaluateIndexingSpecification_CombinationOfCmdlineAndZk() throws Exception {

        // Create an indexer -- verify INDEXER_ADDED event
        IndexerDefinition indexerDef = new IndexerDefinitionBuilder()
                .name("userindexer")
                .configuration(Resources.toByteArray(Resources.getResource(getClass(), "user_indexer.xml")))
                .connectionParams(ImmutableMap.of(
                        "solr.zk", "myZkHost/solr",
                        "solr.collection", "mycollection"))
View Full Code Here

    public void addIndexer(IndexerDefinition indexer)
            throws IndexerExistsException, IndexerModelException, IndexerValidityException {
        assertValid(indexer);

        if (indexer.getIncrementalIndexingState() != IndexerDefinition.IncrementalIndexingState.DO_NOT_SUBSCRIBE) {
            indexer = new IndexerDefinitionBuilder().startFrom(indexer).subscriptionTimestamp(System.currentTimeMillis()).build();
        }
        final String indexerPath = indexerCollectionPath + "/" + indexer.getName();
        final byte[] data = IndexerDefinitionJsonSerDeser.INSTANCE.toJsonBytes(indexer);

        try {
View Full Code Here

            }
        } catch (KeeperException.NoNodeException e) {
            throw new IndexerNotFoundException(indexerName);
        }

        IndexerDefinitionBuilder builder = IndexerDefinitionJsonSerDeser.INSTANCE.fromJsonBytes(data);
        builder.name(indexerName);
        builder.occVersion(stat.getVersion());
        return builder.build();
    }
View Full Code Here

public class IndexerDefinitionJsonSerDeser {
    public static IndexerDefinitionJsonSerDeser INSTANCE = new IndexerDefinitionJsonSerDeser();

    public IndexerDefinitionBuilder fromJsonBytes(byte[] json) {
        return fromJsonBytes(json, new IndexerDefinitionBuilder());
    }
View Full Code Here

        }
        return fromJson(node, indexerDefinitionBuilder);
    }

    public IndexerDefinitionBuilder fromJson(ObjectNode node) {
        return fromJson(node, new IndexerDefinitionBuilder());
    }
View Full Code Here

       
        SOLR_ZK = "127.0.0.1:" + zkClientPort + "/solr";
        INDEXER_ZK = "localhost:" + zkClientPort;
        ZooKeeperItf zkItf = ZkUtil.connect(INDEXER_ZK, 15000);
        INDEXER_MODEL = new IndexerModelImpl(zkItf, "/ngdata/hbaseindexer");
        IndexerDefinition indexerDef = new IndexerDefinitionBuilder()
        .name("zkindexerdef")
        .indexerComponentFactory(DefaultIndexerComponentFactory.class.getName())
        .configuration(Resources.toByteArray(Resources.getResource(
                HBaseMapReduceIndexerToolDirectWriteTest.class, "user_indexer.xml")))
        .connectionParams(ImmutableMap.of(
View Full Code Here

        // Create a table in HBase
        createTable("table1", "family1");

        // Add an indexer
        WriteableIndexerModel indexerModel = main.getIndexerModel();
        IndexerDefinition indexerDef = new IndexerDefinitionBuilder()
                .name("indexer1")
                .configuration(
                        Bytes.toBytes("<indexer table='table1'><field name='field1_s' value='family1:qualifier1'/></indexer>"))
                .connectionType("solr")
                .connectionParams(ImmutableMap.of("solr.zk", solrTestingUtility.getZkConnectString(),
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.