K - type of key read from input topicM - type of message read from input topicU - type of update message read/writtenpublic final class ScalaSpeedModelManagerAdapter<K,M,U> extends Object implements SpeedModelManager<K,M,U>
ScalaSpeedModelManager to be a Java SpeedModelManager.| Constructor and Description |
|---|
ScalaSpeedModelManagerAdapter(com.cloudera.oryx.api.speed.ScalaSpeedModelManager<K,M,U> scalaManager) |
| Modifier and Type | Method and Description |
|---|---|
Iterable<U> |
buildUpdates(org.apache.spark.api.java.JavaPairRDD<K,M> newData) |
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.
|
public void consume(Iterator<KeyMessage<String,U>> updateIterator, org.apache.hadoop.conf.Configuration hadoopConf)
SpeedModelManagerconsume in interface SpeedModelManager<K,M,U>updateIterator - iterator to read models fromhadoopConf - Hadoop context, which may be required for reading from HDFSpublic Iterable<U> buildUpdates(org.apache.spark.api.java.JavaPairRDD<K,M> newData)
buildUpdates in interface SpeedModelManager<K,M,U>newData - RDD of raw new data from the topicpublic void close()
close in interface SpeedModelManager<K,M,U>close in interface Closeableclose in interface AutoCloseableCopyright © 2014–2018. All rights reserved.