Skip to content

Commit

Permalink
chore: update ServerInfo class (#110)
Browse files Browse the repository at this point in the history
Signed-off-by: a3hadi <a3hadi@protonmail.com>
  • Loading branch information
ayildirim21 authored Apr 9, 2024
1 parent e49d49c commit 1b7aac2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/main/java/io/numaproj/numaflow/info/ServerInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Server Information to be used by client to determine:
* - protocol: what is right protocol to use (UDS or TCP)
* - language: what is language used by the server
* - minimum_numaflow_version: lower bound for the supported Numaflow version
* - version: what is the numaflow sdk version used by the server
* - metadata: other information
*/
Expand All @@ -20,13 +21,14 @@
@NoArgsConstructor
@AllArgsConstructor
public class ServerInfo {
public static final String MINIMUM_CLIENT_VERSION = ">= 1.2.0-0";
// Specify the minimum Numaflow version required by the current SDK version
public static final String MINIMUM_NUMAFLOW_VERSION = "1.2.0-0";
@JsonProperty("protocol")
private Protocol protocol;
@JsonProperty("language")
private Language language;
@JsonProperty("minimum_client_version")
private String minimum_client_version;
@JsonProperty("minimum_numaflow_version")
private String minimum_numaflow_version;
@JsonProperty("version")
private String version;
@JsonProperty("metadata")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static void writeServerInfo(
ServerInfo serverInfo = new ServerInfo(
Protocol.UDS_PROTOCOL,
Language.JAVA,
ServerInfo.MINIMUM_CLIENT_VERSION,
ServerInfo.MINIMUM_NUMAFLOW_VERSION,
serverInfoAccessor.getSDKVersion(),
new HashMap<>());
log.info("Writing server info {} to {}", serverInfo, infoFilePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void given_writeServerInfo_when_read_then_returnExactSame() {
ServerInfo testServerInfo = new ServerInfo(
Protocol.TCP_PROTOCOL,
Language.JAVA,
ServerInfo.MINIMUM_CLIENT_VERSION,
ServerInfo.MINIMUM_NUMAFLOW_VERSION,
"0.4.3",
new HashMap<>() {{
put("key1", "value1");
Expand All @@ -39,7 +39,7 @@ public void given_writeServerInfo_when_read_then_returnExactSame() {
ServerInfo got = this.underTest.read(testFilePath);
assertEquals(testServerInfo.getLanguage(), got.getLanguage());
assertEquals(testServerInfo.getProtocol(), got.getProtocol());
assertEquals(testServerInfo.getMinimum_client_version(), got.getMinimum_client_version());
assertEquals(testServerInfo.getMinimum_numaflow_version(), got.getMinimum_numaflow_version());
assertEquals(testServerInfo.getVersion(), got.getVersion());
assertEquals(testServerInfo.getMetadata(), got.getMetadata());
} catch (Exception e) {
Expand Down

0 comments on commit 1b7aac2

Please sign in to comment.