File tree Expand file tree Collapse file tree 4 files changed +47
-0
lines changed
cloudsql-postgresql-plugin/src/main/java/io/cdap/plugin/cloudsql/postgres
database-commons/src/main/java/io/cdap/plugin/util Expand file tree Collapse file tree 4 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright © 2024 Cask Data, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5
+ * use this file except in compliance with the License. You may obtain a copy of
6
+ * the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ * License for the specific language governing permissions and limitations under
14
+ * the License.
15
+ */
16
+
17
+ package io .cdap .plugin .cloudsql .postgres ;
18
+
19
+ import io .cdap .plugin .postgres .PostgresErrorDetailsProvider ;
20
+ import io .cdap .plugin .util .DBUtils ;
21
+
22
+ /**
23
+ * A custom ErrorDetailsProvider for CloudSQL PostgreSQL plugin.
24
+ */
25
+ public class CloudSQLPostgreSQLErrorDetailsProvider extends PostgresErrorDetailsProvider {
26
+ @ Override
27
+ protected String getExternalDocumentationLink () {
28
+ return DBUtils .CLOUDSQLPOSTGRES_SUPPORTED_DOC_URL ;
29
+ }
30
+ }
Original file line number Diff line number Diff line change @@ -147,6 +147,11 @@ protected LineageRecorder getLineageRecorder(BatchSinkContext context) {
147
147
return new LineageRecorder (context , assetBuilder .build ());
148
148
}
149
149
150
+ @ Override
151
+ protected String getErrorDetailsProviderClassName () {
152
+ return CloudSQLPostgreSQLErrorDetailsProvider .class .getName ();
153
+ }
154
+
150
155
/** CloudSQL PostgreSQL sink config. */
151
156
public static class CloudSQLPostgreSQLSinkConfig extends AbstractDBSpecificSinkConfig {
152
157
Original file line number Diff line number Diff line change @@ -86,6 +86,16 @@ protected Class<? extends DBWritable> getDBRecordType() {
86
86
return PostgresDBRecord .class ;
87
87
}
88
88
89
+ @ Override
90
+ protected String getExternalDocumentationLink () {
91
+ return DBUtils .CLOUDSQLPOSTGRES_SUPPORTED_DOC_URL ;
92
+ }
93
+
94
+ @ Override
95
+ protected String getErrorDetailsProviderClassName () {
96
+ return CloudSQLPostgreSQLErrorDetailsProvider .class .getName ();
97
+ }
98
+
89
99
@ Override
90
100
protected String createConnectionString () {
91
101
if (CloudSQLUtil .PRIVATE_INSTANCE .equalsIgnoreCase (
Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ public final class DBUtils {
64
64
public static final String CLOUDSQLMYSQL_SUPPORTED_DOC_URL = "https://cloud.google.com/sql/docs/mysql/error-messages" ;
65
65
public static final String POSTGRES_SUPPORTED_DOC_URL =
66
66
"https://www.postgresql.org/docs/current/errcodes-appendix.html" ;
67
+ public static final String CLOUDSQLPOSTGRES_SUPPORTED_DOC_URL =
68
+ "https://cloud.google.com/sql/docs/postgres/error-messages" ;
67
69
68
70
// Java by default uses October 15, 1582 as a Gregorian cut over date.
69
71
// Any timestamp created with time less than this cut over date is treated as Julian date.
You can’t perform that action at this time.
0 commit comments