Package com.ngdata.hbaseindexer.conf

Examples of com.ngdata.hbaseindexer.conf.IndexerConfBuilder


        final HTableInterface multitableA = mock(HTableInterface.class);
        final HTableInterface multitableB = mock(HTableInterface.class);
        when(tablePool.getTable(multiTableAName.getBytes(Charsets.UTF_8))).thenReturn(multitableA);
        when(tablePool.getTable(multiTableBName.getBytes(Charsets.UTF_8))).thenReturn(multitableB);

        final IndexerConf indexerConf = new IndexerConfBuilder().table(tablePrefix + ".*").build();
        ResultToSolrMapper mapper = createHbaseToSolrMapper(true);
        Indexer indexer = Indexer.createIndexer("index name", indexerConf, tablePrefix+ ".*", mapper, tablePool, null, solrDocumentWriter);
        IndexingEventListener indexingEventListener = new IndexingEventListener(indexer, tablePrefix+ ".*", true);
        List<KeyValue> kvs = Lists.newArrayList(
                new KeyValue(Bytes.toBytes("row1"), Bytes.toBytes("messages"), Bytes.toBytes("msg1"),
View Full Code Here


    public void read(InputStream is) throws IndexerConfException {
        try {
            this.confData = ByteStreams.toByteArray(is);

            validate(new ByteArrayInputStream(confData));
            IndexerConfBuilder builder = new IndexerConfBuilder();

            String zkParam = params.get(LResultToSolrMapper.ZOOKEEPER_KEY);
            if (zkParam == null) {
                throw new IndexerConfException("The required connection parameter " + LilyResultToSolrMapper.ZOOKEEPER_KEY + " is not set.");
            }
            String repoParam= Optional.fromNullable(params.get(LResultToSolrMapper.REPO_KEY)).or(RepoAndTableUtil.DEFAULT_REPOSITORY);
            String tableParam = Optional.fromNullable(params.get(LResultToSolrMapper.TABLE_KEY)).or(LilyHBaseSchema.Table.RECORD.name);
            String tableName;
            if (repoParam.equals("default")) {
                tableName = tableParam;
            } else {
                tableName = repoParam.concat("__").concat(tableParam);
            }
            builder.table(tableName);

            // TODO: Do any of these need to be configurable given the Lily context?
            builder.mappingType(null);
            builder.rowReadMode(null);
            builder.uniqueyKeyField("lily.key");
            builder.uniqueKeyFormatterClass(null);
            builder.rowField(null);
            builder.columnFamilyField(null);
            builder.tableNameField(null);

            indexerConf = builder.build();
        } catch (Exception e) {
            throw new IndexerConfException("Problems initializing the indexer components", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.ngdata.hbaseindexer.conf.IndexerConfBuilder

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.