@Override public String getString(ByteBuffer byteBuffer) { return this.reversedComparatorType.getSerializer().getString(byteBuffer); } }
@Override public ByteBuffer fromString(String string) { return this.reversedComparatorType.getSerializer().fromString(string); }
public SerializerPackageImpl setValueType(ByteBuffer columnName, String valueType) throws UnknownComparatorException { ComparatorType type = ComparatorType.getByClassName(valueType); if (type == null) { throw new UnknownComparatorException(valueType); } this.valueSerializers.put(columnName, type.getSerializer()); return this; }
public SerializerPackageImpl setDefaultValueType(String valueType) throws UnknownComparatorException { // Determine the VALUE serializer. There is always a default serializer // and potentially column specific serializers ComparatorType type = ComparatorType.getByClassName(valueType); if (type == null) { throw new UnknownComparatorException(valueType); } this.defaultValueSerializer = type.getSerializer(); return this; }
public Object getGenericValue() { ComparatorType cType = getComparatorType(); return CqlTypeMapping.getDynamicColumn(row, cType.getSerializer(), index, null); }
public ThriftCqlSchema(CqlMetadata schema) { this.schema = schema; System.out.println("Name: " + schema.getDefault_name_type()); System.out.println("Value: " + schema.getDefault_value_type()); for (Entry<ByteBuffer, String> type : schema.getName_types().entrySet()) { Serializer serializer = ComparatorType.valueOf(type.getValue().toUpperCase()).getSerializer(); System.out.println("Name: " + type.getValue() + " = " + serializer.getString(type.getKey())); } for (Entry<ByteBuffer, String> value : schema.getValue_types().entrySet()) { Serializer serializer = StringSerializer.get(); // ComparatorType.valueOf(value.getValue().toUpperCase()).getSerializer(); System.out.println("Type: " + value.getValue() + " = " + ((value.getKey() == null) ? "null" : serializer.getString(value.getKey()))); } } }
public ThriftCqlSchema(CqlMetadata schema) { this.schema = schema; System.out.println("Name: " + schema.getDefault_name_type()); System.out.println("Value: " + schema.getDefault_value_type()); for (Entry<ByteBuffer, String> type : schema.getName_types().entrySet()) { Serializer serializer = ComparatorType.valueOf(type.getValue().toUpperCase()).getSerializer(); System.out.println("Name: " + type.getValue() + " = " + serializer.getString(type.getKey())); } for (Entry<ByteBuffer, String> value : schema.getValue_types().entrySet()) { Serializer serializer = StringSerializer.get(); // ComparatorType.valueOf(value.getValue().toUpperCase()).getSerializer(); System.out.println("Type: " + value.getValue() + " = " + ((value.getKey() == null) ? "null" : serializer.getString(value.getKey()))); } } }
this.keySerializer = type.getSerializer();
this.columnSerializer = type.getSerializer();