메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


spark Scala를 이용한 Streaming예제

총관리자 2018.03.08 09:59 조회 수 : 69


object StreamingRequestCount {
  def main(args: Array[String]) {
    val ssc = new StreamingContext(new SparkContext(),Seconds(2))
    val mystream = ssc.socketTextStream(hostname, port)
    val userreqs = mystream.map(line => (line.split(' ')(2),1))
        .reduceByKey((x,y) => x+y)
    userreqs.print()
    ssc.start()
    ssc.awaitTermination()
  }
}


번호 제목 글쓴이 날짜 조회 수
70 spark에서 hive table을 읽어 출력하는 예제 소스 총관리자 2017.03.09 37
69 spark2.0.0에서 hive 2.0.1 table을 읽어 출력하는 예제 소스(HiveContext, SparkSession, SQLContext) 총관리자 2017.03.09 163
68 It is indirectly referenced from required .class files 오류 발생시 조치방법 총관리자 2017.03.09 93
67 spark 2.0.0의 api를 이용하는 예제 프로그램 총관리자 2017.03.15 199
66 JavaStreamingContext를 이용하여 스트림으로 들어오는 문자열 카운트 소스 총관리자 2017.03.30 127
65 streaming작업시 입력된 값에 대한 사본을 만들게 되는데 이것이 실패했을때 발생하는 경고메세지 총관리자 2017.04.03 126
64 Caused by: java.lang.ClassNotFoundException: org.apache.spark.Logging 발생시 조치사항 총관리자 2017.04.19 284
63 Spark에서 Serializable관련 오류및 조치사항 총관리자 2017.04.21 4901
62 Spark에서 KafkaUtils.createStream()를 이용하여 이용하여 kafka topic에 접근하여 객채로 저장된 값을 가져오고 처리하는 예제 소스 총관리자 2017.04.26 292
61 Ubuntu 16.04 LTS에 Hive 2.1.1설치하면서 "Version information not found in metastore"발생하는 오류원인및 조치사항 총관리자 2017.05.03 469
60 Hive MetaStore Server기동시 Could not create "increment"/"table" value-generation container SEQUENCE_TABLE since autoCreate flags do not allow it. 오류발생시 조치사항 총관리자 2017.05.03 345
59 Windows7 64bit 환경에서 Apache Spark 2.2.0 설치하기 총관리자 2017.07.26 259
58 spark stream처리할때 두개의 client프로그램이 동일한 checkpoint로 접근할때 발생하는 오류 내용 총관리자 2018.01.16 1115
57 Could not compute split, block input-0-1517397051800 not found형태의 오류가 발생시 조치방법 총관리자 2018.02.01 196
56 spark-submit 실행시 "java.lang.OutOfMemoryError: Java heap space"발생시 조치사항 총관리자 2018.02.01 517
55 scala application 샘플소스(SparkSession이용) 총관리자 2018.03.07 135
» Scala를 이용한 Streaming예제 총관리자 2018.03.08 69
53 Scala에서 countByWindow를 이용하기(예제) 총관리자 2018.03.08 235
52 beeline으로 접근시 "User: gooper is not allowed to impersonate anonymous (state=08S01,code=0)"가 발생하면서 "No current connection"이 발생하는 경우 조치 총관리자 2018.04.15 194
51 우분투 16.04LTS에 Jupyter설치 총관리자 2018.04.17 90

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로