use of org.smartdata.protocol.ClientServerProto.CompressionFileStateProto in project SSM by Intel-bigdata.
the class ProtoBufferHelper method convert.
public static FileState convert(FileStateProto proto) {
FileState fileState = null;
String path = proto.getPath();
FileState.FileType type = FileState.FileType.fromValue(proto.getType());
FileState.FileStage stage = FileState.FileStage.fromValue(proto.getStage());
// FileState.FileStage stage = FileState.FileStage.fromValue(proto.getStage());
if (type == null) {
return new NormalFileState(path);
}
switch(type) {
case NORMAL:
fileState = new NormalFileState(path);
break;
case COMPACT:
CompactFileStateProto compactProto = proto.getCompactFileState();
fileState = new CompactFileState(path, convert(compactProto));
break;
case COMPRESSION:
CompressionFileStateProto compressionProto = proto.getCompressionFileState();
// convert to CompressionFileState
fileState = convert(path, stage, compressionProto);
break;
case S3:
S3FileStateProto s3Proto = proto.getS3FileState();
// fileState = convert(path, type, stage, s3Proto);
break;
default:
}
return fileState;
}
Aggregations