Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.backend.python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.backend.python
Commits
0070e9bc
Commit
0070e9bc
authored
7 years ago
by
Philip ABBET
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring: The 'done()' method of database views must now take a 'last_data_index' parameter
parent
7b3efc83
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/backend/python/data.py
+5
-3
5 additions, 3 deletions
beat/backend/python/data.py
with
5 additions
and
3 deletions
beat/backend/python/data.py
+
5
−
3
View file @
0070e9bc
...
...
@@ -828,9 +828,11 @@ class MemoryDataSource(DataSource):
self
.
data
=
[]
self
.
_done_callback
=
done_callback
self
.
_next_callback
=
next_callback
self
.
_last_data_index
=
-
1
def
add
(
self
,
data
,
start_data_index
,
end_data_index
):
self
.
data
.
append
((
data
,
start_data_index
,
end_data_index
))
self
.
_last_data_index
=
end_data_index
def
next
(
self
):
"""
Retrieves the next block of data
...
...
@@ -839,7 +841,7 @@ class MemoryDataSource(DataSource):
"""
if
(
len
(
self
.
data
)
==
0
)
and
(
self
.
_next_callback
is
not
None
):
if
not
(
self
.
_done_callback
()):
if
not
(
self
.
_done_callback
(
self
.
_last_data_index
)):
self
.
_next_callback
()
if
len
(
self
.
data
)
==
0
:
...
...
@@ -848,10 +850,10 @@ class MemoryDataSource(DataSource):
return
self
.
data
.
pop
(
0
)
def
hasMoreData
(
self
):
if
len
(
self
.
data
)
!=
0
:
return
True
return
not
self
.
_done_callback
()
return
not
self
.
_done_callback
(
self
.
_last_data_index
)
def
statistics
(
self
):
"""
Return the statistics about the number of bytes read from the cache
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment