Package org.apache.solr.core
Class BlobRepository
- java.lang.Object
-
- org.apache.solr.core.BlobRepository
-
public class BlobRepository extends Object
The purpose of this class is to store the Jars loaded in memory and to keep only one copy of the Jar in a single node.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlobRepository.BlobContent<T>
static class
BlobRepository.BlobContentRef<T>
static interface
BlobRepository.Decoder<T>
-
Constructor Summary
Constructors Constructor Description BlobRepository(CoreContainer coreContainer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decrementBlobRefCount(BlobRepository.BlobContentRef<?> ref)
This is to decrement a ref countBlobRepository.BlobContentRef<ByteBuffer>
getBlobIncRef(String key)
Returns the contents of a blob containing a ByteBuffer and increments a reference count.static String
sha512Digest(ByteBuffer byteBuffer)
-
-
-
Field Detail
-
RANDOM
public static final Random RANDOM
-
-
Constructor Detail
-
BlobRepository
public BlobRepository(CoreContainer coreContainer)
-
-
Method Detail
-
getBlobIncRef
public BlobRepository.BlobContentRef<ByteBuffer> getBlobIncRef(String key)
Returns the contents of a blob containing a ByteBuffer and increments a reference count. Please return the same object to decrease the refcount. This is normally used for storing jar files, and binary raw data. If you are caching Java Objects you want to useSolrCore#loadDecodeAndCacheBlob(String, Decoder)
- Parameters:
key
- it is a combination of blobname and version like blobName/version- Returns:
- The reference of a blob
-
sha512Digest
public static String sha512Digest(ByteBuffer byteBuffer)
-
decrementBlobRefCount
public void decrementBlobRefCount(BlobRepository.BlobContentRef<?> ref)
This is to decrement a ref count- Parameters:
ref
- The reference that is already there. Doing multiple calls with same ref will not matter
-
-