From b250270ce075c2afee8cfa05b07d73f3d2bf5c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nelson=20Arap=C3=A9?= Date: Tue, 12 Nov 2019 15:05:36 +0100 Subject: [PATCH] Make success hook public As described in https://github.com/spotify/flo/pull/125 , the original idea was to be able to write final Task task = Task.named("task") .ofType(TableId.class) .context(BigQueryContext.create(table)) .context(BigQueryOperator.create()) .process((stagingTable, bq) -> bq.job( JobInfo.of(QueryJobConfiguration.newBuilder("SELECT foo FROM input") .setDestinationTable(stagingTable.tableId()) .build())) .success(response -> stagingTable.publish())); But because success is package private this use case is only allowed in the classes in the same package, like the unit test --- .../com/spotify/flo/contrib/bigquery/BigQueryOperation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/flo-bigquery/src/main/java/com/spotify/flo/contrib/bigquery/BigQueryOperation.java b/contrib/flo-bigquery/src/main/java/com/spotify/flo/contrib/bigquery/BigQueryOperation.java index 8382e5d9d..5436de935 100644 --- a/contrib/flo-bigquery/src/main/java/com/spotify/flo/contrib/bigquery/BigQueryOperation.java +++ b/contrib/flo-bigquery/src/main/java/com/spotify/flo/contrib/bigquery/BigQueryOperation.java @@ -52,7 +52,7 @@ BigQueryOperation job(Fn jobRequest) { /** * Specify some action to take on success. E.g. publishing a staging table. */ - BigQueryOperation success(F1 success) { + public BigQueryOperation success(F1 success) { this.success = Objects.requireNonNull(success); return this; }