public class PbCodegenUtils extends Object
| Constructor and Description |
|---|
PbCodegenUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Class |
compileClass(ClassLoader classloader,
String className,
String code) |
static String |
convertFlinkArrayElementToPbWithDefaultValueCode(String flinkArrDataVar,
String iVar,
String resultPbVar,
com.google.protobuf.Descriptors.FieldDescriptor elementPbFd,
org.apache.flink.table.types.logical.LogicalType elementDataType,
PbFormatContext pbFormatContext,
int indent)
This method will be called from serializer of flink array/map type because flink contains
both array/map type in array format.
|
static String |
flinkContainerElementCode(String flinkContainerCode,
String index,
org.apache.flink.table.types.logical.LogicalType eleType) |
static String |
getTypeStrFromLogicType(org.apache.flink.table.types.logical.LogicalType type)
Get java type str from
LogicalType which directly fetched from flink type. |
static String |
getTypeStrFromProto(com.google.protobuf.Descriptors.FieldDescriptor fd,
boolean isList)
Get java type str from
Descriptors.FieldDescriptor which directly fetched from protobuf object. |
static boolean |
needToSplit(int noSplitCodeSize) |
static String |
pbDefaultValueCode(com.google.protobuf.Descriptors.FieldDescriptor fieldDescriptor,
PbFormatContext pbFormatContext)
Get protobuf default value from
Descriptors.FieldDescriptor. |
public static String flinkContainerElementCode(String flinkContainerCode, String index, org.apache.flink.table.types.logical.LogicalType eleType)
flinkContainerCode - code phrase which represent flink container type like row/array in
codegen sectionsindex - the index number in flink container typeeleType - the element typepublic static String getTypeStrFromProto(com.google.protobuf.Descriptors.FieldDescriptor fd, boolean isList) throws PbCodegenException
Descriptors.FieldDescriptor which directly fetched from protobuf object.PbCodegenExceptionpublic static String getTypeStrFromLogicType(org.apache.flink.table.types.logical.LogicalType type)
LogicalType which directly fetched from flink type.public static String pbDefaultValueCode(com.google.protobuf.Descriptors.FieldDescriptor fieldDescriptor, PbFormatContext pbFormatContext) throws PbCodegenException
Descriptors.FieldDescriptor.PbCodegenExceptionpublic static String convertFlinkArrayElementToPbWithDefaultValueCode(String flinkArrDataVar, String iVar, String resultPbVar, com.google.protobuf.Descriptors.FieldDescriptor elementPbFd, org.apache.flink.table.types.logical.LogicalType elementDataType, PbFormatContext pbFormatContext, int indent) throws PbCodegenException
flinkArrDataVar - code phrase represent arrayData of arr type or keyData/valueData in
map type.iVar - the index in arrDataVarresultPbVar - the returned pb variable name in codegen.elementPbFd - Descriptors.FieldDescriptor of element type in proto objectelementDataType - LogicalType of element type in flink objectPbCodegenExceptionpublic static Class compileClass(ClassLoader classloader, String className, String code) throws ClassNotFoundException
ClassNotFoundExceptionpublic static boolean needToSplit(int noSplitCodeSize)
Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.