當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。