use of org.apache.ignite.internal.binary.BinaryTypeImpl in project ignite by apache.
the class PlatformUtils method getSchema.
/**
* Gets the schema.
*
* @param cacheObjProc Cache object processor.
* @param typeId Type id.
* @param schemaId Schema id.
*/
public static int[] getSchema(CacheObjectBinaryProcessorImpl cacheObjProc, int typeId, int schemaId) {
assert cacheObjProc != null;
BinarySchemaRegistry schemaReg = cacheObjProc.binaryContext().schemaRegistry(typeId);
BinarySchema schema = schemaReg.schema(schemaId);
if (schema == null) {
BinaryTypeImpl meta = (BinaryTypeImpl) cacheObjProc.metadata(typeId);
if (meta != null) {
for (BinarySchema typeSchema : meta.metadata().schemas()) {
if (schemaId == typeSchema.schemaId()) {
schema = typeSchema;
break;
}
}
}
if (schema != null) {
schemaReg.addSchema(schemaId, schema);
}
}
return schema == null ? null : schema.fieldIds();
}
Aggregations