Skip to content

Conversation

dmitry-timofeev
Copy link
Contributor

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

Overview

Add the Prefixed access, that can be created either
from a handle, or from the base access and the namespace.

Clarify IndexAddress documentation and StorageIndex spec,
to allow index pooling across Accesses.


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

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

Modified the AbstractAccess to resolve
addresses into numeric ids and then use the ids
to cache indexes. That is required for correct
operation of Prefixed accesses and will be
fully tested when they are added.

This patch requires the native code for operation,
and currently does not pass tests.
Add the Prefixed access, that can be created either
from a handle, or from the base access and the namespace.

Clarify IndexAddress documentation and StorageIndex spec,
to allow index pooling across Accesses.
@dmitry-timofeev dmitry-timofeev force-pushed the add-prefixed-access-ECR-4159 branch from 03b7a21 to f2b40a6 Compare January 27, 2020 15:16
@dmitry-timofeev dmitry-timofeev changed the title WIP Add Prefixed database Access [ECR-4159]: Add Prefixed database Access [ECR-4159]: Jan 27, 2020
* Creates a Prefixed native peer given the base access native handle.
* @throws RuntimeException if the base access is unsupported; or if the namespace is not valid
*/
private static native long nativeCreate(String namespace, long accessNativeHandle);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we usually use (handle, arguments....) order in native methods

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In create* a handle is just an argument, it is not a handle to "this".

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, I guess it's the matter of taste

@AfterEach
void dropDatabase() throws CloseFailuresException {
try {
cleaner.close();
Copy link
Contributor

Choose a reason for hiding this comment

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

NPE if an exception occurs in creating db 🙃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmitry-timofeev dmitry-timofeev changed the base branch from use-numeric-index-id-ECR-4156 to numeric-index-ids-for-cache January 29, 2020 09:34
dmitry-timofeev added a commit that referenced this pull request Jan 29, 2020
Add the Prefixed access, that can be created either
from a handle, or from the base access and the namespace.

Clarify IndexAddress documentation and StorageIndex spec,
to allow index pooling across Accesses.
dmitry-timofeev added a commit that referenced this pull request Jan 29, 2020
Add the Prefixed access, that can be created either
from a handle, or from the base access and the namespace.

Clarify IndexAddress documentation and StorageIndex spec,
to allow index pooling across Accesses.
@dmitry-timofeev dmitry-timofeev force-pushed the numeric-index-ids-for-cache branch from ed40b4f to d5daac9 Compare January 29, 2020 09:56
dmitry-timofeev added a commit that referenced this pull request Jan 29, 2020
Add the Prefixed access, that can be created either
from a handle, or from the base access and the namespace.

Clarify IndexAddress documentation and StorageIndex spec,
to allow index pooling across Accesses.
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.

3 participants