Package org.apache.storm.utils
Class VersionedStore
- java.lang.Object
-
- org.apache.storm.utils.VersionedStore
-
public class VersionedStore extends Object
-
-
Constructor Summary
Constructors Constructor Description VersionedStore(String path, boolean createRootDir)Creates a store at the given path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()voidcleanup(int versionsToKeep)StringcreateVersion()StringcreateVersion(long version)voiddeleteVersion(long version)voidfailVersion(String path)List<Long>getAllVersions()Sorted from most recent to oldest.StringgetRoot()LongmostRecentVersion()LongmostRecentVersion(long maxVersion)StringmostRecentVersionPath()StringmostRecentVersionPath(long maxVersion)voidsucceedVersion(String path)StringversionPath(long version)
-
-
-
Constructor Detail
-
VersionedStore
public VersionedStore(String path, boolean createRootDir) throws IOException
Creates a store at the given path.- Parameters:
path- The path for the storecreateRootDir- option to create the path directory- Throws:
IOException
-
-
Method Detail
-
getRoot
public String getRoot()
-
versionPath
public String versionPath(long version)
-
mostRecentVersionPath
public String mostRecentVersionPath() throws IOException
- Throws:
IOException
-
mostRecentVersionPath
public String mostRecentVersionPath(long maxVersion) throws IOException
- Throws:
IOException
-
mostRecentVersion
public Long mostRecentVersion() throws IOException
- Throws:
IOException
-
mostRecentVersion
public Long mostRecentVersion(long maxVersion) throws IOException
- Throws:
IOException
-
createVersion
public String createVersion() throws IOException
- Throws:
IOException
-
createVersion
public String createVersion(long version) throws IOException
- Throws:
IOException
-
failVersion
public void failVersion(String path) throws IOException
- Throws:
IOException
-
deleteVersion
public void deleteVersion(long version) throws IOException- Throws:
IOException
-
succeedVersion
public void succeedVersion(String path) throws IOException
- Throws:
IOException
-
cleanup
public void cleanup() throws IOException- Throws:
IOException
-
cleanup
public void cleanup(int versionsToKeep) throws IOException- Throws:
IOException
-
getAllVersions
public List<Long> getAllVersions() throws IOException
Sorted from most recent to oldest.- Throws:
IOException
-
-