Include strings.h instead of defining _BSD_SOURCE to get strcasecmp.
_BSD_SOURCE is deprecated in favor of _DEFAULT_SOURCE but also it's not
needed for strcasecmp() when including strings.h in addition to string.h.
_BSD_SOURCE is deprecated in favor of _DEFAULT_SOURCE but also it's not
needed for strcasecmp() when including strings.h in addition to string.h.
frontend/query: Add the DATA type to TIMESERIES replies.
This was lost in 9a96acd759c31211aa512e174339a9c178c4eb83.
This was lost in 9a96acd759c31211aa512e174339a9c178c4eb83.
frontend/query: Simplified code a little.
Enable flex verbose output only in verbose build mode.
frontend/query: Fixed an uninitialized value.
Clean up after checking compiler flags and fix C++ tests.
They just happened to work fine when done right after C tests.
They just happened to work fine when done right after C tests.
Enable silent automake rules by default (if available).
Merged branch 'master' of git://git.tokkee.org/sysdb.
Handle last_update/interval in the core rather than in memstore.
For this purpose, let the sdb_plugin_store_* functions fetch the latest
revision of the object to determine the last update interval and last
recorded interval. The memstore now expects both values to be passed in
whenever storing/updating an object.
For this purpose, let the sdb_plugin_store_* functions fetch the latest
revision of the object to determine the last update interval and last
recorded interval. The memstore now expects both values to be passed in
whenever storing/updating an object.
memstore: Let get_child() support arbitrary parent and child elements.
Add support for fetching arbitrary objects, including attributes.
That is, the backend now supports this. The functionality is not yet exposed
via SysQL.
That is, the backend now supports this. The functionality is not yet exposed
via SysQL.
frontend/query_test: Simplified result checks.
Don't track the expected length since it always matches strlen() anyway. The
additional check would hide the diff if it failed, adding an unnecessary step
for debugging failures.
Don't track the expected length since it always matches strlen() anyway. The
additional check would hide the diff if it failed, adding an unnecessary step
for debugging failures.
Include strings.h which is required for strcasecmp().
FETCH: Add parameter for fetching the main object without children.
That is, exclude any attributes or child objects.
Use this to simplify the TIMESERIES fetcher which no longer requires an
attribute callback.
That is, exclude any attributes or child objects.
Use this to simplify the TIMESERIES fetcher which no longer requires an
attribute callback.
Split the memstore module from the store module.
Renamed in-memory store types and functions to sdb_memstore*.
connection: Drop old and unused conn_node* types.
This was part of the old parser implementation.
This was part of the old parser implementation.
Removed sdb_store_fetch_timeseries from headers; it's gone.
store: Use full initializers for store objects.
Older versions of GCC/CLANG don't handle "missing" field initializers well.
Older versions of GCC/CLANG don't handle "missing" field initializers well.
configure: Include rrd.h when checking for rrd_client.h.
Apparently, this is needed for RRDtool 1.5.
Apparently, this is needed for RRDtool 1.5.
Build a more generic/powerful query API which writes to a store-writer.
Instead of letting the query implementation write JSON directly, let them emit
objects to a store-writer. This allows for more powerful and centralized
post-processing of the data and avoids code-duplication by moving all logic of
how to write out the data to the core. Also, this had a couple of nice side
effects and allowed for further simplication:
- The TIMESERIES command is now handled by the front-end (based on a FETCH of
the respective metric data); query plugin no longer have to implement this.
- All protocol specific information is now handled by the frontend; query
plugins no longer have to handle this (response-type).
- Further separation of the memory-store and generic store code.
Instead of letting the query implementation write JSON directly, let them emit
objects to a store-writer. This allows for more powerful and centralized
post-processing of the data and avoids code-duplication by moving all logic of
how to write out the data to the core. Also, this had a couple of nice side
effects and allowed for further simplication:
- The TIMESERIES command is now handled by the front-end (based on a FETCH of
the respective metric data); query plugin no longer have to implement this.
- All protocol specific information is now handled by the frontend; query
plugins no longer have to handle this (response-type).
- Further separation of the memory-store and generic store code.
Move the timeseries serialize to the timeseries module.
store: Don't report an error if a missing writer callback isn't used.
That is, allow to emit store objects to an incomplete writer as long as all
required callbacks are present.
That is, allow to emit store objects to an incomplete writer as long as all
required callbacks are present.
store: Use the JSON writer when querying the in-memory store.
That is, instead of writing to a JSON formatter directly, access it through
it's writer API. This will allow for more flexible store access.
That is, instead of writing to a JSON formatter directly, access it through
it's writer API. This will allow for more flexible store access.
store_json: Base the memstore emitter on the store-writer API.
store_json: Let the formatter implement the store-writer interface.
Read-only store types: const char ** → const char * const *.
This makes it truely read-only.
This makes it truely read-only.
store_json: Remove any memstore-specific code.
This will allow to further separate the JSON code from the memstore
implementation.
This will allow to further separate the JSON code from the memstore
implementation.
store_json: Fix parent/child detection.
Rewinding the formatter state has to happen any time we see a parent object of
the current object. This happens every time the current context isn't HOST
(hosts don't have any parents) or the new object is an ATTRIBUTE (which are
always children of whatever other object type).
This broke in 3603db13105aefac4d6ceb356bcfd118a92fa654.
Rewinding the formatter state has to happen any time we see a parent object of
the current object. This happens every time the current context isn't HOST
(hosts don't have any parents) or the new object is an ATTRIBUTE (which are
always children of whatever other object type).
This broke in 3603db13105aefac4d6ceb356bcfd118a92fa654.
store_json: Split sdb_store_json_emit into private functions.
The public function will only handle memstore specific logic.
The public function will only handle memstore specific logic.
store_json: Moved special casing of parent objects into the caller.
This makes the JSON module more generic by removing a special case of the
memory store. The caller may now emit arbitrary objects and the formatter will
do the right thing as long as parent-child relationships are right.
This makes the JSON module more generic by removing a special case of the
memory store. The caller may now emit arbitrary objects and the formatter will
do the right thing as long as parent-child relationships are right.
store, plugin: Let the plugin module determine an objects backends.
The store writer plugins are only expected to record the provided backend
(after merging it with existing entries).
The store writer plugins are only expected to record the provided backend
(after merging it with existing entries).
store: Further abstract internal handling of new objects.
Add a new type representing a to-be-stored object to simplify storing new
objects.
Add a new type representing a to-be-stored object to simplify storing new
objects.
store: Simplified store-attribute callback.
There's no need anymore to split this across multiple functions. It's easier
to follow if the code is in one place.
There's no need anymore to split this across multiple functions. It's easier
to follow if the code is in one place.
store: Add separate store-object types for the store writer API.
The argument list of some of the callbacks has already gotten kinda long and
we'll want to add more (backends, etc.). Introduce new types which provide all
meta-data of the respective store types.
Also, only use a single callback to store all kinds of attributes, similar to
how it was already done in the "proto" module.
The argument list of some of the callbacks has already gotten kinda long and
we'll want to add more (backends, etc.). Introduce new types which provide all
meta-data of the respective store types.
Also, only use a single callback to store all kinds of attributes, similar to
how it was already done in the "proto" module.
store: Dropped sdb_ prefix from private store types.
store.h: Updated some documentation comments.
A store instance isn't synonym to "the database" anymore.
A store instance isn't synonym to "the database" anymore.
plugin, store: Add service/metric "hostname" attributes centrally.
That is, let the respective sdb_plugin_store* functions do that instead of
requiring each store implementation to do so.
That is, let the respective sdb_plugin_store* functions do that instead of
requiring each store implementation to do so.
frontend/query_test: Test some weird, special cases.
store: Fix execution of more complex iterators.
That is, follow "indirections" of typed expressions if the iterator is not on
the top-most level.
That is, follow "indirections" of typed expressions if the iterator is not on
the top-most level.
Remove unused sdb_store_expr_iterable().
Allow and implement iterating arbitrary (non-constant) array values.
That is, iterators may now work with arithmetic expressions that evaluate to
an array.
That is, iterators may now work with arithmetic expressions that evaluate to
an array.
analyzer: Support more flexible iterator expressions.
In particular, more complex typed expressions may now include an iterator on a
lower level, like `LOOKUP services MATCHING ANY host.backend =~ 'foo'`. This
is done by adding more information to the analyzer context and pushing it down
to child nodes in the AST if necessary.
As a nice side-effect, the iterator analyzer does not longer have to know
about the specific type of its child node.
In particular, more complex typed expressions may now include an iterator on a
lower level, like `LOOKUP services MATCHING ANY host.backend =~ 'foo'`. This
is done by adding more information to the analyzer context and pushing it down
to child nodes in the AST if necessary.
As a nice side-effect, the iterator analyzer does not longer have to know
about the specific type of its child node.
analyzer: Fixed some error messages.
parser: Require a context for each parser operation.
That is, let the caller provide the execution context (object type) when
parsing incomplete commands (conditionals / arithmetic expressions). This
removes the need to call the analyzer again and avoids some special code in
the analyzer.
That is, let the caller provide the execution context (object type) when
parsing incomplete commands (conditionals / arithmetic expressions). This
removes the need to call the analyzer again and avoids some special code in
the analyzer.
Let the front-end handle STORE commands.
… rather than requiring each reader plugin to do so which doesn't make any
sense at all.
… rather than requiring each reader plugin to do so which doesn't make any
sense at all.
t/integration/store.sh: Add integration tests for the STORE command.
store: Do not canonicalize the hostname when fetching a timeseries.
This decision should be made on a higher level.
This decision should be made on a higher level.
frontend: Connection-specific functions now use the sdb_conn_ prefix.
… instead of sdb_fe_.
… instead of sdb_fe_.
frontend/connection.h: Removed sdb_fe_parse, it has been dropped.
store: Removed obsolete TODO note.
plugin, store: Handle hostname canonicalization in the plugin module.
This is a high-level functionality. Each store implementation should not have
to worry about it.
This is a high-level functionality. Each store implementation should not have
to worry about it.
sysdb(7): Briefly mention the object store.
sysdbd-store-memory(5): Added a manpage for store::memory.
store::memory: Add a plugin providing an in-memory store.
This plugin replaces the default, built-in store. It is a simple wrapper
around the built-in store implementation and, thus, provides exactly the same
functionality but wrapped into a plugin.
This plugin replaces the default, built-in store. It is a simple wrapper
around the built-in store implementation and, thus, provides exactly the same
functionality but wrapped into a plugin.
t/Makefile: Drop unused, old frontend/parser_test.
plugin: Report an error when writing to the store with no writers.
store: Drop the global (default) store.
Instead, register a store from sysdbd and make sure to re-register it on
reconfigure. Previously, the store plugin would have been dropped in that
case.
Instead, register a store from sysdbd and make sure to re-register it on
reconfigure. Previously, the store plugin would have been dropped in that
case.
store: All store functions now accept a store object.
That is, instead of operating on a global, shared instance.
That is, instead of operating on a global, shared instance.
store: Add wrapper functions to store an object in an arbitrary store.
core: Export the sdb_store, sdb_store_reader, sdb_store_writer types.
This is in preparation to more flexible store handling.
This is in preparation to more flexible store handling.
t/valgrind.suppress: Refine the suppression in the libc exit handler.
frontend: Use the plugin query interface instead of direct store access.
The built-in store is registered as a reader automatically at the moment.
The built-in store is registered as a reader automatically at the moment.
core: Add support for reader/query plugins.
A reader plugin can be used to query a data-store based on a query described
by an AST. The plugin module provides a generic function for this purpose.
At the moment, only a single reader plugin can be used at a time. Supporting
multiple readers requires a good merge strategy. The challenge is to handle
filters and query conditions correctly which may evaluate differently after
two stores have been merged.
A reader plugin can be used to query a data-store based on a query described
by an AST. The plugin module provides a generic function for this purpose.
At the moment, only a single reader plugin can be used at a time. Supporting
multiple readers requires a good merge strategy. The challenge is to handle
filters and query conditions correctly which may evaluate differently after
two stores have been merged.
t/valgrind.suppress: Add an invalid free in a libc exit handler.
plugin: Drop sdb_plugin prefix from private names.
store_exec: Remove unnecessary casts.
store: Let sdb_store_json_formatter_t inherit from sdb_object_t.
Drop sdb_store_get_host() from tests.
store: Drop unused sdb_store_has_host.
Replaced sdb_store_<type> with sdb_plugin_store_<type>.
That is, all store updates will now directly go through the plugin API and be
distributed to all store-writer plugins from there.
That is, all store updates will now directly go through the plugin API and be
distributed to all store-writer plugins from there.
Merged branch 'master' of git://git.tokkee.org/sysdb.
store: Register a store writer and handle all updates through the plugin API.
We still reference a global store object. This change further encapsulates the
store.
We still reference a global store object. This change further encapsulates the
store.
plugin: sdb_plugin_store_* now return >0 if the new value was too old.
That is, the return values now mean the same as for the sdb_store_* functions.
That is, the return values now mean the same as for the sdb_store_* functions.
store: Reordered some functions to group by general purpose.
Fix an uninitialized value warnings caused by clang not knowing about fail().
store: Make the actual store a separate object.
That'll allow us to use different store objects in multiple places in the
future.
That'll allow us to use different store objects in multiple places in the
future.
store: Drop sdb_ prefix from private symbols.
data: Use a predefined format for sdb_strftime().
Also, print the nanosecond fraction of a second.
Also, print the nanosecond fraction of a second.
t/: Use ck_assert() instead of assert() in all tests.
sysdbql(7): Document 'value' and 'timeseries' fields.
parser: Add support for metric timeseries fields.
store: Add the timeseries field to metrics.
This is a boolean field that specifies whether a timeseries for the metric is
known to SysDB.
This is a boolean field that specifies whether a timeseries for the metric is
known to SysDB.
parser: Skip context-specific checks if the context is unspecified.
Else, the analyzer may reject valid queries. It's up to the caller to run the
analyzer using the right context once it's known.
Else, the analyzer may reject valid queries. It's up to the caller to run the
analyzer using the right context once it's known.
store: Remove (now unused) sdb_store_parse_*() helpers.
store: Remove (now unused) sdb_store_nin_matcher().
sysdbql(7): Document IS [NOT] TRUE / FALSE.
parser: Add support for <expr> IS [NOT] TRUE / FALSE queries.
store: Add support for unary IS TRUE / IS FALSE matchers.
store: Drop the special IS-NOT-NULL matcher.
In the AST world, this is NOT(IS-NULL).
In the AST world, this is NOT(IS-NULL).
utils/proto: Support boolean values.
They are encoded as a single byte on the wire.
They are encoded as a single byte on the wire.
data: Add basic support for a boolean type.
This change breaks backward compatibility of the network protocol because it
changes the encoding of a datum. I felt this is still acceptable (given the
current (non-)compatibility promise) and it made the order of types feel more
natural ;-)
This change breaks backward compatibility of the network protocol because it
changes the encoding of a datum. I felt this is still acceptable (given the
current (non-)compatibility promise) and it made the order of types feel more
natural ;-)
Drop the old frontend parser.
It's fully replaced by the new parser module now.
It's fully replaced by the new parser module now.
store: Add sdb_store_query_prepare_matcher().
This prepares a logical expression described by an AST for execution as a
store matcher. This is useful for anything that uses the lower level store
lookup functions.
This prepares a logical expression described by an AST for execution as a
store matcher. This is useful for anything that uses the lower level store
lookup functions.
frontend: Drop sdb_fe_store_* in favor of sdb_store_query_execute.
Instead, build a temporary AST to represent the command to be executed.
Instead, build a temporary AST to represent the command to be executed.
frontend: Drop sdb_fe_exec_* in favor of sdb_store_query_execute.
Instead, build a temporary AST to represent the command to be executed.
Instead, build a temporary AST to represent the command to be executed.
Remove (now) usued sdb_fe_exec_timeseries().
frontend/query_test: Add tests for the lower level functions.
frontend/query: Split AST execution into a separate function.
store: Use a separate type for prepared querys.
It's sufficiently different from the general matchers/filters approach to not
benefit from sharing a base type.
It's sufficiently different from the general matchers/filters approach to not
benefit from sharing a base type.