Skip to content

Commit

Permalink
Removed ArrayMap and replaced it with HashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Koval committed Feb 19, 2018
1 parent 899d917 commit 33d2032
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 545 deletions.
Expand Up @@ -20,17 +20,18 @@
package org.neo4j.kernel.impl.locking.community;

import java.time.Clock;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map;

import org.neo4j.helpers.MathUtil;
import org.neo4j.kernel.DeadlockDetectedException;
import org.neo4j.kernel.impl.locking.LockAcquisitionTimeoutException;
import org.neo4j.kernel.impl.locking.LockTracer;
import org.neo4j.kernel.impl.locking.LockType;
import org.neo4j.kernel.impl.locking.LockWaitEvent;
import org.neo4j.kernel.impl.util.ArrayMap;
import org.neo4j.logging.Logger;

import static java.lang.Thread.currentThread;
Expand Down Expand Up @@ -68,7 +69,7 @@ class RWLock
{
private final LockResource resource; // the resource this RWLock locks
private final LinkedList<LockRequest> waitingThreadList = new LinkedList<>();
private final ArrayMap<Object,TxLockElement> txLockElementMap = new ArrayMap<>( (byte) 5, false, true );
private final Map<Object, TxLockElement> txLockElementMap = new HashMap<>();
private final RagManager ragManager;
private final Clock clock;
private final long lockAcquisitionTimeoutMillis;
Expand Down
Expand Up @@ -28,7 +28,6 @@
import java.util.Map;

import org.neo4j.kernel.DeadlockDetectedException;
import org.neo4j.kernel.impl.util.ArrayMap;

/**
* The Resource Allocation Graph manager is used for deadlock detection. It
Expand Down Expand Up @@ -69,9 +68,7 @@ public class RagManager
// stopWaitOn( resource ) method must be invoked

private final Map<Object,List<Object>> resourceMap = new HashMap<>();

private final ArrayMap<Object,Object> waitingTxMap =
new ArrayMap<>( (byte) 5, false, true );
private final Map<Object, Object> waitingTxMap = new HashMap<>();

synchronized void lockAcquired( Object resource, Object tx )
{
Expand Down

This file was deleted.

0 comments on commit 33d2032

Please sign in to comment.