partial proof of concept for proposal discussed in https://issues.apache.org/jira/browse/CB-8032