Faust 3

스트림 프로세싱 with Faust - Windows

Faust는 Windowing을 쉽게 지원할 수 있는 기능을 가지고 있다. Windowing을 통해 지난 10분간 데이터의 분석 혹은 매 5분마다 1시간 간격의 데이터 분석과 같은 내용을 수행할 수 있다. 이번 포스팅에서는 Windowing을 사용하는 방법에 대해 알아보고자 한다. Faust는 Hopping, Tumbling window를 지원한다. Tumbling Windows Tumbling window는 중복되지 않은 데이터에 대해 일정간격으로 분석할때 사용된다. from dataclasses import asdict, dataclass from datetime import timedelta import json import random import faust @dataclass class Clic..

빅데이터 2019.11.22
스트림 프로세싱 with Faust - Table

Faust에는 Table이라는 개념이 있다. Table을 생성하면 스트림데이터와 함께 사용 될 수 있다. from dataclasses import asdict, dataclass import json import random import faust @dataclass class ClickEvent(faust.Record): email: str timestamp: str uri: str number: int app = faust.App("exercise6", broker="kafka://localhost:9092") clickevents_topic = app.topic("com.udacity.streams.clickevents", value_type=ClickEvent) # # TODO: Define a..

빅데이터 2019.11.21
스트림 프로세싱 with Faust - Processors, Operations

Faust에는 중요한개념 2가지 Processor과 Operation이 있습니다. Processors 스트림데이터는 끝없는 데이터의 연속적인 흐름입니다. 1개 이상의 Processor들은 callback형태로 동작하게 됩니다. Faust 기반의 application에서 동작하며, function을 사용하여 추가 library등을 조합하여 사용할 수도 있습니다. def add_default_language(value: MyModel) -> MyModel: if not value.language: value.language = 'US' return value async def add_client_info(value: MyModel) -> MyModel: value.client = await get_http_..

빅데이터 2019.11.21