Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:orientechnologies/orientdb into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
wolf4ood committed Sep 4, 2015
2 parents 69bebf7 + 01f2afd commit 1f4fee4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
4 changes: 3 additions & 1 deletion core/src/main/java/com/orientechnologies/common/concur/lock/OModificationLock.java 100644 → 100755
Expand Up @@ -97,7 +97,9 @@ public void prohibitModifications() {
public void prohibitModifications(boolean throwException) {
lock.acquireWriteLock();
try {
this.throwException = throwException;
if (vetos.get() == 0)
this.throwException = throwException;

vetos.incrementAndGet();
} finally {
lock.releaseWriteLock();
Expand Down
Expand Up @@ -2137,10 +2137,6 @@ public void freeze(final boolean throwException) {
final long startTime = Orient.instance().getProfiler().startChrono();

final Collection<? extends OIndex<?>> indexes = getMetadata().getIndexManager().getIndexes();
final List<OIndexAbstract<?>> indexesToLock = prepareIndexesToFreeze(indexes);

flushIndexes(indexesToLock);

final OFreezableStorage storage = getFreezableStorage();
if (storage != null) {
storage.freeze(throwException);
Expand All @@ -2165,11 +2161,6 @@ public void freeze() {

final long startTime = Orient.instance().getProfiler().startChrono();

final Collection<? extends OIndex<?>> indexes = getMetadata().getIndexManager().getIndexes();
final List<OIndexAbstract<?>> indexesToLock = prepareIndexesToFreeze(indexes);

flushIndexes(indexesToLock);

final OFreezableStorage storage = getFreezableStorage();
if (storage != null) {
storage.freeze(false);
Expand Down Expand Up @@ -3011,24 +3002,6 @@ private void flushIndexes(final List<OIndexAbstract<?>> indexesToFlush) {
}
}

private List<OIndexAbstract<?>> prepareIndexesToFreeze(final Collection<? extends OIndex<?>> indexes) {
List<OIndexAbstract<?>> indexesToFreeze = null;
if (indexes != null && !indexes.isEmpty()) {
indexesToFreeze = new ArrayList<OIndexAbstract<?>>(indexes.size());
for (OIndex<?> index : indexes) {
indexesToFreeze.add((OIndexAbstract<?>) index.getInternal());
}

Collections.sort(indexesToFreeze, new Comparator<OIndex<?>>() {
public int compare(OIndex<?> o1, OIndex<?> o2) {
return o1.getName().compareTo(o2.getName());
}
});

}
return indexesToFreeze;
}

/**
* @Internal
*/
Expand Down

0 comments on commit 1f4fee4

Please sign in to comment.