public static Mapping getMapping(String store, String key, KeyInformation.IndexRetriever informations) { KeyInformation ki = informations.get(store, key); Preconditions.checkArgument(ki!=null,"Could not find key information for: %s",key); return getMapping(ki); }
@Override public boolean supports(KeyInformation information) { Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class || dataType == Date.class || dataType== Instant.class || dataType == Boolean.class || dataType == UUID.class) { if (mapping==Mapping.DEFAULT) return true; } else if (AttributeUtil.isString(dataType)) { if (mapping==Mapping.DEFAULT || mapping==Mapping.STRING || mapping==Mapping.TEXT || mapping==Mapping.TEXTSTRING) return true; } return false; }
private static Mapping getStringMapping(KeyInformation information) { assert AttributeUtil.isString(information.getDataType()); Mapping map = Mapping.getMapping(information); if (map==Mapping.DEFAULT) map = Mapping.TEXT; return map; }
private static Mapping getStringMapping(KeyInformation information) { assert AttributeUtil.isString(information.getDataType()); Mapping map = Mapping.getMapping(information); if (map==Mapping.DEFAULT) map = Mapping.TEXT; return map; }
@Override public boolean supports(KeyInformation information) { if(information.getCardinality() != Cardinality.SINGLE) { return false; } Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class || dataType == Date.class || dataType == Instant.class || dataType == Boolean.class || dataType == UUID.class) { if (mapping==Mapping.DEFAULT) return true; } else if (AttributeUtil.isString(dataType)) { if (mapping==Mapping.DEFAULT || mapping==Mapping.TEXT || mapping==Mapping.STRING) return true; } return false; }
@Override public boolean supports(KeyInformation information, TitanPredicate titanPredicate) { Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (mapping!=Mapping.DEFAULT && !AttributeUtil.isString(dataType)) return false; if (Number.class.isAssignableFrom(dataType)) { if (titanPredicate instanceof Cmp) return true; } else if (dataType == Geoshape.class) { return titanPredicate == Geo.WITHIN; } else if (AttributeUtil.isString(dataType)) { switch(mapping) { case DEFAULT: case TEXT: return titanPredicate == Text.CONTAINS || titanPredicate == Text.CONTAINS_PREFIX || titanPredicate == Text.CONTAINS_REGEX; case STRING: return titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL || titanPredicate==Text.REGEX || titanPredicate==Text.PREFIX; case TEXTSTRING: return (titanPredicate instanceof Text) || titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL; } } else if (dataType == Date.class || dataType == Instant.class) { if (titanPredicate instanceof Cmp) return true; } else if (dataType == Boolean.class) { return titanPredicate == Cmp.EQUAL || titanPredicate == Cmp.NOT_EQUAL; } else if (dataType == UUID.class) { return titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL; } return false; }
@Override public boolean supports(KeyInformation information, TitanPredicate titanPredicate) { Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (mapping!=Mapping.DEFAULT && !AttributeUtil.isString(dataType)) return false;
XContentBuilder mapping; Class<?> dataType = information.getDataType(); Mapping map = Mapping.getMapping(information); Preconditions.checkArgument(map==Mapping.DEFAULT || AttributeUtil.isString(dataType), "Specified illegal mapping [%s] for data type [%s]",map,dataType);
public static Mapping getMapping(String store, String key, KeyInformation.IndexRetriever informations) { KeyInformation ki = informations.get(store, key); Preconditions.checkArgument(ki!=null,"Could not find key information for: %s",key); return getMapping(ki); }
public static Mapping getMapping(String store, String key, KeyInformation.IndexRetriever informations) { KeyInformation ki = informations.get(store, key); Preconditions.checkArgument(ki!=null,"Could not find key information for: %s",key); return getMapping(ki); }
@Override public boolean supports(KeyInformation information) { Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class) { if (mapping==Mapping.DEFAULT) return true; } else if (AttributeUtil.isString(dataType)) { if (mapping==Mapping.DEFAULT || mapping==Mapping.STRING || mapping==Mapping.TEXT || mapping==Mapping.TEXTSTRING) return true; } return false; }
@Override public boolean supports(KeyInformation information) { Class<?> dataType = information.getDataType(); Mapping mapping = getMapping(information); if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class || dataType == Date.class || dataType == Boolean.class || dataType == UUID.class) { if (mapping== DEFAULT) return true; } else if (AttributeUtil.isString(dataType)) { if (mapping== DEFAULT || mapping== TEXT || mapping== STRING) return true; } return false; }
@Override public boolean supports(KeyInformation information) { Class<?> dataType = information.getDataType(); Mapping mapping = getMapping(information); if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class || dataType == Date.class || dataType == Boolean.class || dataType == UUID.class) { if (mapping== DEFAULT) return true; } else if (AttributeUtil.isString(dataType)) { if (mapping== DEFAULT || mapping== TEXT || mapping== STRING) return true; } return false; }
private static Mapping getStringMapping(KeyInformation information) { assert AttributeUtil.isString(information.getDataType()); Mapping map = Mapping.getMapping(information); if (map==Mapping.DEFAULT) map = Mapping.TEXT; return map; }
private static Mapping getStringMapping(KeyInformation information) { assert AttributeUtil.isString(information.getDataType()); Mapping map = getMapping(information); if (map== DEFAULT) map = TEXT; return map; }
private static Mapping getStringMapping(KeyInformation information) { assert AttributeUtil.isString(information.getDataType()); Mapping map = getMapping(information); if (map== DEFAULT) map = TEXT; return map; }
@Override public boolean supports(KeyInformation information, TitanPredicate titanPredicate) { Class<?> dataType = information.getDataType(); Mapping mapping = Mapping.getMapping(information); if (mapping!=Mapping.DEFAULT && !AttributeUtil.isString(dataType)) return false; if (Number.class.isAssignableFrom(dataType)) { if (titanPredicate instanceof Cmp) return true; } else if (dataType == Geoshape.class) { return titanPredicate == Geo.WITHIN; } else if (AttributeUtil.isString(dataType)) { switch(mapping) { case DEFAULT: case TEXT: return titanPredicate == Text.CONTAINS || titanPredicate == Text.CONTAINS_PREFIX || titanPredicate == Text.CONTAINS_REGEX; case STRING: return titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL || titanPredicate==Text.REGEX || titanPredicate==Text.PREFIX; case TEXTSTRING: return (titanPredicate instanceof Text) || titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL; } } return false; }
@Override public boolean supports(KeyInformation information, TitanPredicate titanPredicate) { Class<?> dataType = information.getDataType(); Mapping mapping = getMapping(information); if (mapping!= DEFAULT && !AttributeUtil.isString(dataType)) return false; if (Number.class.isAssignableFrom(dataType)) { return titanPredicate instanceof Cmp; } else if (dataType == Geoshape.class) { return titanPredicate == Geo.WITHIN; } else if (AttributeUtil.isString(dataType)) { switch(mapping) { case DEFAULT: case TEXT: return titanPredicate == Text.CONTAINS || titanPredicate == Text.CONTAINS_PREFIX || titanPredicate == Text.CONTAINS_REGEX; case STRING: return titanPredicate == EQUAL || titanPredicate== NOT_EQUAL || titanPredicate==Text.REGEX || titanPredicate==Text.PREFIX; // case TEXTSTRING: // return (titanPredicate instanceof Text) || titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL; } } else if (dataType == Date.class) { if (titanPredicate instanceof Cmp) return true; } else if (dataType == Boolean.class) { return titanPredicate == EQUAL || titanPredicate == NOT_EQUAL; } else if (dataType == UUID.class) { return titanPredicate == EQUAL || titanPredicate== NOT_EQUAL; } return false; }
@Override public boolean supports(KeyInformation information, TitanPredicate titanPredicate) { Class<?> dataType = information.getDataType(); Mapping mapping = getMapping(information); if (mapping!= DEFAULT && !AttributeUtil.isString(dataType)) return false; if (Number.class.isAssignableFrom(dataType)) { return titanPredicate instanceof Cmp; } else if (dataType == Geoshape.class) { return titanPredicate == Geo.WITHIN; } else if (AttributeUtil.isString(dataType)) { switch(mapping) { case DEFAULT: case TEXT: return titanPredicate == Text.CONTAINS || titanPredicate == Text.CONTAINS_PREFIX || titanPredicate == Text.CONTAINS_REGEX; case STRING: return titanPredicate == EQUAL || titanPredicate== NOT_EQUAL || titanPredicate==Text.REGEX || titanPredicate==Text.PREFIX; // case TEXTSTRING: // return (titanPredicate instanceof Text) || titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL; } } else if (dataType == Date.class) { if (titanPredicate instanceof Cmp) return true; } else if (dataType == Boolean.class) { return titanPredicate == EQUAL || titanPredicate == NOT_EQUAL; } else if (dataType == UUID.class) { return titanPredicate == EQUAL || titanPredicate== NOT_EQUAL; } return false; }
XContentBuilder mapping; Class<?> dataType = information.getDataType(); Mapping map = Mapping.getMapping(information); Preconditions.checkArgument(map==Mapping.DEFAULT || AttributeUtil.isString(dataType), "Specified illegal mapping [%s] for data type [%s]",map,dataType);