/** * Instantiate an indexer based on the given {@link IndexerConf}. */ public static Indexer createIndexer(String indexerName, IndexerConf conf, String tableName, ResultToSolrMapper mapper, Connection tablePool, Sharder sharder, SolrInputDocumentWriter solrWriter) { switch (conf.getMappingType()) { case COLUMN: return new ColumnBasedIndexer(indexerName, conf, tableName, mapper, sharder, solrWriter); case ROW: return new RowBasedIndexer(indexerName, conf, tableName, mapper, tablePool, sharder, solrWriter); default: throw new IllegalStateException("Can't determine the type of indexing to use for mapping type " + conf.getMappingType()); } }
/** * Instantiate an indexer based on the given {@link IndexerConf}. */ public static Indexer createIndexer(String indexerName, IndexerConf conf, String tableName, ResultToSolrMapper mapper, Connection tablePool, Sharder sharder, SolrInputDocumentWriter solrWriter) { switch (conf.getMappingType()) { case COLUMN: return new ColumnBasedIndexer(indexerName, conf, tableName, mapper, sharder, solrWriter); case ROW: return new RowBasedIndexer(indexerName, conf, tableName, mapper, tablePool, sharder, solrWriter); default: throw new IllegalStateException("Can't determine the type of indexing to use for mapping type " + conf.getMappingType()); } }
document.appendChild(indexerEl); indexerEl.setAttribute("table", createTableValue(conf)); if (conf.getMappingType() != null) indexerEl.setAttribute("mapping-type", conf.getMappingType().toString().toLowerCase()); if (conf.getRowReadMode() != null) indexerEl.setAttribute("read-row", conf.getRowReadMode().toString().toLowerCase());
document.appendChild(indexerEl); indexerEl.setAttribute("table", createTableValue(conf)); if (conf.getMappingType() != null) indexerEl.setAttribute("mapping-type", conf.getMappingType().toString().toLowerCase()); if (conf.getRowReadMode() != null) indexerEl.setAttribute("read-row", conf.getRowReadMode().toString().toLowerCase());
/** * Construct based on an existing {@code IndexerConf}. All initial settings are * copied from the supplied configuration * * @param indexerConf indexer configuration containing default values */ public IndexerConfBuilder(IndexerConf indexerConf) { this.table = indexerConf.getTable(); this.uniqueKeyField = indexerConf.getUniqueKeyField(); this.rowField = indexerConf.getRowField(); this.columnFamilyField = indexerConf.getColumnFamilyField(); this.tableNameField = indexerConf.getTableNameField(); this.mapperClass = indexerConf.getMapperClass(); this.uniqueKeyFormatterClass = indexerConf.getUniqueKeyFormatterClass(); this.rowReadMode = indexerConf.getRowReadMode(); this.mappingType = indexerConf.getMappingType(); this.fieldDefinitions = Lists.newArrayList(indexerConf.getFieldDefinitions()); this.documentExtractDefinitions = Lists.newArrayList(indexerConf.getDocumentExtractDefinitions()); this.globalParams = Maps.newHashMap(indexerConf.getGlobalParams()); }
/** * Construct based on an existing {@code IndexerConf}. All initial settings are * copied from the supplied configuration * * @param indexerConf indexer configuration containing default values */ public IndexerConfBuilder(IndexerConf indexerConf) { this.table = indexerConf.getTable(); this.uniqueKeyField = indexerConf.getUniqueKeyField(); this.rowField = indexerConf.getRowField(); this.columnFamilyField = indexerConf.getColumnFamilyField(); this.tableNameField = indexerConf.getTableNameField(); this.mapperClass = indexerConf.getMapperClass(); this.uniqueKeyFormatterClass = indexerConf.getUniqueKeyFormatterClass(); this.rowReadMode = indexerConf.getRowReadMode(); this.mappingType = indexerConf.getMappingType(); this.fieldDefinitions = Lists.newArrayList(indexerConf.getFieldDefinitions()); this.documentExtractDefinitions = Lists.newArrayList(indexerConf.getDocumentExtractDefinitions()); this.globalParams = Maps.newHashMap(indexerConf.getGlobalParams()); }
if (indexerConf.getMappingType() == MappingType.ROW) { MorphlineClasspathUtil.setupJavaCompilerClasspath();
if (indexerConf.getMappingType() == MappingType.ROW) { MorphlineClasspathUtil.setupJavaCompilerClasspath();