Skip to content

Commit 67b594d

Browse files
chore: add basic foundation: logging, testing, cli parsing
stack-info: PR: #9688, branch: igorbernstein2/stack/1
1 parent bcecf8f commit 67b594d

File tree

6 files changed

+253
-0
lines changed

6 files changed

+253
-0
lines changed

bigtable/bigtable-proxy/.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
!**/src/main/**/target/
4+
!**/src/test/**/target/
5+
6+
### IntelliJ IDEA ###
7+
.idea/modules.xml
8+
.idea/jarRepositories.xml
9+
.idea/compiler.xml
10+
.idea/libraries/
11+
*.iws
12+
*.iml
13+
*.ipr
14+
15+
### Eclipse ###
16+
.apt_generated
17+
.classpath
18+
.factorypath
19+
.project
20+
.settings
21+
.springBeans
22+
.sts4-cache
23+
24+
### NetBeans ###
25+
/nbproject/private/
26+
/nbbuild/
27+
/dist/
28+
/nbdist/
29+
/.nb-gradle/
30+
build/
31+
!**/src/main/**/build/
32+
!**/src/test/**/build/
33+
34+
### VS Code ###
35+
.vscode/
36+
37+
### Mac OS ###
38+
.DS_Store

bigtable/bigtable-proxy/pom.xml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>com.google.cloud.samples</groupId>
9+
<artifactId>shared-configuration</artifactId>
10+
<version>1.2.2</version>
11+
<relativePath/>
12+
</parent>
13+
14+
<groupId>com.google.cloud.bigtable</groupId>
15+
<artifactId>bigtable-proxy</artifactId>
16+
<version>0.0.1-SNAPSHOT</version>
17+
18+
<properties>
19+
<maven.compiler.source>11</maven.compiler.source>
20+
<maven.compiler.target>11</maven.compiler.target>
21+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
22+
23+
<!-- dep versions -->
24+
<libraries-bom.version>26.50.0</libraries-bom.version>
25+
26+
<slf4j.version>2.0.16</slf4j.version>
27+
<logback.version>1.5.12</logback.version>
28+
<auto-value.version>1.11.0</auto-value.version>
29+
<picocli.version>4.7.6</picocli.version>
30+
<junit.version>4.13.2</junit.version>
31+
<truth.version>1.4.4</truth.version>
32+
</properties>
33+
34+
<dependencyManagement>
35+
<dependencies>
36+
<dependency>
37+
<groupId>com.google.cloud</groupId>
38+
<artifactId>libraries-bom</artifactId>
39+
<version>${libraries-bom.version}</version>
40+
<type>pom</type>
41+
<scope>import</scope>
42+
</dependency>
43+
</dependencies>
44+
</dependencyManagement>
45+
46+
<dependencies>
47+
<!-- Logging -->
48+
<dependency>
49+
<groupId>org.slf4j</groupId>
50+
<artifactId>slf4j-api</artifactId>
51+
<version>${slf4j.version}</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.slf4j</groupId>
55+
<artifactId>jul-to-slf4j</artifactId>
56+
<version>${slf4j.version}</version>
57+
</dependency>
58+
<dependency>
59+
<groupId>ch.qos.logback</groupId>
60+
<artifactId>logback-classic</artifactId>
61+
<version>${logback.version}</version>
62+
</dependency>
63+
64+
<!-- Misc -->
65+
<dependency>
66+
<groupId>com.google.guava</groupId>
67+
<artifactId>guava</artifactId>
68+
<!-- version managed by libraries-bom -->
69+
</dependency>
70+
<dependency>
71+
<groupId>com.google.auto.value</groupId>
72+
<artifactId>auto-value-annotations</artifactId>
73+
<version>${auto-value.version}</version>
74+
<scope>provided</scope>
75+
</dependency>
76+
<dependency>
77+
<groupId>info.picocli</groupId>
78+
<artifactId>picocli</artifactId>
79+
<version>${picocli.version}</version>
80+
</dependency>
81+
82+
<!-- Test -->
83+
<dependency>
84+
<groupId>junit</groupId>
85+
<artifactId>junit</artifactId>
86+
<version>${junit.version}</version>
87+
<scope>test</scope>
88+
</dependency>
89+
<dependency>
90+
<groupId>com.google.truth</groupId>
91+
<artifactId>truth</artifactId>
92+
<version>${truth.version}</version>
93+
<scope>test</scope>
94+
</dependency>
95+
</dependencies>
96+
97+
<build>
98+
<plugins>
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-compiler-plugin</artifactId>
102+
<version>3.13.0</version>
103+
<configuration>
104+
<annotationProcessorPaths>
105+
<path>
106+
<groupId>info.picocli</groupId>
107+
<artifactId>picocli-codegen</artifactId>
108+
<version>${picocli.version}</version>
109+
</path>
110+
<path>
111+
<groupId>com.google.auto.value</groupId>
112+
<artifactId>auto-value</artifactId>
113+
<version>${auto-value.version}</version>
114+
</path>
115+
</annotationProcessorPaths>
116+
<compilerArgs>
117+
<!-- for picocli: https://picocli.info/#_processor_option_project -->
118+
<arg>-Aproject=${project.groupId}/${project.artifactId}</arg>
119+
</compilerArgs>
120+
</configuration>
121+
</plugin>
122+
123+
<plugin>
124+
<artifactId>maven-surefire-plugin</artifactId>
125+
<version>3.5.2</version>
126+
</plugin>
127+
</plugins>
128+
</build>
129+
</project>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://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,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.bigtable.examples.proxy;
18+
19+
import org.slf4j.Logger;
20+
import org.slf4j.LoggerFactory;
21+
import org.slf4j.bridge.SLF4JBridgeHandler;
22+
import picocli.CommandLine;
23+
import picocli.CommandLine.Command;
24+
25+
/**
26+
* Main entry point for proxy commands under {@link
27+
* com.google.cloud.bigtable.examples.proxy.commands}.
28+
*/
29+
@Command(subcommands = {})
30+
public final class Main {
31+
private static final Logger LOGGER = LoggerFactory.getLogger(Main.class);
32+
33+
public static void main(String[] args) {
34+
SLF4JBridgeHandler.install();
35+
new CommandLine(new Main()).execute(args);
36+
}
37+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://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,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/** Contains all the command implementations for the proxy server. */
18+
package com.google.cloud.bigtable.examples.proxy.commands;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://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,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.bigtable.examples.proxy;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<configuration>
2+
<!-- optimize the SLF4JBridgeHandler so that level changes in logback are synced to JUL -->
3+
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
4+
5+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
6+
<encoder>
7+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
8+
</encoder>
9+
</appender>
10+
11+
<root level="INFO">
12+
<appender-ref ref="STDOUT" />
13+
</root>
14+
</configuration>

0 commit comments

Comments
 (0)