Skip to content
Snippets Groups Projects
Commit 704ce18e authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

add close_chunks

parent 8f696d6f
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,7 @@ Then copy your resulting wheel and install it via pip on the target system. ...@@ -54,7 +54,7 @@ Then copy your resulting wheel and install it via pip on the target system.
## v0.5.1 ## v0.5.1
* _TBA_ * added `VarlenSeries.close_chunks`
## v0.5 ## v0.5
......
...@@ -23,7 +23,7 @@ if 'CI' in os.environ: ...@@ -23,7 +23,7 @@ if 'CI' in os.environ:
setup(name='tempsdb', setup(name='tempsdb',
version='0.5.1a1', version='0.5.1a2',
packages=['tempsdb'], packages=['tempsdb'],
install_requires=['satella>=2.14.24', 'ujson', 'indexed_gzip'], install_requires=['satella>=2.14.24', 'ujson', 'indexed_gzip'],
ext_modules=build([Multibuild('tempsdb', find_pyx('tempsdb'), **ext_kwargs), ], ext_modules=build([Multibuild('tempsdb', find_pyx('tempsdb'), **ext_kwargs), ],
......
...@@ -24,6 +24,7 @@ cdef class VarlenSeries: ...@@ -24,6 +24,7 @@ cdef class VarlenSeries:
cdef int get_length_for(self, int index) cdef int get_length_for(self, int index)
cpdef int trim(self, unsigned long long timestamp) except -1 cpdef int trim(self, unsigned long long timestamp) except -1
cdef int add_series(self) except -1 cdef int add_series(self) except -1
cpdef int close_chunks(self) except -1
cdef void register_memory_pressure_manager(self, object mpm) cdef void register_memory_pressure_manager(self, object mpm)
cpdef int append(self, unsigned long long timestamp, bytes data) except -1 cpdef int append(self, unsigned long long timestamp, bytes data) except -1
cpdef long long get_maximum_length(self) except -1 cpdef long long get_maximum_length(self) except -1
......
...@@ -429,6 +429,15 @@ cdef class VarlenSeries: ...@@ -429,6 +429,15 @@ cdef class VarlenSeries:
for series in self.series: for series in self.series:
series.register_memory_pressure_manager(mpm) series.register_memory_pressure_manager(mpm)
cpdef int close_chunks(self) except -1:
"""
Close unnecessary chunks
"""
cdef TimeSeries series
for series in self.series:
series.close_chunks()
return 0
cpdef VarlenIterator iterate_range(self, unsigned long long start, unsigned long long stop, cpdef VarlenIterator iterate_range(self, unsigned long long start, unsigned long long stop,
bint direct_bytes=False): bint direct_bytes=False):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment