Skip to content

Commit

Permalink
Rename config property to match common pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Mar 15, 2022
1 parent 9089794 commit 20df89a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ public SystemSessionProperties(
dataSizeProperty(
FAULT_TOLERANT_EXECUTION_TASK_MEMORY,
"Estimated amount of memory a single task will use when task level retries are used; value is used allocating nodes for tasks execution",
memoryManagerConfig.getFaultTolerantTaskMemory(),
memoryManagerConfig.getFaultTolerantExecutionTaskMemory(),
false),
booleanProperty(
ADAPTIVE_PARTIAL_AGGREGATION_ENABLED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
"resources.reserved-system-memory"})
public class MemoryManagerConfig
{
public static final String FAULT_TOLERANT_TASK_MEMORY_CONFIG = "fault-tolerant-task-memory";
public static final String FAULT_TOLERANT_TASK_MEMORY_CONFIG = "fault-tolerant-execution-task-memory";

// enforced against user memory allocations
private DataSize maxQueryMemory = DataSize.of(20, GIGABYTE);
// enforced against user + system memory allocations (default is maxQueryMemory * 2)
private DataSize maxQueryTotalMemory;
private DataSize faultTolerantTaskMemory = DataSize.of(1, GIGABYTE);
private DataSize faultTolerantExecutionTaskMemory = DataSize.of(1, GIGABYTE);
private LowMemoryKillerPolicy lowMemoryKillerPolicy = LowMemoryKillerPolicy.TOTAL_RESERVATION_ON_BLOCKED_NODES;
private Duration killOnOutOfMemoryDelay = new Duration(5, MINUTES);

Expand Down Expand Up @@ -102,16 +102,16 @@ public MemoryManagerConfig setMaxQueryTotalMemory(DataSize maxQueryTotalMemory)
}

@NotNull
public DataSize getFaultTolerantTaskMemory()
public DataSize getFaultTolerantExecutionTaskMemory()
{
return faultTolerantTaskMemory;
return faultTolerantExecutionTaskMemory;
}

@Config(FAULT_TOLERANT_TASK_MEMORY_CONFIG)
@ConfigDescription("Estimated amount of memory a single task will use when task level retries are used; value is used allocating nodes for tasks execution")
public MemoryManagerConfig setFaultTolerantTaskMemory(DataSize faultTolerantTaskMemory)
public MemoryManagerConfig setFaultTolerantExecutionTaskMemory(DataSize faultTolerantExecutionTaskMemory)
{
this.faultTolerantTaskMemory = faultTolerantTaskMemory;
this.faultTolerantExecutionTaskMemory = faultTolerantExecutionTaskMemory;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testDefaults()
.setKillOnOutOfMemoryDelay(new Duration(5, MINUTES))
.setMaxQueryMemory(DataSize.of(20, GIGABYTE))
.setMaxQueryTotalMemory(DataSize.of(40, GIGABYTE))
.setFaultTolerantTaskMemory(DataSize.of(1, GIGABYTE)));
.setFaultTolerantExecutionTaskMemory(DataSize.of(1, GIGABYTE)));
}

@Test
Expand All @@ -50,15 +50,15 @@ public void testExplicitPropertyMappings()
.put("query.low-memory-killer.delay", "20s")
.put("query.max-memory", "2GB")
.put("query.max-total-memory", "3GB")
.put("fault-tolerant-task-memory", "2GB")
.put("fault-tolerant-execution-task-memory", "2GB")
.buildOrThrow();

MemoryManagerConfig expected = new MemoryManagerConfig()
.setLowMemoryKillerPolicy(NONE)
.setKillOnOutOfMemoryDelay(new Duration(20, SECONDS))
.setMaxQueryMemory(DataSize.of(2, GIGABYTE))
.setMaxQueryTotalMemory(DataSize.of(3, GIGABYTE))
.setFaultTolerantTaskMemory(DataSize.of(2, GIGABYTE));
.setFaultTolerantExecutionTaskMemory(DataSize.of(2, GIGABYTE));

assertFullMapping(properties, expected);
}
Expand Down

0 comments on commit 20df89a

Please sign in to comment.