7777import com.tangosol.net.events.internal.InterceptorManager;
7878import com.tangosol.net.events.internal.ServiceDispatcher;
7979import com.tangosol.net.events.internal.StorageDispatcher;
80- import com.tangosol.net.internal.CopyOnWriteLongList;
8180import com.tangosol.net.internal.EntryInfo;
8281import com.tangosol.net.internal.MemberInfo;
8382import com.tangosol.net.internal.PartitionInfo;
150149import java.util.Map;
151150import java.util.Set;
152151import java.util.concurrent.ConcurrentHashMap;
152+ import java.util.concurrent.CopyOnWriteArraySet;
153153import java.util.concurrent.atomic.AtomicInteger;
154154import java.util.concurrent.atomic.AtomicLong;
155155import java.util.concurrent.atomic.AtomicReferenceArray;
@@ -3777,7 +3777,7 @@ protected void movePartition(int iPartition, int iBackupTo)
37773777 }
37783778
37793779 if (iBackupTo == 0)
3780- {
3780+ {
37813781 ctrl.preparePersistentExtents();
37823782 }
37833783 else
@@ -8453,7 +8453,7 @@ protected boolean persistChanges(com.tangosol.coherence.component.net.RequestCon
84538453 Collection colPartStatus = (Collection) entry.getValue();
84548454 PartitionedCache.PartitionControl ctrlPartition = (PartitionedCache.PartitionControl) getPartitionControl(nPartition);
84558455 PersistentStore store = ctrlPartition.ensureOpenPersistentStore(/*storeFrom*/ null, /*fSeal*/ true);
8456-
8456+
84578457 // commit changes to the persisted partition atomically
84588458 Object oToken = store.begin(collector, ctrlPartition);
84598459 try
@@ -8468,9 +8468,9 @@ protected boolean persistChanges(com.tangosol.coherence.component.net.RequestCon
84688468 long lExtentId = storage.getCacheId();
84698469 ReadBuffer bufKey = status.getKey();
84708470 ReadBuffer bufValue = status.getMergedNewValue();
8471-
8471+
84728472 ctrlPartition.ensurePersistentExtent(lExtentId);
8473-
8473+
84748474 if (bufValue == null)
84758475 {
84768476 // remove
@@ -8535,7 +8535,7 @@ protected boolean persistChanges(com.tangosol.coherence.component.net.RequestCon
85358535 boolean fPersistEvents = storeEvents != null && status.getMapEventsRaw() != null;
85368536
85378537 ctrl.ensurePersistentExtent(lExtentId);
8538-
8538+
85398539 Object oToken = store.begin(fPersistEvents ? null : collector, ctrl);
85408540 try
85418541 {
@@ -31335,8 +31335,8 @@ public void __init()
3133531335 try
3133631336 {
3133731337 setDeferredBackups(new com.tangosol.util.CircularArrayList());
31338- setPersistentBackupExtents(new com.tangosol.net.internal.CopyOnWriteLongList ());
31339- setPersistentExtents(new com.tangosol.net.internal.CopyOnWriteLongList ());
31338+ setPersistentBackupExtents(new CopyOnWriteArraySet ());
31339+ setPersistentExtents(new CopyOnWriteArraySet ());
3134031340 setVersionCounter(new java.util.concurrent.atomic.AtomicLong());
3134131341 }
3134231342 catch (java.lang.Exception e)
@@ -31460,22 +31460,22 @@ public boolean ensureBackupPersistentExtent(long lExtentId)
3146031460 // import com.tangosol.persistence.CachePersistenceHelper as com.tangosol.persistence.CachePersistenceHelper;
3146131461 // import com.tangosol.util.LongArray;
3146231462 // import java.util.Map;
31463-
31464- CopyOnWriteLongList listExtents = getPersistentBackupExtents();
31465- Map mapGraveyard = ((PartitionedCache) get_Module()).getStorageGraveyard();
31463+
31464+ CopyOnWriteArraySet<Long> setExtents = getPersistentBackupExtents();
31465+ Map mapGraveyard = ((PartitionedCache) get_Module()).getStorageGraveyard();
3146631466
3146731467 if (mapGraveyard.containsKey(Long.valueOf(lExtentId)))
3146831468 {
3146931469 return false;
3147031470 }
3147131471
3147231472 // backup partition recovery not relevant
31473- if (listExtents .contains(lExtentId))
31473+ if (setExtents .contains(lExtentId))
3147431474 {
3147531475 boolean fCreatedExtent = false;
3147631476 synchronized (this)
3147731477 {
31478- if (fCreatedExtent = listExtents .contains(lExtentId))
31478+ if (fCreatedExtent = setExtents .contains(lExtentId))
3147931479 {
3148031480 LongArray laCaches = null;
3148131481
@@ -31490,7 +31490,7 @@ public boolean ensureBackupPersistentExtent(long lExtentId)
3149031490 com.tangosol.persistence.CachePersistenceHelper.storeCacheNames(store, laCaches);
3149131491 }
3149231492
31493- listExtents .remove(lExtentId);
31493+ setExtents .remove(lExtentId);
3149431494 }
3149531495 }
3149631496
@@ -31526,22 +31526,22 @@ public boolean ensurePersistentExtent(long lExtentId)
3152631526 // import com.tangosol.persistence.CachePersistenceHelper as com.tangosol.persistence.CachePersistenceHelper;
3152731527 // import com.tangosol.util.LongArray;
3152831528 // import java.util.Map;
31529-
31530- CopyOnWriteLongList listExtents = getPersistentExtents();
31531- Map mapGraveyard = ((PartitionedCache) get_Module()).getStorageGraveyard();
31532-
31529+
31530+ CopyOnWriteArraySet<Long> setExtents = getPersistentExtents();
31531+ Map mapGraveyard = ((PartitionedCache) get_Module()).getStorageGraveyard();
31532+
3153331533 if (mapGraveyard.containsKey(Long.valueOf(lExtentId)))
3153431534 {
3153531535 return false;
3153631536 }
31537-
31538- if (listExtents .contains(lExtentId) && !isRecovering())
31537+
31538+ if (setExtents .contains(lExtentId) && !isRecovering())
3153931539 {
3154031540 PersistentStore storeEvents = getPersistentEventsStore();
3154131541 boolean fCreatedExtent = false;
3154231542 synchronized (this)
3154331543 {
31544- if (fCreatedExtent = listExtents .contains(lExtentId))
31544+ if (fCreatedExtent = setExtents .contains(lExtentId))
3154531545 {
3154631546 LongArray laCaches = null;
3154731547 PersistentStore[] aStore = new PersistentStore[] {ensureOpenPersistentStore(), storeEvents};
@@ -31560,7 +31560,7 @@ public boolean ensurePersistentExtent(long lExtentId)
3156031560 }
3156131561 }
3156231562
31563- listExtents .remove(lExtentId);
31563+ setExtents .remove(lExtentId);
3156431564 }
3156531565 }
3156631566
@@ -31610,8 +31610,8 @@ public void preparePersistentBackupExtents()
3161031610 // import com.tangosol.util.LongArray;
3161131611 // import com.tangosol.util.LongArray$Iterator as com.tangosol.util.LongArray.Iterator;
3161231612
31613- LongArray laCaches = ((PartitionedCache) get_Module()).getPersistentCacheIds();
31614- CopyOnWriteLongList listExtents = getPersistentBackupExtents();
31613+ LongArray laCaches = ((PartitionedCache) get_Module()).getPersistentCacheIds();
31614+ CopyOnWriteArraySet<Long> setExtents = getPersistentBackupExtents();
3161531615
3161631616 // need to "ensure" all of the cache-ids
3161731617 for (com.tangosol.util.LongArray.Iterator iter = laCaches.iterator(); iter.hasNext(); )
@@ -31620,7 +31620,7 @@ public void preparePersistentBackupExtents()
3162031620
3162131621 long lCacheId = iter.getIndex();
3162231622
31623- listExtents .add(lCacheId);
31623+ setExtents .add(lCacheId);
3162431624 }
3162531625 }
3162631626
@@ -31678,9 +31678,9 @@ public void preparePersistentExtents(com.tangosol.util.LongArray laExtentsExclud
3167831678 // import com.tangosol.util.LongArray;
3167931679 // import com.tangosol.util.LongArray$Iterator as com.tangosol.util.LongArray.Iterator;
3168031680
31681- LongArray laCaches = ((PartitionedCache) get_Module()).getPersistentCacheIds();
31682- CopyOnWriteLongList listExtents = getPersistentExtents();
31683-
31681+ LongArray laCaches = ((PartitionedCache) get_Module()).getPersistentCacheIds();
31682+ CopyOnWriteArraySet<Long> setExtents = getPersistentExtents();
31683+
3168431684 // need to "ensure" all of the cache-ids outside of the excludes
3168531685 for (com.tangosol.util.LongArray.Iterator iter = laCaches.iterator(); iter.hasNext(); )
3168631686 {
@@ -31691,7 +31691,7 @@ public void preparePersistentExtents(com.tangosol.util.LongArray laExtentsExclud
3169131691 if (laExtentsExclude == null ||
3169231692 !laExtentsExclude.exists(lCacheId))
3169331693 {
31694- listExtents .add(lCacheId);
31694+ setExtents .add(lCacheId);
3169531695 }
3169631696 }
3169731697 }
0 commit comments