Skip to content

Commit

Permalink
addresss comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-alhuang committed Nov 22, 2024
1 parent d05fd7d commit 5e223b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/main/java/net/snowflake/ingest/utils/ParameterProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class ParameterProvider {
public static final String MAX_CHUNKS_IN_BLOB = "MAX_CHUNKS_IN_BLOB".toLowerCase();
public static final String MAX_CHUNKS_IN_REGISTRATION_REQUEST =
"MAX_CHUNKS_IN_REGISTRATION_REQUEST".toLowerCase();
public static final String BLOB_UPLOAD_TIMEOUT_IN_SEC =
"BLOB_UPLOAD_TIMEOUT_IN_SEC".toLowerCase();
public static final String BLOB_UPLOAD_TIMEOUT_IN_SECONDS =
"BLOB_UPLOAD_TIMEOUT_IN_SECONDS".toLowerCase();

public static final String MAX_CLIENT_LAG = "MAX_CLIENT_LAG".toLowerCase();

Expand All @@ -64,8 +64,8 @@ public class ParameterProvider {
public static final long MAX_MEMORY_LIMIT_IN_BYTES_DEFAULT = -1L;
public static final long MAX_CHANNEL_SIZE_IN_BYTES_DEFAULT = 64 * 1024 * 1024;
public static final long MAX_CHUNK_SIZE_IN_BYTES_DEFAULT = 256 * 1024 * 1024;
public static final int BLOB_UPLOAD_TIMEOUT_IN_SEC_DEFAULT = 5;
public static final int BLOB_UPLOAD_TIMEOUT_IN_SEC_ICEBERG_MODE_DEFAULT = 20;
public static final int BLOB_UPLOAD_TIMEOUT_IN_SECONDS_DEFAULT = 5;
public static final int BLOB_UPLOAD_TIMEOUT_IN_SECONDS_ICEBERG_MODE_DEFAULT = 30;

// Lag related parameters
public static final long MAX_CLIENT_LAG_DEFAULT = 1000; // 1 second
Expand Down Expand Up @@ -278,10 +278,10 @@ private void setParameterMap(Map<String, Object> parameterOverrides, Properties
false /* enforceDefault */);

this.checkAndUpdate(
BLOB_UPLOAD_TIMEOUT_IN_SEC,
BLOB_UPLOAD_TIMEOUT_IN_SECONDS,
isEnableIcebergStreaming()
? BLOB_UPLOAD_TIMEOUT_IN_SEC_ICEBERG_MODE_DEFAULT
: BLOB_UPLOAD_TIMEOUT_IN_SEC_DEFAULT,
? BLOB_UPLOAD_TIMEOUT_IN_SECONDS_ICEBERG_MODE_DEFAULT
: BLOB_UPLOAD_TIMEOUT_IN_SECONDS_DEFAULT,
parameterOverrides,
props,
false /* enforceDefault */);
Expand Down Expand Up @@ -552,10 +552,10 @@ public int getBlobUploadTimeOutInSec() {
}
Object val =
this.parameterMap.getOrDefault(
BLOB_UPLOAD_TIMEOUT_IN_SEC,
BLOB_UPLOAD_TIMEOUT_IN_SECONDS,
isEnableIcebergStreaming()
? BLOB_UPLOAD_TIMEOUT_IN_SEC_ICEBERG_MODE_DEFAULT
: BLOB_UPLOAD_TIMEOUT_IN_SEC_DEFAULT);
? BLOB_UPLOAD_TIMEOUT_IN_SECONDS_ICEBERG_MODE_DEFAULT
: BLOB_UPLOAD_TIMEOUT_IN_SECONDS_DEFAULT);
cachedBlobUploadTimeoutInSec =
(val instanceof String) ? Integer.parseInt(val.toString()) : (int) val;
return cachedBlobUploadTimeoutInSec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ public void withDefaultValues() {
parameterProvider.getMaxChunksInRegistrationRequest());
Assert.assertEquals(
enableIcebergStreaming
? ParameterProvider.BLOB_UPLOAD_TIMEOUT_IN_SEC_ICEBERG_MODE_DEFAULT
: ParameterProvider.BLOB_UPLOAD_TIMEOUT_IN_SEC_DEFAULT,
? ParameterProvider.BLOB_UPLOAD_TIMEOUT_IN_SECONDS_ICEBERG_MODE_DEFAULT
: ParameterProvider.BLOB_UPLOAD_TIMEOUT_IN_SECONDS_DEFAULT,
parameterProvider.getBlobUploadTimeOutInSec());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public void testRegisterService() throws ExecutionException, InterruptedExceptio
Mockito.when(parameterProvider.getBlobUploadTimeOutInSec())
.thenReturn(
enableIcebergStreaming
? ParameterProvider.BLOB_UPLOAD_TIMEOUT_IN_SEC_ICEBERG_MODE_DEFAULT
: ParameterProvider.BLOB_UPLOAD_TIMEOUT_IN_SEC_DEFAULT);
? ParameterProvider.BLOB_UPLOAD_TIMEOUT_IN_SECONDS_ICEBERG_MODE_DEFAULT
: ParameterProvider.BLOB_UPLOAD_TIMEOUT_IN_SECONDS_DEFAULT);
Mockito.when(client.getParameterProvider()).thenReturn(parameterProvider);

RegisterService<StubChunkData> rs = new RegisterService<>(client, true);
Expand Down

0 comments on commit 5e223b8

Please sign in to comment.