-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: jyu6 <[email protected]> Co-authored-by: Avik Basu <[email protected]>
- Loading branch information
1 parent
496543c
commit 043e109
Showing
23 changed files
with
756 additions
and
397 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
from typing import List | ||
from pynumaflow.sink import Datum, Responses, Response, UserDefinedSinkServicer | ||
|
||
from pynumaflow.sink import Message, Responses, Response, HTTPSinkHandler | ||
|
||
|
||
def udsink_handler(messages: List[Message], __) -> Responses: | ||
def udsink_handler(datums: List[Datum], __) -> Responses: | ||
responses = Responses() | ||
for msg in messages: | ||
print("Msg", msg) | ||
for msg in datums: | ||
print("User Defined Sink", msg) | ||
responses.append(Response.as_success(msg.id)) | ||
return responses | ||
|
||
|
||
if __name__ == "__main__": | ||
handler = HTTPSinkHandler(udsink_handler) | ||
handler.start() | ||
grpc_server = UserDefinedSinkServicer(udsink_handler) | ||
grpc_server.start() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from pynumaflow.sink.handler import HTTPSinkHandler | ||
from pynumaflow.sink._dtypes import Message, Response, Responses | ||
from pynumaflow.sink._dtypes import Response, Responses, Datum | ||
from pynumaflow.sink.server import UserDefinedSinkServicer | ||
|
||
__all__ = ["HTTPSinkHandler", "Message", "Response", "Responses"] | ||
__all__ = ["Response", "Responses", "Datum", "UserDefinedSinkServicer"] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
from google.protobuf import descriptor as _descriptor | ||
from google.protobuf import message as _message | ||
from google.protobuf import timestamp_pb2 as _timestamp_pb2 | ||
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 | ||
from typing import ( | ||
ClassVar as _ClassVar, | ||
Mapping as _Mapping, | ||
Optional as _Optional, | ||
Union as _Union, | ||
List, | ||
) | ||
|
||
DESCRIPTOR: _descriptor.FileDescriptor | ||
|
||
class ReadyResponse(_message.Message): | ||
__slots__ = ["ready"] | ||
READY_FIELD_NUMBER: _ClassVar[int] | ||
ready: bool | ||
def __init__(self, ready: _Optional[bool] = ...) -> None: ... | ||
|
||
class EventTime(_message.Message): | ||
__slots__ = ["event_time"] | ||
EVENT_TIME_FIELD_NUMBER: _ClassVar[int] | ||
event_time: _timestamp_pb2.Timestamp | ||
def __init__(self, event_time: _Optional[_timestamp_pb2.Timestamp] = ...) -> None: ... | ||
|
||
class Watermark(_message.Message): | ||
__slots__ = ["watermark"] | ||
WATERMARK_FIELD_NUMBER: _ClassVar[int] | ||
watermark: _timestamp_pb2.Timestamp | ||
def __init__(self, watermark: _Optional[_timestamp_pb2.Timestamp] = ...) -> None: ... | ||
|
||
class Datum(_message.Message): | ||
__slots__ = ["key", "value", "event_time", "watermark", "id"] | ||
KEY_FIELD_NUMBER: _ClassVar[int] | ||
VALUE_FIELD_NUMBER: _ClassVar[int] | ||
ID_FIELD_NUMBER: _ClassVar[int] | ||
EVENT_TIME_FIELD_NUMBER: _ClassVar[int] | ||
WATERMARK_FIELD_NUMBER: _ClassVar[int] | ||
key: str | ||
value: bytes | ||
id: str | ||
event_time: _timestamp_pb2.Timestamp | ||
watermark: _timestamp_pb2.Timestamp | ||
def __init__( | ||
self, | ||
key: _Optional[str], | ||
value: _Optional[bytes], | ||
id: _Optional[str], | ||
event_time: _Optional[_timestamp_pb2.Timestamp] = ..., | ||
watermark: _Optional[_timestamp_pb2.Timestamp] = ..., | ||
) -> None: ... | ||
|
||
class DatumList(_message.Message): | ||
__slots__ = ["elements"] | ||
ELEMENTS_FIELD_NUMBER: _ClassVar[int] | ||
elements: List[Datum] | ||
def __init__(self, elements: _Optional[List[Datum]]) -> None: ... | ||
|
||
class Response(_message.Message): | ||
__slots__ = ["id", "success", "err_msg"] | ||
ID_FIELD_NUMBER: _ClassVar[int] | ||
SUCCESS_FIELD_NUMBER: _ClassVar[int] | ||
ERR_MSG_FIELD_NUMBER: _ClassVar[int] | ||
id: str | ||
success: bool | ||
err_msg: str | ||
def __init__( | ||
self, | ||
id: _Optional[str], | ||
success: _Optional[bool], | ||
err_msg: _Optional[str], | ||
) -> None: ... | ||
|
||
class ResponseList(_message.Message): | ||
__slots__ = ["responses"] | ||
RESPONSES_FIELD_NUMBER: _ClassVar[int] | ||
responses: List[Response] | ||
def __init__(self, responses: _Optional[List[Response]]) -> None: ... |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Oops, something went wrong.