use of org.smartdata.protocol.ClientServerProto.FileStateProto in project SSM by Intel-bigdata.
the class ProtoBufferHelper method convert.
public static FileStateProto convert(FileState fileState) {
FileStateProto.Builder builder = FileStateProto.newBuilder();
builder.setPath(fileState.getPath()).setType(fileState.getFileType().getValue()).setStage(fileState.getFileStage().getValue());
if (fileState instanceof CompactFileState) {
FileContainerInfo fileContainerInfo = ((CompactFileState) fileState).getFileContainerInfo();
builder.setCompactFileState(CompactFileStateProto.newBuilder().setContainerFilePath(fileContainerInfo.getContainerFilePath()).setOffset(fileContainerInfo.getOffset()).setLength(fileContainerInfo.getLength()));
} else if (fileState instanceof CompressionFileState) {
builder.setCompressionFileState(convert((CompressionFileState) fileState));
}
/*else if (fileState instanceof S3FileState) {
builder.setS3FileState();
} else if (fileState instanceof ) {
}
*/
return builder.build();
}
Aggregations