K
- type of key read from input topicM
- type of message read from input topicU
- type of update message read/writtenpublic interface SpeedModelManager<K,M,U> extends Closeable
Modifier and Type | Method and Description |
---|---|
Iterable<U> |
buildUpdates(org.apache.spark.api.java.JavaPairRDD<K,M> newData) |
default void |
close() |
void |
consume(Iterator<KeyMessage<String,U>> updateIterator,
org.apache.hadoop.conf.Configuration hadoopConf)
Called by the framework to initiate a continuous process of reading models, and reading
from the input topic and updating model state in memory, and issuing updates to the
update topic.
|
void consume(Iterator<KeyMessage<String,U>> updateIterator, org.apache.hadoop.conf.Configuration hadoopConf) throws IOException
updateIterator
- iterator to read models fromhadoopConf
- Hadoop context, which may be required for reading from HDFSIOException
- if an error occurs while reading updatesIterable<U> buildUpdates(org.apache.spark.api.java.JavaPairRDD<K,M> newData) throws IOException
newData
- RDD of raw new data from the topicIOException
- if an error occurs while building updatesdefault void close()
close
in interface AutoCloseable
close
in interface Closeable
Copyright © 2014–2018. All rights reserved.