Class Driver
- java.lang.Object
-
- org.apache.iotdb.db.mpp.execution.driver.Driver
-
- All Implemented Interfaces:
IDriver
- Direct Known Subclasses:
DataDriver,SchemaDriver
public abstract class Driver extends java.lang.Object implements IDriver
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDriver.State
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.atomic.AtomicReference<com.google.common.util.concurrent.SettableFuture<?>>driverBlockedFutureprotected DriverContextdriverContextprotected org.apache.iotdb.db.mpp.execution.driver.Driver.DriverLockexclusiveLockprotected static org.slf4j.LoggerLOGGERprotected Operatorrootprotected ISinkHandlesinkHandleprotected java.util.concurrent.atomic.AtomicReference<Driver.State>state
-
Constructor Summary
Constructors Constructor Description Driver(Operator root, ISinkHandle sinkHandle, DriverContext driverContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()clear resource used by this fragment instancevoidfailed(java.lang.Throwable t)fail current driverFragmentInstanceIdgetInfo()the id information about this IDriver.ISinkHandlegetSinkHandle()protected abstract booleaninit(com.google.common.util.concurrent.SettableFuture<?> blockedFuture)do initializationbooleanisFinished()Used to judge whether this IDriver should be scheduled for execution anymorecom.google.common.util.concurrent.ListenableFuture<?>processFor(io.airlift.units.Duration duration)run the IDriver for {@param duration} time slice, the time of this run is likely not to be equal to {@param duration}, the actual run time should be calculated by the callerprotected abstract voidreleaseResource()release resource this driver used
-
-
-
Field Detail
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
root
protected final Operator root
-
sinkHandle
protected final ISinkHandle sinkHandle
-
driverContext
protected final DriverContext driverContext
-
driverBlockedFuture
protected final java.util.concurrent.atomic.AtomicReference<com.google.common.util.concurrent.SettableFuture<?>> driverBlockedFuture
-
state
protected final java.util.concurrent.atomic.AtomicReference<Driver.State> state
-
exclusiveLock
protected final org.apache.iotdb.db.mpp.execution.driver.Driver.DriverLock exclusiveLock
-
-
Constructor Detail
-
Driver
public Driver(Operator root, ISinkHandle sinkHandle, DriverContext driverContext)
-
-
Method Detail
-
isFinished
public boolean isFinished()
Description copied from interface:IDriverUsed to judge whether this IDriver should be scheduled for execution anymore- Specified by:
isFinishedin interfaceIDriver- Returns:
- true if the IDriver is done or terminated due to failure, otherwise false.
-
init
protected abstract boolean init(com.google.common.util.concurrent.SettableFuture<?> blockedFuture)
do initialization- Returns:
- true if init succeed, false otherwise
-
releaseResource
protected abstract void releaseResource()
release resource this driver used
-
processFor
public com.google.common.util.concurrent.ListenableFuture<?> processFor(io.airlift.units.Duration duration)
Description copied from interface:IDriverrun the IDriver for {@param duration} time slice, the time of this run is likely not to be equal to {@param duration}, the actual run time should be calculated by the caller- Specified by:
processForin interfaceIDriver- Parameters:
duration- how long should this IDriver run- Returns:
- the returned ListenableFuture
is used to represent status of this processing if isDone() return true, meaning that this IDriver is not blocked and is ready for next processing. Otherwise, meaning that this IDriver is blocked and not ready for next processing.
-
getInfo
public FragmentInstanceId getInfo()
Description copied from interface:IDriverthe id information about this IDriver.- Specified by:
getInfoin interfaceIDriver- Returns:
- a
FragmentInstanceIdinstance.
-
close
public void close()
Description copied from interface:IDriverclear resource used by this fragment instance
-
failed
public void failed(java.lang.Throwable t)
Description copied from interface:IDriverfail current driver
-
getSinkHandle
public ISinkHandle getSinkHandle()
- Specified by:
getSinkHandlein interfaceIDriver- Returns:
- get SinkHandle of current IDriver
-
-