Skip to content

Commit

Permalink
Added DeferringLocks and added naive and stupid what to bypass them
Browse files Browse the repository at this point in the history
in LockingStatementOperations. Play nice.

 Please enter the commit message for your changes. Lines starting
  • Loading branch information
burqen authored and lutovich committed Jul 21, 2016
1 parent 8b330d1 commit 76818f0
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 48 deletions.

Large diffs are not rendered by default.

Expand Up @@ -180,5 +180,11 @@ public int getLockSessionId()
{
return clientDelegate.getLockSessionId();
}

@Override
public Client delegate()
{
return clientDelegate;
}
}
}
Expand Up @@ -117,6 +117,9 @@ interface Client extends AutoCloseable

/** For slave transactions, this tracks an identifier for the lock session running on the master */
int getLockSessionId();

/** Get a potential delegate */
Client delegate();
}

/**
Expand Down
Expand Up @@ -78,4 +78,10 @@ public int getLockSessionId()
{
return -1;
}

@Override
public Locks.Client delegate()
{
return this;
}
}
Expand Up @@ -306,6 +306,12 @@ public int getLockSessionId()
return lockTransaction.getId();
}

@Override
public Locks.Client delegate()
{
return this;
}

private PrimitiveLongObjectMap<LockResource> localShared( Locks.ResourceType resourceType )
{
PrimitiveLongObjectMap<LockResource> map = sharedLocks.get( resourceType.typeId() );
Expand Down
Expand Up @@ -294,6 +294,12 @@ private void endLockSessionOnMaster( boolean success )
}
}

@Override
public Locks.Client delegate()
{
return client;
}

private boolean getReadLockOnMaster( Locks.ResourceType resourceType, long resourceId )
{
if ( resourceType == ResourceTypes.NODE
Expand Down
Expand Up @@ -574,6 +574,12 @@ public int getLockSessionId()
return clientId;
}

@Override
public Locks.Client delegate()
{
return this;
}

public int waitListSize()
{
return waitList.size();
Expand Down

0 comments on commit 76818f0

Please sign in to comment.