CasConverter
public
class
CasConverter
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.build.CasConverter |
A singleton class for converting a FastCDC-chunked directory to its original directory.
Summary
Constants | |
|---|---|
long |
CONVERSION_TIMEOUT_IN_MS
|
Public methods | |
|---|---|
void
|
convert(Path chunkedDirectory, Path convertedDirectory)
Converts a FastCDC-chunked directory to its source directory at a destination path. |
void
|
convert(Path chunkedDirectory)
Converts a FastCDC-chunked directory back to its source directory. |
static
CasConverter
|
getInstance()
|
Constants
CONVERSION_TIMEOUT_IN_MS
protected static final long CONVERSION_TIMEOUT_IN_MS
Constant Value: 600000 (0x00000000000927c0)
Public methods
convert
public void convert (Path chunkedDirectory,
Path convertedDirectory)Converts a FastCDC-chunked directory to its source directory at a destination path. If the destination path is null or the same as the source path, it will fallback to inplace conversion.
The method is synchronized to prevent concurrent conversions from running at the same time. This is rare in practice, but possible. For example, a DeviceBuildInfo and its clone shares the same device image and may attempt to convert it at the same time and there can be a race condition with unpredictable result.
| Parameters | |
|---|---|
chunkedDirectory |
Path: The directory containing the FastCDC chunks. |
convertedDirectory |
Path: The directory to convert to. |
| Throws | |
|---|---|
IOException |
If an I/O error occurs. |
convert
public void convert (Path chunkedDirectory)
Converts a FastCDC-chunked directory back to its source directory. The conversion is in-place and the original directory will be overwritten.
| Parameters | |
|---|---|
chunkedDirectory |
Path: The directory containing the FastCDC chunks. It becomes the converted
directory on return. |
| Throws | |
|---|---|
IOException |
If an I/O error occurs. |