meatballspaghetti opened a new pull request, #5451:
URL: https://github.com/apache/accumulo/pull/5451
This PR is to improve efficiency and reduce slowdown of retrieving and
writing table names in ZooKeeper. These particular changes modify how table
names are managed, and follow #4996 which made the same modification for
namespace names. It replaces the use of the `/name` nodes under tables in
`/tables` with a table id-to-name mapping in a Json format stored under each
namespace in `/namespaces`, under a new node `/tables` (different from the main
`/tables` node that holds all tables). With this, when any function wants to
retrieve a table name, ZooKeeper will only need to read one or several mappings
instead of iterating through all `/name` nodes every time.
Previous Location of Table Names in ZooKeeper:
- `/tables/<tableAId>/name` (`/name` holds `namespaceA.tableAName`)
- `/tables/<tableBId>/name` (`/name` holds `namespaceA.tableBName`)
- `/tables/<tableCId>/name` (`/name` holds `namespaceB.tableCName`)
- `/tables/<tableDId>/name` (`/name` holds `namespaceB.tableDName`)
- etc.
Migration of Table Names into mappings under respective namespaces:
- `/namespaces/namespaceA/tables` (`/tables` holds `{tableAId:tableAName,
tableBId:tableBName}`)
- `/namespaces/namespaceB/tables` (`/tables` holds `{tableCId:tableCName,
tableDId:tableDName}`)
- etc.
**New files added:**
- `/accumulo/core/util/tables/TableMapping.java`:
Class that holds functionality for putting, renaming, removing, and
retrievingtable id-to-name map (and name-to-id map).
**Main Files changed for implementation:**
- `Constants.java`: Delete ZTABLE_NAME.
- `ClientContext.java`: Allow table mapping to be retrieved by referencing
the context. Mapping initialized as a Cache.
- `NamespaceMapping.java` + `NamespaceMappingTest.java`: Rename
serialization/deserialization methods to specify they are for Maps, as they are
also used in TableMapping.java.
- `AccumuloTable.java`: Add functionality to retrieve built-in table IDs and
names.
- `TableMap.java`: Deleted. Functionality moved into TableZooHelper.
- `TableZooHelper.java`: Add functionality from TableMap to create map of
all tables with qualified names. Change methods to use new TableMapping instead
of pulling directly from ZooCache.
- `ZooKeeperInitializer.java`: Initialize table mappings with built-in
tables upon starting ZooKeeper.
- `Utils.java`: Remove method for checking if table already exists, as it is
now checked within mutateExisting method calls in TableMapping.java.
- `CloneZookeeper.java` + `PopulateZookeeper.java` +
`ImportPopulateZookeeper.java` + `RenameTable.java`: Call new methods in
TableMapping to make respective updates.
**Developments yet to be made:**
- Finish implementing Cache into ClientContext to store
- Add table mapping to applicable upgrader and upgrader test
- Potentially rename TableZooHelper
- Run ITs
Original Issue: #4698
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]