[ 
https://issues.apache.org/jira/browse/ARTEMIS-2321?focusedWorklogId=234352&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-234352
 ]

ASF GitHub Bot logged work on ARTEMIS-2321:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Apr/19 07:37
            Start Date: 29/Apr/19 07:37
    Worklog Time Spent: 10m 
      Work Description: michaelandrepearce commented on pull request #2645: 
ARTEMIS-2321 Paging scalability and GC improvement
URL: https://github.com/apache/activemq-artemis/pull/2645#discussion_r279259143
 
 

 ##########
 File path: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/SoftValueLongObjectHashMap.java
 ##########
 @@ -21,26 +21,26 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.concurrent.atomic.AtomicLong;
 
+import io.netty.util.collection.LongObjectHashMap;
+import io.netty.util.collection.LongObjectMap;
 import org.jboss.logging.Logger;
 
-public class SoftValueHashMap<K, V extends SoftValueHashMap.ValueCache> 
implements Map<K, V> {
+public class SoftValueLongObjectHashMap<V extends 
SoftValueLongObjectHashMap.ValueCache> implements LongObjectMap<V> {
 
-   private static final Logger logger = 
Logger.getLogger(SoftValueHashMap.class);
+   private static final Logger logger = 
Logger.getLogger(SoftValueLongObjectHashMap.class);
 
    // The soft references that are already good.
    // too bad there's no way to override the queue method on ReferenceQueue, 
so I wouldn't need this
    private final ReferenceQueue<V> refQueue = new ReferenceQueue<>();
 
-   private final Map<K, AggregatedSoftReference> mapDelegate = new HashMap<>();
+   private final LongObjectMap<AggregatedSoftReference<V>> mapDelegate = new 
LongObjectHashMap<>();
 
 Review comment:
   Why do you need to make the field type use it directly? They implement map 
interface. And the add primitive methods that will be invoked at runtime, you 
dont need to make the field the concrete impl. This is the trick all primitive 
impl use. The whole idea is you keep map interface so should a better version 
arrive just like any other map you just switch the impl, not the rest of the 
code or field type
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 234352)
    Time Spent: 2h 20m  (was: 2h 10m)

> Paging scalability and GC improvements
> --------------------------------------
>
>                 Key: ARTEMIS-2321
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2321
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.8.0
>            Reporter: Francesco Nigro
>            Priority: Major
>             Fix For: 2.9.0
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> PageCursorProviderImpl::getPageCache's on cache miss is blocking the whole 
> softCache until the requested page isn't fully read, making other threads 
> unable to make progress by querying the cache.
> It would be better to make the page read operation a non-blocking operation 
> for the whole cache, allowing threads that need different pageId to make 
> progress.
> Other improvements:
> * PageCursorProviderImpl can use specialized primitive hash maps to reduce 
> memory footprint (that would cause some page entries to be collected 
> prematurely)
> * PageCache children can avoid to maintain a reference to a Page
> * PagingStoreImpl perform many unnecessary volatile stores/loads and some 
> fields can be turned into plain ones, avoiding expensive atomic operations



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to