Package org.apache.solr.filestore
Class DistribFileStore
- java.lang.Object
-
- org.apache.solr.filestore.DistribFileStore
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.filestore.FileStore
FileStore.FileDetails, FileStore.FileEntry, FileStore.FileType
-
-
Constructor Summary
Constructors Constructor Description DistribFileStore(CoreContainer coreContainer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileStore.FileType
_getFileType(File file)
static void
_persistToFile(Path solrHome, String path, ByteBuffer data, ByteBuffer meta)
Internal APIvoid
delete(String path)
Delete a file cluster-widevoid
deleteLocal(String path)
Delete file from local file systemstatic void
deleteZKFileEntry(org.apache.solr.common.cloud.SolrZkClient client, String path)
boolean
fetch(String path, String from)
Fetch a resource from another node internal APIvoid
get(String path, Consumer<FileStore.FileEntry> consumer, boolean fetchmissing)
read file content from a given pathstatic Path
getFileStoreDirPath(Path solrHome)
Map<String,byte[]>
getKeys()
Get all the keys in the package store.Path
getRealpath(String path)
get the real path on filesystemFileStore.FileType
getType(String path, boolean fetchMissing)
The type of the resourcestatic boolean
isMetaDataFile(String file)
List<FileStore.FileDetails>
list(String path, Predicate<String> predicate)
void
put(FileStore.FileEntry entry)
Store a file into the filestore.void
refresh(String path)
Refresh the files in a path.void
syncToAllNodes(String path)
Sync a local file to all nodes.
-
-
-
Constructor Detail
-
DistribFileStore
public DistribFileStore(CoreContainer coreContainer)
-
-
Method Detail
-
getRealpath
public Path getRealpath(String path)
Description copied from interface:FileStore
get the real path on filesystem- Specified by:
getRealpath
in interfaceFileStore
-
put
public void put(FileStore.FileEntry entry) throws IOException
Description copied from interface:FileStore
Store a file into the filestore. This should ensure that it is replicated across all nodes in the cluster- Specified by:
put
in interfaceFileStore
- Throws:
IOException
-
fetch
public boolean fetch(String path, String from)
Description copied from interface:FileStore
Fetch a resource from another node internal API
-
get
public void get(String path, Consumer<FileStore.FileEntry> consumer, boolean fetchmissing) throws IOException
Description copied from interface:FileStore
read file content from a given path- Specified by:
get
in interfaceFileStore
- Throws:
IOException
-
syncToAllNodes
public void syncToAllNodes(String path) throws IOException
Description copied from interface:FileStore
Sync a local file to all nodes. All the nodes are asked to pull the file from this node- Specified by:
syncToAllNodes
in interfaceFileStore
- Throws:
IOException
-
list
public List<FileStore.FileDetails> list(String path, Predicate<String> predicate)
-
delete
public void delete(String path)
Description copied from interface:FileStore
Delete a file cluster-wide
-
deleteLocal
public void deleteLocal(String path)
Description copied from interface:FileStore
Delete file from local file system- Specified by:
deleteLocal
in interfaceFileStore
-
refresh
public void refresh(String path)
Description copied from interface:FileStore
Refresh the files in a path. May be this node does not have all files
-
getType
public FileStore.FileType getType(String path, boolean fetchMissing)
Description copied from interface:FileStore
The type of the resource
-
_getFileType
public static FileStore.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:FileStore
Get all the keys in the package store. The data is a .DER file content- Specified by:
getKeys
in interfaceFileStore
- Throws:
IOException
-
deleteZKFileEntry
public static void deleteZKFileEntry(org.apache.solr.common.cloud.SolrZkClient client, String path)
-
-