Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<artifactId>common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<name>${project.groupId}:${project.artifactId}</name>


Expand Down
2 changes: 1 addition & 1 deletion common/src/main/java/com/skyflow/logs/InfoLogs.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
;


Expand Down
2 changes: 2 additions & 0 deletions common/src/main/java/com/skyflow/logs/WarningLogs.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>com.skyflow</groupId>
<artifactId>common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>

</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions v3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<artifactId>skyflow-java</artifactId>
<version>3.0.0-beta.2</version>
<version>3.0.0-beta.2-dev.dca75d0</version>
<packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<description>Skyflow V3 SDK for the Java programming language</description>
Expand Down Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>com.skyflow</groupId>
<artifactId>common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion v3/src/main/java/com/skyflow/utils/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand All @@ -70,6 +71,7 @@ public CompletableFuture<com.skyflow.vault.data.InsertResponse> 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<ErrorRecord> errorRecords = Collections.synchronizedList(new ArrayList<>());
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down