protected AbstractOperatorBenchmark( Session session, LocalQueryRunner localQueryRunner, String benchmarkName, int warmupIterations, int measuredIterations) { super(benchmarkName, warmupIterations, measuredIterations); this.localQueryRunner = requireNonNull(localQueryRunner, "localQueryRunner is null"); TransactionId transactionId = localQueryRunner.getTransactionManager().beginTransaction(false); this.session = session.beginTransactionId( transactionId, localQueryRunner.getTransactionManager(), new AllowAllAccessControl()); }
@Override protected void tearDown() { localQueryRunner.getTransactionManager().asyncAbort(session.getRequiredTransactionId()); super.tearDown(); }
public RuleTester(List<Plugin> plugins, Map<String, String> sessionProperties, Optional<Integer> nodeCountForStats) { Session.SessionBuilder sessionBuilder = testSessionBuilder() .setCatalog(CATALOG_ID) .setSchema("tiny") .setSystemProperty("task_concurrency", "1"); // these tests don't handle exchanges from local parallel for (Map.Entry<String, String> entry : sessionProperties.entrySet()) { sessionBuilder.setSystemProperty(entry.getKey(), entry.getValue()); } session = sessionBuilder.build(); queryRunner = nodeCountForStats .map(nodeCount -> LocalQueryRunner.queryRunnerWithFakeNodeCountForStats(session, nodeCount)) .orElseGet(() -> new LocalQueryRunner(session)); queryRunner.createCatalog(session.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of()); plugins.stream().forEach(queryRunner::installPlugin); this.metadata = queryRunner.getMetadata(); this.transactionManager = queryRunner.getTransactionManager(); this.splitManager = queryRunner.getSplitManager(); this.pageSourceManager = queryRunner.getPageSourceManager(); this.accessControl = queryRunner.getAccessControl(); this.sqlParser = queryRunner.getSqlParser(); }
protected AbstractOperatorBenchmark( Session session, LocalQueryRunner localQueryRunner, String benchmarkName, int warmupIterations, int measuredIterations) { super(benchmarkName, warmupIterations, measuredIterations); this.localQueryRunner = requireNonNull(localQueryRunner, "localQueryRunner is null"); TransactionId transactionId = localQueryRunner.getTransactionManager().beginTransaction(false); this.session = session.beginTransactionId( transactionId, localQueryRunner.getTransactionManager(), new AllowAllAccessControl()); }
@Override protected void tearDown() { localQueryRunner.getTransactionManager().asyncAbort(session.getRequiredTransactionId()); super.tearDown(); }