@Override public void init(NamedList args) { super.init(args); }
@Override public void initializeMetrics(SolrMetricManager manager, String registryName, String tag, String scope) { super.initializeMetrics(manager, registryName, tag, scope); metrics = new MetricsMap((detailed, map) -> { if (importer != null) { DocBuilder.Statistics cumulative = importer.cumulativeStatistics; map.put("Status", importer.getStatus().toString()); if (importer.docBuilder != null) { DocBuilder.Statistics running = importer.docBuilder.importStatistics; map.put("Documents Processed", running.docCount); map.put("Requests made to DataSource", running.queryCount); map.put("Rows Fetched", running.rowsCount); map.put("Documents Deleted", running.deletedDocCount); map.put("Documents Skipped", running.skipDocCount); } map.put(DataImporter.MSG.TOTAL_DOC_PROCESSED, cumulative.docCount); map.put(DataImporter.MSG.TOTAL_QUERIES_EXECUTED, cumulative.queryCount); map.put(DataImporter.MSG.TOTAL_ROWS_EXECUTED, cumulative.rowsCount); map.put(DataImporter.MSG.TOTAL_DOCS_DELETED, cumulative.deletedDocCount); map.put(DataImporter.MSG.TOTAL_DOCS_SKIPPED, cumulative.skipDocCount); } }); manager.registerGauge(this, registryName, metrics, tag, true, "importer", getCategory().toString(), scope); }
public void handleRequest(SolrQueryRequest req, SolrQueryResponse rsp) { numRequests++; try { SolrPluginUtils.setDefaults(req,defaults,appends,invariants); rsp.setHttpCaching(httpCaching); handleRequestBody( req, rsp ); // count timeouts NamedList header = rsp.getResponseHeader(); if(header != null) { Object partialResults = header.get("partialResults"); boolean timedOut = partialResults == null ? false : (Boolean)partialResults; if( timedOut ) { numTimeouts++; rsp.setHttpCaching(false); } } } catch (Exception e) { SolrException.log(SolrCore.log,e); if (e instanceof ParseException) { e = new SolrException(SolrException.ErrorCode.BAD_REQUEST, e); } rsp.setException(e); numErrors++; } totalTime += rsp.getEndTime() - req.getStartTime(); }
@Override @SuppressWarnings("unchecked") public NamedList getStatistics() { NamedList list = super.getStatistics(); if (core != null) { list.add("indexSize", readableSize(getIndexSize()));
@Override public void init(NamedList args) { super.init(args); }
@Override public void init(NamedList args) { super.init(args); }
@Override public void init(NamedList args) { super.init(args); }
@Override public void init(NamedList args) { super.init(args); this.args = SolrParams.toSolrParams(args); }
@Override public void init(NamedList args) { super.init(args); inputFactory = XMLInputFactory.newInstance(); try { // The java 1.6 bundled stax parser (sjsxp) does not currently have a thread-safe // XMLInputFactory, as that implementation tries to cache and reuse the // XMLStreamReader. Setting the parser-specific "reuse-instance" property to false // prevents this. // All other known open-source stax parsers (and the bea ref impl) // have thread-safe factories. inputFactory.setProperty("reuse-instance", Boolean.FALSE); } catch (IllegalArgumentException ex) { // Other implementations will likely throw this exception since "reuse-instance" // isimplementation specific. log.debug("Unable to set the 'reuse-instance' property for the input factory: " + inputFactory); } }
@Override @SuppressWarnings("rawtypes") public void init(NamedList arg0) { super.init(arg0); service = new AutoCompleteService("etc/hr-wiki-titles.txt"); }
@Override @SuppressWarnings("unchecked") public void init(NamedList args) { super.init(args); Map<String,String> macro = new HashMap<>(); macro.put("expandMacros", "false"); defaults = SolrParams.wrapDefaults(defaults, new MapSolrParams(macro)); }
@Override public void init(NamedList args) { super.init( args ); // by default, use wt=raw ModifiableSolrParams params = new ModifiableSolrParams( invariants ); if( params.get( CommonParams.WT ) == null ) { params.set( CommonParams.WT, "raw" ); } this.invariants = params; // Build a list of hidden files hiddenFiles = new HashSet<String>(); if( invariants != null ) { String[] hidden = invariants.getParams( HIDDEN ); if( hidden != null ) { for( String s : hidden ) { hiddenFiles.add( s.toUpperCase() ); } } } }
@Override public void init(NamedList args) { super.init(args); this.queryField = invariants.get(RetentionConstants.QUERY_FIELD); this.timeSeriesAge = invariants.get(RetentionConstants.REMOVE_TIME_SERIES_OLDER); this.optimizeAfterDeletion = Boolean.valueOf(invariants.get(RetentionConstants.OPTIMIZE_AFTER_DELETION)); this.softCommit = Boolean.valueOf(invariants.get(RetentionConstants.SOFT_COMMIT)); this.removeDailyAt = Integer.valueOf(invariants.get(RetentionConstants.REMOVE_DAILY_AT)); this.retentionURL = String.valueOf(invariants.get(RetentionConstants.RETENTION_URL)); scheduledDeletion(); addShutdownHook(); }