Package com.graphhopper.storage
Class GHDirectory
java.lang.Object
com.graphhopper.storage.GHDirectory
- All Implemented Interfaces:
Directory
- Direct Known Subclasses:
MMapDirectory,RAMDirectory
Implements some common methods for the subclasses.
- Author:
- Peter Karich
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all contained objects from the directory and releases its resources.voidclose()Releases all allocated resources from the directory without removing backing files.configure(LinkedHashMap<String, String> config) Configure the DAType (specified by the value) of a single DataAccess object (specified by the key).create()Creates a new DataAccess object with the given name in the location of this Directory.getDAs()getDefaultType(String dataAccess, boolean preferInts) This method returns the default DAType of the specified DataAccess (as string).booleanvoidloadMMap()voidRemoves the specified object from the directory.toString()
-
Field Details
-
location
-
-
Constructor Details
-
GHDirectory
-
-
Method Details
-
configure
Configure the DAType (specified by the value) of a single DataAccess object (specified by the key). For "MMAP" you can prepend "preload." to the name and specify a percentage which preloads the DataAccess into physical memory of the specified percentage (only applied for load, not for import). As keys can be patterns the order is important and the LinkedHashMap is forced as type. -
loadMMap
public void loadMMap() -
create
Description copied from interface:DirectoryCreates a new DataAccess object with the given name in the location of this Directory. Each name can only be used once. -
create
-
create
-
create
-
close
public void close()Description copied from interface:DirectoryReleases all allocated resources from the directory without removing backing files. -
clear
public void clear()Description copied from interface:DirectoryRemoves all contained objects from the directory and releases its resources. -
remove
Description copied from interface:DirectoryRemoves the specified object from the directory. -
getDefaultType
- Specified by:
getDefaultTypein interfaceDirectory- Returns:
- the default type of a newly created DataAccess object
-
getDefaultType
This method returns the default DAType of the specified DataAccess (as string). If preferInts is true then this method returns e.g. RAM_INT if the type of the specified DataAccess is RAM.- Specified by:
getDefaultTypein interfaceDirectory
-
isStoring
public boolean isStoring() -
create
-
toString
-
getLocation
- Specified by:
getLocationin interfaceDirectory- Returns:
- an id or location in the local filesystem.
-
getDAs
-