Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/system/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def pollPartition(
partition, # type: int
offset, # type: Union[str, unicode]
options=None, # type: Optional[Dict[Union[str, unicode], Any]]
sizeCutoff=None, # type: Optional[int]
timeoutMs=None, # type: Optional[long]
):
# type: (...) -> List[Any]
"""Polls a specific partition of a topic.
Expand All @@ -87,11 +89,15 @@ def pollPartition(
offset: The position of offset to start the poll at.
options: Custom options specific to the consumer, with key value
string pairs. Optional
sizeCutoff: The total record count allowed before polling will
be stopped. Optional.
timeoutMs: The amount of time in milliseconds before polling
will be stopped. Optional.

Returns:
A list of records polled from a specified partition.
"""
print(connector, topic, partition, offset, options)
print(connector, topic, partition, offset, options, sizeCutoff, timeoutMs)
return []


Expand All @@ -100,6 +106,8 @@ def pollTopic(
topic, # type: Union[str, unicode]
groupId, # type: Union[str, unicode]
options=None, # type: Optional[Dict[Union[str, unicode], Any]]
sizeCutoff=None, # type: Optional[int]
timeoutMs=None, # type: Optional[long]
):
# type: (...) -> List[Any]
"""Returns a list of records from the specified topic.
Expand All @@ -111,11 +119,15 @@ def pollTopic(
belongs to.
options: Custom options specific to the consumer, with key value
string pairs. Optional
sizeCutoff: The total record count allowed before polling will
be stopped. Optional.
timeoutMs: The amount of time in milliseconds before polling
will be stopped. Optional.

Returns:
A list of records from the specified topic.
"""
print(connector, topic, groupId, options)
print(connector, topic, groupId, options, sizeCutoff, timeoutMs)
return []


Expand Down
4 changes: 4 additions & 0 deletions stubs/stubs/system/kafka.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ def pollPartition(
partition: int,
offset: Union[str, unicode],
options: Optional[Dict[Union[str, unicode], Any]] = ...,
sizeCutoff: Optional[int] = ...,
timeoutMs: Optional[long] = ...,
) -> List[Any]: ...
def pollTopic(
connector: Union[str, unicode],
topic: Union[str, unicode],
groupId: Union[str, unicode],
options: Optional[Dict[Union[str, unicode], Any]] = ...,
sizeCutoff: Optional[int] = ...,
timeoutMs: Optional[long] = ...,
) -> List[Any]: ...
def seekLatest(
connector: Union[str, unicode],
Expand Down