@Override public TranslatableTable apply(final List<Object> arguments) { final RelDataType rowType; // Using an escalator here is a hack, but it's currently needed to get the row type. Ideally, some // later refactoring would make this unnecessary, since there is no actual query going out herem. final AuthenticationResult authenticationResult = escalator.createEscalatedAuthenticationResult(); try (final DruidPlanner planner = plannerFactory.createPlanner(null, authenticationResult)) { rowType = planner.plan(viewSql).rowType(); } catch (Exception e) { throw Throwables.propagate(e); } return new ViewTable( null, RelDataTypeImpl.proto(rowType), viewSql, ImmutableList.of(DruidSchema.NAME), null ); }
@Override public HttpClient get() { final DruidHttpClientConfig config = getConfigProvider().get().get(); final HttpClientConfig.Builder builder = HttpClientConfig .builder() .withNumConnections(config.getNumConnections()) .withReadTimeout(config.getReadTimeout()) .withWorkerCount(config.getNumMaxThreads()) .withCompressionCodec( HttpClientConfig.CompressionCodec.valueOf(StringUtils.toUpperCase(config.getCompressionCodec())) ) .withUnusedConnectionTimeoutDuration(config.getUnusedConnectionTimeout()); if (getSslContextBinding() != null) { builder.withSslContext(getSslContextBinding().getProvider().get()); } HttpClient client = HttpClientInit.createClient( builder.build(), LifecycleUtils.asMmxLifecycle(getLifecycleProvider().get()) ); if (isEscalated) { return escalator.createEscalatedClient(client); } else { return client; } } }
queryLifecycleFactory, Iterables.limit(segments, MAX_SEGMENTS_PER_QUERY), escalator.createEscalatedAuthenticationResult() );
@Override public HttpClient get() { final DruidHttpClientConfig config = getConfigProvider().get().get(); final HttpClientConfig.Builder builder = HttpClientConfig .builder() .withNumConnections(config.getNumConnections()) .withReadTimeout(config.getReadTimeout()) .withWorkerCount(config.getNumMaxThreads()) .withCompressionCodec( HttpClientConfig.CompressionCodec.valueOf(StringUtils.toUpperCase(config.getCompressionCodec())) ) .withUnusedConnectionTimeoutDuration(config.getUnusedConnectionTimeout()); if (getSslContextBinding() != null) { builder.withSslContext(getSslContextBinding().getProvider().get()); } HttpClient client = HttpClientInit.createClient( builder.build(), LifecycleUtils.asMmxLifecycle(getLifecycleProvider().get()) ); if (isEscalated) { return escalator.createEscalatedClient(client); } else { return client; } } }
@Override public TranslatableTable apply(final List<Object> arguments) { final RelDataType rowType; try (final DruidPlanner planner = plannerFactory.createPlanner(null)) { // Using an escalator here is a hack, but it's currently needed to get the row type. Ideally, some // later refactoring would make this unnecessary, since there is no actual query going out herem. rowType = planner.plan(viewSql, escalator.createEscalatedAuthenticationResult()).rowType(); } catch (Exception e) { throw Throwables.propagate(e); } return new ViewTable( null, RelDataTypeImpl.proto(rowType), viewSql, ImmutableList.of(DruidSchema.NAME), null ); }
queryLifecycleFactory, Iterables.limit(segments, MAX_SEGMENTS_PER_QUERY), escalator.createEscalatedAuthenticationResult() );