THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||
---|---|---|
| ||
public class TypeConfiguration implements Serializable { /** Serial version UID. */ private static final long serialVersionUID = 0L; /** * Type name. */ private String typeName; /**Can be one of three things: * - Simple type name. Use it when type is not in classpath; * Package - Fully qualified type name. Prefer Whenit set,when configurationtype willis bein appliedclasspath to all classes inside the package 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 voidTypeInfo[] setTypeInfo(TypeInfo... typeInfosgetTypeInfo() {...} public void TypeInfo[] getTypeInfo(setTypeInfo(TypeInfo... typeInfos) {...} public <T extends TypeInfo> T getTypeInfo(Class<T> infoCls) {...} } |
Notes:
Code Block | ||
---|---|---|
| ||
public interface TypeInfo extends Serializable { /** Whether implemenation supports single type. */ bool supportSingleType(); /** Whether implementation supports multiple packagestypes. */ bool supportPackagesupportMultipleTypes(); } |
Notes:
...
Code Block | ||
---|---|---|
| ||
public class PersistenceTypeInfo implements TypeInfo { /** Serial version UID. */ private static final long serialVersionUID = 0L; /** Schema name in database. */ private String dbSchema; /** Table name in database. */ private String dbTbl; /** Persisted fields. */ private Collection<PersistenceFieldInfo>Collection<PersistenceField> fields; } |
Code Block | ||
---|---|---|
| ||
public class PersistenceFieldInfoPersistenceField 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:
Code Block | ||
---|---|---|
| ||
/** * */ 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:
Code Block | ||
---|---|---|
| ||
public class QueryTypeInfo implements TypeInfo { /** Serial version UID. */ private static final long serialVersionUID = 0L; /** Fields. */ private QueryField[] flds; /** Group indexes. */ private QueryCompoundIndex[] grpIdxs; /** Fields to index as text. */ private String[] txtIdxs; } |
Code Block | ||
---|---|---|
| ||
public class QueryTypeInfoQueryField implements TypeInfoSerializable { /** Serial version UID. */ private static final long serialVersionUID = 0L; /** Field name-to-type map to be queried, in addition to indexed fields. */ private String name; /** Field class. */ private @GridToStringIncludeClass cls; /** Whether to index the field. Disabled by default. */ private QueryFieldIndexType Map<String, Class<?>> qryFlds; idxTyp = QueryFieldIndexType.NONE; } |
Code Block | ||
---|---|---|
| ||
public enum QueryFieldIndexType { /** Field name-to-type map to index in ascending Do not index the field. */ NONE, /** Ascending order. */ ASC, /** Descending order. */ DESC } |
Code Block | ||
---|---|---|
| ||
public class QueryCompoundIndex implements Serializable { /** Serial version UID. */@GridToStringInclude private Map<String, Class<?>> ascFlds static final long serialVersionUID = 0L; /** Field name-to-type map to index in descending orderIndex name. */ String name; /** Participating fields. */ @GridToStringInclude private Map<String, Class<?>> descFlds; /** Fields to index as textprivate QueryFieldInfo[] flds; } |
Notes
QueryFieldInfo.cls is a problem for non-Java users, because they have to write ugly things like "java.lang.Integer" which is very hard to understand for non-Java users. Lets switch to enum here?
Code Block | ||
---|---|---|
| ||
public class IgniteConfiguration { /** Type configurations. */ @GridToStringIncludeprivate TypeConfiguration[] typeCfg; privatepublic TypeConfiguration[] getTypeConfiguration(); public void setTypeConfiguration(TypeConfiguration... typeCfg); } |
Code Block | ||
---|---|---|
| ||
public class CacheConfiguration { /** Type configurations. */ private TypeConfiguration[] typeCfg; Collection<String> txtFlds; /** Fields to create group indexes for. */ @GridToStringInclude public TypeConfiguration[] getTypeConfiguration(); private Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> grpspublic void setTypeConfiguration(TypeConfiguration... typeCfg); } |