public abstract class PeriodicSource<T> extends Source<T> implements java.lang.Runnable, PeriodMXBean
Modifier | Constructor and Description |
---|---|
protected |
PeriodicSource(long period,
java.util.concurrent.TimeUnit unit) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
fetchTuples() |
long |
getPeriod()
Get the period.
|
protected java.lang.Runnable |
getRunnable() |
java.util.concurrent.TimeUnit |
getUnit()
Get the time unit for
PeriodMXBean.getPeriod() . |
void |
initialize(OpletContext<java.lang.Void,T> context)
Initialize the oplet.
|
void |
run() |
void |
setPeriod(long period)
Set the period.
|
void |
setPeriod(long period,
java.util.concurrent.TimeUnit unit)
Set the period and unit
|
void |
start()
Start the oplet.
|
getDestination, getInputs, submit
getOpletContext
protected PeriodicSource(long period, java.util.concurrent.TimeUnit unit)
public void initialize(OpletContext<java.lang.Void,T> context)
Oplet
initialize
in interface Oplet<java.lang.Void,T>
initialize
in class Source<T>
context
- the OpletContextpublic void start()
Oplet
protected java.lang.Runnable getRunnable()
protected abstract void fetchTuples() throws java.lang.Exception
java.lang.Exception
public void run()
run
in interface java.lang.Runnable
public long getPeriod()
PeriodMXBean
getPeriod
in interface PeriodMXBean
public java.util.concurrent.TimeUnit getUnit()
PeriodMXBean
PeriodMXBean.getPeriod()
.getUnit
in interface PeriodMXBean
public void setPeriod(long period)
PeriodMXBean
setPeriod
in interface PeriodMXBean
period
- the periodpublic void setPeriod(long period, java.util.concurrent.TimeUnit unit)
PeriodMXBean
setPeriod
in interface PeriodMXBean
period
- the periodunit
- the TimeUnit
of period
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641