Skip to content

Conversation

dmitry-timofeev
Copy link
Contributor

@dmitry-timofeev dmitry-timofeev commented Jan 30, 2020

Overview

Added BlockchainData — an object providing access to all categories of persistent data stored in the database: the executing service data, other services’ data, Exonum Core data.

BlockchainData is a service-specific object — it remembers the service to which it is provided and allows modification only to the data of that service. The service data is automatically isolated via namespaces, with a service name followed by a dot as a prefix.

Node is also made a service-specific interface — and now provides BlockchainData.

NodeProxy is no longer a Node, as it works with Snapshots.

Removed AbstractService#createDataSchema — just use the schema constructor/factory method. Also, with BlockchainData and Prefixed access it makes more sense to support injecting TransactionContext components (Jira tbd).


See: https://jira.bf.local/browse/ECR-4175

Definition of Done

  • There are no TODOs left in the code
  • Change is covered by automated tests
  • The coding guidelines are followed
  • Public API has Javadoc
  • Method preconditions are checked and documented in the Javadoc of the method
  • Changelog is updated if needed (in case of notable or breaking changes)
  • The continuous integration build passes

wip: description
Add Node#withServiceData for symmetry with Testkit
and TransactionContext.
Rename to have consistent naming in BD accessors:
 - Testkit
 - TransactionContext
 - Node
BlockchainData#fromRawAccess cannot be invoked with mock
tests as it will invoke the native code with an invalid handle.
Hence the code that needs to instantiate BD from Access has
to use the factory.
@dmitry-timofeev dmitry-timofeev changed the base branch from master to numeric-index-ids-for-cache January 30, 2020 17:09
the service to which it is provided and allows modification only to the data
of that service. The service data is automatically isolated via namespaces,
with a service name followed by a dot as a prefix. (#1393)
- `Prefixed` and `ReadonlyFork` database Accesses.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR ref?

* @param instanceName the name of the service instance to which data to provide access
* <p>The namespace is equal to the service instance name.
*
* @param serviceName the name of the service instance to which data to provide access
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the sentence looks complicated a little bit.
"service instance name for providing data access to"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original seems to be more exact, but I agree it is a little complex, though can't think how to simplify it.

* Creates a new owning blockchain data.
*
* @param nativeHandle a handle to the native BlockchainData object
* @param cleaner a cleaner to register the destructor\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param cleaner a cleaner to register the destructor\
* @param cleaner a cleaner to register the destructor

@dmitry-timofeev dmitry-timofeev merged commit f434ec8 into numeric-index-ids-for-cache Jan 31, 2020
@dmitry-timofeev dmitry-timofeev deleted the integrate-blockchain-data-ECR-4175 branch January 31, 2020 19:23
@dmitry-timofeev
Copy link
Contributor Author

Also, with BlockchainData and Prefixed access it makes more sense to support injecting TransactionContext components (Jira tbd).

https://jira.bf.local/browse/ECR-4189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants