congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FieldMapping.getFieldName
Code IndexAdd Tabnine to your IDE (free)

How to use
getFieldName
method
in
org.kitesdk.data.FieldMapping

Best Java code snippets using org.kitesdk.data.FieldMapping.getFieldName (Showing top 20 results out of 315)

origin: kite-sdk/kite

public FieldMapping getFieldMapping(String fieldName) {
 for (FieldMapping fm : fieldMappings) {
  if (fm.getFieldName().equals(fieldName)) {
   return fm;
  }
 }
 return null;
}
origin: kite-sdk/kite

private static PartitionStrategy buildPartitionStrategyForKeyMappings(
  Map<Integer, FieldMapping> keyMappings) {
 PartitionStrategy.Builder builder = new PartitionStrategy.Builder();
 for (Integer index : new TreeSet<Integer>(keyMappings.keySet())) {
  builder.identity(keyMappings.get(index).getFieldName());
 }
 return builder.build();
}
origin: kite-sdk/kite

/**
 * Initialize the AvroRecordBuilderFactories for all keyAsColumn mapped fields
 * that are record types. We need to be able to get record builders for these
 * since the records are broken across many columns, and need to be
 * constructed by the composer.
 */
private void initRecordBuilderFactories() {
 for (FieldMapping fieldMapping : avroSchema.getColumnMappingDescriptor().getFieldMappings()) {
  if (fieldMapping.getMappingType() == MappingType.KEY_AS_COLUMN) {
   String fieldName = fieldMapping.getFieldName();
   Schema fieldSchema = avroSchema.getAvroSchema().getField(fieldName)
     .schema();
   Schema.Type fieldSchemaType = fieldSchema.getType();
   if (fieldSchemaType == Schema.Type.RECORD) {
    AvroRecordBuilderFactory<E> factory = buildAvroRecordBuilderFactory(fieldSchema);
    kacRecordBuilderFactories.put(fieldName, factory);
   }
  }
 }
}
origin: org.kitesdk/kite-data-hbase

/**
 * Initialize the AvroRecordBuilderFactories for all keyAsColumn mapped fields
 * that are record types. We need to be able to get record builders for these
 * since the records are broken across many columns, and need to be
 * constructed by the composer.
 */
private void initRecordBuilderFactories() {
 for (FieldMapping fieldMapping : avroSchema.getColumnMappingDescriptor().getFieldMappings()) {
  if (fieldMapping.getMappingType() == MappingType.KEY_AS_COLUMN) {
   String fieldName = fieldMapping.getFieldName();
   Schema fieldSchema = avroSchema.getAvroSchema().getField(fieldName)
     .schema();
   Schema.Type fieldSchemaType = fieldSchema.getType();
   if (fieldSchemaType == Schema.Type.RECORD) {
    AvroRecordBuilderFactory<E> factory = buildAvroRecordBuilderFactory(fieldSchema);
    kacRecordBuilderFactories.put(fieldName, factory);
   }
  }
 }
}
origin: org.kitesdk/kite-data-hbase

/**
 * Deserialize an entity field from the HBase Result.
 * 
 * @param fieldMapping
 *          The FieldMapping that specifies this field's mapping type and
 *          field name.
 * @param result
 *          The HBase Result that represents a row in HBase.
 * @return The field Object we deserialized from the Result.
 */
public Object deserialize(FieldMapping fieldMapping, Result result) {
 String fieldName = fieldMapping.getFieldName();
 MappingType mappingType = fieldMapping.getMappingType();
 if (mappingType == MappingType.COLUMN || mappingType == MappingType.COUNTER) {
  return deserializeColumn(fieldMapping.getFieldName(),
    fieldMapping.getFamily(), fieldMapping.getQualifier(), result);
 } else if (mappingType == MappingType.KEY_AS_COLUMN) {
  return deserializeKeyAsColumn(fieldMapping.getFieldName(),
    fieldMapping.getFamily(), fieldMapping.getPrefix(), result);
 } else if (mappingType == MappingType.OCC_VERSION) {
  return deserializeOCCColumn(result);
 } else {
  throw new ValidationException(
    "Invalid field mapping for field with name: " + fieldName);
 }
}
origin: kite-sdk/kite

Set<String> keyMappedFields = Sets.newHashSet();
for (FieldMapping fm : mappings.getFieldMappings()) {
 Schema fieldSchema = SchemaUtil.fieldSchema(schema, fm.getFieldName());
 ValidationException.check(
   SchemaUtil.isConsistentWithMappingType(
   fieldSchema.getType(), fm);
 if (FieldMapping.MappingType.KEY == fm.getMappingType()) {
  keyMappedFields.add(fm.getFieldName());
origin: kite-sdk/kite

/**
 * Deserialize an entity field from the HBase Result.
 * 
 * @param fieldMapping
 *          The FieldMapping that specifies this field's mapping type and
 *          field name.
 * @param result
 *          The HBase Result that represents a row in HBase.
 * @return The field Object we deserialized from the Result.
 */
public Object deserialize(FieldMapping fieldMapping, Result result) {
 String fieldName = fieldMapping.getFieldName();
 MappingType mappingType = fieldMapping.getMappingType();
 if (mappingType == MappingType.COLUMN || mappingType == MappingType.COUNTER) {
  return deserializeColumn(fieldMapping.getFieldName(),
    fieldMapping.getFamily(), fieldMapping.getQualifier(), result);
 } else if (mappingType == MappingType.KEY_AS_COLUMN) {
  return deserializeKeyAsColumn(fieldMapping.getFieldName(),
    fieldMapping.getFamily(), fieldMapping.getPrefix(), result);
 } else if (mappingType == MappingType.OCC_VERSION) {
  return deserializeOCCColumn(result);
 } else {
  throw new ValidationException(
    "Invalid field mapping for field with name: " + fieldName);
 }
}
origin: kite-sdk/kite

private static JsonNode toJson(FieldMapping fm) {
 ObjectNode fieldMapping = JsonNodeFactory.instance.objectNode();
 fieldMapping.set(SOURCE, TextNode.valueOf(fm.getFieldName()));
 switch (fm.getMappingType()) {
  case KEY:
origin: kite-sdk/kite

/**
 * Ensure that the column mappings for the shared fields between the old and
 * new schema haven't changed.
 * 
 * @param oldSchema
 * @param newSchema
 * @return true if the mappings are compatible, false if not.
 */
private static boolean mappingCompatible(EntitySchema oldSchema,
  EntitySchema newSchema) {
 for (FieldMapping oldFieldMapping : oldSchema.getColumnMappingDescriptor()
   .getFieldMappings()) {
  FieldMapping newFieldMapping = newSchema.getColumnMappingDescriptor()
    .getFieldMapping(oldFieldMapping.getFieldName());
  if (newFieldMapping != null) {
   if (!oldFieldMapping.equals(newFieldMapping)) {
    return false;
   }
  }
 }
 return true;
}
origin: org.kitesdk/kite-data-hbase

/**
 * Ensure that the column mappings for the shared fields between the old and
 * new schema haven't changed.
 * 
 * @param oldSchema
 * @param newSchema
 * @return true if the mappings are compatible, false if not.
 */
private static boolean mappingCompatible(EntitySchema oldSchema,
  EntitySchema newSchema) {
 for (FieldMapping oldFieldMapping : oldSchema.getColumnMappingDescriptor()
   .getFieldMappings()) {
  FieldMapping newFieldMapping = newSchema.getColumnMappingDescriptor()
    .getFieldMapping(oldFieldMapping.getFieldName());
  if (newFieldMapping != null) {
   if (!oldFieldMapping.equals(newFieldMapping)) {
    return false;
   }
  }
 }
 return true;
}
origin: kite-sdk/kite

@Override
public PutAction mapFromEntity(E entity) {
 List<PutAction> putActionList = new ArrayList<PutAction>();
 byte[] keyBytes;
 if (keySchema == null || keySerDe == null) {
  keyBytes = new byte[] { (byte) 0 };
 } else {
  keyBytes = keySerDe.serialize(mapToKey(entity));
 }
 for (FieldMapping fieldMapping : entitySchema.getColumnMappingDescriptor()
   .getFieldMappings()) {
  if (fieldMapping.getMappingType() == MappingType.KEY) {
   continue;
  }
  Object fieldValue = getEntityComposer().extractField(entity,
    fieldMapping.getFieldName());
  if (fieldValue != null) {
   PutAction put = entitySerDe.serialize(keyBytes, fieldMapping,
     fieldValue);
   putActionList.add(put);
  }
 }
 return HBaseUtils.mergePutActions(keyBytes, putActionList);
}
origin: org.kitesdk/kite-data-hbase

@Override
public PutAction mapFromEntity(E entity) {
 List<PutAction> putActionList = new ArrayList<PutAction>();
 byte[] keyBytes;
 if (keySchema == null || keySerDe == null) {
  keyBytes = new byte[] { (byte) 0 };
 } else {
  keyBytes = keySerDe.serialize(mapToKey(entity));
 }
 for (FieldMapping fieldMapping : entitySchema.getColumnMappingDescriptor()
   .getFieldMappings()) {
  if (fieldMapping.getMappingType() == MappingType.KEY) {
   continue;
  }
  Object fieldValue = getEntityComposer().extractField(entity,
    fieldMapping.getFieldName());
  if (fieldValue != null) {
   PutAction put = entitySerDe.serialize(keyBytes, fieldMapping,
     fieldValue);
   putActionList.add(put);
  }
 }
 return HBaseUtils.mergePutActions(keyBytes, putActionList);
}
origin: kite-sdk/kite

Put put = new Put(keyBytes);
PutAction putAction = new PutAction(put);
String fieldName = fieldMapping.getFieldName();
if (fieldMapping.getMappingType() == MappingType.COLUMN
  || fieldMapping.getMappingType() == MappingType.COUNTER) {
 throw new ValidationException(
   "Invalid field mapping for field with name: "
     + fieldMapping.getFieldName());
origin: org.kitesdk/kite-data-hbase

Put put = new Put(keyBytes);
PutAction putAction = new PutAction(put);
String fieldName = fieldMapping.getFieldName();
if (fieldMapping.getMappingType() == MappingType.COLUMN
  || fieldMapping.getMappingType() == MappingType.COUNTER) {
 throw new ValidationException(
   "Invalid field mapping for field with name: "
     + fieldMapping.getFieldName());
origin: kite-sdk/kite

 .getColumnMappingDescriptor().getFieldMappings()) {
if (fieldMapping.getMappingType() == MappingType.OCC_VERSION) {
 LOG.warn("Field: " + fieldMapping.getFieldName() + " in schema "
   + entitySchema2.getName()
   + " conflicts with an occVersion field in "
origin: org.kitesdk/kite-data-hbase

 .getColumnMappingDescriptor().getFieldMappings()) {
if (fieldMapping.getMappingType() == MappingType.OCC_VERSION) {
 LOG.warn("Field: " + fieldMapping.getFieldName() + " in schema "
   + entitySchema2.getName()
   + " conflicts with an occVersion field in "
origin: kite-sdk/kite

String fieldName = fieldMapping.getFieldName();
Schema fieldSchema = avroSchema.getAvroSchema().getField(fieldName)
  .schema();
origin: org.kitesdk/kite-data-hbase

String fieldName = fieldMapping.getFieldName();
Schema fieldSchema = avroSchema.getAvroSchema().getField(fieldName)
  .schema();
origin: kite-sdk/kite

   keySchema.position(fieldMapping.getFieldName()));
} else {
builder.put(fieldMapping.getFieldName(), fieldValue);
origin: org.kitesdk/kite-data-hbase

   keySchema.position(fieldMapping.getFieldName()));
} else {
builder.put(fieldMapping.getFieldName(), fieldValue);
org.kitesdk.dataFieldMappinggetFieldName

Popular methods of FieldMapping

  • getMappingType
  • getFamilyAsString
  • getPrefix
  • getQualifierAsString
  • key
  • <init>
  • column
  • counter
  • encodeUtf8
  • equals
  • getFamily
  • getQualifier
  • getFamily,
  • getQualifier,
  • keyAsColumn,
  • occ,
  • version

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • BoxLayout (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now