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 TypeMethodDescriptionvoid
clear()
Removes all contained objects from the directory and releases its resources.void
close()
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).boolean
void
loadMMap()
void
Removes 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:Directory
Creates 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:Directory
Releases all allocated resources from the directory without removing backing files. -
clear
public void clear()Description copied from interface:Directory
Removes all contained objects from the directory and releases its resources. -
remove
Description copied from interface:Directory
Removes the specified object from the directory. -
getDefaultType
- Specified by:
getDefaultType
in 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:
getDefaultType
in interfaceDirectory
-
isStoring
public boolean isStoring() -
create
-
toString
-
getLocation
- Specified by:
getLocation
in interfaceDirectory
- Returns:
- an id or location in the local filesystem.
-
getDAs
-