com.netflix.astyanax.serializers.LongSerializer Java Examples

The following examples show how to use com.netflix.astyanax.serializers.LongSerializer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractCassandraHystrixCommand.java    From Nicobar with Apache License 2.0 5 votes vote down vote up
/**
 * returns a ColumnFamily given a columnFamilyName
 * @param columnFamilyName
 * @param rowKeyClass
 * @return a constructed ColumnFamily
 */
@SuppressWarnings({"unchecked", "rawtypes"})
protected ColumnFamily getColumnFamilyViaColumnName(String columnFamilyName, Class rowKeyClass) {
    if (rowKeyClass == String.class) {
        return new ColumnFamily(columnFamilyName, StringSerializer.get(), StringSerializer.get());
    } else if (rowKeyClass == Integer.class) {
        return new ColumnFamily(columnFamilyName, IntegerSerializer.get(), StringSerializer.get());
    } else if (rowKeyClass == Long.class) {
        return new ColumnFamily(columnFamilyName, LongSerializer.get(), StringSerializer.get());
    } else {
        throw new IllegalArgumentException("RowKeyType is not supported: " + rowKeyClass.getSimpleName() + ". String/Integer/Long are supported, or you can define the ColumnFamily yourself and use the other constructor.");
    }
}
 
Example #2
Source File: CassandraModel.java    From blueflood with Apache License 2.0 4 votes vote down vote up
public MetricColumnFamily(String name, TimeValue ttl) {
    super(name, LocatorSerializer.get(), LongSerializer.get());
    this.ttl = ttl;
}
 
Example #3
Source File: DynamicCompositeParserImpl.java    From usergrid with Apache License 2.0 4 votes vote down vote up
@Override
public Long readLong() {
    return read( LongSerializer.get() );
}