Skip to content

Commit

Permalink
Merge branch '2.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed Dec 8, 2015
2 parents 842ff2e + d1fc85f commit ad7cbed
Show file tree
Hide file tree
Showing 186 changed files with 7,368 additions and 4,340 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<property environment="env"/>
<property name="vendor" value="Orient Technologies Ltd"/>
<property name="product" value="OrientDB"/>
<property name="version" value="2.1.6"/>
<property name="version" value="2.1.7"/>
<condition property="community.release" value="${releaseHome}/orientdb-community-${version}"
else="../releases/orientdb-community-${version}">
<isset property="releaseHome"/>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>2.1.6</version>
<version>2.1.7</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,7 @@ public void commit(final OTransaction iTx, Runnable callback) {
handleDBFreeze();
} catch (Exception e) {
handleException(network, "Error on commit", e);
iTx.restore();

} finally {
OStorageRemoteThreadLocal.INSTANCE.get().commandExecuting = false;
Expand Down Expand Up @@ -1659,21 +1660,22 @@ public void updateClusterConfiguration(final String iConnectedURL, final byte[]
// TEMPORARY FIX: DISTRIBUTED MODE DOESN'T SUPPORT TREE BONSAI, KEEP ALWAYS EMBEDDED RIDS
OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD.setValue(Integer.MAX_VALUE);

// UPDATE IT
synchronized (serverURLs) {
final List<ODocument> members;
synchronized (clusterConfiguration) {
clusterConfiguration.fromStream(obj);

clusterConfiguration.toString();
members = clusterConfiguration.field("members");
}

// UPDATE IT
synchronized (serverURLs) {

final List<ODocument> members = clusterConfiguration.field("members");
if (members != null) {
serverURLs.clear();

// ADD CURRENT SERVER AS FIRST
addHost(iConnectedURL);

// parseServerURLs();

for (ODocument m : members)
if (m != null && !serverURLs.contains((String) m.field("name"))) {
final Collection<Map<String, Object>> listeners = ((Collection<Map<String, Object>>) m.field("listeners"));
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>2.1.6</version>
<version>2.1.7</version>
<relativePath>../</relativePath>
</parent>

Expand Down
21 changes: 5 additions & 16 deletions core/src/main/grammar/OrientSQL.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -1010,25 +1010,14 @@ ODeleteEdgeStatement DeleteEdgeWhereStatement():
}

OUpdateStatement UpdateStatement():
{ OUpdateOperations lastOperations; }
{
OUpdateOperations lastOperations;
ORid lastRid;
}
{
(
<UPDATE>
(
jjtThis.targetRid = Rid()
|
jjtThis.targetClass = Identifier()
|
jjtThis.targetCluster = Cluster()
|
jjtThis.targetIndex = IndexIdentifier()
|
(
<LPAREN>
jjtThis.targetQuery = QueryStatement()
<RPAREN>
)
)
jjtThis.target = FromClause()
( lastOperations = UpdateOperations() { jjtThis.operations.add(lastOperations); } )+
[ <UPSERT> { jjtThis.upsert = true; } ]
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,20 @@
* @author Andrey Lomakin (a.lomakin-at-orientechnologies.com)
* @since 8/18/14
*/
public class OReadersWriterSpinLock extends AbstractOwnableSynchronizer implements OOrientStartupListener, OOrientShutdownListener {
private final ODistributedCounter distributedCounter = new ODistributedCounter();
public class OReadersWriterSpinLock extends AbstractOwnableSynchronizer {
private final ODistributedCounter distributedCounter = new ODistributedCounter();

private final AtomicReference<WNode> tail = new AtomicReference<WNode>();
private volatile ThreadLocal<OModifiableInteger> lockHolds = new InitOModifiableInteger();
private final AtomicReference<WNode> tail = new AtomicReference<WNode>();
private final ThreadLocal<OModifiableInteger> lockHolds = new InitOModifiableInteger();

private volatile ThreadLocal<WNode> myNode = new InitWNode();
private volatile ThreadLocal<WNode> predNode = new ThreadLocal<WNode>();
private final ThreadLocal<WNode> myNode = new InitWNode();
private final ThreadLocal<WNode> predNode = new ThreadLocal<WNode>();

public OReadersWriterSpinLock() {
final WNode wNode = new WNode();
wNode.locked = false;

tail.set(wNode);

Orient.instance().registerWeakOrientStartupListener(this);
Orient.instance().registerWeakOrientShutdownListener(this);
}

public void acquireReadLock() {
Expand Down Expand Up @@ -169,26 +166,6 @@ public void releaseWriteLock() {
assert lHolds.intValue() == 0;
}

@Override
public void onShutdown() {
lockHolds = null;
myNode = null;
predNode = null;
}

@Override
public void onStartup() {
if (lockHolds == null)
lockHolds = new InitOModifiableInteger();

if (myNode == null)
myNode = new InitWNode();

if (predNode == null)
predNode = new ThreadLocal<WNode>();

}

private static final class InitWNode extends ThreadLocal<WNode> {
@Override
protected WNode initialValue() {
Expand All @@ -206,7 +183,7 @@ protected OModifiableInteger initialValue() {
private final static class WNode {
private final Queue<Thread> waitingReaders = new ConcurrentLinkedQueue<Thread>();

private volatile boolean locked = true;
private volatile Thread waitingWriter;
private volatile boolean locked = true;
private volatile Thread waitingWriter;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.orientechnologies.common.directmemory;

/**
* @author Andrey Lomakin <lomakin.andrey@gmail.com>.
* @since 9/8/2015
*/
public interface ODirectMemoryMXBean {
long getSize();

long getSizeInKB();

long getSizeInMB();

long getSizeInGB();
}

0 comments on commit ad7cbed

Please sign in to comment.