Package org.apache.lucene.replicator
Interface Replicator
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
HttpReplicator
,LocalReplicator
@Deprecated public interface Replicator extends Closeable
Deprecated.use org.apache.lucene.replicator.nrt insteadAn interface for replicating files. Allows a producer topublish
Revision
s and consumers tocheck for updates
. When a client needs to be updated, it is given aSessionToken
through which it canobtain
the files of that revision. After the client has finished obtaining all the files, it shouldrelease
the given session, so that the files can be reclaimed if they are not needed anymore.A client is always updated to the newest revision available. That is, if a client is on revision r1 and revisions r2 and r3 were published, then when the cllient will next check for update, it will receive r3.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description SessionToken
checkForUpdate(String currVersion)
Deprecated.Check whether the given version is up-to-date and returns aSessionToken
which can be used for fetching the revision files, otherwise returnsnull
.InputStream
obtainFile(String sessionID, String source, String fileName)
Deprecated.Returns anInputStream
for the requested file and source in the context of the givensession
.void
publish(Revision revision)
Deprecated.Publish a newRevision
for consumption by clients.void
release(String sessionID)
Deprecated.Notify that the specifiedSessionToken
is no longer needed by the caller.
-
-
-
Method Detail
-
publish
void publish(Revision revision) throws IOException
Deprecated.Publish a newRevision
for consumption by clients. It is the caller's responsibility to verify that the revision files exist and can be read by clients. When the revision is no longer needed, it will bereleased
by the replicator.- Throws:
IOException
-
checkForUpdate
SessionToken checkForUpdate(String currVersion) throws IOException
Deprecated.Check whether the given version is up-to-date and returns aSessionToken
which can be used for fetching the revision files, otherwise returnsnull
.NOTE: when the returned session token is no longer needed, you should call
release(String)
so that the session resources can be reclaimed, including the revision files.- Throws:
IOException
-
release
void release(String sessionID) throws IOException
Deprecated.Notify that the specifiedSessionToken
is no longer needed by the caller.- Throws:
IOException
-
obtainFile
InputStream obtainFile(String sessionID, String source, String fileName) throws IOException
Deprecated.Returns anInputStream
for the requested file and source in the context of the givensession
.NOTE: it is the caller's responsibility to close the returned stream.
- Throws:
SessionExpiredException
- if the specified session has already expiredIOException
-
-