All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hydrosphere.mist.contexts.ContextRepository.scala Maven / Gradle / Ivy

There is a newer version: 0.10.0
Show newest version
package io.hydrosphere.mist.contexts

import io.hydrosphere.mist.{Specification, Repository}

import scala.collection.mutable.ArrayBuffer
/*
private[mist] trait ContextRepository extends Repository[ContextWrapper]

private[mist] object InMemoryContextRepository extends ContextRepository {

  val collection = ArrayBuffer.empty[ContextWrapper]

  override def add(sparkContext: ContextWrapper): Unit = {
    collection += sparkContext
  }

  override def remove(sparkContext: ContextWrapper): Unit = {
    collection -= sparkContext
  }

  override def get(specification: Specification[ContextWrapper]): Option[ContextWrapper] = {
    val predicate:ContextWrapper => Boolean = x => specification.specified(x)
    collection.find(predicate)
  }

  override def filter(specification: Specification[ContextWrapper]): List[ContextWrapper] = {
    val predicate:ContextWrapper => Boolean = x => specification.specified(x)
    collection.filter(predicate).toList
  }
}
*/




© 2015 - 2024 Weber Informatics LLC | Privacy Policy