ibessonov commented on code in PR #812:
URL: https://github.com/apache/ignite-3/pull/812#discussion_r881824356


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PageMemoryImpl.java:
##########
@@ -268,7 +261,7 @@ public PageMemoryImpl(
                 throw new IgniteInternalException("Unexpected page replacement 
mode: " + replacementMode);
         }
 
-        delayedPageReplacementTracker = 
getBoolean(IGNITE_DELAYED_REPLACED_PAGE_WRITE, true)
+        delayedPageReplacementTracker = 
dataRegionConfig.delayedReplacedPageWrite().value()

Review Comment:
   Why don't you read this value from the view?



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/impl/PageMemoryNoStoreImpl.java:
##########
@@ -674,7 +675,7 @@ private synchronized Segment addSegment(Segment[] oldRef) {
 
             if (oldRef != null) {
                 if (LOG.isInfoEnabled()) {
-                    LOG.info("Allocated next memory segment [plcName=" + 
dataRegionCfg.name()
+                    LOG.info("Allocated next memory segment [plcName=" + 
dataRegionConfigView.name()

Review Comment:
   "plcName", hmmmmmm............. I smell legacy



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/configuration/schema/PageMemoryDataRegionConfigurationSchema.java:
##########
@@ -92,4 +87,8 @@ public class PageMemoryDataRegionConfigurationSchema {
 
     @Value(hasDefault = true)
     public boolean lazyMemoryAllocation = true;
+
+    /** Write to the page store without holding the segment lock (with a 
delay). */

Review Comment:
   Original comment on system property was much larger



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/Checkpointer.java:
##########
@@ -728,9 +718,9 @@ boolean isShutdownNow() {
      * <p>It helps when the cluster makes a checkpoint in the same time in 
every node.
      */
     long nextCheckpointInterval() {
-        long frequency = checkpointFrequencySupplier.getAsLong();
+        long frequency = checkpointConfig.frequency().value();

Review Comment:
   I know I'm picking, but it would be better to use the same view to obtain 
both of these values, just in case



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PageMemoryImpl.java:
##########
@@ -219,37 +211,38 @@ public class PageMemoryImpl implements PageMemoryEx {
      * Constructor.
      *
      * @param directMemoryProvider Memory allocator to use.
-     * @param dataRegionCfg Data region configuration.
+     * @param dataRegionConfig Data region configuration.
      * @param ioRegistry IO registry.
      * @param sizes Segments sizes, the last one being the checkpoint buffer 
size.
      * @param pmPageMgr Page store manager.
      * @param changeTracker Callback invoked to track changes in pages.
      * @param flushDirtyPage Write callback invoked when a dirty page is 
removed for replacement.
+     * @param pageSize Page size in bytes.
      */
     public PageMemoryImpl(
             DirectMemoryProvider directMemoryProvider,
-            PageMemoryDataRegionConfiguration dataRegionCfg,
+            PageMemoryDataRegionConfiguration dataRegionConfig,
             PageIoRegistry ioRegistry,
             long[] sizes,
             PageReadWriteManager pmPageMgr,
             @Nullable PageChangeTracker changeTracker,
-            PageStoreWriter flushDirtyPage
+            PageStoreWriter flushDirtyPage,
+            // TODO: IGNITE-17017 Move to common config
+            int pageSize
     ) {
         this.directMemoryProvider = directMemoryProvider;
-        this.dataRegionCfg = dataRegionCfg.value();
+        this.dataRegionConfigView = dataRegionConfig.value();
         this.ioRegistry = ioRegistry;
         this.sizes = sizes;
         this.pmPageMgr = pmPageMgr;
         this.changeTracker = changeTracker;
         this.flushDirtyPage = flushDirtyPage;
 
-        int pageSize = this.dataRegionCfg.pageSize();
-
         sysPageSize = pageSize + PAGE_OVERHEAD;
 
         rwLock = new OffheapReadWriteLock(128);
 
-        String replacementMode = this.dataRegionCfg.replacementMode();
+        String replacementMode = this.dataRegionConfigView.replacementMode();

Review Comment:
   "this." is not required anymore



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to