serialization: serialize send index 00/216800/1
authorAdrian Szyndela <adrian.s@samsung.com>
Fri, 25 Oct 2019 14:27:09 +0000 (16:27 +0200)
committersanghyeok oh <sanghyeok.oh@samsung.com>
Fri, 1 Nov 2019 08:06:28 +0000 (08:06 +0000)
commite83f85abbe208d0c96c137ebc852ea4e459449ae
tree4dc89a59d4dab1ea3f84971511fcfd8e92edd2c8
parent9a4f9bd5959b6082645c8bf966a68d667da7baa2
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
(cherry picked from commit 783b7e7315959b625a613b959c19b12a381e5831)
src/internal/include/fb.fbs
src/internal/include/fb_generated.h
src/internal/serializer.cpp
src/internal/storage_backend_serialized.cpp