Skip to content

Support transaction in FunctionNamespaceManager#13484

Merged
rongrong merged 13 commits intoprestodb:masterfrom
caithagoras:s6
Oct 10, 2019
Merged

Support transaction in FunctionNamespaceManager#13484
rongrong merged 13 commits intoprestodb:masterfrom
caithagoras:s6

Conversation

@caithagoras
Copy link
Contributor

@caithagoras caithagoras commented Sep 30, 2019

Highlights of the PR:

  • InMemoryFunctionNamespaceManager for testing purpose.
    • Requires proper definition for createFunction.
    • Requires proper definition for SqlInvokedRegularFunction
  • Transaction support for FunctionNamespaceManager.
    • For this PR, transaction support is limited to the read-only method #getFunctions.
  • Caching support for FunctionNamespaceManager<SqlInvokedRegularFunction>
    • Covers both #getFunctions and #getFunctionMetadata
== NO RELEASE NOTE ==

@caithagoras caithagoras force-pushed the s6 branch 12 times, most recently from c28e4f7 to 384555b Compare October 1, 2019 08:25
@caithagoras caithagoras force-pushed the s6 branch 8 times, most recently from 41d4575 to 6e23c89 Compare October 2, 2019 08:10
@caithagoras
Copy link
Contributor Author

Test failures have been addressed.

@caithagoras
Copy link
Contributor Author

caithagoras commented Oct 8, 2019

Updates since last comment:

  • Kept method FunctionNamespaceManager#getFunctionHandle
    • Remove BoundSqlFunction and BoundBuiltInFunction
  • Placed classes related to SqlInvokedRegularFunction into a new module presto-sql-function.
  • Placed transactional and caching implementation AbstractSqlInvokedFunctionNamespaceManager into presto-sql-function
  • Fixed tests

@caithagoras
Copy link
Contributor Author

@rongrong This PR is ready for review

Copy link
Contributor

@rongrong rongrong left a comment

Choose a reason for hiding this comment

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

Up to Introduce InMemoryFunctionNamespaceManager for testing purpose looks good with nits.

FunctionNamespaceManager now supports the transaciton-like operations,
including beginTransaction, commit, and rollback.

AbstractTransactionalFunctionNamespaceManager gives one such
implementation. TransactionManager manages the mapping from
TransactionId to FunctionNamespaceTransactionHandle, while the
FunctionNamespaceManager implementation manages its own transaction.

The currernt transaction support guarantees the consistency (read
consistency) for the transaction-aware method #getFunctions.
AbstractSqlInvokedFunctionNamespaceManager supports caching in
addition to transaction. Fetched functions and function metadata
are both cached to reduce the latency of lookups and the frequency
of the external API calls.
@caithagoras
Copy link
Contributor Author

@rongrong TODOs added.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants