public class CompactionRecordCountProvider extends RecordCountProvider
RecordCountProvider, which provides record count from file path.
The file name should follow the pattern: {Prefix}{RecordCount}.{SystemCurrentTimeInMills}.{RandomInteger}{SUFFIX}.
The prefix should be either M_OUTPUT_FILE_PREFIX or MR_OUTPUT_FILE_PREFIX.
For example, given a file path: "/a/b/c/part-m-123.1444437036.12345.avro", the record count will be 123.| Modifier and Type | Field and Description |
|---|---|
static String |
M_OUTPUT_FILE_PREFIX |
static String |
MR_OUTPUT_FILE_PREFIX |
| Constructor and Description |
|---|
CompactionRecordCountProvider() |
| Modifier and Type | Method and Description |
|---|---|
static String |
constructFileName(String filenamePrefix,
long recordCount)
Construct the file name as {filenamePrefix}{recordCount}.{SystemCurrentTimeInMills}.{RandomInteger}{SUFFIX}.
|
Path |
convertPath(Path path,
RecordCountProvider src)
This method currently supports converting the given
Path from IngestionRecordCountProvider. |
long |
getRecordCount(Path filepath)
Get the record count through filename.
|
getNotImplementedException, getRecordCountpublic static final String MR_OUTPUT_FILE_PREFIX
public static final String M_OUTPUT_FILE_PREFIX
public static String constructFileName(String filenamePrefix, long recordCount)
public long getRecordCount(Path filepath)
getRecordCount in class RecordCountProviderpublic Path convertPath(Path path, RecordCountProvider src)
Path from IngestionRecordCountProvider.
The converted Path will start with M_OUTPUT_FILE_PREFIX.convertPath in class RecordCountProvider