Class Job

java.lang.Object
org.basex.core.jobs.Job
Direct Known Subclasses:
Builder, Command, CsvConverter, IndexBuilder, Parser, QueryContext, QueryJob, QueryProcessor, ServerQuery, Zip

public abstract class Job extends Object
Job class. This abstract class is implemented by all command and query instances.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    State of job.
    boolean
    This flag indicates that a job is updating.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Job()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final Job
    Returns the currently active job.
    void
    Adds the strings (databases, special identifiers) for which locks need to be acquired.
    final void
    Checks if the job was stopped; if yes, throws a runtime exception.
    Returns detailed progress information.
    jc()
    Returns the job context.
    final void
    Stops a job because a memory limit was exceeded.
    final void
    Pops the last job.
    double
    Returns a progress value (0 - 1).
    final <J extends Job>
    J
    pushJob(J job)
    Adds a new child job.
    final void
    Registers the job (puts it on a queue).
    Returns short progress information.
    void
    Sends a new job state.
    final void
    Stops a job or sub job.
    final boolean
    Indicates if the job was stopped.
    final void
    Stops a job because of a timeout.
    final void
    Unregisters the job.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • updating

      public volatile boolean updating
      This flag indicates that a job is updating.
    • state

      public volatile JobState state
      State of job.
  • Constructor Details

    • Job

      public Job()
  • Method Details

    • jc

      public final JobContext jc()
      Returns the job context.
      Returns:
      info
    • register

      public final void register(Context ctx)
      Registers the job (puts it on a queue).
      Parameters:
      ctx - context
    • unregister

      public final void unregister(Context ctx)
      Unregisters the job.
      Parameters:
      ctx - context
    • active

      public final Job active()
      Returns the currently active job.
      Returns:
      job
    • pushJob

      public final <J extends Job> J pushJob(J job)
      Adds a new child job.
      Type Parameters:
      J - job type
      Parameters:
      job - child job
      Returns:
      passed on job reference
    • popJob

      public final void popJob()
      Pops the last job.
    • stop

      public final void stop()
      Stops a job or sub job.
    • timeout

      public final void timeout()
      Stops a job because of a timeout.
    • memory

      public final void memory()
      Stops a job because a memory limit was exceeded.
    • checkStop

      public final void checkStop()
      Checks if the job was stopped; if yes, throws a runtime exception.
    • stopped

      public final boolean stopped()
      Indicates if the job was stopped.
      Returns:
      result of check
    • state

      public void state(JobState js)
      Sends a new job state.
      Parameters:
      js - new state
    • addLocks

      public void addLocks()
      Adds the strings (databases, special identifiers) for which locks need to be acquired.
    • shortInfo

      public String shortInfo()
      Returns short progress information. Can be overwritten to give more specific feedback.
      Returns:
      header information
    • detailedInfo

      public String detailedInfo()
      Returns detailed progress information. Can be overwritten to give more specific feedback.
      Returns:
      header information
    • progressInfo

      public double progressInfo()
      Returns a progress value (0 - 1). Can be overwritten to give more specific feedback.
      Returns:
      header information