public abstract class ManagedResourceStorage extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ManagedResourceStorage.FileStorageIO
Local file-based storage implementation.
|
static class |
ManagedResourceStorage.InMemoryStorageIO
Memory-backed storage IO; not really intended for storage large amounts
of data in production, but useful for testing and other transient workloads.
|
static class |
ManagedResourceStorage.JsonStorage
Default storage implementation that uses JSON as the storage format for managed data.
|
static interface |
ManagedResourceStorage.StorageIO
Hides the underlying storage implementation for data being managed
by a ManagedResource.
|
static class |
ManagedResourceStorage.ZooKeeperStorageIO
ZooKeeper based storage implementation that uses the SolrZkClient provided
by the CoreContainer.
|
Modifier and Type | Field and Description |
---|---|
protected SolrResourceLoader |
loader |
static org.slf4j.Logger |
log |
static String |
STORAGE_DIR_INIT_ARG |
static String |
STORAGE_IO_CLASS_INIT_ARG |
protected ManagedResourceStorage.StorageIO |
storageIO |
static Charset |
UTF_8 |
Modifier | Constructor and Description |
---|---|
protected |
ManagedResourceStorage(ManagedResourceStorage.StorageIO storageIO,
SolrResourceLoader loader) |
Modifier and Type | Method and Description |
---|---|
boolean |
delete(String resourceId)
Removes the given resourceId's persisted representation.
|
SolrResourceLoader |
getResourceLoader()
Returns the resource loader used by this storage instance
|
ManagedResourceStorage.StorageIO |
getStorageIO()
Returns the storageIO instance used by this storage instance
|
abstract String |
getStoredResourceId(String resourceId)
Gets the unique identifier for a stored resource, typically based
on the resourceId and some storage-specific information, such as
file extension and storage root directory.
|
Object |
load(String resourceId)
Loads a resource from storage; the default implementation makes
the assumption that the data is stored as UTF-8 encoded text,
such as JSON.
|
static ManagedResourceStorage.StorageIO |
newStorageIO(String collection,
SolrResourceLoader resourceLoader,
NamedList<String> initArgs)
Creates a new StorageIO instance for a Solr core, taking into account
whether the core is running in cloud mode as well as initArgs.
|
protected Object |
parseText(Reader reader,
String resourceId)
Called by
load(String) to convert the
serialized resource into its in-memory representation. |
abstract void |
store(String resourceId,
Object toStore)
Persists the given toStore object with the given resourceId.
|
public static final String STORAGE_IO_CLASS_INIT_ARG
public static final String STORAGE_DIR_INIT_ARG
public static final org.slf4j.Logger log
public static final Charset UTF_8
protected ManagedResourceStorage.StorageIO storageIO
protected SolrResourceLoader loader
protected ManagedResourceStorage(ManagedResourceStorage.StorageIO storageIO, SolrResourceLoader loader)
public static ManagedResourceStorage.StorageIO newStorageIO(String collection, SolrResourceLoader resourceLoader, NamedList<String> initArgs)
public SolrResourceLoader getResourceLoader()
public ManagedResourceStorage.StorageIO getStorageIO()
public abstract String getStoredResourceId(String resourceId)
public Object load(String resourceId) throws IOException
IOException
protected Object parseText(Reader reader, String resourceId) throws IOException
load(String)
to convert the
serialized resource into its in-memory representation.IOException
public abstract void store(String resourceId, Object toStore) throws IOException
IOException
public boolean delete(String resourceId) throws IOException
IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.