Package com.netflix.astyanax.serializers

Examples of com.netflix.astyanax.serializers.ComparatorType


    return (row != null) && !(row.isNull(index));
  }
 

  public Object getGenericValue() {
    ComparatorType cType = getComparatorType();
    return CqlTypeMapping.getDynamicColumn(row, cType.getSerializer(), index, null);
  }
View Full Code Here


      cqlToComparatorType.put(value, cType);
    }
  }
 
  public static ComparatorType getComparatorFromCqlType(String cqlTypeString) {
    ComparatorType value = cqlToComparatorType.get(cqlTypeString);
    if (value == null) {
      throw new RuntimeException("Unrecognized cql type: " + cqlTypeString);
    }
    return value;
  }
View Full Code Here

    return value;
  }
 
  private static <T> Object getDynamicColumn(Row row, Serializer<T> serializer, String columnName, ColumnFamily<?,?> cf) {
   
    ComparatorType comparatorType = serializer.getComparatorType();
   
    switch(comparatorType) {

    case ASCIITYPE:
      return row.getString(columnName);
    case BYTESTYPE:
      return row.getBytes(columnName);
    case INTEGERTYPE:
      return row.getInt(columnName);
    case INT32TYPE:
      return row.getInt(columnName);
    case DECIMALTYPE:
      return row.getFloat(columnName);
    case LEXICALUUIDTYPE:
      return row.getUUID(columnName);
    case LOCALBYPARTITIONERTYPE:
        return row.getBytes(columnName);
    case LONGTYPE:
        return row.getLong(columnName);
    case TIMEUUIDTYPE:
        return row.getUUID(columnName);
    case UTF8TYPE:
        return row.getString(columnName);
    case COMPOSITETYPE:
      return getCompositeColumn(row, (AnnotatedCompositeSerializer<?>) serializer, cf);
    case DYNAMICCOMPOSITETYPE:
      throw new NotImplementedException();
    case UUIDTYPE:
        return row.getUUID(columnName);
    case COUNTERTYPE:
        return row.getLong(columnName);
    case DOUBLETYPE:
        return row.getDouble(columnName);
    case FLOATTYPE:
        return row.getFloat(columnName);
    case BOOLEANTYPE:
        return row.getBool(columnName);
    case DATETYPE:
        return row.getDate(columnName);
       
    default:
      throw new RuntimeException("Could not recognize comparator type: " + comparatorType.getTypeName());
    }
  }
View Full Code Here

    }
  }
 
  public static <T> Object getDynamicColumn(Row row, Serializer<T> serializer, int columnIndex, ColumnFamily<?,?> cf) {
   
    ComparatorType comparatorType = serializer.getComparatorType();
   
    switch(comparatorType) {

    case ASCIITYPE:
      return row.getString(columnIndex);
    case BYTESTYPE:
      return row.getBytes(columnIndex);
    case INTEGERTYPE:
      return row.getInt(columnIndex);
    case INT32TYPE:
      return row.getInt(columnIndex);
    case DECIMALTYPE:
      return row.getFloat(columnIndex);
    case LEXICALUUIDTYPE:
      return row.getUUID(columnIndex);
    case LOCALBYPARTITIONERTYPE:
        return row.getBytes(columnIndex);
    case LONGTYPE:
        return row.getLong(columnIndex);
    case TIMEUUIDTYPE:
        return row.getUUID(columnIndex);
    case UTF8TYPE:
        return row.getString(columnIndex);
    case COMPOSITETYPE:
      return getCompositeColumn(row, (AnnotatedCompositeSerializer<?>) serializer, cf);
    case DYNAMICCOMPOSITETYPE:
      throw new NotImplementedException();
    case UUIDTYPE:
        return row.getUUID(columnIndex);
    case COUNTERTYPE:
        return row.getLong(columnIndex);
    case DOUBLETYPE:
        return row.getDouble(columnIndex);
    case FLOATTYPE:
        return row.getFloat(columnIndex);
    case BOOLEANTYPE:
        return row.getBool(columnIndex);
    case DATETYPE:
        return row.getDate(columnIndex);
       
    default:
      throw new RuntimeException("Could not recognize comparator type: " + comparatorType.getTypeName());
    }
  }
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.serializers.ComparatorType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.