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
552a2cd7
Commit
552a2cd7
authored
4 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
refactor the code
parent
ec969ace
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
setup.py
+1
-1
1 addition, 1 deletion
setup.py
tempsdb/chunks.pyx
+3
-3
3 additions, 3 deletions
tempsdb/chunks.pyx
tempsdb/series.pyx
+2
-2
2 additions, 2 deletions
tempsdb/series.pyx
with
6 additions
and
6 deletions
setup.py
+
1
−
1
View file @
552a2cd7
...
@@ -28,7 +28,7 @@ if 'CI' in os.environ:
...
@@ -28,7 +28,7 @@ if 'CI' in os.environ:
setup
(
name
=
'
tempsdb
'
,
setup
(
name
=
'
tempsdb
'
,
version
=
'
0.5a
1
'
,
version
=
'
0.5a
2
'
,
packages
=
[
'
tempsdb
'
],
packages
=
[
'
tempsdb
'
],
install_requires
=
[
'
satella>=2.14.24
'
,
'
ujson
'
],
install_requires
=
[
'
satella>=2.14.24
'
,
'
ujson
'
],
ext_modules
=
build
([
Multibuild
(
'
tempsdb
'
,
find_pyx
(
'
tempsdb
'
)),
],
ext_modules
=
build
([
Multibuild
(
'
tempsdb
'
,
find_pyx
(
'
tempsdb
'
)),
],
...
...
This diff is collapsed.
Click to expand it.
tempsdb/chunks.pyx
+
3
−
3
View file @
552a2cd7
...
@@ -140,8 +140,8 @@ cdef class Chunk:
...
@@ -140,8 +140,8 @@ cdef class Chunk:
cdef
int
decref
(
self
)
except
-
1
:
cdef
int
decref
(
self
)
except
-
1
:
if
self
.
parent
is
not
None
:
if
self
.
parent
is
not
None
:
self
.
parent
.
decref_chunk
(
self
.
min_ts
)
self
.
parent
.
decref_chunk
(
self
.
name
()
)
if
self
.
parent
.
refs_chunks
[
self
.
name
()
]
<
0
:
if
self
.
parent
.
get_references_for
(
self
.
name
()
)
<
0
:
raise
ValueError
(
'
reference of chunk fell below zero!
'
)
raise
ValueError
(
'
reference of chunk fell below zero!
'
)
return
0
return
0
...
@@ -407,7 +407,7 @@ cdef class Chunk:
...
@@ -407,7 +407,7 @@ cdef class Chunk:
cdef
unsigned
long
long
name
=
self
.
name
()
cdef
unsigned
long
long
name
=
self
.
name
()
if
self
.
parent
:
if
self
.
parent
:
with
self
.
parent
.
open_lock
:
with
self
.
parent
.
open_lock
:
if
not
force
and
self
.
parent
.
refs_chunks
.
get
(
name
,
0
)
>
0
:
if
not
force
and
self
.
parent
.
get_references_for
(
name
)
>
0
:
raise
StillOpen
(
'
this chunk is opened
'
)
raise
StillOpen
(
'
this chunk is opened
'
)
del
self
.
parent
.
refs_chunks
[
name
]
del
self
.
parent
.
refs_chunks
[
name
]
del
self
.
parent
.
open_chunks
[
name
]
del
self
.
parent
.
open_chunks
[
name
]
...
...
This diff is collapsed.
Click to expand it.
tempsdb/series.pyx
+
2
−
2
View file @
552a2cd7
...
@@ -204,7 +204,7 @@ cdef class TimeSeries:
...
@@ -204,7 +204,7 @@ cdef class TimeSeries:
while
len
(
self
.
chunks
)
>=
2
and
timestamp
>
self
.
chunks
[
1
]:
while
len
(
self
.
chunks
)
>=
2
and
timestamp
>
self
.
chunks
[
1
]:
chunk_to_delete
=
self
.
chunks
[
0
]
chunk_to_delete
=
self
.
chunks
[
0
]
if
chunk_to_delete
in
self
.
open_chunks
:
if
chunk_to_delete
in
self
.
open_chunks
:
refs
=
self
.
refs_chunks
.
get
(
chunk_to_delete
,
0
)
refs
=
self
.
get_references_for
(
chunk_to_delete
)
if
not
refs
:
if
not
refs
:
self
.
open_chunks
[
chunk_to_delete
].
delete
()
self
.
open_chunks
[
chunk_to_delete
].
delete
()
else
:
else
:
...
@@ -378,7 +378,7 @@ cdef class TimeSeries:
...
@@ -378,7 +378,7 @@ cdef class TimeSeries:
for
chunk_name
in
chunks
:
for
chunk_name
in
chunks
:
if
chunk_name
==
last_chunk_name
:
if
chunk_name
==
last_chunk_name
:
continue
continue
elif
not
self
.
refs_chunks
.
get
(
chunk_name
,
0
):
elif
not
self
.
get_references_for
(
chunk_name
):
self
.
open_chunks
[
chunk_name
].
close
()
self
.
open_chunks
[
chunk_name
].
close
()
try
:
try
:
del
self
.
refs_chunks
[
chunk_name
]
del
self
.
refs_chunks
[
chunk_name
]
...
...
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