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
//classLoader에서 getResourceAsStream을 이용한 방식 | |
def readFileByClassLoaderResourceAsStream(name: String) = { | |
println(s"read file by ClassloaderResourceAsStream : ${name}") | |
try { | |
val reader = new BufferedReader(new InputStreamReader(SparkResourceTest.getClass.getClassLoader.getResourceAsStream(name))) | |
var line: String = null | |
while ( { | |
line = reader.readLine(); | |
line != null | |
}) { |
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
#karabiner설치 -> ~/.config/karabiner/karabiner.json파일 수정 | |
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ |
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
import connector.stores.ZooKeeperOffsetsStore | |
import kafka.message.MessageAndMetadata | |
import kafka.serializer.StringDecoder | |
import org.apache.spark.streaming.StreamingContext | |
import org.apache.spark.streaming.kafka.KafkaUtils | |
class KafkaStreamSource() { | |
def kafkaStream(ssc: StreamingContext, zookeeperStore: ZooKeeperOffsetsStore, topic: String, groupId: String, zkHosts: String, bootstrapServer: String, autoCommit: String) | |
: org.apache.spark.streaming.api.java.JavaPairInputDStream[String, String] = { |
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
/* | |
사용된 java version | |
java version "1.8.0_171" | |
Java(TM) SE Runtime Environment (build 1.8.0_171-b11) | |
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode) | |
*/ | |
public class Lottery { | |
@Test | |
public void Run() throws IOException { | |
//추첨 |