tkalkirill commented on code in PR #7374:
URL: https://github.com/apache/ignite-3/pull/7374#discussion_r2675879235


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/VolatilePageMemoryDataRegion.java:
##########
@@ -58,6 +58,8 @@ public class VolatilePageMemoryDataRegion implements 
DataRegion<VolatilePageMemo
 
     private final int pageSize;
 
+    private long regionSizeBytes;

Review Comment:
   Lets add `volatile` like 
`org.apache.ignite.internal.storage.pagememory.VolatilePageMemoryDataRegion#pageMemory`.
 Maybe rename to regionSize?



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryDataRegion.java:
##########
@@ -101,6 +101,8 @@ public class PersistentPageMemoryDataRegion implements 
DataRegion<PersistentPage
 
     private final int pageSize;
 
+    private long regionSizeBytes;

Review Comment:
   Please add `volatile` like 
`org.apache.ignite.internal.storage.pagememory.PersistentPageMemoryDataRegion#pageListCacheLimit`.
   Maybe rename to `regionSize` ?



##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbStorageProfile.java:
##########
@@ -45,6 +45,8 @@ public class RocksDbStorageProfile {
     /** Write buffer manager instance. */
     private WriteBufferManager writeBufferManager;
 
+    private long dataRegionSize;

Review Comment:
   Let's rename to `regionSize`.



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/DataRegion.java:
##########
@@ -25,4 +25,11 @@ public interface DataRegion<T extends PageMemory> {
      * Returns page memory.
      */
     T pageMemory();
+
+    /**
+     * Returns the region size in bytes.
+     */
+    default long regionSize() {

Review Comment:
   I propose to get rid of this method in this interface, I don’t see that a 
general method is used, but a specific one is used for each implementation.



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/VolatilePageMemoryDataRegion.java:
##########
@@ -103,7 +105,7 @@ public void start() {
         this.pageMemory = pageMemory;
     }
 
-    private static VolatileDataRegionConfiguration 
regionConfiguration(VolatilePageMemoryProfileConfiguration cfg, int pageSize) {
+    private VolatileDataRegionConfiguration 
regionConfiguration(VolatilePageMemoryProfileConfiguration cfg, int pageSize) {

Review Comment:
   I propose to write the result of the method execution in the class field.



##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbStorageProfile.java:
##########
@@ -69,7 +71,7 @@ public void start() {
 
     private long sizeBytes() {
         var storageProfileConfigView = (RocksDbProfileView) 
storageProfileConfig.value();
-        long dataRegionSize = storageProfileConfigView.sizeBytes();
+        dataRegionSize = storageProfileConfigView.sizeBytes();

Review Comment:
   I propose to write the result of the method execution in the class field.



-- 
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