@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); this.pipelineId = in.readOptionalString(); boolean verbose = in.readBoolean(); int responsesLength = in.readVInt(); results = new ArrayList<>(); for (int i = 0; i < responsesLength; i++) { SimulateDocumentResult simulateDocumentResult; if (verbose) { simulateDocumentResult = new SimulateDocumentVerboseResult(in); } else { simulateDocumentResult = new SimulateDocumentBaseResult(in); } results.add(simulateDocumentResult); } }
SimulateDocumentResult executeDocument(Pipeline pipeline, IngestDocument ingestDocument, boolean verbose) { if (verbose) { List<SimulateProcessorResult> processorResultList = new ArrayList<>(); CompoundProcessor verbosePipelineProcessor = decorate(pipeline.getCompoundProcessor(), processorResultList); try { Pipeline verbosePipeline = new Pipeline(pipeline.getId(), pipeline.getDescription(), pipeline.getVersion(), verbosePipelineProcessor); ingestDocument.executePipeline(verbosePipeline); return new SimulateDocumentVerboseResult(processorResultList); } catch (Exception e) { return new SimulateDocumentVerboseResult(processorResultList); } } else { try { pipeline.execute(ingestDocument); return new SimulateDocumentBaseResult(ingestDocument); } catch (Exception e) { return new SimulateDocumentBaseResult(e); } } }
SimulateDocumentResult executeDocument(Pipeline pipeline, IngestDocument ingestDocument, boolean verbose) { if (verbose) { List<SimulateProcessorResult> processorResultList = new ArrayList<>(); CompoundProcessor verbosePipelineProcessor = decorate(pipeline.getCompoundProcessor(), processorResultList); try { verbosePipelineProcessor.execute(ingestDocument); return new SimulateDocumentVerboseResult(processorResultList); } catch (Exception e) { return new SimulateDocumentVerboseResult(processorResultList); } } else { try { pipeline.execute(ingestDocument); return new SimulateDocumentBaseResult(ingestDocument); } catch (Exception e) { return new SimulateDocumentBaseResult(e); } } }
SimulateDocumentResult executeDocument(Pipeline pipeline, IngestDocument ingestDocument, boolean verbose) { if (verbose) { List<SimulateProcessorResult> processorResultList = new ArrayList<>(); CompoundProcessor verbosePipelineProcessor = decorate(pipeline.getCompoundProcessor(), processorResultList); try { verbosePipelineProcessor.execute(ingestDocument); return new SimulateDocumentVerboseResult(processorResultList); } catch (Exception e) { return new SimulateDocumentVerboseResult(processorResultList); } } else { try { pipeline.execute(ingestDocument); return new SimulateDocumentBaseResult(ingestDocument); } catch (Exception e) { return new SimulateDocumentBaseResult(e); } } }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); this.pipelineId = in.readOptionalString(); boolean verbose = in.readBoolean(); int responsesLength = in.readVInt(); results = new ArrayList<>(); for (int i = 0; i < responsesLength; i++) { SimulateDocumentResult simulateDocumentResult; if (verbose) { simulateDocumentResult = new SimulateDocumentVerboseResult(in); } else { simulateDocumentResult = new SimulateDocumentBaseResult(in); } results.add(simulateDocumentResult); } }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); this.pipelineId = in.readOptionalString(); boolean verbose = in.readBoolean(); int responsesLength = in.readVInt(); results = new ArrayList<>(); for (int i = 0; i < responsesLength; i++) { SimulateDocumentResult simulateDocumentResult; if (verbose) { simulateDocumentResult = new SimulateDocumentVerboseResult(in); } else { simulateDocumentResult = new SimulateDocumentBaseResult(in); } results.add(simulateDocumentResult); } }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); this.pipelineId = in.readOptionalString(); boolean verbose = in.readBoolean(); int responsesLength = in.readVInt(); results = new ArrayList<>(); for (int i = 0; i < responsesLength; i++) { SimulateDocumentResult simulateDocumentResult; if (verbose) { simulateDocumentResult = new SimulateDocumentVerboseResult(in); } else { simulateDocumentResult = new SimulateDocumentBaseResult(in); } results.add(simulateDocumentResult); } }
SimulateDocumentResult executeDocument(Pipeline pipeline, IngestDocument ingestDocument, boolean verbose) { if (verbose) { List<SimulateProcessorResult> processorResultList = new ArrayList<>(); CompoundProcessor verbosePipelineProcessor = decorate(pipeline.getCompoundProcessor(), processorResultList); try { Pipeline verbosePipeline = new Pipeline(pipeline.getId(), pipeline.getDescription(), pipeline.getVersion(), verbosePipelineProcessor); ingestDocument.executePipeline(verbosePipeline); return new SimulateDocumentVerboseResult(processorResultList); } catch (Exception e) { return new SimulateDocumentVerboseResult(processorResultList); } } else { try { pipeline.execute(ingestDocument); return new SimulateDocumentBaseResult(ingestDocument); } catch (Exception e) { return new SimulateDocumentBaseResult(e); } } }