Indexer(String indexerName, IndexerConf conf, String tableName, ResultToSolrMapper mapper, Sharder sharder, SolrInputDocumentWriter solrWriter) { this.indexerName = indexerName; this.conf = conf; this.tableName = tableName; this.mapper = mapper; try { this.uniqueKeyFormatter = conf.getUniqueKeyFormatterClass().newInstance(); } catch (Exception e) { throw new RuntimeException("Problem instantiating the UniqueKeyFormatter.", e); } ConfigureUtil.configure(uniqueKeyFormatter, conf.getGlobalParams()); this.sharder = sharder; this.solrWriter = solrWriter; this.indexingTimer = Metrics.newTimer(metricName(getClass(), "Index update calculation timer", indexerName), TimeUnit.MILLISECONDS, TimeUnit.SECONDS); }
Indexer(String indexerName, IndexerConf conf, String tableName, ResultToSolrMapper mapper, Sharder sharder, SolrInputDocumentWriter solrWriter) { this.indexerName = indexerName; this.conf = conf; this.tableName = tableName; this.mapper = mapper; try { this.uniqueKeyFormatter = conf.getUniqueKeyFormatterClass().newInstance(); } catch (Exception e) { throw new RuntimeException("Problem instantiating the UniqueKeyFormatter.", e); } ConfigureUtil.configure(uniqueKeyFormatter, conf.getGlobalParams()); this.sharder = sharder; this.solrWriter = solrWriter; this.indexingTimer = Metrics.newTimer(metricName(getClass(), "Index update calculation timer", indexerName), TimeUnit.MILLISECONDS, TimeUnit.SECONDS); }
if (conf.getUniqueKeyFormatterClass() != null) indexerEl.setAttribute("unique-key-formatter", conf.getUniqueKeyFormatterClass().getName());
if (conf.getUniqueKeyFormatterClass() != null) indexerEl.setAttribute("unique-key-formatter", conf.getUniqueKeyFormatterClass().getName());
/** * 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()); }