public static class MetaFileWriterBuilder.MetaFileWriter extends java.lang.Object implements MetaFileWriterBuilder.StartStep, MetaFileWriterBuilder.DataStep, MetaFileWriterBuilder.UploadStep
Modifier and Type | Method and Description |
---|---|
MetaFileWriterBuilder.DataStep |
addColumnfamilyResult(ColumnfamilyResult columnfamilyResult)
Add
ColumnfamilyResult after it has been processed so it can be streamed to
meta.json. |
MetaFileWriterBuilder.UploadStep |
endMetaFileGeneration()
Finish the generation of meta.json file and save it on local media.
|
java.nio.file.Path |
getMetaFilePath() |
java.lang.String |
getRemoteMetaFilePath() |
MetaFileWriterBuilder.DataStep |
startMetaFileGeneration(java.time.Instant snapshotInstant)
Start the generation of meta file.
|
void |
uploadMetaFile(boolean deleteOnSuccess)
Upload the meta file generated to backup file system.
|
public MetaFileWriterBuilder.DataStep startMetaFileGeneration(java.time.Instant snapshotInstant) throws java.io.IOException
startMetaFileGeneration
in interface MetaFileWriterBuilder.StartStep
java.io.IOException
- if unable to write to meta file (permissions, disk full etc)public MetaFileWriterBuilder.DataStep addColumnfamilyResult(ColumnfamilyResult columnfamilyResult) throws java.io.IOException
ColumnfamilyResult
after it has been processed so it can be streamed to
meta.json. Streaming write to meta.json is required so we don't get Priam OOM.addColumnfamilyResult
in interface MetaFileWriterBuilder.DataStep
columnfamilyResult
- a POJO encapsulating the column family resultjava.io.IOException
- if unable to write to the file or if JSON is not validpublic MetaFileWriterBuilder.UploadStep endMetaFileGeneration() throws java.io.IOException
endMetaFileGeneration
in interface MetaFileWriterBuilder.DataStep
Path
to the local meta.json produced.java.io.IOException
- if unable to write to file or if JSON is not validpublic void uploadMetaFile(boolean deleteOnSuccess) throws java.lang.Exception
uploadMetaFile
in interface MetaFileWriterBuilder.UploadStep
deleteOnSuccess
- delete the meta file from local file system if backup is
successful. Useful for testing purposesjava.lang.Exception
- when unable to upload the meta file.public java.nio.file.Path getMetaFilePath()
getMetaFilePath
in interface MetaFileWriterBuilder.UploadStep
public java.lang.String getRemoteMetaFilePath() throws java.lang.Exception
getRemoteMetaFilePath
in interface MetaFileWriterBuilder.UploadStep
java.lang.Exception