From e6f8f2ae31e9ad8e8607520ea5b737c87cabd0d1 Mon Sep 17 00:00:00 2001 From: Nathaniel Bauernfeind Date: Tue, 16 Jan 2024 10:22:56 -0700 Subject: [PATCH] Ryan's feedback --- .../table/impl/util/WritableRowRedirection.java | 2 +- .../barrage/table/BarrageRedirectedTable.java | 4 ++++ .../extensions/barrage/table/BarrageTable.java | 12 ++++-------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/WritableRowRedirection.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/WritableRowRedirection.java index cd293678c74..799563e5de4 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/util/WritableRowRedirection.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/util/WritableRowRedirection.java @@ -171,7 +171,7 @@ default void applyShift(final RowSet tableRowSet, final RowSetShiftData shiftDat } /** - * Factory for producing WritableRowSets and their components. + * Factory for producing WritableRowRedirections and their components. */ interface Factory { TLongLongMap createUnderlyingMapWithCapacity(int initialCapacity); diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageRedirectedTable.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageRedirectedTable.java index 858862712e7..3b7b37e3b1d 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageRedirectedTable.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageRedirectedTable.java @@ -55,9 +55,13 @@ protected BarrageRedirectedTable(final UpdateSourceRegistrar registrar, final WritableColumnSource[] writableSources, final WritableRowRedirection rowRedirection, final Map attributes, + final boolean isFlat, @Nullable final ViewportChangedCallback vpCallback) { super(registrar, notificationQueue, executorService, columns, writableSources, attributes, vpCallback); this.rowRedirection = rowRedirection; + if (isFlat) { + setFlat(); + } } private UpdateCoalescer processUpdate(final BarrageMessage update, final UpdateCoalescer coalescer) { diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageTable.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageTable.java index 00a7d868e7a..2b20f937e9b 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageTable.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/table/BarrageTable.java @@ -461,21 +461,17 @@ public static BarrageTable make( } else { final WritableRowRedirection rowRedirection; final boolean isFlat = getAttribute.test(BarrageUtil.TABLE_ATTRIBUTE_IS_FLAT); - if (getAttribute.test(Table.APPEND_ONLY_TABLE_ATTRIBUTE) - || getAttribute.test(Table.ADD_ONLY_TABLE_ATTRIBUTE) - || isFlat) { + if (getAttribute.test(Table.APPEND_ONLY_TABLE_ATTRIBUTE) || isFlat) { rowRedirection = new LongColumnSourceWritableRowRedirection(new LongSparseArraySource()); } else { - rowRedirection = WritableRowRedirectionLockFree.FACTORY.createRowRedirection(1024); + rowRedirection = WritableRowRedirection.FACTORY.createRowRedirection(1024); } final LinkedHashMap> finalColumns = makeColumns(columns, writableSources, rowRedirection); table = new BarrageRedirectedTable( - registrar, queue, executor, finalColumns, writableSources, rowRedirection, attributes, vpCallback); - if (isFlat) { - table.setFlat(); - } + registrar, queue, executor, finalColumns, writableSources, rowRedirection, attributes, isFlat, + vpCallback); } return table;