Tabnine Logo
com.netflix.hollow.core.schema
Code IndexAdd Tabnine to your IDE (free)

How to use com.netflix.hollow.core.schema

Best Java code snippets using com.netflix.hollow.core.schema (Showing top 20 results out of 315)

origin: Netflix/hollow

private PrimaryKey getPrimaryKey(HollowSchema schema) {
  if(schema.getSchemaType() == SchemaType.OBJECT)
    return ((HollowObjectSchema)schema).getPrimaryKey();
  return null;
}
origin: Netflix/hollow

  @Override
  protected String getClassName(HollowObjectSchema schema) {
    return schema.getName() + "PrimaryKeyIndex";
  }
}
origin: Netflix/hollow

public HollowPrimaryKeyIndexGenerator(HollowDataset dataset, String packageName, String apiClassname, HollowObjectSchema schema, CodeGeneratorConfig config) {
  super(packageName, apiClassname, schema, dataset, config);
  this.pk = schema.getPrimaryKey();
  isGenSimpleConstructor = true;
  isParameterizedConstructorPublic = false;
  isAutoListenToDataRefresh = false;
  isImplementsUniqueKeyIndex = false;
}
origin: Netflix/hollow

public static HollowSchema withoutKeys(HollowSchema schema) {
  switch(schema.getSchemaType()) {
  case SET:
    HollowSetSchema setSchema = (HollowSetSchema)schema;
    if(setSchema.getHashKey() != null)
      setSchema = new HollowSetSchema(setSchema.getName(), setSchema.getElementType());
    return setSchema;
  case MAP:
    HollowMapSchema mapSchema = (HollowMapSchema)schema;
    if(mapSchema.getHashKey() != null)
      mapSchema = new HollowMapSchema(mapSchema.getName(), mapSchema.getKeyType(), mapSchema.getValueType());
    return mapSchema;
  default:
    return schema;
  }
}
origin: Netflix/hollow

private int[] createFieldMapping(HollowObjectSchema unionSchema, HollowObjectSchema individualSchema) {
  int mapping[] = new int[unionSchema.numFields()];
  for(int i=0;i<unionSchema.numFields();i++) {
    String fieldName = unionSchema.getFieldName(i);
    mapping[i] = individualSchema.getPosition(fieldName);
  }
  return mapping;
}
origin: Netflix/hollow

private static HollowObjectSchema getStringSchema(String schemaName) {
  HollowObjectSchema schema = new HollowObjectSchema(schemaName, 1);
  schema.addField("value", FieldType.STRING);
  return schema;
}
origin: Netflix/hollow

private boolean shouldPreserveHashPositions(HollowSchema schema) {
  switch(schema.getSchemaType()) {
  case MAP:
    return from.getTypesWithDefinedHashCodes().contains(((HollowMapSchema)schema).getKeyType());
  case SET:
    return from.getTypesWithDefinedHashCodes().contains(((HollowSetSchema)schema).getElementType());
  default:
    return false;
  }
}
origin: Netflix/hollow

@Override
public HollowSchema handleSchema(String type) {
  if("MissingMap".equals(type))
    return new HollowMapSchema("MissingMap", "MissingObject", "MissingObject");
  if("MissingObject".equals(type))
    return new HollowObjectSchema("MissingObject", 0);
  return null;
}
origin: Netflix/hollow

@Override
public HollowSchema handleSchema(String type) {
  if("MissingList".equals(type))
    return new HollowListSchema("MissingList", "MissingObject");
  if("MissingObject".equals(type))
    return new HollowObjectSchema("MissingObject", 0);
  return null;
}
origin: Netflix/hollow

public FieldType getFieldType(String fieldName) {
  int fieldPosition = getPosition(fieldName);
  if(fieldPosition == -1)
    return null;
  return getFieldType(fieldPosition);
}
origin: Netflix/hollow

@Override
public HollowSchema handleSchema(String type) {
  if("MissingSet".equals(type))
    return new HollowSetSchema("MissingSet", "MissingObject");
  if("MissingObject".equals(type))
    return new HollowObjectSchema("MissingObject", 0);
  return null;
}
origin: Netflix/hollow

public String getReferencedType(String fieldName) {
  int fieldPosition = getPosition(fieldName);
  if(fieldPosition == -1)
    return null;
  return getReferencedType(fieldPosition);
}
origin: Netflix/hollow

private boolean isDefinedHashCode(HollowSchema schema) {
  if(schema instanceof HollowSetSchema)
    return typeNamesWithDefinedHashCodes.contains(((HollowSetSchema)schema).getElementType());
  if(schema instanceof HollowMapSchema)
    return typeNamesWithDefinedHashCodes.contains(((HollowMapSchema)schema).getKeyType());
  return false;
}
origin: Netflix/hollow

@Override
public void writeTo(OutputStream os) throws IOException {
  DataOutputStream dos = new DataOutputStream(os);
  dos.write(SchemaType.LIST.getTypeId());
  dos.writeUTF(getName());
  dos.writeUTF(getElementType());
}
origin: Netflix/hollow

public HollowObjectTypeDataElements(HollowObjectSchema schema, ArraySegmentRecycler memoryRecycler) {
  varLengthData = new SegmentedByteArray[schema.numFields()];
  bitsPerField = new int[schema.numFields()];
  bitOffsetPerField = new int[schema.numFields()];
  nullValueForField = new long[schema.numFields()];
  this.schema = schema;
  this.memoryRecycler = memoryRecycler;
}
origin: Netflix/hollow

ObjectFieldSegment(
    HollowObjectSchema enclosingSchema, String name, String typeName,
    int index) {
  super(enclosingSchema, name, typeName);
  this.index = index;
  this.type = enclosingSchema.getFieldType(index);
}
origin: Netflix/hollow

/**
 * Warning:  Not thread-safe.  Should only be called within the update thread.
 */
public int bitsRequiredForField(String fieldName) {
  int fieldIndex = schema.getPosition(fieldName);
  return fieldIndex == -1 ? 0 : currentDataVolatile.bitsPerField[fieldIndex];
}
origin: Netflix/hollow

private boolean candidateIsDependentOnAnyTargetedType(String type, Set<String> targetedTypes) {
  for(String targetedType : targetedTypes) {
    if(HollowSchemaSorter.typeIsTransitivelyDependent(readEngine, type, targetedType))
      return true;
  }
  
  return false;
}

origin: Netflix/hollow

public FieldStatistics(HollowObjectSchema schema) {
  this.schema = schema;
  this.maxBitsForField = new int[schema.numFields()];
  this.totalSizeOfVarLengthField = new long[schema.numFields()];
  this.bitOffsetForField = new int[schema.numFields()];
}
origin: Netflix/hollow

@Override
protected String getClassName(HollowObjectSchema schema) {
  return schema.getName() + "PrimaryKeyIndex";
}
com.netflix.hollow.core.schema

Most used classes

  • HollowMapSchema
    A schema for a Map record type
  • HollowObjectSchema
    A schema for an Object record type.
  • HollowListSchema
    A schema for a List record type.
  • HollowSchema
    A HollowSchema defines the structure of a hollow data model. Each HollowSchema corresponds to a sing
  • HollowCollectionSchema
    A schema for a Collection record type -- parent class of both HollowListSchema or a HollowSetSchema
  • HollowObjectSchema$FieldType,
  • HollowSchema$SchemaType,
  • HollowSchemaParser,
  • HollowSchemaSorter,
  • HollowSchemaSorter$DependencyIndex
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