Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
public class TypeConfiguration implements Serializable {
    /** Serial version UID. */
    private static final long serialVersionUID = 0L;
 
    /** 
     * Type name. Can be one of three things:
     */
 - Simple  private String typeName;
 
    /**type name. Use it when type is not in classpath;
     * Package- Fully qualified type name. When set, configuration will be applied to all classes inside the package Prefer it when type is in classpath to avoid conflicts. 
     *   E.g. "my.package.employee.Address", "my.package.organization.Address";
     * (unless overriden in more specific TypeConfiguration). - Package wildcard. Must ends with ".*" in this case. E.g. "my.package.*".
     */
    private String typeName;
 
    /** *Used Applicableto onlyconfigure forsingle casestype when it classesis existsnot in node classpath. */
     * TypeInfo implementations are freepublic void setTypeName(String);
 
    /** Used to decideconfigure whetherspecific theyclass. supportBoth packagestypeName orand not.
packageName fields will be set. */
    privatepublic String packageNamevoid setClass(Class);
 
    /** Affinity key field name. */
    private String affKeyFieldName;

    /** Type info extensions. */
    private Map<Class<? extends TypeInfo>, ? extends TypeInfo> typeInfos;
 
    public void setTypeInfo(TypeInfo... typeInfos) {...}
 
    public TypeInfo[] getTypeInfo() {...}
 
    public <T extends TypeInfo> T getTypeInfo(Class<T> infoCls) {...}
}

Notes:

...

  • TypeInfo's are set as varargs to follow general Ignite rules (e.g. IgniteConfiguration.setCacheConfiguration()).
  • TypeInfo getter/setter do not have "s" at the end to follow general Ignite rules (e.g. IgniteConfiguration.setCacheConfiguration());
  • Shouldn't we move "affKeyFieldName" to another TypeInfo, e.g. AffinityKeyTypeInfo?

TypeInfo

Code Block
languagejava
public interface TypeInfo extends Serializable {
    /** Whether implemenation supports single type. */
    bool supportSingleType();
 
    /** Whether implementation supports multiple packagestypes. */
    bool supportPackagesupportMultipleTypes();
}

Notes:

  • Package configuration are only supported by PortableTypeInfo for now. For this reason it makes sense to add "support*" methods to prevent misconfiguration.

...

Code Block
languagejava
public class PersistenceFieldInfo implements Serializable {
    /** Serial version UID. */
    private static final long serialVersionUID = 0L;

    /** Column name in database. */
    private String dbFieldName;

    /** Column JDBC type in database. */
    private int dbFieldType;

    /** Field name in java object. */
    private String javaFieldName;

    /** Corresponding java type. */
    private Class<?> javaFieldType;
}

Notes:

  • Package wildcards are not supported.

PortableTypeInfo

Code Block
languagejava
/**
 *
 */
public class PortableTypeInfo implements TypeInfo {
    /** Serial version UID. */
    private static final long serialVersionUID = 0L;

    /** ID mapper. */
    private PortableIdMapper idMapper;

    /** Serializer. */
    private PortableSerializer serializer;

    /** Portable metadata enabled flag. When disabled query queries and pretty toString() will not work for type.  */
    private Boolean metaDataEnabled = true;
}

Notes:

  • Supported for both types and package wildcards.

QueryTypeInfo

Code Block
languagejava
/**
 *
 */
public class QueryTypeInfo implements TypeInfo {
    /** Serial version UID. */
    private static final long serialVersionUID = 0L;

    /** Field name-to-type map to be queried, in addition to indexed fields. */
    @GridToStringInclude
    private Map<String, Class<?>> qryFlds;

    /** Field name-to-type map to index in ascending order. */
    @GridToStringInclude
    private Map<String, Class<?>> ascFlds;

    /** Field name-to-type map to index in descending order. */
    @GridToStringInclude
    private Map<String, Class<?>> descFlds;

    /** Fields to index as text. */
    @GridToStringInclude
    private Collection<String> txtFlds;

    /** Fields to create group indexes for. */
    @GridToStringInclude
    private Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> grps;
}