serialization: serialize send index 96/216496/1
authorAdrian Szyndela <adrian.s@samsung.com>
Fri, 25 Oct 2019 14:27:09 +0000 (16:27 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Fri, 25 Oct 2019 14:27:09 +0000 (16:27 +0200)
commit783b7e7315959b625a613b959c19b12a381e5831
treea4df063e4cf1bbf9e0aa435337f9dcb11867385f
parentc641a5cb8a025f7a75f7b88015d85e1a5cc6813a
serialization: serialize send index

This removes creating send index after reading a serialized database.
Instead, the send index is created while serializing the database,
and written along with the database. Then, the index is used
as before, but in a bit more generalized way, being a part
of PolicySend now.

Therefore, this extends the database with the new tables,
making the database version up to LDP2. The previous version
LDP1 is still compatible with new code, however the send index
is not supported for old databases.

This results in the following:
- with serialized database, version LDP2, the send index
  is kept in serialized database file, and used accordingly
  for all lookups to "send" part of the database;
- with serialized database, version LDP1, there is no send index,
  the lookups are performed in an old-fashined, linear manner;
- with no serialized database, only XML files, the index is created
  in memory, along with the serialized database. Thus, running
  fast, but at the cost of memory.

Change-Id: Ib918fa96eb60d216512faf60f8e20692c8a5d3a3
src/internal/include/fb.fbs
src/internal/include/fb_generated.h
src/internal/serializer.cpp
src/internal/storage_backend_serialized.cpp