Skip to content

Commit 8b8683e

Browse files
author
Komal Yadav
committed
Removed unit-tests
updated updated updated updated formatting update updated changes updated changes
1 parent 14ce5fc commit 8b8683e

3 files changed

Lines changed: 318 additions & 36 deletions

File tree

cdap-master/pom.xml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@
113113
<artifactId>cdap-messaging-ext-spanner</artifactId>
114114
<version>${project.version}</version>
115115
</dependency>
116-
<dependency>
117-
<groupId>io.cdap.cdap</groupId>
118-
<artifactId>cdap-metadata-ext-spanner</artifactId>
119-
<version>${project.version}</version>
120-
</dependency>
121116
<dependency>
122117
<groupId>org.apache.tephra</groupId>
123118
<artifactId>tephra-api</artifactId>
@@ -256,7 +251,6 @@
256251
<stage.authenticators.ext.dir>${stage.opt.dir}/ext/authenticators</stage.authenticators.ext.dir>
257252
<stage.credential.provider.extensions.dir>${stage.opt.dir}/ext/credentialproviders</stage.credential.provider.extensions.dir>
258253
<stage.messaging.ext.dir>${stage.opt.dir}/ext/messagingproviders</stage.messaging.ext.dir>
259-
<stage.metadata.ext.dir>${stage.opt.dir}/ext/metadatastorage</stage.metadata.ext.dir>
260254
<stage.metricswriters.ext.dir>${stage.opt.dir}/ext/metricswriters/google_cloud_monitoring_writer
261255
</stage.metricswriters.ext.dir>
262256
<stage.eventwriters.ext.dir>${stage.opt.dir}/ext/eventwriters/google_cloud_pubsub_writer
@@ -739,28 +733,6 @@
739733
</configuration>
740734
</execution>
741735

742-
<!-- Copy metadata extensions -->
743-
<execution>
744-
<id>copy-metadata-ext-spanner</id>
745-
<phase>process-resources</phase>
746-
<goals>
747-
<goal>copy-resources</goal>
748-
</goals>
749-
<configuration combine.self="override">
750-
<outputDirectory>${stage.metadata.ext.dir}/spanner</outputDirectory>
751-
<resources>
752-
<resource>
753-
<directory>
754-
${project.parent.basedir}/cdap-metadata-ext-spanner/target/libexec/
755-
</directory>
756-
<includes>
757-
<include>*.jar</include>
758-
</includes>
759-
</resource>
760-
</resources>
761-
</configuration>
762-
</execution>
763-
764736
<!-- Copy remote authenticator extensions -->
765737
<execution>
766738
<id>copy-authenticator-ext-gcp</id>
@@ -848,7 +820,7 @@
848820
<exclude name="${additional.artifacts.exclude.pattern}"/>
849821
<exclude name="**/target/*-sources.jar"/>
850822
<exclude name="**/target/*-javadoc.jar"/>
851-
<!-- Wrangler excludes -->
823+
<!-- Wrangler excludes -->
852824
<exclude name="**/target/wrangler-core*"/>
853825
<exclude name="**/target/wrangler-test*"/>
854826
<!--We don't want to package the following plugins with CDAP-->
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright © 2025 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+
package io.cdap.cdap.metadata.spanner;
17+
18+
import com.google.cloud.spanner.DatabaseAdminClient;
19+
import com.google.cloud.spanner.Spanner;
20+
import java.util.Map;
21+
import java.util.Objects;
22+
23+
/**
24+
* Utility class for spanner metadata storage.
25+
*/
26+
class SpannerConfig {
27+
28+
private static final String PROJECT = "project";
29+
private static final String INSTANCE = "instance";
30+
private static final String DATABASE = "database";
31+
32+
static DatabaseAdminClient getSpannerDbAdminClient(Spanner spanner) {
33+
return spanner.getDatabaseAdminClient();
34+
}
35+
36+
static String getInstanceID(Map<String, String> cConf) {
37+
String instance = cConf.get(INSTANCE);
38+
return Objects.requireNonNull(instance);
39+
}
40+
41+
static String getDatabaseID(Map<String, String> cConf) {
42+
String database = cConf.get(DATABASE);
43+
return Objects.requireNonNull(database);
44+
}
45+
46+
static String getProjectID(Map<String, String> cConf) {
47+
String project = cConf.get(PROJECT);
48+
return Objects.requireNonNull(project);
49+
}
50+
}

0 commit comments

Comments
 (0)