Skip to content

Commit fb32ec3

Browse files
committed
Merged branch 1.4.1
2 parents 046f38a + 98dc361 commit fb32ec3

39 files changed

Lines changed: 308 additions & 176 deletions

File tree

build.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,9 @@ protected ODocument sendRequest(final byte iRequest, final ODocument iPayLoad, f
671671
storage.endRequest(network);
672672
}
673673

674-
storage.beginResponse(network);
675674
retry = false;
676675
try {
676+
storage.beginResponse(network);
677677
return new ODocument(network.readBytes());
678678
} finally {
679679
storage.endResponse(network);

client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,7 @@ protected void openRemoteDatabase() throws IOException {
16231623
}
16241624

16251625
// CHECK AGAIN IF THERE ARE FREE CHANNELS
1626+
createConnectionPool();
16261627
synchronized (networkPool) {
16271628
availableConnections = !networkPool.isEmpty();
16281629
}
@@ -1929,7 +1930,7 @@ public void updateClusterConfiguration(final byte[] obj) {
19291930

19301931
final List<ODocument> members = clusterConfiguration.field("members");
19311932
if (members != null) {
1932-
// serverURLs.clear();
1933+
serverURLs.clear();
19331934

19341935
for (ODocument m : members)
19351936
if (m != null && !serverURLs.contains((String) m.field("id"))) {

core/src/main/java/com/orientechnologies/orient/core/Orient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ public void shutdown() {
329329
if (listeners != null)
330330
listeners.clear();
331331

332+
timer.cancel();
333+
332334
OLogManager.instance().info(this, "Orient Engine shutdown complete\n");
333335

334336
} finally {

core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public void change(final Object iCurrentValue, final Object iNewValue) {
212212
MVRBTREE_OPTIMIZE_THRESHOLD(
213213
"mvrbtree.optimizeThreshold",
214214
"Auto optimize the TreeMap every X tree rotations. This forces the optimization of the tree after many changes to recompute entry points. -1 means never",
215-
Integer.class, 10000),
215+
Integer.class, 100000),
216216

217217
MVRBTREE_ENTRYPOINTS("mvrbtree.entryPoints", "Number of entry points to start searching entries", Integer.class, 64),
218218

core/src/main/java/com/orientechnologies/orient/core/db/raw/ODatabaseRaw.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -722,25 +722,25 @@ public void setCustomInternal(final String iName, final String iValue) {
722722
// CREATE A NEW ONE
723723
storage.getConfiguration().properties.add(new OStorageEntryConfiguration(iName, iValue));
724724
}
725-
725+
726726
storage.getConfiguration().update();
727727
}
728728

729729
public void clearCustomInternal() {
730730
storage.getConfiguration().properties = null;
731731
}
732732

733-
public <V> V callInLock(Callable<V> iCallable, boolean iExclusiveLock) {
733+
public <V> V callInLock(final Callable<V> iCallable, final boolean iExclusiveLock) {
734734
return storage.callInLock(iCallable, iExclusiveLock);
735735
}
736736

737737
@Override
738-
public <V> V callInRecordLock(Callable<V> iCallable, ORID rid, boolean iExclusiveLock) {
738+
public <V> V callInRecordLock(final Callable<V> iCallable, final ORID rid, final boolean iExclusiveLock) {
739739
return storage.callInRecordLock(iCallable, rid, iExclusiveLock);
740740
}
741741

742742
@Override
743-
public ORecordMetadata getRecordMetadata(ORID rid) {
743+
public ORecordMetadata getRecordMetadata(final ORID rid) {
744744
return storage.getRecordMetadata(rid);
745745
}
746746

@@ -758,7 +758,7 @@ public void callOnCloseListeners() {
758758
}
759759
}
760760

761-
protected boolean isClusterBoundedToClass(int iClusterId) {
761+
protected boolean isClusterBoundedToClass(final int iClusterId) {
762762
return false;
763763
}
764764

@@ -778,7 +778,7 @@ public void freeze() {
778778
storage.freeze(false);
779779
}
780780

781-
public void freeze(boolean throwException) {
781+
public void freeze(final boolean throwException) {
782782
final OStorageLocalAbstract storage;
783783
if (getStorage() instanceof OStorageLocalAbstract)
784784
storage = ((OStorageLocalAbstract) getStorage());
@@ -803,12 +803,12 @@ public void release() {
803803
}
804804

805805
@Override
806-
public void freezeCluster(int iClusterId) {
806+
public void freezeCluster(final int iClusterId) {
807807
freezeCluster(iClusterId, false);
808808
}
809809

810810
@Override
811-
public void releaseCluster(int iClusterId) {
811+
public void releaseCluster(final int iClusterId) {
812812
final OLocalPaginatedStorage storage;
813813
if (getStorage() instanceof OLocalPaginatedStorage)
814814
storage = ((OLocalPaginatedStorage) getStorage());
@@ -821,7 +821,7 @@ public void releaseCluster(int iClusterId) {
821821
}
822822

823823
@Override
824-
public void freezeCluster(int iClusterId, boolean throwException) {
824+
public void freezeCluster(final int iClusterId, final boolean throwException) {
825825
if (getStorage() instanceof OLocalPaginatedStorage) {
826826
final OLocalPaginatedStorage paginatedStorage = ((OLocalPaginatedStorage) getStorage());
827827
paginatedStorage.freeze(throwException, iClusterId);

core/src/main/java/com/orientechnologies/orient/core/index/OIndexMVRBTreeAbstract.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ public long rebuild(final OProgressListener iProgressListener) {
473473
}
474474

475475
lazySave();
476+
unload();
476477

477478
if (iProgressListener != null)
478479
iProgressListener.onCompletition(this, true);
@@ -917,6 +918,7 @@ public void onClose(final ODatabase iDatabase) {
917918
try {
918919

919920
map.commitChanges(true);
921+
map.unload();
920922
Orient.instance().getMemoryWatchDog().removeListener(watchDog);
921923

922924
} finally {
@@ -988,7 +990,12 @@ public void acquireModificationLock() {
988990
}
989991

990992
public void releaseModificationLock() {
991-
modificationLock.releaseModificationLock();
993+
try {
994+
modificationLock.releaseModificationLock();
995+
} catch (IllegalMonitorStateException e) {
996+
OLogManager.instance().error(this, "Error on releasing index lock against %s", e, getName());
997+
throw e;
998+
}
992999
}
9931000

9941001
@Override

core/src/main/java/com/orientechnologies/orient/core/index/OIndexManagerShared.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public void run() {
253253

254254
final int clusterId = newDb.getStorage().getClusterIdByName(OMetadata.CLUSTER_INDEX_NAME);
255255
if (clusterId > -1)
256-
newDb.getStorage().dropCluster(clusterId, false);
256+
newDb.dropCluster(clusterId, false);
257257

258258
newDb.addDataSegment(OMetadata.DATASEGMENT_INDEX_NAME, null);
259259
newDb.getStorage().addCluster(OClusterLocal.TYPE, OMetadata.CLUSTER_INDEX_NAME, null,

core/src/main/java/com/orientechnologies/orient/core/index/OIndexRebuildOutputListener.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ public OIndexRebuildOutputListener(final OIndex<?> idx) {
3838
public void onBegin(final Object iTask, final long iTotal) {
3939
startTime = System.currentTimeMillis();
4040
lastDump = startTime;
41-
OLogManager.instance().debug(idx, "- Building index %s...", idx.getName());
41+
OLogManager.instance().debug(this, "- Building index %s...", idx.getName());
4242
}
4343

4444
@Override
4545
public boolean onProgress(final Object iTask, final long iCounter, final float iPercent) {
4646
final long now = System.currentTimeMillis();
4747
if (now - lastDump > 10000) {
4848
// DUMP EVERY 5 SECONDS FOR LARGE INDEXES
49-
OLogManager.instance().debug(idx, "--> %3.2f%% progress, %,d indexed so far (%,d items/sec)", iPercent, iCounter,
49+
OLogManager.instance().debug(this, "--> %3.2f%% progress, %,d indexed so far (%,d items/sec)", iPercent, iCounter,
5050
((iCounter - lastCounter) / 10));
5151
lastDump = now;
5252
lastCounter = iCounter;
@@ -56,7 +56,7 @@ public boolean onProgress(final Object iTask, final long iCounter, final float i
5656

5757
@Override
5858
public void onCompletition(final Object iTask, final boolean iSucceed) {
59-
OLogManager.instance().debug(idx, "--> OK, indexed %,d items in %,d ms", idx.getSize(),
59+
OLogManager.instance().debug(this, "--> OK, indexed %,d items in %,d ms", idx.getSize(),
6060
(System.currentTimeMillis() - startTime));
6161
}
6262
}

core/src/main/java/com/orientechnologies/orient/core/record/impl/ODocumentHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ else if (function.startsWith("ASDATETIME("))
678678
// EXTRACT ARGUMENTS
679679
final List<String> args = OStringSerializerHelper.getParameters(iFunction.substring(iFunction.indexOf('(')));
680680

681-
final ORecordInternal<?> currentRecord = (ORecordInternal<?>) iContext.getVariable("$current");
681+
final ORecordInternal<?> currentRecord = iContext != null ? (ORecordInternal<?>) iContext.getVariable("$current") : null;
682682
for (int i = 0; i < args.size(); ++i) {
683683
final String arg = args.get(i);
684684
final Object o = OSQLHelper.getValue(arg, currentRecord, iContext);

0 commit comments

Comments
 (0)