From 92d9de74012a1ad85352a16e2de5c2d40b4f626d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Sat, 12 Dec 2020 02:20:53 +0100 Subject: [PATCH] minor fixes --- docs/varlen.rst | 2 +- tempsdb/chunks.pyx | 2 +- tempsdb/series.pxd | 2 +- tempsdb/varlen.pyx | 2 +- tests/test_varlen.py | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/varlen.rst b/docs/varlen.rst index 5e19bc3..8988ba9 100644 --- a/docs/varlen.rst +++ b/docs/varlen.rst @@ -36,7 +36,7 @@ Note that the only valid sizes of `size_struct` are: * 1 for maximum length of 255 * 2 for maximum length of 65535 * 3 for maximum length of 16777215 -* 4 for maximum length of 4294967295 +* 4 for maximum length of 2147483647 Also note that variable length series live in a different namespace than standard time series, so you can name them the same. diff --git a/tempsdb/chunks.pyx b/tempsdb/chunks.pyx index 31f2a23..0656288 100644 --- a/tempsdb/chunks.pyx +++ b/tempsdb/chunks.pyx @@ -27,7 +27,7 @@ cdef class AlternativeMMap: def madvise(self, a, b, c): ... - def resize(self, file_size: int): + def resize(self, int file_size): self.size = file_size def __init__(self, io_file: io.BinaryIO, file_lock_object): diff --git a/tempsdb/series.pxd b/tempsdb/series.pxd index 4ef27a8..08976e0 100644 --- a/tempsdb/series.pxd +++ b/tempsdb/series.pxd @@ -11,7 +11,7 @@ cdef class TimeSeries: readonly str name unsigned int max_entries_per_chunk readonly unsigned long long last_entry_synced - readonly unsigned int block_size + readonly int block_size readonly unsigned long long last_entry_ts unsigned int page_size readonly dict metadata diff --git a/tempsdb/varlen.pyx b/tempsdb/varlen.pyx index 25d605b..41b9355 100644 --- a/tempsdb/varlen.pyx +++ b/tempsdb/varlen.pyx @@ -612,7 +612,7 @@ cdef class VarlenSeries: elif self.size_field == 3: return 0xFFFFFF elif self.size_field == 4: - return 0xFFFFFFFF + return 0x7FFFFFFF else: raise ValueError('How did this happen?') diff --git a/tests/test_varlen.py b/tests/test_varlen.py index 3299d2a..a88933a 100644 --- a/tests/test_varlen.py +++ b/tests/test_varlen.py @@ -3,6 +3,7 @@ import os import unittest from tempsdb.varlen import create_varlen_series +from tempsdb.database import Database logger = logging.getLogger(__name__) -- GitLab