diff --git a/common/pom.xml b/common/pom.xml index 72fff275..df90bb58 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -11,7 +11,7 @@ common - 1.0.0 + 1.0.1 ${project.groupId}:${project.artifactId} diff --git a/common/src/main/java/com/skyflow/logs/InfoLogs.java b/common/src/main/java/com/skyflow/logs/InfoLogs.java index 03f80ac7..9727e811 100644 --- a/common/src/main/java/com/skyflow/logs/InfoLogs.java +++ b/common/src/main/java/com/skyflow/logs/InfoLogs.java @@ -92,7 +92,7 @@ public enum InfoLogs { VALIDATE_GET_DETECT_RUN_REQUEST("Validating get detect run request."), REIDENTIFY_TEXT_SUCCESS("Text data re-identified."), - PROCESSING_BATCHES("Processing batch") + PROCESSING_BATCHES("Processing batch"), ; diff --git a/common/src/main/java/com/skyflow/logs/WarningLogs.java b/common/src/main/java/com/skyflow/logs/WarningLogs.java index 8905ad12..5f80a728 100644 --- a/common/src/main/java/com/skyflow/logs/WarningLogs.java +++ b/common/src/main/java/com/skyflow/logs/WarningLogs.java @@ -3,6 +3,8 @@ public enum WarningLogs { INVALID_BATCH_SIZE_PROVIDED("Invalid value for batch size provided, switching to default value."), INVALID_CONCURRENCY_LIMIT_PROVIDED("Invalid value for concurrency limit provided, switching to default value."), + BATCH_SIZE_EXCEEDS_MAX_LIMIT("Provided batch size exceeds the maximum limit, switching to max limit."), + CONCURRENCY_EXCEEDS_MAX_LIMIT("Provided concurrency limit exceeds the maximum limit, switching to max limit.") ; private final String log; diff --git a/v2/pom.xml b/v2/pom.xml index e239bc85..17e4ebe6 100644 --- a/v2/pom.xml +++ b/v2/pom.xml @@ -24,7 +24,7 @@ com.skyflow common - 1.0.0 + 1.0.1 diff --git a/v3/pom.xml b/v3/pom.xml index 6a6bf839..82532786 100644 --- a/v3/pom.xml +++ b/v3/pom.xml @@ -11,7 +11,7 @@ skyflow-java - 3.0.0-beta.2 + 3.0.0-beta.2-dev.dca75d0 jar ${project.groupId}:${project.artifactId} Skyflow V3 SDK for the Java programming language @@ -43,7 +43,7 @@ com.skyflow common - 1.0.0 + 1.0.1 diff --git a/v3/src/main/java/com/skyflow/utils/Constants.java b/v3/src/main/java/com/skyflow/utils/Constants.java index 80e07298..e3c56ad3 100644 --- a/v3/src/main/java/com/skyflow/utils/Constants.java +++ b/v3/src/main/java/com/skyflow/utils/Constants.java @@ -2,7 +2,7 @@ public final class Constants extends BaseConstants { public static final String SDK_NAME = "Skyflow Java SDK "; - public static final String SDK_VERSION = "3.0.0-beta.2"; + public static final String SDK_VERSION = "3.0.0-beta.3"; public static final String VAULT_DOMAIN = ".skyvault."; public static final String SDK_PREFIX = SDK_NAME + SDK_VERSION; public static final Integer INSERT_BATCH_SIZE = 50; diff --git a/v3/src/main/java/com/skyflow/vault/controller/VaultController.java b/v3/src/main/java/com/skyflow/vault/controller/VaultController.java index fc8cc278..0ac80f4a 100644 --- a/v3/src/main/java/com/skyflow/vault/controller/VaultController.java +++ b/v3/src/main/java/com/skyflow/vault/controller/VaultController.java @@ -49,6 +49,7 @@ public com.skyflow.vault.data.InsertResponse bulkInsert(InsertRequest insertRequ LogUtil.printInfoLog(InfoLogs.VALIDATE_INSERT_REQUEST.getLog()); Validations.validateInsertRequest(insertRequest); configureInsertConcurrencyAndBatchSize(insertRequest.getValues().size()); + setBearerToken(); com.skyflow.generated.rest.resources.recordservice.requests.InsertRequest request = super.getBulkInsertRequestBody(insertRequest, super.getVaultConfig()); @@ -70,6 +71,7 @@ public CompletableFuture bulkInsertAsync( LogUtil.printInfoLog(InfoLogs.VALIDATE_INSERT_REQUEST.getLog()); Validations.validateInsertRequest(insertRequest); configureInsertConcurrencyAndBatchSize(insertRequest.getValues().size()); + setBearerToken(); com.skyflow.generated.rest.resources.recordservice.requests.InsertRequest request = super.getBulkInsertRequestBody(insertRequest, super.getVaultConfig()); List errorRecords = Collections.synchronizedList(new ArrayList<>()); @@ -306,6 +308,9 @@ private void configureInsertConcurrencyAndBatchSize(int totalRequests) { if (userProvidedBatchSize != null) { try { int batchSize = Integer.parseInt(userProvidedBatchSize); + if (batchSize > Constants.MAX_INSERT_BATCH_SIZE) { + LogUtil.printWarningLog(WarningLogs.BATCH_SIZE_EXCEEDS_MAX_LIMIT.getLog()); + } int maxBatchSize = Math.min(batchSize, Constants.MAX_INSERT_BATCH_SIZE); if (maxBatchSize > 0) { this.insertBatchSize = maxBatchSize; @@ -326,7 +331,9 @@ private void configureInsertConcurrencyAndBatchSize(int totalRequests) { try { int concurrencyLimit = Integer.parseInt(userProvidedConcurrencyLimit); int maxConcurrencyLimit = Math.min(concurrencyLimit, Constants.MAX_INSERT_CONCURRENCY_LIMIT); - + if (concurrencyLimit > Constants.MAX_INSERT_CONCURRENCY_LIMIT) { + LogUtil.printWarningLog(WarningLogs.CONCURRENCY_EXCEEDS_MAX_LIMIT.getLog()); + } if (maxConcurrencyLimit > 0) { this.insertConcurrencyLimit = Math.min(maxConcurrencyLimit, maxConcurrencyNeeded); } else { @@ -357,6 +364,9 @@ private void configureDetokenizeConcurrencyAndBatchSize(int totalRequests) { if (userProvidedBatchSize != null) { try { int batchSize = Integer.parseInt(userProvidedBatchSize); + if (batchSize > Constants.MAX_DETOKENIZE_BATCH_SIZE) { + LogUtil.printWarningLog(WarningLogs.BATCH_SIZE_EXCEEDS_MAX_LIMIT.getLog()); + } int maxBatchSize = Math.min(batchSize, Constants.MAX_DETOKENIZE_BATCH_SIZE); if (maxBatchSize > 0) { this.detokenizeBatchSize = maxBatchSize; @@ -376,6 +386,9 @@ private void configureDetokenizeConcurrencyAndBatchSize(int totalRequests) { if (userProvidedConcurrencyLimit != null) { try { int concurrencyLimit = Integer.parseInt(userProvidedConcurrencyLimit); + if (concurrencyLimit > Constants.MAX_DETOKENIZE_CONCURRENCY_LIMIT) { + LogUtil.printWarningLog(WarningLogs.CONCURRENCY_EXCEEDS_MAX_LIMIT.getLog()); + } int maxConcurrencyLimit = Math.min(concurrencyLimit, Constants.MAX_DETOKENIZE_CONCURRENCY_LIMIT); if (maxConcurrencyLimit > 0) {