Skip to content

Commit

Permalink
Iteration 5: Jays comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-tjones committed Sep 14, 2023
1 parent c65d9de commit 8f38047
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/net/snowflake/ingest/utils/ParameterProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

/** Utility class to provide configurable constants */
public class ParameterProvider {
Expand Down Expand Up @@ -54,10 +55,9 @@ public class ParameterProvider {
public static final String MAX_CLIENT_LAG_DEFAULT = "1 second";
public static final boolean MAX_CLIENT_LAG_ENABLED_DEFAULT = true;

static final long MAX_CLIENT_LAG_MS_MIN = 1000;
static final long MAX_CLIENT_LAG_MS_MIN = TimeUnit.SECONDS.toMillis(1);

// 10 minutes
static final long MAX_CLIENT_LAG_MS_MAX = 600000;
static final long MAX_CLIENT_LAG_MS_MAX = TimeUnit.MINUTES.toMillis(10);
public static final long MAX_ALLOWED_ROW_SIZE_IN_BYTES_DEFAULT = 64 * 1024 * 1024; // 64 MB

/* Parameter that enables using internal Parquet buffers for buffering of rows before serializing.
Expand Down Expand Up @@ -211,15 +211,15 @@ private long getMaxClientLagMs() {
throw new IllegalArgumentException(
String.format("Failed to parse MAX_CLIENT_LAG = '%s'", lagParts[0]), t);
}
long computedLag = BUFFER_FLUSH_INTERVAL_IN_MILLIS_DEFAULT;
long computedLag;
switch (lagParts[1].toLowerCase()) {
case "second":
case "seconds":
computedLag = lag * 1000;
computedLag = lag * TimeUnit.SECONDS.toMillis(1);
break;
case "minute":
case "minutes":
computedLag = lag * 60000;
computedLag = lag * TimeUnit.SECONDS.toMillis(60);
break;
default:
throw new IllegalArgumentException(
Expand Down

0 comments on commit 8f38047

Please sign in to comment.