으로 구조적 이벤트가 수신된 직후에 완료된다. 다음 몇 페이지에서 이에 대한 예를 살펴볼 것
이다.
22.5
mapWithState
사용하기
mapWithState
는 사용자로 하여금 상태 계산 작업을 설명하는
StateSpec
객체를 제공하도록
요구한다. 이것의 핵심 부분은 당연히 주어진 키에 대해 새로운 값을 입력하여 출력을 반환할 뿐
330
3
부
스파크 스트리밍
만 아니라 이 키에 대한 상태를 업데이트하는 함수다. 실제로 이
StateSpec
의 빌더 객체는 이
함수를 의무화한다.
이
StateSpec
은 네 가지 유형으로 파라미터화된다.
●
키 타입
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.