Class BlobIdTracker
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.blob.datastore.BlobIdTracker
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,BlobTracker
public class BlobIdTracker extends Object implements Closeable, BlobTracker
Tracks the blob ids available or added in the blob store using theBlobIdTracker.BlobIdStore
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlobIdTracker.ActiveDeletionTracker
Tracking any active deletions store for managing the blob reference-
Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.plugins.blob.datastore.BlobTracker
BlobTracker.Options
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.jackrabbit.oak.plugins.blob.datastore.BlobIdTracker.BlobIdStore
store
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(File recs)
Adds the ids in the given file.void
add(String id)
Adds the given id.void
add(Iterator<String> recs)
Adds the given ids.static BlobIdTracker
build(String path, String repositoryId, long snapshotIntervalSecs, SharedDataStore datastore)
void
close()
Closes the tracker and the underlying store.Iterator<String>
get()
Retrieves all the reference files available in the DataStore and merges them to the local store and then returns an iterator over it.File
get(String path)
Fetches a File object which having all the sorted records.BlobIdTracker.ActiveDeletionTracker
getDeleteTracker()
void
remove(File recs)
Remove the ids in the given file and deletes the file.void
remove(File recs, BlobTracker.Options options)
Remove the ids in the given file and deletes the file.void
remove(Iterator<String> recs)
Remove the given ids.
-
-
-
Method Detail
-
build
public static BlobIdTracker build(String path, String repositoryId, long snapshotIntervalSecs, SharedDataStore datastore) throws IOException
- Throws:
IOException
-
getDeleteTracker
public BlobIdTracker.ActiveDeletionTracker getDeleteTracker()
-
remove
public void remove(File recs, BlobTracker.Options options) throws IOException
Description copied from interface:BlobTracker
Remove the ids in the given file and deletes the file.- Specified by:
remove
in interfaceBlobTracker
- Throws:
IOException
-
remove
public void remove(File recs) throws IOException
Description copied from interface:BlobTracker
Remove the ids in the given file and deletes the file.- Specified by:
remove
in interfaceBlobTracker
- Throws:
IOException
-
remove
public void remove(Iterator<String> recs) throws IOException
Description copied from interface:BlobTracker
Remove the given ids.- Specified by:
remove
in interfaceBlobTracker
- Throws:
IOException
-
add
public void add(String id) throws IOException
Description copied from interface:BlobTracker
Adds the given id.- Specified by:
add
in interfaceBlobTracker
- Parameters:
id
- the record id to be tracked- Throws:
IOException
-
add
public void add(Iterator<String> recs) throws IOException
Description copied from interface:BlobTracker
Adds the given ids.- Specified by:
add
in interfaceBlobTracker
- Throws:
IOException
-
add
public void add(File recs) throws IOException
Description copied from interface:BlobTracker
Adds the ids in the given file.- Specified by:
add
in interfaceBlobTracker
- Throws:
IOException
-
get
public Iterator<String> get() throws IOException
Retrieves all the reference files available in the DataStore and merges them to the local store and then returns an iterator over it. This way the ids returned are as recent as the snapshots taken on all instances/repositories connected to the DataStore.The iterator returned ia a Closeable instance and should be closed by calling #close().
- Specified by:
get
in interfaceBlobTracker
- Returns:
- iterator over all the blob ids available
- Throws:
IOException
-
get
public File get(String path) throws IOException
Description copied from interface:BlobTracker
Fetches a File object which having all the sorted records. The lifecycle of the returnedFile
handle is the responsibility of the handler.- Specified by:
get
in interfaceBlobTracker
- Returns:
- Throws:
IOException
-
close
public void close() throws IOException
Closes the tracker and the underlying store.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-