nyurik / timeseriesdb

Automatically exported from code.google.com/p/timeseriesdb
GNU General Public License v3.0
13 stars 6 forks source link

Insert/replace existing data #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
First, thanks for creating the timeseriesdb.

I've been researching to use timeseriesdb for my project and found that there 
is no easy way to replace or insert data into an existing time series.

My project requires to "patch" existing data and it seems that the way I can do 
is to:
1) break up the existing time series file into 2 sets where I want to replace 
or insert
2) build a new time series file using these 3 sets

For example, if bf is IWriteableFeed returned from BinaryFile.Open, I assume I 
can insert in psuedo code:

var newData = bf.Stream(0, 
whereIwantToInsert).concat(someData).concat(bf.stream(whereIwanttoInsert, 
theRest);

To replace, I have to basically find the ArraySegment and modify it and again 
rebuild it.

Do you have any other suggestion?
Do you think you will enhance it to have an easier interface?

Thanks

Original issue reported on code.google.com by kck...@gmail.com on 21 Feb 2013 at 2:19

GoogleCodeExporter commented 9 years ago
Hi kckhui, the problem is that the timeseriesdb uses a linear compression (a 
fairly simple one at this point, but it will get more complex with time). It is 
not really possible to change data in the middle, but what i would suggest is 
to break your data into daily/weekly/etc segments that can be easily modified 
by simply copying from original into a new file while modifying data, and 
deleting original. You won't have to create temporary sets, just do it 
dynamically while copying. Copying one item at a time is slightly slower 
computationally (inside it will still use buffers), but might be an easier 
solution for you. Hope this helps.

Original comment by yuriastrakhan on 21 Feb 2013 at 2:27

GoogleCodeExporter commented 9 years ago
Thanks for the prompt reply. I'd give it a try.

Original comment by kck...@gmail.com on 21 Feb 2013 at 3:15