Skip to content

Commit f3578bb

Browse files
SK-2274 update the ssdk version in v3
1 parent ce6b915 commit f3578bb

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

v3/src/main/java/com/skyflow/utils/Constants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
public final class Constants extends BaseConstants {
44
public static final String SDK_NAME = "Skyflow Java SDK ";
5-
public static final String SDK_VERSION = "3.0.0-beta.1";
5+
public static final String SDK_VERSION = "3.0.0-beta.2";
66
public static final String VAULT_DOMAIN = ".skyvault.";
77
public static final String SDK_PREFIX = SDK_NAME + SDK_VERSION;
88
public static final Integer INSERT_BATCH_SIZE = 50;
99
public static final Integer MAX_INSERT_BATCH_SIZE = 1000;
1010
public static final Integer INSERT_CONCURRENCY_LIMIT = 10;
1111
public static final Integer MAX_INSERT_CONCURRENCY_LIMIT = 10;
12+
1213
public static final Integer DETOKENIZE_BATCH_SIZE = 50;
1314
public static final Integer DETOKENIZE_CONCURRENCY_LIMIT = 10;
14-
1515
public static final Integer MAX_DETOKENIZE_BATCH_SIZE = 1000;
1616
public static final Integer MAX_DETOKENIZE_CONCURRENCY_LIMIT = 10;
1717

v3/src/main/java/com/skyflow/utils/Utils.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,17 @@ public static List<DetokenizeRequest> createDetokenizeBatches(DetokenizeRequest
6565
public static ErrorRecord createErrorRecord(Map<String, Object> recordMap, int indexNumber) {
6666
ErrorRecord err = null;
6767
if (recordMap != null) {
68-
int code = recordMap.containsKey("http_code") ? (Integer) recordMap.get("http_code") : 500;
68+
int code = 500;
69+
if (recordMap.containsKey("http_code")) {
70+
code = (Integer) recordMap.get("http_code");
71+
} else if (recordMap.containsKey("httpCode")) {
72+
code = (Integer) recordMap.get("httpCode");
73+
74+
} else{
75+
if (recordMap.containsKey("statusCode")) {
76+
code = (Integer) recordMap.get("statusCode");
77+
}
78+
}
6979
String message = recordMap.containsKey("error") ? (String) recordMap.get("error") :
7080
recordMap.containsKey("message") ? (String) recordMap.get("message") : "Unknown error";
7181
err = new ErrorRecord(indexNumber, message, code);
@@ -126,8 +136,8 @@ public static List<ErrorRecord> handleDetokenizeBatchException(
126136
Map<String, Object> responseBody = (Map<String, Object>) apiException.body();
127137
int indexNumber = batchNumber * batchSize;
128138
if (responseBody != null) {
129-
if (responseBody.containsKey("records")) {
130-
Object recordss = responseBody.get("records");
139+
if (responseBody.containsKey("response")) {
140+
Object recordss = responseBody.get("response");
131141
if (recordss instanceof List) {
132142
List<?> recordsList = (List<?>) recordss;
133143
for (Object record : recordsList) {

0 commit comments

Comments
 (0)