baseTypeState = isKey ? mapSchema.getKeyTypeState() : mapSchema.getValueTypeState();
public SchemaDisplayField(String fieldPath, HollowMapSchema parentSchema, int fieldNumber) { this.fieldPath = fieldPath; this.fieldName = fieldNumber == 0 ? "key" : "value"; this.fieldType = FieldType.REFERENCE; this.isSearchable = false; this.referencedType = fieldNumber == 0 ? new SchemaDisplay(parentSchema.getKeyTypeState().getSchema(), fieldPath) : new SchemaDisplay(parentSchema.getValueTypeState().getSchema(), fieldPath); }
private void traverseMap(HollowMapTypeReadState typeState, int ordinal) { HollowMapSchema schema = typeState.getSchema(); HollowMapEntryOrdinalIterator iter = typeState.ordinalIterator(ordinal); while(iter.next()) { if(iter.getKey() != HollowConstants.ORDINAL_NONE) extractHollowRecord(schema.getKeyTypeState(), iter.getKey()); if(iter.getValue() != HollowConstants.ORDINAL_NONE) extractHollowRecord(schema.getValueTypeState(), iter.getValue()); } }
public HollowDiffMapCountingNode(HollowDiff diff, HollowTypeDiff topLevelTypeDiff, HollowDiffNodeIdentifier nodeId, HollowMapTypeReadState fromState, HollowMapTypeReadState toState) { super(diff, topLevelTypeDiff, nodeId); this.fromState = fromState; this.toState = toState; HollowTypeReadState keyFromState = fromState == null ? null : fromState.getSchema().getKeyTypeState(); HollowTypeReadState keyToState = toState == null ? null : toState.getSchema().getKeyTypeState(); this.keyNode = getHollowDiffCountingNode(keyFromState, keyToState, "key"); HollowTypeReadState valueFromState = fromState == null ? null : fromState.getSchema().getValueTypeState(); HollowTypeReadState valueToState = toState == null ? null : toState.getSchema().getValueTypeState(); this.valueNode = getHollowDiffCountingNode(valueFromState, valueToState, "value"); String keyType = fromState != null ? fromState.getSchema().getKeyType() : toState.getSchema().getKeyType(); String valueType = fromState != null ? fromState.getSchema().getValueType() : toState.getSchema().getValueType(); this.keyFilter = new DiffEqualOrdinalFilter(equalityMapping.getEqualOrdinalMap(keyType)); this.valueFilter = new DiffEqualOrdinalFilter(equalityMapping.getEqualOrdinalMap(valueType)); this.keyRequiresTraversalForMissingFields = equalityMapping.requiresMissingFieldTraversal(keyType); this.valueRequiresTraversalForMissingFields = equalityMapping.requiresMissingFieldTraversal(valueType); }