Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run penalizeSingleSelectMultiArgList=true #14

Open
wants to merge 1 commit into
base: 0.4.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ abstract class BaseAlgorithm[PD, M, Q, P]
* @return Type signature of query
*/
def queryClass: Class[Q] = {
val types = TypeResolver
.resolveRawArguments(classOf[BaseAlgorithm[PD, M, Q, P]], getClass)
val types = TypeResolver.resolveRawArguments(
classOf[BaseAlgorithm[PD, M, Q, P]],
getClass)
types(2).asInstanceOf[Class[Q]]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,9 @@ class ServerActor[Q, P](val args: ServerConfig,
def actorRefFactory: ActorContext = context

implicit val timeout = Timeout(5, TimeUnit.SECONDS)
val pluginsActorRef = context
.actorOf(Props(classOf[PluginsActor], args.engineVariant), "PluginsActor")
val pluginsActorRef = context.actorOf(
Props(classOf[PluginsActor], args.engineVariant),
"PluginsActor")
val pluginContext = EngineServerPluginContext(log, args.engineVariant)

def receive: Actor.Receive = runRoute(myRoute)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ object JsonExtractor {
def paramToJson(extractorOption: JsonExtractorOption,
param: (String, Params)): String = {
// to be replaced JValue needs to be done by Json4s, otherwise the tuple JValue will be wrong
val toBeReplacedJValue = JsonExtractor
.toJValue(JsonExtractorOption.Json4sNative, (param._1, null))
val toBeReplacedJValue = JsonExtractor.toJValue(
JsonExtractorOption.Json4sNative,
(param._1, null))
val paramJValue = JsonExtractor.toJValue(extractorOption, param._2)

compact(render(toBeReplacedJValue.replace(param._1 :: Nil, paramJValue)))
Expand Down Expand Up @@ -134,8 +135,9 @@ object JsonExtractor {
val jValues = params.map {
case (name, param) =>
// to be replaced JValue needs to be done by Json4s, otherwise the tuple JValue will be wrong
val toBeReplacedJValue = JsonExtractor
.toJValue(JsonExtractorOption.Json4sNative, (name, null))
val toBeReplacedJValue =
JsonExtractor.toJValue(JsonExtractorOption.Json4sNative,
(name, null))
val paramJValue = JsonExtractor.toJValue(extractorOption, param)

toBeReplacedJValue.replace(name :: Nil, paramJValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ class MetricEvaluatorDevSuite extends FunSuite with SharedSparkContext {
(EngineParams(),
Seq((EmptyParams(), sc.parallelize(Seq((1, 0, 0), (2, 0, 0)))))))

val r = metricEvaluator
.evaluateBase(sc, Evaluation0, engineEvalDataSet, WorkflowParams())
val r = metricEvaluator.evaluateBase(sc,
Evaluation0,
engineEvalDataSet,
WorkflowParams())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ class JsonExtractorSuite extends FunSuite with Matchers {
val json =
"""{"string": "query string", "optional": "optional string", "default": "d"}"""

val query = JsonExtractor
.extract(JsonExtractorOption.Json4sNative, json, classOf[ScalaQuery])
val query = JsonExtractor.extract(JsonExtractorOption.Json4sNative,
json,
classOf[ScalaQuery])

query should be(ScalaQuery("query string", Some("optional string"), "d"))
}
Expand All @@ -48,8 +49,9 @@ class JsonExtractorSuite extends FunSuite with Matchers {

val json = """{"string": "query string"}"""

val query = JsonExtractor
.extract(JsonExtractorOption.Json4sNative, json, classOf[ScalaQuery])
val query = JsonExtractor.extract(JsonExtractorOption.Json4sNative,
json,
classOf[ScalaQuery])

query should be(ScalaQuery("query string", None, "default"))
}
Expand All @@ -61,8 +63,9 @@ class JsonExtractorSuite extends FunSuite with Matchers {
val json =
"""{"string": "query string", "optional": null, "default": null}"""

val query = JsonExtractor
.extract(JsonExtractorOption.Json4sNative, json, classOf[ScalaQuery])
val query = JsonExtractor.extract(JsonExtractorOption.Json4sNative,
json,
classOf[ScalaQuery])

query should be(ScalaQuery("query string", None, "default"))
}
Expand All @@ -73,8 +76,9 @@ class JsonExtractorSuite extends FunSuite with Matchers {
val json =
"""{"string": "query string", "optional": "optional string", "default": "d"}"""

val query = JsonExtractor
.extract(JsonExtractorOption.Json4sNative, json, classOf[ScalaQuery])
val query = JsonExtractor.extract(JsonExtractorOption.Json4sNative,
json,
classOf[ScalaQuery])

query should be(ScalaQuery("query string", Some("optional string"), "d"))
}
Expand All @@ -85,8 +89,9 @@ class JsonExtractorSuite extends FunSuite with Matchers {

val json = """{"string": "query string"}"""

val query = JsonExtractor
.extract(JsonExtractorOption.Json4sNative, json, classOf[ScalaQuery])
val query = JsonExtractor.extract(JsonExtractorOption.Json4sNative,
json,
classOf[ScalaQuery])

query should be(ScalaQuery("query string", None, "default"))
}
Expand All @@ -97,8 +102,9 @@ class JsonExtractorSuite extends FunSuite with Matchers {
val json =
"""{"string": "query string", "optional": null, "default": null}"""

val query = JsonExtractor
.extract(JsonExtractorOption.Json4sNative, json, classOf[ScalaQuery])
val query = JsonExtractor.extract(JsonExtractorOption.Json4sNative,
json,
classOf[ScalaQuery])

query should be(ScalaQuery("query string", None, "default"))
}
Expand All @@ -108,8 +114,9 @@ class JsonExtractorSuite extends FunSuite with Matchers {
" value") {

val json = """{"string": "query string"}"""
val query = JsonExtractor
.extract(JsonExtractorOption.Gson, json, classOf[ScalaQuery])
val query = JsonExtractor.extract(JsonExtractorOption.Gson,
json,
classOf[ScalaQuery])

query should be(ScalaQuery("query string", null, null))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,9 @@ object Storage extends Logging {
info("Test writing to Event Store (App Id 0)...")
// use appId=0 for testing purpose
eventsDb.init(0)
eventsDb
.insert(Event(event = "test", entityType = "test", entityId = "test"), 0)
eventsDb.insert(
Event(event = "test", entityType = "test", entityId = "test"),
0)
eventsDb.remove(0)
eventsDb.close()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ class ForestFireSamplingDataSource(val dsp: FFSamplingDSParams)

override def readTraining(sc: SparkContext): TrainingData = {
val g = GraphLoader.edgeListFile(sc, dsp.graphEdgelistPath)
val sampled = Sampling
.forestFireSamplingInduced(sc, g, dsp.sampleFraction, dsp.geoParam)
val sampled = Sampling.forestFireSamplingInduced(sc,
g,
dsp.sampleFraction,
dsp.geoParam)

val identity = DeltaSimRankRDD.identityMatrix(sc, g.vertices.count())
new TrainingData(sampled, identity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ class SimRankAlgorithm(val ap: SimRankParams)

def train(td: TrainingData): RDD[(Long, Double)] = {
td.g.edges.count()
val scores = DeltaSimRankRDD
.compute(td.g, ap.numIterations, td.identityMatrix, ap.decay)
val scores = DeltaSimRankRDD.compute(td.g,
ap.numIterations,
td.identityMatrix,
ap.decay)
scores
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ object RunServer extends Logging {
.getOrElse(Nil) ++ Seq("--json-extractor",
ca.common.jsonExtractor.toString)

Runner
.runOnSpark("io.prediction.workflow.CreateServer", args, ca, jarFiles)
Runner.runOnSpark("io.prediction.workflow.CreateServer",
args,
ca,
jarFiles)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ object RunWorkflow extends Logging {
else
Seq()) ++ Seq("--json-extractor", ca.common.jsonExtractor.toString)

Runner
.runOnSpark("io.prediction.workflow.CreateWorkflow", args, ca, jarFiles)
Runner.runOnSpark("io.prediction.workflow.CreateWorkflow",
args,
ca,
jarFiles)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,9 @@ object Console extends Logging {
info(s"Uber JAR enabled. Putting ${core.getName} in lib.")
val dst = new File("lib")
dst.mkdir()
FileUtils
.copyFileToDirectory(coreAssembly(ca.common.pioHome.get), dst, true)
FileUtils.copyFileToDirectory(coreAssembly(ca.common.pioHome.get),
dst,
true)
} else {
if (new File("engine.json").exists()) {
info(s"Uber JAR disabled. Making sure lib/${core.getName} is absent.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ object ActorCreationPerfSpec {
sender() ! Created
case WaitForChildren ⇒
context.children.foreach(_ ! IsAlive)
context
.become(waiting(context.children.size, sender()), discardOld = false)
context.become(waiting(context.children.size, sender()),
discardOld = false)
}

def waiting(number: Int, replyTo: ActorRef): Receive = {
Expand Down Expand Up @@ -80,8 +80,8 @@ object ActorCreationPerfSpec {
sender() ! Created
case WaitForChildren ⇒
context.children.foreach(_ ! IsAlive)
context
.become(waiting(context.children.size, sender()), discardOld = false)
context.become(waiting(context.children.size, sender()),
discardOld = false)
}

def waiting(number: Int, replyTo: ActorRef): Receive = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ class ActorDSLSpec extends AkkaSpec {
try {
for (_ ← 1 to 1000) i.receiver ! 0
expectNoMsg(1 second)
EventFilter
.warning(start = "dropping message", occurrences = 1) intercept {
EventFilter.warning(start = "dropping message", occurrences = 1) intercept {
i.receiver ! 42
}
expectMsgType[Warning]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {

"find actors by looking up their path" in {
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
Await
.result(looker ? LookupPath(pathOf.path), timeout.duration) should ===(
Await.result(looker ? LookupPath(pathOf.path), timeout.duration) should ===(
result)
}
for {
Expand Down Expand Up @@ -238,8 +237,7 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
"find system-generated actors" in {
def check(target: ActorRef) {
for (looker ← all) {
Await
.result(looker ? LookupPath(target.path), timeout.duration) should ===(
Await.result(looker ? LookupPath(target.path), timeout.duration) should ===(
target)
Await.result(looker ? LookupString(target.path.toString),
timeout.duration) should ===(target)
Expand Down Expand Up @@ -288,15 +286,13 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
val a = expectMsgType[ActorRef]
a.path.elements.head should ===("temp")
Await.result(c2 ? LookupPath(a.path), timeout.duration) should ===(a)
Await
.result(c2 ? LookupString(a.path.toString), timeout.duration) should ===(
Await.result(c2 ? LookupString(a.path.toString), timeout.duration) should ===(
a)
Await.result(c2 ? LookupString(a.path.toStringWithoutAddress),
timeout.duration) should ===(a)
Await.result(c2 ? LookupString("../../" + a.path.elements.mkString("/")),
timeout.duration) should ===(a)
Await
.result(c2 ? LookupString(a.path.toString + "/"), timeout.duration) should ===(
Await.result(c2 ? LookupString(a.path.toString + "/"), timeout.duration) should ===(
a)
Await.result(c2 ? LookupString(a.path.toStringWithoutAddress + "/"),
timeout.duration) should ===(a)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ class ActorSelectionSpec
asked.correlationId should ===(selection)

implicit val ec = system.dispatcher
val resolved = Await
.result(selection.resolveOne(timeout.duration).mapTo[ActorRef] recover {
val resolved = Await.result(
selection.resolveOne(timeout.duration).mapTo[ActorRef] recover {
case _ ⇒ null
}, timeout.duration)
},
timeout.duration)
Option(resolved) should ===(result)

result
Expand Down Expand Up @@ -323,8 +324,7 @@ class ActorSelectionSpec
"resolve one actor with explicit timeout" in {
val s = system.actorSelection(system / "c2")
// Java and Scala API
Await
.result(s.resolveOne(1.second.dilated), timeout.duration) should ===(
Await.result(s.resolveOne(1.second.dilated), timeout.duration) should ===(
c2)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ object ActorSystemSpec {
mbox: Mailbox,
hasMessageHint: Boolean,
hasSystemMessageHint: Boolean): Boolean = {
val ret = super
.registerForExecution(mbox, hasMessageHint, hasSystemMessageHint)
val ret = super.registerForExecution(mbox,
hasMessageHint,
hasSystemMessageHint)
doneIt.switchOn {
TestKit.awaitCond(mbox.actor.actor != null, 1.second)
mbox.actor.actor match {
Expand Down Expand Up @@ -305,8 +306,7 @@ class ActorSystemSpec
implicit val timeout = Timeout((20 seconds).dilated)
val waves = for (i ← 1 to 3)
yield system.actorOf(Props[ActorSystemSpec.Waves]) ? 50000
Await
.result(Future.sequence(waves), timeout.duration + 5.seconds) should ===(
Await.result(Future.sequence(waves), timeout.duration + 5.seconds) should ===(
Vector("done", "done", "done"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ object ConsistencySpec {
val maxThreads = 2000
val factor = 1.5d
val threads =
ThreadPoolConfig
.scaledPoolSize(minThreads, factor, maxThreads) // Make sure we have more threads than cores
ThreadPoolConfig.scaledPoolSize(minThreads, factor, maxThreads) // Make sure we have more threads than cores

val config = s"""
consistency-dispatcher {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class DeadLetterSupressionSpec extends AkkaSpec with ImplicitSender {
system.eventStream.subscribe(deadListener.ref, classOf[DeadLetter])

val suppressedListener = TestProbe()
system.eventStream
.subscribe(suppressedListener.ref, classOf[SuppressedDeadLetter])
system.eventStream.subscribe(suppressedListener.ref,
classOf[SuppressedDeadLetter])

val allListener = TestProbe()
system.eventStream.subscribe(allListener.ref, classOf[AllDeadLetters])
Expand All @@ -60,8 +60,8 @@ class DeadLetterSupressionSpec extends AkkaSpec with ImplicitSender {
system.eventStream.subscribe(deadListener.ref, classOf[DeadLetter])

val suppressedListener = TestProbe()
system.eventStream
.subscribe(suppressedListener.ref, classOf[SuppressedDeadLetter])
system.eventStream.subscribe(suppressedListener.ref,
classOf[SuppressedDeadLetter])

val allListener = TestProbe()
system.eventStream.subscribe(allListener.ref, classOf[AllDeadLetters])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ class FSMActorSpec
Await.ready(transitionCallBackLatch, timeout.duration)
Await.ready(lockedLatch, timeout.duration)

EventFilter
.warning(start = "unhandled event", occurrences = 1) intercept {
EventFilter.warning(start = "unhandled event", occurrences = 1) intercept {
lock ! "not_handled"
Await.ready(unhandledLatch, timeout.duration)
}
Expand Down Expand Up @@ -172,8 +171,7 @@ class FSMActorSpec
}
})
val name = fsm.path.toString
EventFilter
.error("Next state 2 does not exist", occurrences = 1) intercept {
EventFilter.error("Next state 2 does not exist", occurrences = 1) intercept {
system.eventStream.subscribe(testActor, classOf[Logging.Error])
fsm ! "go"
expectMsgPF(1 second, hint = "Next state 2 does not exist") {
Expand Down
Loading