当前位置: 首页>>代码示例>>Java>>正文


Java Field.doc方法代码示例

本文整理汇总了Java中org.apache.avro.Schema.Field.doc方法的典型用法代码示例。如果您正苦于以下问题:Java Field.doc方法的具体用法?Java Field.doc怎么用?Java Field.doc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.avro.Schema.Field的用法示例。


在下文中一共展示了Field.doc方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addExtras

import org.apache.avro.Schema.Field; //导入方法依赖的package包/类
private void addExtras(Field field) {
	
	List<Entry<String, String>> extras = new ArrayList<>(3);
	
	String dflt = defaultFor(field);
	if (dflt != null) {
		extras.add(new AbstractMap.SimpleEntry<String, String>("default", dflt));
	}
	String doc = field.doc();
	if (doc != null) {
		extras.add(new AbstractMap.SimpleEntry<String, String>("doc", doc));
	}
	
	String size = childIntNodeAsString(field, "size");
	if (size!= null) {
		extras.add(new AbstractMap.SimpleEntry<String, String>("size", size));
	}

	appendAsData(extras);
}
 
开发者ID:Comcast,项目名称:pipeclamp,代码行数:21,代码来源:AvroSchemaTreeComposer.java

示例2: getRecordSchemaWithDirtySupport

import org.apache.avro.Schema.Field; //导入方法依赖的package包/类
private static Schema getRecordSchemaWithDirtySupport(Schema originalSchema, Map<Schema,Schema> queue) throws IOException {
  if (originalSchema.getType() != Type.RECORD) {
    throw new IOException("Gora only supports record schemas.");
  }
  List<Field> originalFields = originalSchema.getFields();
  /* make sure the schema doesn't contain the field __g__dirty */
  for (Field field : originalFields) {
    if (GORA_RESERVED_NAMES.contains(field.name())) {
      throw new IOException(
        "Gora schemas cannot contain the field name " + field.name());
    }
  }
  Schema newSchema = Schema.createRecord(originalSchema.getName(),
  originalSchema.getDoc(), originalSchema.getNamespace(),
  originalSchema.isError());
  
  queue.put(originalSchema, newSchema);
  
  List<Field> newFields = new ArrayList<>();
  byte[] defaultDirtyBytesValue = new byte[getNumberOfBytesNeededForDirtyBits(originalSchema)];
  Arrays.fill(defaultDirtyBytesValue, (byte) 0);
  JsonNode defaultDirtyJsonValue = JsonNodeFactory.instance
    .binaryNode(defaultDirtyBytesValue);
  Field dirtyBits = new Field(DIRTY_BYTES_FIELD_NAME,
    Schema.create(Type.BYTES),
    "Bytes used to represent weather or not a field is dirty.",
    defaultDirtyJsonValue);
  newFields.add(dirtyBits);
  for (Field originalField : originalFields) {
    // recursively add dirty support
    Field newField = new Field(originalField.name(),
      getSchemaWithDirtySupport(originalField.schema(),queue),
      originalField.doc(), originalField.defaultValue(),
      originalField.order());
    newFields.add(newField);
  }
  newSchema.setFields(newFields);
  return newSchema;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:40,代码来源:GoraCompiler.java

示例3: getKeySchema

import org.apache.avro.Schema.Field; //导入方法依赖的package包/类
private Optional<Schema> getKeySchema(Field field) {
  switch (field.schema().getType()) {
    case RECORD:
      return getKeySchemaFromRecord(field.schema());
    default:
      if (field.doc() != null && field.doc().toLowerCase().endsWith(SCHEMA_DEDUP_FIELD_ANNOTATOR)) {
        return Optional.of(field.schema());
      } else {
        return Optional.absent();
      }
  }
}
 
开发者ID:Hanmourang,项目名称:Gobblin,代码行数:13,代码来源:MRCompactorAvroKeyDedupJobRunner.java

示例4: getSchemaFieldsList

import org.apache.avro.Schema.Field; //导入方法依赖的package包/类
public static List<Field> getSchemaFieldsList(Schema schema) {
    List<Field> result = new ArrayList<>();
    for (Field f : schema.getFields()) {
        Field nf = new Field(f.name(), f.schema(), f.doc(), f.defaultVal());
        nf.getObjectProps().putAll(f.getObjectProps());
        for (Map.Entry<String, Object> entry : f.getObjectProps().entrySet()) {
            nf.addProp(entry.getKey(), entry.getValue());
        }
        result.add(nf);
    }
    return result;
}
 
开发者ID:Talend,项目名称:components,代码行数:13,代码来源:MarketoSourceOrSink.java

示例5: generateNewField

import org.apache.avro.Schema.Field; //导入方法依赖的package包/类
public static Field generateNewField(Field origin) {
    Schema.Field field = new Schema.Field(origin.name(), origin.schema(), origin.doc(), origin.defaultVal(), origin.order());
    field.getObjectProps().putAll(origin.getObjectProps());
    for (Map.Entry<String, Object> entry : origin.getObjectProps().entrySet()) {
        field.addProp(entry.getKey(), entry.getValue());
    }
    return field;
}
 
开发者ID:Talend,项目名称:components,代码行数:9,代码来源:MarketoUtils.java

示例6: getMigratedField

import org.apache.avro.Schema.Field; //导入方法依赖的package包/类
private Field getMigratedField(Field origin, Schema expectedSchema, String expectedDIType) {
    Field expectedField = new Schema.Field(origin.name(), expectedSchema, origin.doc(), origin.defaultVal(), origin.order());
    for (Map.Entry<String, Object> entry : origin.getObjectProps().entrySet()) {
        if ("di.column.talendType".equals(entry.getKey())) {
            expectedField.addProp("di.column.talendType", expectedDIType);
        } else {
            expectedField.addProp(entry.getKey(), entry.getValue());
        }
    }
    return expectedField;
}
 
开发者ID:Talend,项目名称:components,代码行数:12,代码来源:TMarketoInputProperties.java


注:本文中的org.apache.avro.Schema.Field.doc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。