Skip to content

Commit 747d0b8

Browse files
committed
Fix bug: Java simple benchmark (601.hello_world) now works correctly
1 parent 3520644 commit 747d0b8

File tree

5 files changed

+47
-32
lines changed

5 files changed

+47
-32
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"timeout": 120,
3-
"memory": 512,
2+
"timeout": 60,
3+
"memory": 256,
44
"languages": ["java"]
5-
}
6-
5+
}
6+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def buckets_count():
2+
return (0, 0)
3+
4+
def generate_input(data_dir, size, benchmarks_bucket, input_paths, output_paths, upload_func):
5+
return { }

benchmarks/600.java/601.hello-world/java/pom.xml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0"
2-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4-
http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
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">
65
<modelVersion>4.0.0</modelVersion>
76

8-
<!-- Group ID and Artifact ID uniquely identify the project -->
97
<groupId>faas</groupId>
10-
<artifactId>601.hello-world</artifactId>
11-
<version>1.0-SNAPSHOT</version>
12-
<packaging>jar</packaging> <!-- The packaging type for the project (jar by default) -->
8+
<artifactId>benchmark</artifactId>
9+
<version>1</version>
1310

14-
<!-- Configure the Java version (set to Java 8) -->
1511
<properties>
16-
<maven.compiler.source>1.8</maven.compiler.source> <!-- Source compatibility (Java 8) -->
17-
<maven.compiler.target>1.8</maven.compiler.target> <!-- Target compatibility (Java 8) -->
12+
<maven.compiler.source>8</maven.compiler.source>
13+
<maven.compiler.target>8</maven.compiler.target>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1815
</properties>
1916

20-
<!-- Define the main class to run the JAR -->
17+
<dependencies>
18+
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
19+
<dependency>
20+
<groupId>com.google.code.gson</groupId>
21+
<artifactId>gson</artifactId>
22+
<version>2.11.0</version>
23+
</dependency>
24+
</dependencies>
2125
<build>
2226
<plugins>
2327
<plugin>
2428
<groupId>org.apache.maven.plugins</groupId>
25-
<artifactId>maven-jar-plugin</artifactId>
26-
<version>3.2.0</version>
27-
<configuration>
28-
<archive>
29-
<manifest>
30-
<mainClass>faas.App</mainClass> <!-- Replace with your main class -->
31-
</manifest>
32-
</archive>
33-
</configuration>
29+
<artifactId>maven-shade-plugin</artifactId>
30+
<version>3.2.4</version>
31+
<executions>
32+
<execution>
33+
<phase>package</phase>
34+
<goals>
35+
<goal>shade</goal>
36+
</goals>
37+
<configuration>
38+
<createDependencyReducedPom>false</createDependencyReducedPom>
39+
</configuration>
40+
</execution>
41+
</executions>
3442
</plugin>
3543
</plugins>
3644
</build>
3745
</project>
38-
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package faas;
2+
import com.google.gson.JsonObject;
23

34
public class App {
4-
public static void main(String[] args) {
5-
System.out.println("Hellooooooooooooooooooo, World!");
5+
public JsonObject handler(JsonObject args) {
6+
7+
JsonObject jsonResult = new JsonObject();
8+
jsonResult.addProperty("Hello", "World");
9+
return jsonResult;
610
}
711
}

benchmarks/wrappers/openwhisk/java/Main.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import faas.App;
22
import com.google.gson.Gson;
33
import com.google.gson.JsonObject;
4-
import util.SessionBlob;
5-
import util.ShaSecurityProvider;
64
import java.time.Instant;
75
import java.time.Duration;
86
import java.io.File;
97
import java.io.IOException;
10-
//import jakarta.ws.rs.core.Response;
8+
119

1210

1311
public class Main {
@@ -60,3 +58,4 @@ public static JsonObject main(JsonObject args) {
6058
}
6159

6260
}
61+

0 commit comments

Comments
 (0)