Skip to content

Commit 7c5c85e

Browse files
SK-2315 add version as prefix to logs (#252)
* SK-2315 add version as prefix to logs (#251) * [AUTOMATED] Private Release 3.0.0-beta.6-dev-29215f7 * SK-2315 update the samples * [AUTOMATED] Private Release 3.0.0-beta.6-dev-4dec765 --------- Co-authored-by: skyflow-shravan <skyflow-shravan@users.noreply.github.com>
1 parent df42a76 commit 7c5c85e

File tree

9 files changed

+46
-13
lines changed

9 files changed

+46
-13
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Public release
22
on:
33
push:
4-
tags: '*.*.*'
4+
tags: '[0-9]+.[0-9]+.[0-9]+'
55
jobs:
66
build-and-deploy:
77
uses: ./.github/workflows/shared-build-and-deploy.yml

samples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<dependency>
1919
<groupId>com.skyflow</groupId>
2020
<artifactId>skyflow-java</artifactId>
21-
<version>3.0.0-beta.3</version>
21+
<version>3.0.0-beta.6</version>
2222
</dependency>
2323

2424
</dependencies>

samples/src/main/java/com/example/vault/BulkInsertAsync.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.skyflow.config.VaultConfig;
66
import com.skyflow.enums.Env;
77
import com.skyflow.enums.LogLevel;
8-
import com.skyflow.enums.UpdateType;
8+
import com.skyflow.enums.UpsertType;
99
import com.skyflow.vault.data.InsertRecord;
1010
import com.skyflow.vault.data.InsertRequest;
1111
import com.skyflow.vault.data.InsertResponse;
@@ -77,7 +77,7 @@ public static void main(String[] args) {
7777
InsertRequest request = InsertRequest.builder()
7878
.table("<YOUR_TABLE_NAME>")
7979
.upsert(upsertColumns)
80-
.upsertType(UpdateType.REPLACE)
80+
.upsertType(UpsertType.REPLACE)
8181
.records(insertRecords)
8282
.build();
8383

samples/src/main/java/com/example/vault/BulkInsertSync.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import com.skyflow.config.VaultConfig;
66
import com.skyflow.enums.Env;
77
import com.skyflow.enums.LogLevel;
8-
import com.skyflow.enums.UpdateType;
8+
import com.skyflow.enums.UpsertType;
99
import com.skyflow.errors.SkyflowException;
10+
import com.skyflow.vault.data.InsertRecord;
1011
import com.skyflow.vault.data.InsertRequest;
1112
import com.skyflow.vault.data.InsertResponse;
1213

@@ -76,7 +77,7 @@ public static void main(String[] args) {
7677
InsertRequest request = InsertRequest.builder()
7778
.table("<YOUR_TABLE_NAME>")
7879
.upsert(upsertColumns)
79-
.upsertType(UpdateType.REPLACE)
80+
.upsertType(UpsertType.REPLACE)
8081
.records(insertRecords)
8182
.build();
8283

samples/src/main/java/com/example/vault/BulkMultiTableInsertAsync.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.skyflow.config.VaultConfig;
66
import com.skyflow.enums.Env;
77
import com.skyflow.enums.LogLevel;
8-
import com.skyflow.enums.UpdateType;
8+
import com.skyflow.enums.UpsertType;
99
import com.skyflow.vault.data.InsertRecord;
1010
import com.skyflow.vault.data.InsertRequest;
1111
import com.skyflow.vault.data.InsertResponse;
@@ -48,7 +48,7 @@ public static void main(String[] args) {
4848

4949
// Step 4: Prepare first record for insertion
5050
HashMap<String, Object> recordData1 = new HashMap<>();
51-
rerecordData1cord1.put("<YOUR_COLUMN_NAME_1>", "<YOUR_VALUE_1>");
51+
recordData1.put("<YOUR_COLUMN_NAME_1>", "<YOUR_VALUE_1>");
5252
recordData1.put("<YOUR_COLUMN_NAME_2>", "<YOUR_VALUE_1>");
5353

5454
List<String> upsertColumns = new ArrayList<>();

samples/src/main/java/com/example/vault/BulkMultiTableInsertSync.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import com.skyflow.config.VaultConfig;
66
import com.skyflow.enums.Env;
77
import com.skyflow.enums.LogLevel;
8-
import com.skyflow.enums.UpdateType;
8+
import com.skyflow.enums.UpsertType;
99
import com.skyflow.errors.SkyflowException;
10+
import com.skyflow.vault.data.InsertRecord;
1011
import com.skyflow.vault.data.InsertRequest;
1112
import com.skyflow.vault.data.InsertResponse;
1213

@@ -46,7 +47,7 @@ public static void main(String[] args) {
4647

4748
// Step 4: Prepare first record for insertion
4849
HashMap<String, Object> recordData1 = new HashMap<>();
49-
rerecordData1cord1.put("<YOUR_COLUMN_NAME_1>", "<YOUR_VALUE_1>");
50+
recordData1.put("<YOUR_COLUMN_NAME_1>", "<YOUR_VALUE_1>");
5051
recordData1.put("<YOUR_COLUMN_NAME_2>", "<YOUR_VALUE_1>");
5152

5253
List<String> upsertColumns = new ArrayList<>();

v3/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</parent>
1212

1313
<artifactId>skyflow-java</artifactId>
14-
<version>3.0.0-beta.6</version>
14+
<version>3.0.0-beta.6-dev.4dec765</version>
1515
<packaging>jar</packaging>
1616
<name>${project.groupId}:${project.artifactId}</name>
1717
<description>Skyflow V3 SDK for the Java programming language</description>
@@ -35,6 +35,7 @@
3535
<maven.compiler.target>8</maven.compiler.target>
3636
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3737
<maven.deploy.skip>false</maven.deploy.skip>
38+
<sdk.version>${project.version}</sdk.version>
3839
</properties>
3940

4041

@@ -48,6 +49,12 @@
4849
</dependencies>
4950

5051
<build>
52+
<resources>
53+
<resource>
54+
<directory>src/main/resources</directory>
55+
<filtering>true</filtering>
56+
</resource>
57+
</resources>
5158
<plugins>
5259
<plugin>
5360
<groupId>org.apache.maven.plugins</groupId>
Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
package com.skyflow.utils;
22

3+
import java.io.IOException;
4+
import java.io.InputStream;
5+
import java.util.Properties;
6+
37
public final class Constants extends BaseConstants {
48
public static final String SDK_NAME = "Skyflow Java SDK ";
5-
public static final String SDK_VERSION = "3.0.0-beta.6";
9+
public static final String SDK_VERSION;
610
public static final String VAULT_DOMAIN = ".skyvault.";
7-
public static final String SDK_PREFIX = SDK_NAME + SDK_VERSION;
11+
public static final String SDK_PREFIX;
812
public static final Integer INSERT_BATCH_SIZE = 50;
913
public static final Integer MAX_INSERT_BATCH_SIZE = 1000;
1014
public static final Integer INSERT_CONCURRENCY_LIMIT = 1;
@@ -13,5 +17,24 @@ public final class Constants extends BaseConstants {
1317
public static final Integer DETOKENIZE_CONCURRENCY_LIMIT = 1;
1418
public static final Integer MAX_DETOKENIZE_BATCH_SIZE = 1000;
1519
public static final Integer MAX_DETOKENIZE_CONCURRENCY_LIMIT = 10;
20+
public static final String DEFAULT_SDK_VERSION = "v3";
21+
22+
static {
23+
String sdkVersion;
24+
// Use a static initializer block to read the properties file
25+
Properties properties = new Properties();
26+
try (InputStream input = Constants.class.getClassLoader().getResourceAsStream("sdk.properties")) {
27+
if (input == null) {
28+
sdkVersion = DEFAULT_SDK_VERSION;
29+
} else {
30+
properties.load(input);
31+
sdkVersion = properties.getProperty("sdk.version", DEFAULT_SDK_VERSION);
32+
}
33+
} catch (IOException ex) {
34+
sdkVersion = DEFAULT_SDK_VERSION;
35+
}
36+
SDK_VERSION = sdkVersion;
37+
SDK_PREFIX = SDK_NAME + " " + SDK_VERSION;
38+
}
1639

1740
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sdk.version=${sdk.version}

0 commit comments

Comments
 (0)