Package org.apache.solr.filestore
Class DistribPackageStore
- java.lang.Object
-
- org.apache.solr.filestore.DistribPackageStore
-
- All Implemented Interfaces:
PackageStore
@SolrThreadUnsafe public class DistribPackageStore extends Object implements PackageStore
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.filestore.PackageStore
PackageStore.FileDetails, PackageStore.FileEntry, PackageStore.FileType
-
-
Constructor Summary
Constructors Constructor Description DistribPackageStore(CoreContainer coreContainer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PackageStore.FileType_getFileType(File file)static void_persistToFile(Path solrHome, String path, ByteBuffer data, ByteBuffer meta)Internal APIvoiddelete(String path)Delete a file cluster-widevoiddeleteLocal(String path)Delete file from local file systemstatic voiddeleteZKFileEntry(SolrZkClient client, String path)booleanfetch(String path, String from)Fetch a resource from another node internal APIvoidget(String path, Consumer<PackageStore.FileEntry> consumer, boolean fetchmissing)read file content from a given pathMap<String,byte[]>getKeys()Get all the keys in the package store.static PathgetPackageStoreDirPath(Path solrHome)PathgetRealpath(String path)get the real path on filesystemPackageStore.FileTypegetType(String path, boolean fetchMissing)The type of the resourcestatic booleanisMetaDataFile(String file)List<PackageStore.FileDetails>list(String path, Predicate<String> predicate)voidput(PackageStore.FileEntry entry)Store a file into the filestore.voidrefresh(String path)Refresh the files in a path.voidsyncToAllNodes(String path)Sync a local file to all nodes.
-
-
-
Constructor Detail
-
DistribPackageStore
public DistribPackageStore(CoreContainer coreContainer)
-
-
Method Detail
-
getRealpath
public Path getRealpath(String path)
Description copied from interface:PackageStoreget the real path on filesystem- Specified by:
getRealpathin interfacePackageStore
-
put
public void put(PackageStore.FileEntry entry) throws IOException
Description copied from interface:PackageStoreStore a file into the filestore. This should ensure that it is replicated across all nodes in the cluster- Specified by:
putin interfacePackageStore- Throws:
IOException
-
fetch
public boolean fetch(String path, String from)
Description copied from interface:PackageStoreFetch a resource from another node internal API- Specified by:
fetchin interfacePackageStore
-
get
public void get(String path, Consumer<PackageStore.FileEntry> consumer, boolean fetchmissing) throws IOException
Description copied from interface:PackageStoreread file content from a given path- Specified by:
getin interfacePackageStore- Throws:
IOException
-
syncToAllNodes
public void syncToAllNodes(String path) throws IOException
Description copied from interface:PackageStoreSync a local file to all nodes. All the nodes are asked to pull the file from this node- Specified by:
syncToAllNodesin interfacePackageStore- Throws:
IOException
-
list
public List<PackageStore.FileDetails> list(String path, Predicate<String> predicate)
- Specified by:
listin interfacePackageStore
-
delete
public void delete(String path)
Description copied from interface:PackageStoreDelete a file cluster-wide- Specified by:
deletein interfacePackageStore
-
deleteLocal
public void deleteLocal(String path)
Description copied from interface:PackageStoreDelete file from local file system- Specified by:
deleteLocalin interfacePackageStore
-
refresh
public void refresh(String path)
Description copied from interface:PackageStoreRefresh the files in a path. May be this node does not have all files- Specified by:
refreshin interfacePackageStore- Parameters:
path- the path to be refreshed.
-
getType
public PackageStore.FileType getType(String path, boolean fetchMissing)
Description copied from interface:PackageStoreThe type of the resource- Specified by:
getTypein interfacePackageStore
-
_getFileType
public static PackageStore.FileType _getFileType(File file)
-
isMetaDataFile
public static boolean isMetaDataFile(String file)
-
_persistToFile
public static void _persistToFile(Path solrHome, String path, ByteBuffer data, ByteBuffer meta) throws IOException
Internal API- Throws:
IOException
-
getKeys
public Map<String,byte[]> getKeys() throws IOException
Description copied from interface:PackageStoreGet all the keys in the package store. The data is a .DER file content- Specified by:
getKeysin interfacePackageStore- Throws:
IOException
-
deleteZKFileEntry
public static void deleteZKFileEntry(SolrZkClient client, String path)
-
-