- Use
List
as parameter:
sc.parallelize(List(line)).collect()
It will return:
res1: Array[String] = Array(hello,world)
lagom.broker.kafka { | |
service-name = "" | |
brokers = "127.0.0.1:9092" | |
client { | |
default { | |
failure-exponential-backoff { | |
min = 3s | |
max = 30s |
cassandra.default { | |
## list the contact points here | |
contact-points = ["127.0.0.1"] | |
## override Lagom’s ServiceLocator-based ConfigSessionProvider | |
session-provider = akka.persistence.cassandra.ConfigSessionProvider | |
} | |
cassandra-journal { | |
contact-points = ${cassandra.default.contact-points} | |
session-provider = ${cassandra.default.session-provider} |
List
as parameter: sc.parallelize(List(line)).collect()
It will return:
res1: Array[String] = Array(hello,world)
package com.knoldus.kafka.examples | |
import java.util.Properties | |
import org.apache.kafka.common.serialization._ | |
import org.apache.kafka.streams._ | |
import org.apache.kafka.streams.kstream.{KStreamBuilder, KeyValueMapper} | |
/** | |
* Copyright Knoldus Software LLP, 2017. All rights reserved. |
package com.knoldus.kafka.examples | |
import java.util.Properties | |
import org.apache.kafka.common.serialization._ | |
import org.apache.kafka.streams._ | |
import org.apache.kafka.streams.kstream.KStreamBuilder | |
/** | |
* Copyright Knoldus Software LLP, 2017. All rights reserved. |
<script src="https://unpkg.com/react@15/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script> | |
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.js"></script> | |
<script type = "text/babel"> | |
ReactDOM.render( | |
<h1>Hello, world!</h1>, | |
document.getElementById('root') | |
); | |
</script> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello React</title> | |
</head> | |
<body> | |
<div id="root"> | |
</div> | |
<script src="https://unpkg.com/react@15/dist/react.js"></script> |
class Assignment1 { | |
def length(list: List[Any]): Int = list.foldRight(0) { (_, sum) => sum + 1 } | |
def hasSubsequence(list: List[Any], subList: List[Any]): Boolean = list.containsSlice(subList) | |
def splitList(list : List[Int], func: Int => Boolean) : (List[Int],List[Int]) = { | |
val l1 = for{ l <- list if(func(l))} yield l | |
val l2 = for{ l <- list if(!func(l))} yield l | |
(l1, l2) | |
} |