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 docs/groovy/conceptual/query-engine/parallelization.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ To explicitly mark a `Selectable` or `Filter` as stateful, use the `withSerial`

- A serial `Filter` cannot be reordered with respect to other `Filter`s. Every input row to a stateful `Filter` is evaluated in order.
- When a `Selectable` is serial, then every row for that column is evaluated in order.
- For `Selectable`s, additional ordering constraints are controlled by the value of the `QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS`. This is set by the property `QueryTable.serialSelectImplicitBarriers` (defaulting to the value of `QueryTable.statelessSelectByDefault`).
- For `Selectable`s, additional ordering constraints are controlled by the value of the `QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS`. This is set by the property `QueryTable.serialSelectImplicitBarriers`. The default value is the inverse of `QueryTable.statelessSelectByDefault`. When `Selectables` are stateless by default, no implicit barriers are added (i.e., `QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS` is false). When `Selectables` are stateful by default, then implicit barriers are added (i.e. `QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS` is true).
- If `QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS` is false, no additional ordering between expressions is imposed. As with every `select` or `update` call, if column B references column A, then the necessary inputs to column B from column A are evaluated before column B is evaluated. To impose further ordering constraints, use barriers.
- If `QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS` is true, then a serial `Selectable` is an absolute barrier with respect to all other serial `Selectable`s. This prohibits serial `Selectable`s from being evaluated concurrently, permitting them to access global state. `Selectable`s that are not serial may be reordered with respect to a serial selectable.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,16 @@ public interface MemoizableOperation<T extends DynamicNode & NotificationStepRec
/**
* If set to true, then stateful SelectColumns form implicit barriers. If set to false, then StatefulSelectColumns
* do not form implicit barriers.
*
* <p>
* When stateless selectables are on by default ({@code QueryTable.statelessSelectByDefault=true}), no implicit
* barriers are added (i.e., this defaults to false). When stateless columns are off by default
* ({@code QueryTable.statelessSelectByDefault=false}), implicit barriers are added (i.e., this defaults to true).
* </p>
*/
public static boolean SERIAL_SELECT_IMPLICIT_BARRIERS =
Configuration.getInstance().getBooleanWithDefault("QueryTable.serialSelectImplicitBarriers",
STATELESS_SELECT_BY_DEFAULT);
!STATELESS_SELECT_BY_DEFAULT);

private static final AtomicReferenceFieldUpdater<QueryTable, ModifiedColumnSet> MODIFIED_COLUMN_SET_UPDATER =
AtomicReferenceFieldUpdater.newUpdater(QueryTable.class, ModifiedColumnSet.class, "modifiedColumnSet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public class QueryTableSelectBarrierTest {
// then you can increase this amount to run the tests many times.
private static final int REPEATS_FOR_CONFIDENCE = 1;

@Test
public void testPropertyDefaults() {
assertFalse(QueryTable.STATELESS_FILTERS_BY_DEFAULT);
assertFalse(QueryTable.STATELESS_SELECT_BY_DEFAULT);
assertTrue(QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS);
}

@Test
public void testRepeatedBarrierSelectColumn() {
for (int ii = 0; ii < REPEATS_FOR_CONFIDENCE; ++ii) {
Expand Down
Loading