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 APIvoiddelete(String path)Delete a file cluster-widevoiddeleteLocal(String path)Delete file from local file systemstatic voiddeleteZKFileEntry(org.apache.solr.common.cloud.SolrZkClient client, String path)booleanfetch(String path, String from)Fetch a resource from another node internal APIvoidget(String path, Consumer<FileStore.FileEntry> consumer, boolean fetchmissing)read file content from a given pathstatic PathgetFileStoreDirPath(Path solrHome)Map<String,byte[]>getKeys()Get all the keys in the package store.PathgetRealpath(String path)get the real path on filesystemFileStore.FileTypegetType(String path, boolean fetchMissing)The type of the resourcestatic booleanisMetaDataFile(String file)List<FileStore.FileDetails>list(String path, Predicate<String> predicate)voidput(FileStore.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
-
DistribFileStore
public DistribFileStore(CoreContainer coreContainer)
-
-
Method Detail
-
getRealpath
public Path getRealpath(String path)
Description copied from interface:FileStoreget the real path on filesystem- Specified by:
getRealpathin interfaceFileStore
-
put
public void put(FileStore.FileEntry entry) throws IOException
Description copied from interface:FileStoreStore a file into the filestore. This should ensure that it is replicated across all nodes in the cluster- Specified by:
putin interfaceFileStore- Throws:
IOException
-
fetch
public boolean fetch(String path, String from)
Description copied from interface:FileStoreFetch 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:FileStoreread file content from a given path- Specified by:
getin interfaceFileStore- Throws:
IOException
-
syncToAllNodes
public void syncToAllNodes(String path) throws IOException
Description copied from interface:FileStoreSync a local file to all nodes. All the nodes are asked to pull the file from this node- Specified by:
syncToAllNodesin interfaceFileStore- Throws:
IOException
-
list
public List<FileStore.FileDetails> list(String path, Predicate<String> predicate)
-
delete
public void delete(String path)
Description copied from interface:FileStoreDelete a file cluster-wide
-
deleteLocal
public void deleteLocal(String path)
Description copied from interface:FileStoreDelete file from local file system- Specified by:
deleteLocalin interfaceFileStore
-
refresh
public void refresh(String path)
Description copied from interface:FileStoreRefresh 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:FileStoreThe 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:FileStoreGet all the keys in the package store. The data is a .DER file content- Specified by:
getKeysin interfaceFileStore- Throws:
IOException
-
deleteZKFileEntry
public static void deleteZKFileEntry(org.apache.solr.common.cloud.SolrZkClient client, String path)
-
-