Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow caching stats in JDBC but not metadata #19859

Merged
merged 8 commits into from
Nov 23, 2023

Commits on Nov 22, 2023

  1. Code cleanup

    - static fields before instance fields
    - private where appropriate
    - remove special values
    - fix code indentation
    - use explicit `Duration` constructor instead of approximating
      `Duration.succinctDuration`
    findepi committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    3fd0684 View commit details
    Browse the repository at this point in the history
  2. Remove CachingJdbcClient overload

    Inline in usages to simplify CachingJdbcClient construction.
    findepi committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    ddf7e7b View commit details
    Browse the repository at this point in the history
  3. By default test defaults in TestCachingJdbcClient

    Previously the test used cacheMissing=true by default, despite this
    being false by default in the config.
    findepi committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    ef4a13f View commit details
    Browse the repository at this point in the history
  4. Construct CachingJdbcClient using builder and config in test

    Using builder avoids maintaining overloads of various "create some
    CachingJdbcClient" methods.
    
    Using config avoids passing 3 Duration parameters positionally to the
    constructor. The config is equivalent of named parameters.
    
    This also moves helper methods below tests.
    
    This is code cleanup and preparatory change before adding yet another
    Duration parameter.
    findepi committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    72086b4 View commit details
    Browse the repository at this point in the history
  5. Remove default CachingJdbcClient in test

    Many TestCachingJdbcClient's tests construct their own instance, so
    providing a default instance in the `@Before` creates duplicated state
    and confusion.
    findepi committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    f81446a View commit details
    Browse the repository at this point in the history
  6. Remove unnecessary logic from CachingJdbcClient

    This logically reverts commit b25c90b.
    The class uses `EvictableCacheBuilder` and the
    `io.trino.cache.EvictableCacheBuilder#cacheDisabled` considers the cache
    to be disabled when TTL is 0 or cache size is 0, so no need to set cache
    size to 0 if TTL is known to be 0.
    findepi committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    62e2619 View commit details
    Browse the repository at this point in the history
  7. Allow caching stats in JDBC but not metadata

    Apply `CachingHiveMetastore` capabilities in JDBC. Allow turning on
    statistics caching without having to use caching for all of the
    metadata. In common case caching statistics has much fewer side effects
    than caching other stuff.
    findepi committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    2da922e View commit details
    Browse the repository at this point in the history
  8. Make testSpecificSchemaAndTableCaches faster

    The test used a masked Thread.sleep to await for cache expiration, and
    thus lasted at least 6 seconds. Now the whole test class runs about 1
    second.
    findepi committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    a212756 View commit details
    Browse the repository at this point in the history