메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

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


stream-api
 StreamService.java : 가. stream 인터페이스를 정의함
                      나. Lagom이 어떻게 서비스하는지와 HelloStream서비스를 이용하기 위한 모든것을 정의함.(현재 autonomousStream()가 정의되어 있음)

stream-impl
 StreamModule.java : 가. StreamService와 StreamServiceImpl클래스를 바인딩함
                     나. bindService, bindClient, bind메서를 이용하여 바인딩함
      
    StreamRepository.java : 가. Cassandra에 대한 session정보를 가지고 있음
                            나. session정보가 없으면 Cassandra에 테이블을 생성하고 session정보를 확득하여 가지고 있음(greeting_message테이블을 생성함)
       다. updateMessage(), getMessage()메서스를 가지고 있음
    StreamServiceImpl.java : 가. StreamService에 대한 구현클래스
                          나. HelloService및 StreamRepository를 상태로 가지고 있음
        다. directStrem(), autonomousStream()메서드(서비스)를 가지고 있음
    StreamSubscriber.java : 가. HelloService event stream을 구독한다.
                         나. GreetingMessageChanged가 되면 repository의 updateMessage를 호출한다.
 
 resources/application.conf
     play.modules.enabled += com.example.hello.stream.impl.StreamModule
  lagom.persistence.ask-timeout = 10s
  stream.cassandra.keyspace = stream
  cassandra-journal.keyspace = ${stream.cassandra.keyspace}
  cassandra-snapshot-store.keyspace = ${stream.cassandra.keyspace}
  lagom.persistence.read-side.cassandra.keyspace = ${stream.cassandra.keyspace}


  
  
  
hello-api
 HelloEvent.java : HelloEvent인터페이스를 상속한 GreetingMessageChanged라는 event클래스(name과 message를 가짐)를 가지고 있는 클래스 파일
 HelloService.java : Hello가 제공하는 서비스에 대하여 Lagom이 알아야 하는 모든것을 기술(hello, useGreeting, helloEvents메서드가 정의되어 있음)
 GreatingMessage.java : message를 담고 있는 클래스 파일

hello-impl
 HellpEvent.java : 가. hello-api에 있는 HelloEvent클래스와 상관없는거 같음
       나. Hello entity가 제공하는 모든 event를 정의한 HelloEvent 인터페이스를 이용하여 GreetingMessageChanged클래스를 정의함
       다. Tags는 event의 stream을 get하고 publish하는데 사용됨, 각 event는 이 태그를 가지게 된다.
      (이 경우는 tag를 4개의 shard로 partitioning하여 event가 4개의 동시적인 processor/publisher를 가지게 된다)
        
      
 HelloServiceImpl.java : HelloService의 구현 클래스 파일
 HelloState.java   : event의 message를 가지고 있는 클래스(message와 timestamp속성을 가짐)
 HelloCommand.java : Hello entity가 제공하는 모든 명령을 정의하는 클래스 파일(UseGreetingMessage와 Hello 클래스 두개가 정의되어있음)
 HelloEntity.java : 가. event sourced entity로서 어떤 인사를 해야 하는지를 알려주는 값을 저장하고 있는 상태를 가지고 있다.
                    나. event sourced entity는 command를 보냄으로서 상호작용을 한다.
        다. 두개의 command(UserGreetingMessage(greeting을 변경할때 사용하는 command), Hello(읽기전용 command로 이름으로 구분된는 command에게 보내는 greeting을 리턴한다 ))
        라. command는 event로 변환되며 entity에 의해서 연속성을 갖게된다. 그리고 event handler는 단순하게 event를 현재상태에 적용한다. 이것은 event가 처음 생성될때 이루어지며
            entity가 데이타베이스로부터 적재될때 이루어진다. 각각의 이벤트는 entity의 상태를 재생성하기 위해서 replay된다.
        마. 이 entity는 한개의 event를 정의한다. 즉 GreetingMessageChangedㄹ는 이벤트는 UseGreetingMessage라는 command를 받으면 emit된다.
        바. entity는 다른 상태에 따른 른 behaviours를 정의할 수 있으나 항상 initialBehavior에서 시작한다.
 HelloModule.java : 서비스가 가능하도록 HelloService와 HelloServiceImpl 클래스를 바인드하는 모듈 클래스
 
resources/application.conf
  play.modules.enabled += com.example.hello.hello.impl.HelloModule
  lagom.persistence.ask-timeout = 10s
  hello.cassandra.keyspace = hello
  cassandra-journal.keyspace = ${hello.cassandra.keyspace}
  cassandra-snapshot-store.keyspace = ${hello.cassandra.keyspace}
  lagom.persistence.read-side.cassandra.keyspace = ${hello.cassandra.keyspace}

intergration-tests


my-first-system

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.

위로