Codota Logo
Task
Code IndexAdd Codota to your IDE (free)

How to use
Task
in
org.opencb.commons.run

Best Java code snippets using org.opencb.commons.run.Task (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: org.opencb.commons/commons-lib

@Override
public List<NR> drain() throws Exception {
  // Drain both tasks
  List<R> drain1 = thisTask.drain();
  // Create new list, in case it is not modifiable
  List<NR> batch2 = new ArrayList<>(nextTask.apply(drain1));
  List<NR> drain2 = nextTask.drain();
  batch2.addAll(drain2);
  return batch2;
}
origin: org.opencb.commons/commons-lib

  @Override
  public void post() throws Exception {
    thisTask.post();
    nextTask.post();
  }
};
origin: org.opencb.commons/commons-lib

@Override
public void pre() throws Exception {
  thisTask.pre();
  nextTask.pre();
}
origin: opencb/opencga

  return batch;
})
.then(new JsonSerializerTask<>(VariantStatsWrapper.class)));
origin: org.opencb.commons/commons-lib

  task.pre();
} catch (Exception e) {
for (org.opencb.commons.run.Task<I, O> task : tasks) {
  try {
    task.post();
  } catch (Exception e) {
origin: org.opencb.commons/commons-lib

@Override
public List<NR> apply(List<T> batch) throws Exception {
  List<R> apply1 = thisTask.apply(batch);
  return nextTask.apply(apply1);
}
origin: org.opencb.commons/commons-lib

@Override
public List<R> drain() throws Exception {
  // Drain and write
  List<R> drain = task.drain();
  writer.write(drain);
  return drain;
}
origin: opencb/opencga

})).then(new VariantToVcfSliceConverterTask(progressLogger));
origin: org.opencb.commons/commons-lib

@Override
public List<R> apply(List<T> batch) throws Exception {
  List<R> batch2 = task.apply(batch);
  writer.write(batch2);
  return batch2;
}
origin: opencb/opencga

if (isStageParallelWrite(options)) {
  logger.info("Multi thread stage load... [{} readerThreads, {} writerThreads]", numReaders, loadThreads);
  ptr = new ParallelTaskRunner<>(variantReader, remapIdsTask.then(converterTask).then(stageLoader), null, config);
} else {
  logger.info("Multi thread stage load... [{} readerThreads, {} tasks, {} writerThreads]", numReaders, loadThreads, 1);
  ptr = new ParallelTaskRunner<>(variantReader, remapIdsTask.then(converterTask), stageLoader, config);
origin: org.opencb.commons/commons-lib

  @Override
  public List<O> read(int batch) {
    try {
      List<T> read = DataReader.this.read(batch);
      // Iterate while reader has data
      // Exit when reader is exhausted, or task produces data
      while (read != null && !read.isEmpty()) {
        List<O> apply = task.apply(read);
        if (apply != null && !apply.isEmpty()) {
          // Valid task apply.
          return apply;
        } else {
          // Empty task apply. Read more data
          read = DataReader.this.read(batch);
        }
      }
      // Reader is exhausted. Drain the task.
      return task.drain();
    } catch (Exception e) {
      // TODO: Reader should throw any exception
      throw new RuntimeException(e);
    }
  }
};
origin: org.opencb.commons/commons-lib

@Override
public boolean post() {
  try {
    task.post();
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  return DataReader.this.post();
}
origin: org.opencb.commons/commons-lib

@Override
public boolean pre() {
  try {
    task.pre();
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  return DataReader.this.pre();
}
origin: org.opencb.commons/commons-lib

  @Override
  public void post() throws Exception {
    task.post();
    if (!post.getAndSet(true)) {
      writer.post();
      writer.close();
    }
  }
};
origin: org.opencb.commons/commons-lib

@Override
public void pre() throws Exception {
  if (!pre.getAndSet(true)) {
    writer.open();
    writer.pre();
  }
  task.pre();
}
org.opencb.commons.runTask

Javadoc

Created on 13/02/18.

Most used methods

  • then
    Use to concatenate Tasks. task1.then(task2).then(task3);
  • apply
  • drain
  • post
  • pre

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • orElseThrow (Optional)
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JCheckBox (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now