Skip to content

Commit

Permalink
Initial server stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Randgalt committed May 15, 2024
1 parent 901652d commit 5003d86
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
<air.java.version>22.0.0</air.java.version>
<air.main.basedir>${project.basedir}</air.main.basedir>
<air.modernizer.java-version>8</air.modernizer.java-version>
<air.check.skip-spotbugs>true</air.check.skip-spotbugs>
<air.check.skip-pmd>true</air.check.skip-pmd>

<dep.airlift.version>245</dep.airlift.version>
</properties>
Expand Down
9 changes: 5 additions & 4 deletions trino-s3-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@
</dependency>

<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>

<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.s3.proxy.server;

import com.google.common.collect.ImmutableList;
import com.google.inject.Module;
import io.airlift.bootstrap.Bootstrap;
import io.airlift.event.client.EventModule;
import io.airlift.http.server.HttpServerModule;
import io.airlift.jaxrs.JaxrsModule;
import io.airlift.json.JsonModule;
import io.airlift.log.Logger;
import io.airlift.node.NodeModule;

public final class TrinoS3ProxyServer
{
private static final Logger log = Logger.get(TrinoS3ProxyServer.class);

private TrinoS3ProxyServer() {}

public static void main(String[] args)
{
ImmutableList.Builder<Module> modules = ImmutableList.<Module>builder()
.add(new NodeModule())
.add(new EventModule())
.add(new HttpServerModule())
.add(new JsonModule())
.add(new JaxrsModule());

Bootstrap app = new Bootstrap(modules.build());
app.initialize();

log.info("======== SERVER STARTED ========");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.s3.proxy.server;

import org.junit.jupiter.api.Test;

public class DummyTest
{
@Test
public void testDummy()
{
// stub test for now
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.s3.proxy.server;

import com.google.common.collect.ImmutableList;
import com.google.inject.Module;
import io.airlift.bootstrap.Bootstrap;
import io.airlift.event.client.EventModule;
import io.airlift.http.server.testing.TestingHttpServerModule;
import io.airlift.jaxrs.JaxrsModule;
import io.airlift.json.JsonModule;
import io.airlift.log.Logger;
import io.airlift.node.testing.TestingNodeModule;

public final class TestingTrinoS3ProxyServer
{
private static final Logger log = Logger.get(TestingTrinoS3ProxyServer.class);

private TestingTrinoS3ProxyServer() {}

public static void main(String[] args)
{
ImmutableList.Builder<Module> modules = ImmutableList.<Module>builder()
.add(new TrinoS3ProxyServerModule())
.add(new TestingNodeModule())
.add(new EventModule())
.add(new TestingHttpServerModule())
.add(new JsonModule())
.add(new JaxrsModule());

Bootstrap app = new Bootstrap(modules.build());
app.initialize();

log.info("======== TESTING SERVER STARTED ========");
}
}

0 comments on commit 5003d86

Please sign in to comment.