@Override public long getPos() throws IOException { Progress[] progressArr = reader.getProgress(); for (Progress p : progressArr) { if (p.getUnit().equals(Progress.BYTES)) return p.getCompleted(); } return 0; }
public void initializationComplete() { // init progress bar int nrFiles = -1; Progress progress[] = mCPE.getProgress(); if (progress != null) { for (int i = 0; i < progress.length; i++) { if (progress[i].getUnit().equals(Progress.ENTITIES)) { nrFiles = (int) progress[i].getTotal(); break; } } } if (nrFiles != -1) { progressBar.setMaximum(nrFiles); progressBar.setIndeterminate(false); } else progressBar.setIndeterminate(true); progressBar.setValue(0); // start progress timer which will update the progress bar progressTimer.start(); }
@Override public float getProgress() throws IOException { Progress[] progressArr = reader.getProgress(); for (Progress p : progressArr) { // Use the first progress type that reports a total > 0 if (p.getTotal() > 0) return getPercent(p.getCompleted(), p.getTotal()); } return 0.0f; }
for (Progress p : progresses) { ctx.message("Progress " + readerDesc.getImplementationName() + " " + p.getCompleted() + "/" + p.getTotal() + " " + p.getUnit());
private void initTotal() { Progress progress = getProgress(); if(progress != null) { total = (int)progress.getTotal(); } }
"UIMA_CPM_show_cr_progress__FINEST", new Object[] { Thread.currentThread().getName(), String.valueOf(progress[0].getCompleted()) });
@Test public void test() throws Exception { ExternalResourceDescription contentExtractor = ExternalResourceFactory.createExternalResourceDescription( KEY_CONTENT_EXTRACTOR, FakeBaleenContentExtractor.class); FakeCollectionReader cr = (FakeCollectionReader) CollectionReaderFactory.createReader( FakeCollectionReader.class, BaleenCollectionReader.KEY_CONTENT_EXTRACTOR, contentExtractor); UimaContext context = UimaContextFactory.createUimaContext(); cr.initialize(context); assertTrue(cr.initialised); assertNotNull(cr.getSupport()); assertNotNull(cr.getMonitor()); assertNotNull(cr.getProgress()); Progress[] progress = cr.getProgress(); assertEquals("testunits", progress[0].getUnit()); assertFalse(cr.hasNext()); assertTrue(cr.hasNext); cr.getNext((JCas) null); assertTrue(cr.getNext); cr.destroy(); assertTrue(cr.closed); }
for (Progress p : progresses) { ctx.message("Progress " + readerDesc.getImplementationName() + " " + p.getCompleted() + "/" + p.getTotal() + " " + p.getUnit() + " " + "(" + documentTitle + ")");
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); progressMeter = new ProgressMeter(getProgress()[0].getTotal()); }
public void run() throws Exception { StagedConfiguration stagedConfig = new StagedConfigurationImpl(config); FunnelingStrategy ps = getProcessingStrategy(); for (Stage stage : stagedConfig) { FunneledFlow funnel = ps.newFunnelStrategy(builder.getExperimentUuid()); AnyObject conf = stage.getConfiguration(); CollectionReader reader = builder.buildCollectionReader(conf, stage.getId()); AnalysisEngine pipeline = builder.buildPipeline(conf, "pipeline", stage.getId(), funnel); if (conf.getIterable("post-process") != null) { AnalysisEngine post = builder.buildPostProcess(conf, "post-process", stage.getId()); SimplePipelineRev803.runPipeline(reader, pipeline, post); } else { SimplePipelineRev803.runPipeline(reader, pipeline); } Progress progress = reader.getProgress()[0]; long total = progress.getCompleted(); processedItems.add(total); } }
for (Progress p : progresses) { ctx.message("Progress " + readerDesc.getImplementationName() + " " + p.getCompleted() + "/" + p.getTotal() + " " + p.getUnit() + " " + "(" + documentTitle + ")");
private void displayProgress() { if (mCPE != null) { try { Progress progress[] = mCPE.getProgress(); if (progress != null && progress.length > 0) { int FILE_ENTITY_PROGRESS_INDEX = -1; if (FILE_ENTITY_PROGRESS_INDEX == -1) { for (int i = 0; i < progress.length; i++) { if (progress[i].getUnit().equals(Progress.ENTITIES)) { FILE_ENTITY_PROGRESS_INDEX = i; break; } } } if (FILE_ENTITY_PROGRESS_INDEX >= 0) { // uima-1086 int value = (int) progress[FILE_ENTITY_PROGRESS_INDEX].getCompleted(); progressBar.setValue(value); if (progressBar.isIndeterminate()) statusLabel.setText("Processed " + value); else statusLabel.setText("Processed " + value + " of " + progressBar.getMaximum()); } } } catch (Exception e) { displayError(e); } } }
@Override public void initializationComplete() { // init progress bar int nrFiles = -1; Progress progress[] = mCPE.getProgress(); if (progress != null) { for (int i = 0; i < progress.length; i++) { if (progress[i].getUnit().equals(Progress.ENTITIES)) { nrFiles = (int) progress[i].getTotal(); break; } } } if (nrFiles != -1) { progressBar.setMaximum(nrFiles); progressBar.setIndeterminate(false); } else progressBar.setIndeterminate(true); progressBar.setValue(0); // start progress timer which will update the progress bar progressTimer.start(); }
if (progress[i].getUnit().equals(Progress.ENTITIES)) { FILE_ENTITY_PROGRESS_INDEX = i; break; int value = (int) progress[FILE_ENTITY_PROGRESS_INDEX].getCompleted(); progressBar.setValue(value);
public void initializationComplete() { if (this.logger == null) { return; } int totalDocs = 0; Progress[] progress = this.mCPE.getCollectionReader().getProgress(); if (progress != null) { for (int i = 0; i < progress.length; ++i) { if (progress[i].getUnit().equals(this.logger.getUnit())) { totalDocs = (int) progress[i].getTotal(); break; } } } logger.initializationComplete(totalDocs); }
if (Progress.BYTES.equals(colReaderProgress[i].getUnit())) { processTrace.addEvent(readerName, Constants.COLLECTION_READER_BYTES_PROCESSED, String .valueOf(colReaderProgress[i].getCompleted()), 0, null); } else if (Progress.ENTITIES.equals(colReaderProgress[i].getUnit())) { processTrace.addEvent(readerName, Constants.COLLECTION_READER_DOCS_PROCESSED, String .valueOf(colReaderProgress[i].getCompleted()), 0, null);