Skip to content

Commit

Permalink
Finish review cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Dec 8, 2023
1 parent 8c0e582 commit b8fa59f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ public PartitionedTable transform(
// Perform the transformation
final Table resultTable = prepared.update(List.of(new TableTransformationColumn(
constituentColumnName,
maybeReplaceExecContext(executionContext), // THIS ONE MUST NOT HAVE THE SAME OT AS THIS CURRENT
// THREAD's EXEC CONTEXT,
// UNLESS NON_PARALLELIZABLE
maybeReplaceExecContext(executionContext),
prepared.isRefreshing() ? transformer : assertResultsStatic(transformer))));

// Make sure we have a valid result constituent definition
Expand All @@ -321,6 +319,12 @@ public PartitionedTable transform(
return resultPartitionedTable;
}

/**
* Ensures that the returned executionContext will have an OperationInitializer compatible
* with being called by work already running on an initialization thread - it must either
* already return false for {@link OperationInitializer#canParallelize()}, or must be a
* different instance than the current context's OperationInitializer.
*/
private static ExecutionContext maybeReplaceExecContext(ExecutionContext provided) {
if (provided == null) {
return null;
Expand Down Expand Up @@ -370,9 +374,7 @@ public PartitionedTable partitionedTransform(
.update(List.of(new BiTableTransformationColumn(
constituentColumnName,
RHS_CONSTITUENT,
maybeReplaceExecContext(executionContext), // THIS ONE MUST NOT HAVE THE SAME OT AS THIS
// CURRENT THREAD's EXEC
// CONTEXT, UNLESS NON_PARALLELIZABLE
maybeReplaceExecContext(executionContext),
prepared.isRefreshing() ? transformer : assertResultsStatic(transformer))))
.dropColumns(RHS_CONSTITUENT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ public Builder numUpdateThreads(int numUpdateThreads) {

/**
* Sets a functional interface that adds custom initialization for threads started by this UpdateGraph.
*
*
* @param threadInitializationFactory the function to invoke on any runnables that will be used to start threads
* @return this builder
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.concurrent.Future;

/**
* alt naming: OperationParallelismControl?
* Provides guidance for initialization operations on how they can parallelize.
*/
public interface OperationInitializer {
OperationInitializer NON_PARALLELIZABLE = new OperationInitializer() {
Expand All @@ -26,21 +26,17 @@ public int parallelismFactor() {
};

/**
* @return Whether the current thread can parallelize operations using this OperationInitialization.
* Whether the current thread can parallelize operations using this OperationInitialization.
*/
boolean canParallelize();

/**
* Submits a task to run in this thread pool.
*
* @param runnable
* @return
*/
Future<?> submit(Runnable runnable);

/**
*
* @return
* Number of threads that are potentially available.
*/
int parallelismFactor();
}
4 changes: 0 additions & 4 deletions props/configs/src/main/resources/dh-defaults.prop
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,3 @@ client.configuration.list=java.version,deephaven.version,barrage.version,http.se
# jar, and a class that is found in that jar. Any such keys will be made available to the client.configuration.list
# as <key>.version.
client.version.list=deephaven=io.deephaven.engine.table.Table,barrage=io.deephaven.barrage.flatbuf.BarrageMessageWrapper


# Specifies additional setup to run on threads that can perform table operations with user code. Comma-separated list, instances must be of type io.deephaven.util.thread.ThreadInitializationFactory
thread.initialization=
1 change: 0 additions & 1 deletion props/test-configs/src/main/resources/dh-tests.prop
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,3 @@ client.version.list=
authentication.anonymous.warn=false

deephaven.console.type=none
thread.initialization=

0 comments on commit b8fa59f

Please sign in to comment.