Package org.basex.core.jobs
Class Job
java.lang.Object
org.basex.core.jobs.Job
- Direct Known Subclasses:
Builder,Command,CsvConverter,IndexBuilder,Parser,QueryContext,QueryJob,QueryProcessor,ServerQuery,Zip
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Jobactive()Returns the currently active job.voidaddLocks()Adds the strings (databases, special identifiers) for which locks need to be acquired.final voidChecks if the job was stopped; if yes, throws a runtime exception.Returns detailed progress information.final JobContextjc()Returns the job context.final voidmemory()Stops a job because a memory limit was exceeded.final voidpopJob()Pops the last job.doubleReturns a progress value (0 - 1).final <J extends Job>
JpushJob(J job) Adds a new child job.final voidRegisters the job (puts it on a queue).Returns short progress information.voidSends a new job state.final voidstop()Stops a job or sub job.final booleanstopped()Indicates if the job was stopped.final voidtimeout()Stops a job because of a timeout.final voidunregister(Context ctx) Unregisters the job.
-
Field Details
-
updating
public volatile boolean updatingThis flag indicates that a job is updating. -
state
State of job.
-
-
Constructor Details
-
Job
public Job()
-
-
Method Details
-
jc
Returns the job context.- Returns:
- info
-
register
Registers the job (puts it on a queue).- Parameters:
ctx- context
-
unregister
Unregisters the job.- Parameters:
ctx- context
-
active
Returns the currently active job.- Returns:
- job
-
pushJob
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
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
Returns short progress information. Can be overwritten to give more specific feedback.- Returns:
- header information
-
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
-