Skip to content

Commit

Permalink
ISPN-4139 Upgrade Lucene 4 Infinispan Directory to Lucene 4.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne authored and pruivo committed Mar 21, 2014
1 parent b9938de commit f3d17e7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Two different _LockFactory_ implementations are provided to guarantee only one _
Javadoc: link:$$http://docs.jboss.org/infinispan/6.0/apidocs/org/infinispan/lucene/InfinispanDirectory.html$$[] Issue tracker: link:$$https://jira.jboss.org/browse/ISPN/component/12312732$$[] Source code: link:$$http://www.jboss.org/infinispan/sourcecode.html$$[]

=== Lucene compatibility
The current version was developed and compiled against both _Lucene 3.6.2_ and _Lucene 4.3.0_ (separately and then assembled in a single jar for your convenience as most code is shared). It is also regularly tested to work with Lucene versions from 3.0.x to 3.5.0, version 2.9.x, the older 2.4.1 and newer version 4.0, 4.1, 4.2.
The current version was developed and compiled against both _Lucene 3.6.2_ and _Lucene 4.7.0_ (separately and then assembled in a single jar for your convenience as most code is shared). It is also regularly tested to work with Lucene versions from 3.0.x to 3.5.0, version 2.9.x, the older 2.4.1 and newer versions 4.0 to 4.7.

=== How to use it
To create a Directory instance:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.infinispan.lucene.locking;

import java.io.Closeable;
import org.apache.lucene.store.Lock;
import org.infinispan.Cache;
import org.infinispan.context.Flag;
Expand All @@ -17,7 +18,7 @@
* @see org.apache.lucene.store.Lock
*/
@SuppressWarnings("unchecked")
class BaseLuceneLock extends Lock {
class BaseLuceneLock extends Lock implements Closeable {

private static final Log log = LogFactory.getLog(BaseLuceneLock.class);

Expand Down Expand Up @@ -77,4 +78,12 @@ public boolean isLocked() {
return locked;
}

/**
* Since Lucene 4.7, method release() was renamed to close()
*/
@Override
public void close() {
clearLock();
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.infinispan.lucene.locking;

import java.io.Closeable;
import java.io.IOException;

import javax.transaction.Transaction;
Expand All @@ -24,7 +25,7 @@
* @see org.apache.lucene.store.Lock
*/
@SuppressWarnings("unchecked")
class TransactionalSharedLuceneLock extends Lock {
class TransactionalSharedLuceneLock extends Lock implements Closeable {

private static final Log log = LogFactory.getLog(TransactionalSharedLuceneLock.class, Log.class);

Expand Down Expand Up @@ -180,4 +181,12 @@ public void clearLockSuspending() {
}
}

/**
* Since Lucene 4.7, method release() was renamed to close()
*/
@Override
public void close() throws IOException {
release();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void testLuceneIndexLocking(final String writeLockProvider) throws IOExce
assert ! anotherLock.isLocked();
assert ! luceneLockA.obtain();
assert ! luceneLockB.obtain();
luceneLockA.release();
luceneLockA.close();
assert ! luceneLockB.isLocked();
assert luceneLockB.obtain();
lockManagerA.clearLock(writeLockProvider);
Expand Down
2 changes: 1 addition & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<version.leveldbjni>1.7</version.leveldbjni>
<version.log4j>1.2.16</version.log4j>
<version.lucene.v3>3.6.2</version.lucene.v3>
<version.lucene.v4>4.6.1</version.lucene.v4>
<version.lucene.v4>4.7.0</version.lucene.v4>
<version.mc4j>1.2.6</version.mc4j>
<version.milyn.smooks>1.2.2</version.milyn.smooks>
<version.mockito>1.9.5</version.mockito>
Expand Down

0 comments on commit f3d17e7

Please sign in to comment.