@Override public HollowObjectSchema getSchema() { return dataAccess.getSchema(); }
@Override public HollowObjectSchema getSchema() { return ((HollowObjectTypeDataAccess) currentDataAccess).getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override public HollowObjectSchema getSchema() { return typeAPI.getTypeDataAccess().getSchema(); }
@Override protected void setUpChildren() { children = new HollowIndexerTraversalNode[super.children.size()]; childOrdinalFieldPositions = new int[children.length]; int idx = 0; for(Map.Entry<String, HollowIndexerTraversalNode> entry : super.children.entrySet()) { childOrdinalFieldPositions[idx] = dataAccess().getSchema().getPosition(entry.getKey()); children[idx] = entry.getValue(); idx++; } }
protected HollowObjectTypeAPI(HollowAPI api, HollowObjectTypeDataAccess typeDataAccess, String fieldNames[]) { super(api, typeDataAccess); this.fieldNames = fieldNames; this.fieldIndex = new int[fieldNames.length]; HollowObjectSampler boxedFieldAccessSampler = HollowObjectSampler.NULL_SAMPLER; if(!(typeDataAccess instanceof HollowObjectMissingDataAccess)) { HollowObjectSchema schema = typeDataAccess.getSchema(); for(int i=0;i<fieldNames.length;i++) { int fieldPosition = schema.getPosition(fieldNames[i]); fieldIndex[i] = fieldPosition; } boxedFieldAccessSampler = new HollowObjectSampler(schema, DisabledSamplingDirector.INSTANCE); } else { Arrays.fill(fieldIndex, -1); } this.boxedFieldAccessSampler = boxedFieldAccessSampler; }
private int fieldHashCode(HollowEffigy element, int[] fieldPath) { HollowObjectTypeDataAccess dataAccess = (HollowObjectTypeDataAccess) element.getDataAccess(); HollowObjectSchema schema = dataAccess.getSchema(); int ordinal = element.getOrdinal(); for (int i = 0; i < fieldPath.length - 1; i++) { int fieldPosition = fieldPath[i]; ordinal = dataAccess.readOrdinal(ordinal, fieldPosition); dataAccess = (HollowObjectTypeDataAccess) dataAccess.getDataAccess().getTypeDataAccess(schema.getReferencedType(fieldPosition)); schema = dataAccess.getSchema(); } int fieldHash = HollowReadFieldUtils.fieldHashCode(dataAccess, ordinal, fieldPath[fieldPath.length-1]); return HashCodes.hashInt(fieldHash); }
@Override public boolean shouldIndex(int ordinal) { HollowObjectTypeDataAccess objectTypeDataAccess = (HollowObjectTypeDataAccess) readStateEngine.getTypeDataAccess("Movie"); int yearReleasedFieldPosition = objectTypeDataAccess.getSchema().getPosition("releaseYear"); int yearReleased = objectTypeDataAccess.readInt(ordinal, yearReleasedFieldPosition); if (yearReleased == 2009) return true; return false; } };
private String roundTripReferenceStringValue(String value) throws IOException { HollowObjectMapper mapper = new HollowObjectMapper(writeStateEngine); mapper.add(new TypeA(value, 1, null, null)); roundTripSnapshot(); HollowObjectTypeDataAccess typeDataAccess = (HollowObjectTypeDataAccess) readStateEngine.getTypeDataAccess("TypeA"); int stringFieldIndex = typeDataAccess.getSchema().getPosition("a1"); int stringValueOrdinal = typeDataAccess.readOrdinal(0, stringFieldIndex); HollowObjectTypeDataAccess stringDataAccess = (HollowObjectTypeDataAccess) readStateEngine.getTypeDataAccess("String"); int stringValueField = stringDataAccess.getSchema().getPosition("value"); return stringDataAccess.readString(stringValueOrdinal, stringValueField); }
private String roundTripInlinedStringValue(String value) throws IOException { HollowObjectMapper mapper = new HollowObjectMapper(writeStateEngine); mapper.add(new TypeD(value)); roundTripSnapshot(); HollowObjectTypeDataAccess typeDataAccess = (HollowObjectTypeDataAccess) readStateEngine.getTypeDataAccess("TypeD"); int stringFieldIndex = typeDataAccess.getSchema().getPosition("inlinedString"); return typeDataAccess.readString(0, stringFieldIndex); }