Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tempsdb
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
tempsdb
Commits
d350725f
Commit
d350725f
authored
4 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
force closing var series
parent
6e409cf2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
tempsdb/database.pyx
+1
-1
1 addition, 1 deletion
tempsdb/database.pyx
tempsdb/varlen.pxd
+1
-1
1 addition, 1 deletion
tempsdb/varlen.pxd
tempsdb/varlen.pyx
+5
-2
5 additions, 2 deletions
tempsdb/varlen.pyx
tests/test_database.py
+0
-1
0 additions, 1 deletion
tests/test_database.py
with
7 additions
and
5 deletions
tempsdb/database.pyx
+
1
−
1
View file @
d350725f
...
@@ -322,7 +322,7 @@ cdef class Database:
...
@@ -322,7 +322,7 @@ cdef class Database:
series
.
close
()
# because already closed series won't close themselves
series
.
close
()
# because already closed series won't close themselves
self
.
open_series
=
{}
self
.
open_series
=
{}
for
var_series
in
self
.
open_varlen_series
.
values
():
for
var_series
in
self
.
open_varlen_series
.
values
():
var_series
.
close
()
var_series
.
close
(
True
)
self
.
open_varlen_series
=
{}
self
.
open_varlen_series
=
{}
self
.
closed
=
True
self
.
closed
=
True
return
0
return
0
...
...
This diff is collapsed.
Click to expand it.
tempsdb/varlen.pxd
+
1
−
1
View file @
d350725f
...
@@ -18,7 +18,7 @@ cdef class VarlenSeries:
...
@@ -18,7 +18,7 @@ cdef class VarlenSeries:
int
gzip_level
int
gzip_level
cpdef
int
mark_synced_up_to
(
self
,
unsigned
long
long
timestamp
)
except
-
1
cpdef
int
mark_synced_up_to
(
self
,
unsigned
long
long
timestamp
)
except
-
1
cpdef
int
close
(
self
)
except
-
1
cpdef
int
close
(
self
,
bint
force
=*
)
except
-
1
cpdef
int
delete
(
self
)
except
-
1
cpdef
int
delete
(
self
)
except
-
1
cpdef
tuple
get_current_value
(
self
)
cpdef
tuple
get_current_value
(
self
)
cdef
int
get_length_for
(
self
,
int
index
)
cdef
int
get_length_for
(
self
,
int
index
)
...
...
This diff is collapsed.
Click to expand it.
tempsdb/varlen.pyx
+
5
−
2
View file @
d350725f
...
@@ -300,6 +300,7 @@ cdef class VarlenIterator:
...
@@ -300,6 +300,7 @@ cdef class VarlenIterator:
def
__init__
(
self
,
parent
:
VarlenSeries
,
start
:
int
,
stop
:
int
,
def
__init__
(
self
,
parent
:
VarlenSeries
,
start
:
int
,
stop
:
int
,
direct_bytes
:
bool
=
False
):
direct_bytes
:
bool
=
False
):
self
.
parent
=
parent
self
.
parent
=
parent
self
.
parent
.
references
+=
1
self
.
start
=
start
self
.
start
=
start
self
.
stop
=
stop
self
.
stop
=
stop
self
.
direct_bytes
=
direct_bytes
self
.
direct_bytes
=
direct_bytes
...
@@ -596,18 +597,20 @@ cdef class VarlenSeries:
...
@@ -596,18 +597,20 @@ cdef class VarlenSeries:
"""
"""
return
self
.
length_profile
[
-
1
if
index
>=
len
(
self
.
length_profile
)
else
index
]
return
self
.
length_profile
[
-
1
if
index
>=
len
(
self
.
length_profile
)
else
index
]
cpdef
int
close
(
self
)
except
-
1
:
cpdef
int
close
(
self
,
bint
force
=
False
)
except
-
1
:
"""
"""
Close this series.
Close this series.
No-op if already closed.
No-op if already closed.
:param force: set to True to ignore open references
:raises StillOpen: some references are being held
:raises StillOpen: some references are being held
"""
"""
if
self
.
closed
:
if
self
.
closed
:
return
0
return
0
if
self
.
references
:
if
self
.
references
and
not
force
:
raise
StillOpen
(
'
still some iterators around
'
)
raise
StillOpen
(
'
still some iterators around
'
)
self
.
closed
=
True
self
.
closed
=
True
...
...
This diff is collapsed.
Click to expand it.
tests/test_database.py
+
0
−
1
View file @
d350725f
...
@@ -31,7 +31,6 @@ class TestDatabase(unittest.TestCase):
...
@@ -31,7 +31,6 @@ class TestDatabase(unittest.TestCase):
ser
=
self
.
db
.
get_varlen_series
(
'
hello-world
'
)
ser
=
self
.
db
.
get_varlen_series
(
'
hello-world
'
)
self
.
assertEqual
(
ser
.
get_current_value
(),
(
20
,
b
'
\x00\x00\x00
'
))
self
.
assertEqual
(
ser
.
get_current_value
(),
(
20
,
b
'
\x00\x00\x00
'
))
self
.
assertEqual
(
ser
.
last_entry_ts
,
20
)
ser
.
close
()
ser
.
close
()
self
.
db
.
delete_varlen_series
(
'
hello-world
'
)
self
.
db
.
delete_varlen_series
(
'
hello-world
'
)
...
...
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