-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#345 Refactored EngineMeta to store the command in the command attrib…
…ute instead of the spark attribute.
- Loading branch information
Showing
50 changed files
with
1,071 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
metalus-core/src/main/scala/com/acxiom/metalus/context/ContextManager.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.acxiom.metalus.context | ||
|
||
import com.acxiom.metalus.ClassInfo | ||
import com.acxiom.metalus.utils.ReflectionUtils | ||
|
||
/** | ||
* This class maintains a set of contexts that can be used by the running pipelines. | ||
* | ||
* @param contexts Map of class info objects that need to be initialized. | ||
* @param setupParameters A map containing items that were passed to the application at startup. | ||
*/ | ||
class ContextManager(contexts: Map[String, ClassInfo], setupParameters: Map[String, Any]) { | ||
private val defaultContexts: Map[String, ClassInfo] = Map[String, ClassInfo]( | ||
"json" -> ClassInfo(Some("com.acxiom.metalus.context.Json4sContext"), Some(Map[String, Any]())) | ||
) | ||
private val contextObjects: Map[String, Context] = (defaultContexts ++ contexts) | ||
.map(c => c._1 -> ReflectionUtils.loadClass(c._2.className.get, Some(c._2.parameters.getOrElse(Map()) ++ setupParameters)).asInstanceOf[Context]) | ||
|
||
/** | ||
* Returns the Context associated with the provided key or None. | ||
* | ||
* @param key The lookup key for the Context. | ||
* @return A Context for the key or None if it doesn't exist. | ||
*/ | ||
def getContext(key: String): Option[Context] = contextObjects.get(key) | ||
} | ||
|
||
/** | ||
* Marker trait for objects managed by the ContextManager | ||
*/ | ||
trait Context |
8 changes: 0 additions & 8 deletions
8
metalus-core/src/main/scala/com/acxiom/metalus/context/Json4sContext.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.