Package com.ngdata.hbaseindexer.indexer

Examples of com.ngdata.hbaseindexer.indexer.Indexer


       
        ResultToSolrMapper resultToSolrMapper = ResultToSolrMapperFactory.createResultToSolrMapper(
                indexingSpec.getIndexerName(),
                indexerConf);
       
        Indexer indexer = Indexer.createIndexer(
                                indexingSpec.getIndexerName(),
                                indexerConf,
                                indexingSpec.getTableName(),
                                resultToSolrMapper,
                                null,
                                null,
                                documentWriter);
       
        Scan scan = indexingOpts.getScans().get(0);
       
        HTable htable = null;
        try {
            htable = new HTable(hbaseConf, indexingSpec.getTableName());
            ResultScanner scanner = htable.getScanner(scan);
            for (Result result : scanner) {
                indexer.indexRowData(ImmutableList.<RowData>of(new ResultWrappingRowData(result,
                        indexingSpec.getTableName().getBytes(Charsets.UTF_8))));
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
View Full Code Here


    @POST
    @Path("{name}")
    public void indexOn(@QueryParam("action") String action, @PathParam("name") String indexName,
                        @QueryParam("id")final String rowkey, @QueryParam("table") String tableName) throws Exception {
        if ("index".equals(action)) {           
            Indexer indexer = getIndexerSupervisor().getIndexer(indexName);
            List<RowData> rowData = new ArrayList<RowData>();

            if (tableName != null || tableName.isEmpty()) {
                tableName = fetchIndexerTableName(indexName);
            }

            rowData.add(new KeyRowData(rowkey.getBytes(Charsets.UTF_8), tableName.getBytes(Charsets.UTF_8)));
            indexer.indexRowData(rowData);           
        } else {
            throw new WebApplicationException(
                    Response.status(Response.Status.BAD_REQUEST).entity("Unsupported POST action: " + action).build());
        }
    }
View Full Code Here

            } else {
                throw new RuntimeException(
                        "Invalid connection type: " + indexerDef.getConnectionType() + ". Only 'solr' is supported");
            }

            Indexer indexer = Indexer.createIndexer(indexerDef.getName(), indexerConf, indexerConf.getTable(),
                    mapper, htablePool, sharder, solrWriter);
            IndexingEventListener eventListener = new IndexingEventListener(
                    indexer, indexerConf.getTable(), indexerConf.tableNameIsRegex());

            int threads = hbaseConf.getInt("hbaseindexer.indexer.threads", 10);
View Full Code Here

TOP

Related Classes of com.ngdata.hbaseindexer.indexer.Indexer

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.