in src/main/java/org/apache/skywalking/banyandb/v1/client/metadata/Measure.java [235:267]
private static FieldSpec fromProtobuf(BanyandbDatabase.FieldSpec pb) {
Builder b = null;
switch (pb.getFieldType()) {
case FIELD_TYPE_STRING:
b = newStringField(pb.getName());
break;
case FIELD_TYPE_INT:
b = newIntField(pb.getName());
break;
case FIELD_TYPE_DATA_BINARY:
b = newBinaryField(pb.getName());
break;
case FIELD_TYPE_FLOAT:
b = newFloatField(pb.getName());
break;
default:
throw new IllegalArgumentException("unrecognized field type");
}
switch (pb.getEncodingMethod()) {
case ENCODING_METHOD_GORILLA:
b.encodeWithGorilla();
break;
}
switch (pb.getCompressionMethod()) {
case COMPRESSION_METHOD_ZSTD:
b.compressWithZSTD();
break;
}
return b.build();
}