@SuppressWarnings("unchecked")
  private LoadingCache<TableRuntimeContext, TableReadContext> buildReadContextCache(CacheLoader<TableRuntimeContext, TableReadContext> tableCacheLoader) {
    CacheBuilder resultSetCacheBuilder = CacheBuilder.newBuilder()
        .removalListener(new JdbcTableReadContextInvalidationListener());

    if (tableJdbcConfigBean.batchTableStrategy == BatchTableStrategy.SWITCH_TABLES) {
      if (tableJdbcConfigBean.resultCacheSize > 0) {
        resultSetCacheBuilder = resultSetCacheBuilder.maximumSize(tableJdbcConfigBean.resultCacheSize);
      }
    } else {
      resultSetCacheBuilder = resultSetCacheBuilder.maximumSize(1);
    }

    if (tableCacheLoader != null) {
      return resultSetCacheBuilder.build(tableCacheLoader);
    } else {
      return resultSetCacheBuilder.build(new JdbcTableReadContextLoader(
          connectionManager,
          offsets,
          tableJdbcConfigBean.fetchSize,
          tableJdbcConfigBean.quoteChar.getQuoteCharacter(),
          tableJdbcELEvalContext,
          isReconnect
      ));
    }
  }
@SuppressWarnings("unchecked")
  private LoadingCache<TableRuntimeContext, TableReadContext> buildReadContextCache(CacheLoader<TableRuntimeContext, TableReadContext> tableCacheLoader) {
    CacheBuilder resultSetCacheBuilder = CacheBuilder.newBuilder()
        .removalListener(new JdbcTableReadContextInvalidationListener());

    if (tableJdbcConfigBean.batchTableStrategy == BatchTableStrategy.SWITCH_TABLES) {
      if (tableJdbcConfigBean.resultCacheSize > 0) {
        resultSetCacheBuilder = resultSetCacheBuilder.maximumSize(tableJdbcConfigBean.resultCacheSize);
      }
    } else {
      resultSetCacheBuilder = resultSetCacheBuilder.maximumSize(1);
    }

    if (tableCacheLoader != null) {
      return resultSetCacheBuilder.build(tableCacheLoader);
    } else {
      return resultSetCacheBuilder.build(new JdbcTableReadContextLoader(
          connectionManager,
          offsets,
          tableJdbcConfigBean.fetchSize,
          tableJdbcConfigBean.quoteChar.getQuoteCharacter(),
          tableJdbcELEvalContext,
          isReconnect
      ));
    }
  }
@ SuppressWarnings ( "unchecked" ) private LoadingCache < TableRuntimeContext , TableReadContext > buildReadContextCache ( CacheLoader < TableRuntimeContext , TableReadContext > tableCacheLoader ) { CacheBuilder resultSetCacheBuilder = CacheBuilder . newBuilder ( ) . removalListener ( new JdbcTableReadContextInvalidationListener ( ) ) ; if ( tableJdbcConfigBean . batchTableStrategy == BatchTableStrategy . SWITCH_TABLES ) { if ( tableJdbcConfigBean . resultCacheSize > 0 ) { resultSetCacheBuilder = resultSetCacheBuilder . maximumSize ( tableJdbcConfigBean . resultCacheSize ) ; } } else { resultSetCacheBuilder = resultSetCacheBuilder . maximumSize ( 1 ) ; } if ( tableCacheLoader != null ) { return resultSetCacheBuilder . build ( tableCacheLoader ) ; } else { return resultSetCacheBuilder . build ( new JdbcTableReadContextLoader ( connectionManager , offsets , tableJdbcConfigBean . fetchSize , tableJdbcConfigBean . quoteChar . getQuoteCharacter ( ) , tableJdbcELEvalContext , isReconnect ) ) ; } }
Builds the Read Context Cache {@link #tableReadContextCache}
Builds the Read Context Cache {