Skip to content

Commit

Permalink
Merge branch 'hotfix-1.6.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed Dec 28, 2013
2 parents 24be347 + e7289dc commit dd92677
Show file tree
Hide file tree
Showing 117 changed files with 2,149 additions and 3,094 deletions.
8 changes: 4 additions & 4 deletions 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="NuvolaBase Ltd"/>
<property name="product" value="OrientDB"/>
<property name="version" value="1.6.2"/>
<property name="version" value="1.6.3"/>
<condition property="community.release" value="${releaseHome}/orientdb-community-${version}"
else="../releases/orientdb-community-${version}">
<isset property="releaseHome"/>
Expand Down Expand Up @@ -179,9 +179,9 @@
</copy>

<delete dir="${community.release}/databases"/>
<java fork="true" dir="graphdb" classname="com.orientechnologies.orient.graph.blueprints.TestLoadGraph">
<java fork="true" dir="graphdb" classname="com.orientechnologies.orient.graph.blueprints.TestLoadGraph">
<classpath>
<fileset dir="${community.release}/lib" includes="*.jar"/>
<fileset dir="${community.release}/lib" includes="*.jar"/>
</classpath>
</java>

Expand Down Expand Up @@ -265,7 +265,7 @@
<tarfileset dir="../releases/orientdb-community-${version}" mode="755">
<include name="**/*.sh"/>
</tarfileset>
</tar>
</tar>
</target>

</project>
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>1.6.2</version>
<version>1.6.3</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,10 +911,8 @@ public Object command(final OCommandRequestText iCommand) {
do {

OStorageRemoteThreadLocal.INSTANCE.get().commandExecuting = true;
final OCommandRequestText aquery = iCommand;
try {

final OCommandRequestText aquery = iCommand;

final boolean asynch = iCommand instanceof OCommandRequestAsynch && ((OCommandRequestAsynch) iCommand).isAsynchronous();

try {
Expand All @@ -930,6 +928,7 @@ public Object command(final OCommandRequestText iCommand) {
try {
beginResponse(network);

boolean addNextRecord = true;
if (asynch) {
byte status;

Expand All @@ -942,19 +941,10 @@ public Object command(final OCommandRequestText iCommand) {
switch (status) {
case 1:
// PUT AS PART OF THE RESULT SET. INVOKE THE LISTENER
try {
if (!aquery.getResultListener().result(record)) {
// EMPTY THE INPUT CHANNEL
while (network.in.available() > 0)
network.in.read();

break;
}
} catch (Throwable t) {
// ABSORBE ALL THE USER EXCEPTIONS
t.printStackTrace();
if (addNextRecord) {
addNextRecord = aquery.getResultListener().result(record);
database.getLevel1Cache().updateRecord(record);
}
database.getLevel1Cache().updateRecord(record);
break;

case 2:
Expand Down Expand Up @@ -1010,20 +1000,19 @@ public Object command(final OCommandRequestText iCommand) {
}
break;
} finally {
if (aquery.getResultListener() != null) {
aquery.getResultListener().end();
}
endResponse(network);
}

} catch (OModificationOperationProhibitedException mope) {
handleDBFreeze();
} catch (Exception e) {
handleException(network, "Error on executing command: " + iCommand, e);

} finally {
OStorageRemoteThreadLocal.INSTANCE.get().commandExecuting = false;
}
if (aquery.getResultListener() != null) {
aquery.getResultListener().end();
}
}
} while (true);

return result;
Expand Down Expand Up @@ -1809,14 +1798,14 @@ private void removeDeadConnections() {
// FREE DEAD CONNECTIONS
int removedDeadConnections = 0;
for (OChannelBinaryAsynchClient n : new ArrayList<OChannelBinaryAsynchClient>(networkPool)) {
if (n != null && !n.isConnected()) //Fixed issue with removing of network connections though connection is active.
if (n != null && !n.isConnected()) // Fixed issue with removing of network connections though connection is active.
{
try {
n.close();
} catch (Exception e) {
}
networkPool.remove(n);
removedDeadConnections++;
networkPool.remove(n);
removedDeadConnections++;
}
}

Expand Down
6 changes: 4 additions & 2 deletions commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>1.6.2</version>
<version>1.6.3</version>
<relativePath>../</relativePath>
</parent>

Expand All @@ -34,7 +34,9 @@

<properties>
<osgi.export>com.orientechnologies.common.*</osgi.export>
<osgi.import>javax.imageio.spi.*,sun.misc.*;resolution:=optional</osgi.import>
<osgi.import>
javax.imageio.spi.*,sun.misc.*;resolution:=optional,com.orientechnologies.nio;resolution:=optional
</osgi.import>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public String nextCommand() {
}
}

final String result;
String result;
if (partialResult.length() > 0) {
if (end > 0) {
result = partialResult.append(buffer.subSequence(start, end + 1).toString()).toString();
Expand All @@ -107,7 +107,10 @@ public String nextCommand() {
result = partialResult.toString();
}
} else {
result = buffer.subSequence(start, end + 1).toString();
// DON'T PUT THIS ON ONE LINE ONLY BECAUSE WITH JDK6 subSequence() RETURNS A CHAR CharSequence while JDK7+ RETURNS
// CharBuffer
final CharSequence cs = buffer.subSequence(start, end + 1);
result = cs.toString();
}

buffer.position(buffer.position() + position);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ODirectMemoryFactory {
localDirectMemory = null;
else
localDirectMemory = (ODirectMemory) jnaClass.newInstance();
} catch (Exception e) {
} catch (Throwable e) {
// ignore
}

Expand All @@ -48,7 +48,7 @@ class ODirectMemoryFactory {
"Sun Unsafe direct memory implementation is going to be used, "
+ "this implementation is not stable so please use JNA version instead.");
}
} catch (Exception e) {
} catch (Throwable e) {
// ignore
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>1.6.2</version>
<version>1.6.3</version>
<relativePath>../</relativePath>
</parent>

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

public class OConstants {
public static final String ORIENT_VERSION = "1.6.2";
public static final String ORIENT_VERSION = "1.6.3";
public static final String ORIENT_URL = "www.orientechnologies.com";

public static String getVersion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public enum OGlobalConfiguration {
"Maximum size of WAL cache (in amount of WAL pages, each page is 64k) <= 0 means that caching will be switched off.",
Integer.class, 3000),

WAL_MAX_SEGMENT_SIZE("storage.wal.maxSegmentSize", "Maximum size of single WAL segment in megabytes.", Integer.class, 256),
WAL_MAX_SEGMENT_SIZE("storage.wal.maxSegmentSize", "Maximum size of single. WAL segment in megabytes.", Integer.class, 256),

WAL_MAX_SIZE("storage.wal.maxSize", "Maximum size of WAL on disk in megabytes.", Integer.class, 4 * 1024),

Expand All @@ -93,6 +93,13 @@ public enum OGlobalConfiguration {
WAL_FUZZY_CHECKPOINT_INTERVAL("storage.wal.fuzzyCheckpointInterval", "Interval between fuzzy checkpoints (in seconds)",
Integer.class, 2592000),

WAL_REPORT_AFTER_OPERATIONS_DURING_RESTORE(
"storage.wal.reportAfterOperationsDuringRestore",
"Amount of processed log operations, after which status of data restore procedure will be printed 0 or negative value, means that status will not be printed",
Integer.class, 10000),

WAL_READ_CACHE_SIZE("storage.wal.readCacheSize", "Size of WAL read cache in amount of pages", Integer.class, 1000),

WAL_FUZZY_CHECKPOINT_SHUTDOWN_TIMEOUT("storage.wal.fuzzyCheckpointShutdownWait",
"Interval which we should wait till shutdown (in seconds)", Integer.class, 60 * 10),

Expand Down
31 changes: 27 additions & 4 deletions ...in/java/com/orientechnologies/orient/core/db/record/ridset/sbtree/OIndexRIDContainer.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,30 @@ public class OIndexRIDContainer implements Set<OIdentifiable> {
private int bottomThreshold = 60;

public OIndexRIDContainer(String name) {
fileId = resolveFileIdByName(name + INDEX_FILE_EXTENSION);
underlying = new HashSet<OIdentifiable>();
isEmbedded = true;
}

public OIndexRIDContainer(String fileName, Set<OIdentifiable> underlying, boolean autoConvert) {
this.fileId = resolveFileIdByName(fileName + INDEX_FILE_EXTENSION);
this.underlying = underlying;
isEmbedded = !(underlying instanceof OIndexRIDContainerSBTree);
if (!autoConvert) {
assert !isEmbedded;
topThreshold = -1;
bottomThreshold = -1;
}
}

private long resolveFileIdByName(String fileName) {
final OStorageLocalAbstract storage = (OStorageLocalAbstract) ODatabaseRecordThreadLocal.INSTANCE.get().getStorage()
.getUnderlying();
try {
fileId = storage.getDiskCache().openFile(name + INDEX_FILE_EXTENSION);
return storage.getDiskCache().openFile(fileName);
} catch (IOException e) {
throw new OSBTreeException("Error creation of sbtree with name" + name, e);
throw new OSBTreeException("Error creation of sbtree with name" + fileName, e);
}
underlying = new HashSet<OIdentifiable>();
isEmbedded = true;
}

public OIndexRIDContainer(long fileId, Set<OIdentifiable> underlying) {
Expand Down Expand Up @@ -171,6 +186,14 @@ private void convertToEmbedded() {
isEmbedded = true;
}

/**
* If set is embedded convert it not embedded representation.
*/
public void checkNotEmbedded() {
if (isEmbedded)
convertToSbTree();
}

private void convertToSbTree() {
final OIndexRIDContainerSBTree tree = new OIndexRIDContainerSBTree(fileId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ public void delete() {
tree.delete();
}

public String getFileName() {
return tree.getFileName();
public String getName() {
return tree.getName();
}

private static class TreeKeyIterator implements Iterator<OIdentifiable> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author <a href="mailto:[email protected]">Artem Orobets</a>
*/
public class OSBTreeRIDSet implements Set<OIdentifiable>, OStringBuilderSerializable, ORecordLazyMultiValue {
private final long fileId;
private final long fileId;
private final OBonsaiBucketPointer rootPointer;
private ORecordInternal<?> owner;
private boolean autoConvertToRecord = true;
Expand Down Expand Up @@ -256,7 +256,7 @@ public static OSBTreeRIDSet fromStream(String stream, ORecordInternal<?> owner)
doc.fromString(stream);
final OBonsaiBucketPointer rootIndex = new OBonsaiBucketPointer((Long) doc.field("rootIndex"),
(Integer) doc.field("rootOffset"));
final long fileId = doc.field("fileId");
final long fileId = (Long) doc.field("fileId");

return new OSBTreeRIDSet(owner, fileId, rootIndex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,41 @@ public Long call() {
++differences;
}

final ODocument metadataOne = indexOne.getMetadata();
final ODocument metadataTwo = indexTwo.getMetadata();

if (metadataOne == null && metadataTwo != null) {
ok = false;
listener.onMessage("\n- ERR: Metadata for index " + indexOne.getName() + " for DB1 is null but for DB2 is not.");
listener.onMessage("\n");
++differences;
} else if (metadataOne != null && metadataTwo == null) {
ok = false;
listener.onMessage("\n- ERR: Metadata for index " + indexOne.getName() + " for DB1 is not null but for DB2 is null.");
listener.onMessage("\n");
++differences;
} else if (metadataOne != null && metadataTwo != null
&& !ODocumentHelper.hasSameContentOf(metadataOne, databaseDocumentTxOne, metadataTwo, databaseDocumentTxTwo, ridMapper)) {
ok = false;
listener.onMessage("\n- ERR: Metadata for index " + indexOne.getName() + " for DB1 and for DB2 are different.");
makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<Object>() {
@Override
public Object call() {
listener.onMessage("\n--- M1: " + metadataOne);
return null;
}
});
makeDbCall(databaseDocumentTxTwo, new ODbRelatedCall<Object>() {
@Override
public Object call() {
listener.onMessage("\n--- M2: " + metadataTwo);
return null;
}
});
listener.onMessage("\n");
++differences;
}

if (((compareEntriesForAutomaticIndexes && !indexOne.getType().equals("DICTIONARY")) || !indexOne.isAutomatic())) {
final Iterator<Map.Entry<Object, Object>> indexIteratorOne = makeDbCall(databaseDocumentTxOne,
new ODbRelatedCall<Iterator<Map.Entry<Object, Object>>>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
public class ODatabaseExport extends ODatabaseImpExpAbstract {
protected OJSONWriter writer;
protected long recordExported;
public static final int VERSION = 6;
public static final int VERSION = 7;

public ODatabaseExport(final ODatabaseRecord iDatabase, final String iFileName, final OCommandOutputListener iListener)
throws IOException {
Expand Down Expand Up @@ -339,6 +339,10 @@ private void exportIndexDefinitions() throws IOException {
writer.endObject(4, true);
}

ODocument metadata = index.getMetadata();
if (metadata != null)
writer.writeAttribute(4, true, "metadata", metadata);

writer.endObject(2, true);
listener.onMessage("OK");
}
Expand Down
Loading

0 comments on commit dd92677

Please sign in to comment.