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 Oct 4, 2015
2 parents f0aff7e + ef14cd0 commit edc6fc6
Show file tree
Hide file tree
Showing 118 changed files with 4,216 additions and 3,338 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.2"/>
<property name="version" value="2.1.3"/>
<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.2</version>
<version>2.1.3</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,6 @@ public int getId() {
public void synch() throws IOException {
}

public void setSoftlyClosed(boolean softlyClosed) throws IOException {
}

@Override
public boolean wasSoftlyClosed() throws IOException {
return true;
}

public String getName() {
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@
*/
package com.orientechnologies.orient.client.remote;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;

import com.orientechnologies.common.concur.lock.OModificationOperationProhibitedException;
import com.orientechnologies.common.exception.OException;
import com.orientechnologies.common.io.OIOException;
Expand Down Expand Up @@ -76,21 +92,6 @@
import com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol;
import com.orientechnologies.orient.enterprise.channel.binary.ORemoteServerEventListener;

import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

/**
* This object is bound to each remote ODatabase instances.
*/
Expand Down Expand Up @@ -1633,8 +1634,18 @@ public void endRequest(final OChannelBinaryAsynchClient iNetwork) throws IOExcep
* End response reached: release the channel in the pool to being reused
*/
public void endResponse(final OChannelBinaryAsynchClient iNetwork) {
iNetwork.endResponse();
engine.getConnectionManager().release(iNetwork);
try {
iNetwork.endResponse();
engine.getConnectionManager().release(iNetwork);
} catch (IOException e) {
engine.getConnectionManager().remove(iNetwork);
OLogManager.instance().warn(this, "dirty data left in the socket closing", e);
}
}

@Override
public boolean isRemote() {
return true;
}

public boolean isPermanentRequester() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ public OStorage getUnderlying() {
return delegate;
}

@Override
public boolean isRemote() {
return true;
}

public Set<String> getClusterNames() {
pushSession();
try {
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.2</version>
<version>2.1.3</version>
<relativePath>../</relativePath>
</parent>

Expand Down
167 changes: 14 additions & 153 deletions core/src/main/grammar/OrientSQL.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -481,158 +481,6 @@ OIdentifier Identifier():
token = <EXCEPTION>
|
quotedToken = <QUOTED_IDENTIFIER>
/*
(
//TODO REPLACE THIS WITH <QUOTED_IDENTIFIER>
<BACKTICK>
(
token = <IDENTIFIER>
|
token = <SELECT>
|
token = <TRAVERSE>
|
token = <INSERT>
|
token = <CREATE>
|
token = <DELETE>
|
token = <VERTEX>
|
token = <EDGE>
|
token = <UPDATE>
|
token = <UPSERT>
|
token = <FROM>
|
token = <TO>
|
token = <WHERE>
|
token = <WHILE>
|
token = <INTO>
|
token = <VALUES>
|
token = <SET>
|
token = <ADD>
|
token = <PUT>
|
token = <MERGE>
|
token = <CONTENT>
|
token = <REMOVE>
|
token = <INCREMENT>
|
token = <AND>
|
token = <OR>
|
token = <NULL>
|
token = <DEFINED>
|
token = <ORDER>
|
token = <GROUP>
|
token = <BY>
|
token = <LIMIT>
|
token = <SKIP2>
|
token = <OFFSET>
|
token = <TIMEOUT>
|
token = <ASC>
|
token = <AS>
|
token = <DESC>
|
token = <FETCHPLAN>
|
token = <RETURN>
|
token = <BEFORE>
|
token = <AFTER>
|
token = <LOCK>
|
token = <RECORD>
|
token = <WAIT>
|
token = <RETRY>
|
token = <LET>
|
token = <NOCACHE>
|
token = <UNSAFE>
|
token = <PARALLEL>
|
token = <STRATEGY>
|
token = <DEPTH_FIRST>
|
token = <BREADTH_FIRST>
|
token = <LUCENE>
|
token = <NEAR>
|
token = <WITHIN>
|
token = <UNWIND>
|
token = <MAXDEPTH>
|
token = <NOT>
|
token = <IN>
|
token = <LIKE>
|
token = <IS>
|
token = <BETWEEN>
|
token = <CONTAINS>
|
token = <CONTAINSALL>
|
token = <CONTAINSKEY>
|
token = <CONTAINSVALUE>
|
token = <CONTAINSTEXT>
|
token = <MATCHES>
|
token = <KEY>
|
token = <INSTANCEOF>
|
token = <CLUSTER>
|
token = <EXCEPTION>
)
<BACKTICK>
)
*/
) {

if(token!=null){
Expand Down Expand Up @@ -1521,6 +1369,7 @@ OCreateEdgeStatement CreateEdgeStatement():
[ jjtThis.body = InsertBody() ]
[ jjtThis.retry = Retry() ]
[ jjtThis.wait = Wait() ]
[ jjtThis.batch = Batch() ]
) {return jjtThis;}
}

Expand Down Expand Up @@ -1890,7 +1739,15 @@ OMathExpression ParenthesisExpression():
{}
{
(
<LPAREN> ( jjtThis.expression = Expression() | jjtThis.statement = SelectStatement() ) <RPAREN>
<LPAREN>
(
jjtThis.expression = Expression()
|
jjtThis.statement = SelectStatement()
|
jjtThis.statement = InsertStatement()
)
<RPAREN>
)
{return jjtThis;}
}
Expand Down Expand Up @@ -2866,6 +2723,8 @@ OJson Json():
(
lastItem.leftIdentifier = Identifier()
|
token = <RECORD_ATTRIBUTE> {lastItem.leftString = token.image; }
|
token = <STRING_LITERAL> { lastItem.leftString = token.image.substring(1, token.image.length() - 1); }
|
token = <CHARACTER_LITERAL> { lastItem.leftString = token.image.substring(1, token.image.length() - 1); }
Expand All @@ -2878,6 +2737,8 @@ OJson Json():
(
lastItem.leftIdentifier = Identifier()
|
token = <RECORD_ATTRIBUTE> {lastItem.leftString = token.image; }
|
token = <STRING_LITERAL> { lastItem.leftString = token.image.substring(1, token.image.length() - 1); }
|
token = <CHARACTER_LITERAL> { lastItem.leftString = token.image.substring(1, token.image.length() - 1); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.db.record.ridbag.ORidBag;
import com.orientechnologies.orient.core.iterator.OLazyWrapperIterator;
import com.orientechnologies.orient.core.record.impl.ODocument;

import java.lang.reflect.Array;
import java.util.ArrayList;
Expand All @@ -34,6 +35,7 @@
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;

/**
* Iterator that allow to iterate against multiple collection of elements.
Expand Down Expand Up @@ -176,7 +178,7 @@ public boolean supportsFastContains() {
final Object o = sources.get(i);

if (o != null) {
if (o instanceof Collection<?> || o instanceof ORidBag) {
if (o instanceof Set<?> || o instanceof ORidBag) {
// OK
} else if (o instanceof OLazyWrapperIterator) {
if (!((OLazyWrapperIterator) o).canUseMultiValueDirectly())
Expand Down Expand Up @@ -220,7 +222,7 @@ protected boolean getNextPartial() {
Object next = sourcesIterator.next();
if (next != null) {

if (next instanceof Iterable<?>)
if (!(next instanceof ODocument) && next instanceof Iterable<?>)
next = ((Iterable) next).iterator();

if (next instanceof OAutoConvertToRecord)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,10 @@ public int size() {
} else
coll = (OCollection<Object>) iObject;

if (isMultiValue(iToAdd)) {
if (!(iToAdd instanceof Map) && isMultiValue(iToAdd)) {
// COLLECTION - COLLECTION
for (Object o : getMultiValueIterable(iToAdd)) {
if (isMultiValue(o))
if (!(o instanceof Map) && isMultiValue(o))
add(coll, o);
else
coll.add(o);
Expand All @@ -400,7 +400,7 @@ else if (iToAdd != null && iToAdd.getClass().isArray()) {
// ARRAY - COLLECTION
for (int i = 0; i < Array.getLength(iToAdd); ++i) {
Object o = Array.get(iToAdd, i);
if (isMultiValue(o))
if (!(o instanceof Map) && isMultiValue(o))
add(coll, o);
else
coll.add(o);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ protected String parseOptionalWord(final boolean iUpperCase, final String... iWo
throwSyntaxErrorException("Found unexpected keyword '" + parserLastWord + "' while it was expected '"
+ Arrays.toString(iWords) + "'");
}

if (parserLastWord.length() > 1 && parserLastWord.charAt(0) == '`' && parserLastWord.charAt(parserLastWord.length() - 1) == '`') {
return parserLastWord.substring(1, parserLastWord.length() - 1);
}

return parserLastWord.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package com.orientechnologies.orient.core;

public class OConstants {
public static final String ORIENT_VERSION = "2.1.2";
public static final String ORIENT_VERSION = "2.1.3";

public static final String ORIENT_URL = "www.orientdb.com";
public static final String COPYRIGHT = "Copyrights (c) 2015 Orient Technologies LTD";
Expand Down
Loading

0 comments on commit edc6fc6

Please sign in to comment.