Class FileManager
- java.lang.Object
-
- org.apache.hugegraph.computer.core.store.FileManager
-
- All Implemented Interfaces:
Manager,FileGenerator
public class FileManager extends java.lang.Object implements FileGenerator, Manager
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAME
-
Constructor Summary
Constructors Constructor Description FileManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(org.apache.hugegraph.computer.core.config.Config config)Close the resources used in the computation.java.util.List<java.lang.String>dirs()voidinit(org.apache.hugegraph.computer.core.config.Config config)Used to add the resources needed by the computation.java.lang.Stringname()The unique identify name.java.lang.StringnextDirectory()Allocate a base directory each call.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.hugegraph.computer.core.store.FileGenerator
nextDirectory, randomDirectory
-
Methods inherited from interface org.apache.hugegraph.computer.core.manager.Manager
afterSuperstep, beforeSuperstep, inited
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:ManagerThe unique identify name.
-
init
public void init(org.apache.hugegraph.computer.core.config.Config config)
Description copied from interface:ManagerUsed to add the resources needed by the computation. Be called only one time before all supersteps start.
-
close
public void close(org.apache.hugegraph.computer.core.config.Config config)
Description copied from interface:ManagerClose the resources used in the computation. Be called only one time after all supersteps ended.
-
nextDirectory
public java.lang.String nextDirectory()
Description copied from interface:FileGeneratorAllocate a base directory each call. There may be multi base directories configured by user, generally each base directory represent a disk, allocated by round mode. For example, the base directories configured ["/disk1/job_001/container_001", "/disk2/job_001/container_001"]. It indicates there are two base directories and each base directory for one disk. First call returns "/disk1/job_001/container_001", second call returns "/disk2/job_001/container_001" and third call returns "/disk1/job_001/container_001" and so on in round mode. Note: Can't request a directory and write many files into it, this will cause the io pressure can't distributed over several disks.- Specified by:
nextDirectoryin interfaceFileGenerator- Returns:
- The directory of allocated local base directory.
-
dirs
public java.util.List<java.lang.String> dirs()
- Specified by:
dirsin interfaceFileGenerator
-
-