Feature #2527

rsbag cat requires converters to output meta-data

Added by M. Goerlich over 5 years ago. Updated over 5 years ago.

Status:ResolvedStart date:03/17/2016
Priority:NormalDue date:
Assignee:J. Moringen% Done:

100%

Category:Commandline Tools
Target version:Robotics Service Bus - rsb-0.14

Description

Would be cool if you would not have to add them.

Associated revisions

Revision df90f46f
Added by J. Moringen over 5 years ago

Added access protocol in src/event-processing/protocol.lisp

refs #2527

  • src/event-processing/protocol.lisp (header): updated copyright
    (event-parts): new variable; a list of event parts and respective
    access information
    (access?): new generic function; indicate whether a given processor
    needs access to a given part of an event
    (access? t t t): new method; default to nil
    (access? sequence t t): new method; delegate to elements
  • src/event-processing/package.lisp (header): updated copyright
    (package rsb.event-processing): added exported symbols event-parts
    and access?
  • test/package.lisp (header): updated copyright
    (package rsb.test): added exported symbols call-with-access-checking,
    with[out]-access-checking, access-checking-event, event-readable?,
    event-writable?, make-access-checking-event, and
    make-access-checking-event-for-processor
    (call-with-access-checking): new function; helper for
    with[out]-access-checking
    (with-access-checking): new macro; execute forms with accesses to
    event parts checked
    (without-access-checking): opposite
    (access-checking-event): new class; a specialized event class that
    checks accesses to its parts
    (print-object :around access-checking-event): new method; disable
    access checks around printing
    (access? access-checking-event t t): new method; compute answer from
    supplied rules
    (setf access? t access-checking-event t t): likewise
    (check-access): new generic function; check whether a particular
    access is allowed
    (define-checked-methods): new local macro; defined checked versions of
    event accessor methods using rsb.ep:*event-parts*
    (make-access-checking-event): new function; construct an
    `access-checking-event'
    (make-access-checking-event-for-processor): new function; call
    `make-access-checking-event' with rules suitable for the supplied
    processor
  • cl-rsb.asd (system cl-rsb): extracted module "event-processing-early"
    with files
    src/event-processing/{package,util,protocol,scope-trie}.lisp from
    module "event-processing"; modules "filter", "transform" and
    "event-processing" depend on "event-processing-early"

Revision ee5b123f
Added by J. Moringen over 5 years ago

Use access protocol in src/filter/*.lisp

refs #2527

Added "opt-in" methods for filter classes on the access? generic
function, i.e. these methods return true if the filter in question has
to read the a given event part.

  • src/filter/filter-mixins.lisp (header): updated copyright
    (access? payload-matching-mixin eql :data eql :read): new method;
    return t
  • src/filter/composite-filter.lisp (header): updated copyright
    (access? composite-filter t t): new method; delegate decision to
    children
  • src/filter/meta-data-filter.lisp (header): updated copyright
    (access? meta-data-filter eql :meta-data eql :read): new method;
    return t
  • src/filter/method-filter.lisp (header): updated copyright
    (access? method-filter eql :method eql :read): new method; return t
  • src/filter/origin-filter.lisp (header): updated copyright
    (access? origin-filter eql :origin eql :read): new method; return t
  • src/filter/scope-filter.lisp (header): updated copyright
    (access? scope-filter eql :scope eql :read): new method; return t
  • src/filter/type-filter.lisp (access? type-filter eql :data eql :read):
    new method; return t
  • test/filter/package.lisp (header): updated copyright
    (package rsb.filter.test): added used package let-plus; fixed
    documentation string
    (call-with-filter-checking-thunk): new function; perform a filter
    check with a suitable access checking event
    (define-basic-filter-test-cases): use
    `call-with-filter-checking-thunk'

Revision 2fb31485
Added by J. Moringen over 5 years ago

Use access protocol in src/transform/*.lisp

refs #2527

Added "opt-in" methods for transform classes on the access? generic
function, i.e. these methods return true if the transform in question
has to read or write the a given event part.

  • src/transform/adjust-timestamps.lisp (header): updated copyright
    (access? adjust-timestamps eql :data t): new method; return t
  • src/transform/drop-payload.lisp (header): updated copyright
    (access? drop-payload eql :data eql :write): new method; return t
  • src/transform/prefix-scope.lisp (header): updated copyright
    (access? prefix-scope eql :data t): new method; return t
  • test/transform/adjust-timestamps.lisp (header): updated copyright
    (test rsb.transform.adjust-timestamps-root::smoke): use
    `call-with-transform-thunk'
  • test/transform/drop-payload.lisp (header): updated copyright
    (test rsb.transform.drop-payload-root:smoke): use
    `call-with-transform-thunk'
  • test/transform/prefix-scope.lisp (header): updated copyright
    (test rsb.transform.prefix-scope-root::smoke): use
    `call-with-transform-thunk'
  • test/transform/package.lisp (header): updated copyright
    (call-with-transform-thunk): new function; perform a transform
    application with suitable event access rules

Revision 39f6d7a7
Added by J. Moringen over 5 years ago

Implemented access? protocol in src/{formatting,stats}/*.lisp

refs #2527

Event formatting styles, columns and statistical quantities use the
access? protocol to report the event parts they need access to.

  • src/formatting/style-mixins.lisp (access-mixin): new class; mixin for
    access declaring style classes
    (access? access-mixin t eql :write): new method; return nil as
    formatting styles never write
    (access? delegating-mixin t t): new method; delegate to sub-styles
    (access? payload-style-mixin eql :data eql :read): new method; return
    true when there is a payload style
  • src/formatting/text-style-mixins.lisp (access? columns-mixin t t): new
    method; delegate to columns
  • src/formatting/quantity-column.lisp (access? quantity-column t t): new
    method; delegate to quantity
  • src/formatting/columns.lisp (define-simple-column): generate methods
    on the `access?' generic function according to the access requirements
    of the column class
  • src/formatting/event-style-meta-data.lisp (define-access?-method):
    new local macro; define methods on the `access?' generic
    function (style-meta-data): added superclass `access-mixin'
  • src/formatting/event-style-detailed.lisp (style-detailed): added
    superclass `access-mixin'
  • src/formatting/timeline.lisp (define-access?-method): local macro;
    define methods on the `access?' generic function
  • src/formatting/event-style-json.lisp (style-json): added superclass
    `access-mixin'
    (access? style-json t eql :read): new method; return t as read access
    to all parts is required
  • src/formatting/event-style-programmable.lisp
    (style-programmable-default-bindings): minor renaming to make
    binding use detectable
    (style-programmable-default-binding-access-info): new variable;
    stores event parts corresponding to bindings
    (style-programmable::used-bindings): new slot; stores names of
    bindings used by the code
    (setf style-code :before t style-programmable): use local function
    `recompile' which also updates used bindings
    (setf style-bindings :before t style-programmable): likewise
    (access? style-programmable t eql :read): new method; check query
    against used bindings
    (binding-use): new condition class; helper for detecting binding
    during compilation
    (compile-code style-programmable t list): detect binding uses and
    return list of used bindings
  • src/stats/quantities.lisp (header): updated copyright
    (define-simple-quantity): generate methods on the `access?' generic
    function according to the access requirements of the quantity class
  • test/formatting/package.lisp (header): updated copyright
    (ensure-style-cases): use `with-access-checking' and
    `maybe-add-access-checking' to perform all tests with access checking
    events
    (maybe-add-access-checking): new function; helper for
    `ensure-style-cases'
  • cl-rsb-formatting.asd (system cl-rsb-formatting-test): added system
    dependency on cl-rsb-test

Revision 5f04cbc0
Added by J. Moringen over 5 years ago

Mention cat's selective deserialization in news.rst

refs #2527

  • news.rst (RSBag 0.14): mention selective deserialization performed by
    rsbag cat

Revision ddf00eaa
Added by J. Moringen over 5 years ago

Exploit access? protocol in src/commands/cat.lisp

fixes #2527

Using the access? protocol, select a channel transformation that
deserializes event payloads or not depending on whether the selected
event formatting style needs access to event payloads.

  • src/commands/util.lisp (header): updated copyright
    (coding-transform): removed; replaced by function
    (coding-transform): new function; return transform specification with
    or without non-trivial converter depending on whether access to the
    event payload is needed
  • src/commands/cat.lisp (command-execute cat): determine whether the
    selected formatting style needs access to the event payload and select
    the transform accordingly; adapted to `coding-transform' change
  • src/commands/transform.lisp (header): updated copyright
    (command-execute transform): adapted to `coding-transform' change

Revision cfe8972a
Added by J. Moringen over 5 years ago

Use access protocol for converter selection in src/commands/bridge/participant.lisp

refs #2527

  • src/commands/bridge/participant.lisp
    (shared-initialize :after connection t): select converters of listener
    and informer children based on whether the transform needs access to
    the event data
  • test/commands/bridge/command.lisp
    (test commands-bridge-command-root::smoke): use
    `call-tracking-converter' to check converter calls made by bridge
    participants
  • rsb-tools-commands.asd (system rsb-tools-commands-test): added system
    dependencies on cl-rsb-test and rsb-transport-socket

Revision 29842e61
Added by J. Moringen over 5 years ago

Account for filter when selecting converters in src/commands/bridge/participant.lisp

refs #2527

  • src/commands/bridge/participant.lisp
    (shared-initialize :after connect t): also query filters when
    determining whether read access to the event data will be required

History

#1 Updated by J. Moringen over 5 years ago

  • Category set to Commandline Tools
  • Status changed from New to In Progress
  • Assignee set to J. Moringen
  • Target version set to rsb-0.14

Would be cool if you would not have to add them.

As it happens, I just developed the machinery to make this possible.

#2 Updated by J. Moringen over 5 years ago

  • % Done changed from 0 to 70

#3 Updated by J. Moringen over 5 years ago

  • % Done changed from 70 to 90

#4 Updated by J. Moringen over 5 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Also available in: Atom PDF