Package org.apache.solr.rest
Class ManagedResourceStorage.JsonStorage
- java.lang.Object
-
- org.apache.solr.rest.ManagedResourceStorage
-
- org.apache.solr.rest.ManagedResourceStorage.JsonStorage
-
- Enclosing class:
- ManagedResourceStorage
public static class ManagedResourceStorage.JsonStorage extends ManagedResourceStorage
Default storage implementation that uses JSON as the storage format for managed data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.rest.ManagedResourceStorage
ManagedResourceStorage.FileStorageIO, ManagedResourceStorage.InMemoryStorageIO, ManagedResourceStorage.JsonStorage, ManagedResourceStorage.StorageIO, ManagedResourceStorage.ZooKeeperStorageIO
-
-
Field Summary
-
Fields inherited from class org.apache.solr.rest.ManagedResourceStorage
loader, STORAGE_DIR_INIT_ARG, STORAGE_IO_CLASS_INIT_ARG, storageIO, UTF_8
-
-
Constructor Summary
Constructors Constructor Description JsonStorage(ManagedResourceStorage.StorageIO storageIO, SolrResourceLoader loader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetStoredResourceId(String resourceId)Determines the relative path (from the storage root) for the given resource.protected ObjectparseText(Reader reader, String resourceId)Called byManagedResourceStorage.load(String)to convert the serialized resource into its in-memory representation.voidstore(String resourceId, Object toStore)Persists the given toStore object with the given resourceId.-
Methods inherited from class org.apache.solr.rest.ManagedResourceStorage
delete, getResourceLoader, getStorageIO, load, newStorageIO
-
-
-
-
Constructor Detail
-
JsonStorage
public JsonStorage(ManagedResourceStorage.StorageIO storageIO, SolrResourceLoader loader)
-
-
Method Detail
-
getStoredResourceId
public String getStoredResourceId(String resourceId)
Determines the relative path (from the storage root) for the given resource. In this case, it returns a file named with the .json extension.- Specified by:
getStoredResourceIdin classManagedResourceStorage
-
parseText
protected Object parseText(Reader reader, String resourceId) throws IOException
Description copied from class:ManagedResourceStorageCalled byManagedResourceStorage.load(String)to convert the serialized resource into its in-memory representation.- Overrides:
parseTextin classManagedResourceStorage- Throws:
IOException
-
store
public void store(String resourceId, Object toStore) throws IOException
Description copied from class:ManagedResourceStoragePersists the given toStore object with the given resourceId.- Specified by:
storein classManagedResourceStorage- Throws:
IOException
-
-