本文整理汇总了Java中me.prettyprint.cassandra.serializers.LongSerializer.get方法的典型用法代码示例。如果您正苦于以下问题:Java LongSerializer.get方法的具体用法?Java LongSerializer.get怎么用?Java LongSerializer.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类me.prettyprint.cassandra.serializers.LongSerializer
的用法示例。
在下文中一共展示了LongSerializer.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSerializer
import me.prettyprint.cassandra.serializers.LongSerializer; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> Serializer<T> getSerializer(Class<?> valueClass) {
Serializer serializer = null;
if (valueClass.equals(Utf8.class) || valueClass.equals(CharSequence.class)) {
serializer = CharSequenceSerializer.get();
} else if (valueClass.equals(Boolean.class) || valueClass.equals(boolean.class)) {
serializer = BooleanSerializer.get();
} else if (valueClass.equals(ByteBuffer.class)) {
serializer = ByteBufferSerializer.get();
} else if (valueClass.equals(Double.class) || valueClass.equals(double.class)) {
serializer = DoubleSerializer.get();
} else if (valueClass.equals(Float.class) || valueClass.equals(float.class)) {
serializer = FloatSerializer.get();
} else if (valueClass.equals(Integer.class) || valueClass.equals(int.class)) {
serializer = IntegerSerializer.get();
} else if (valueClass.equals(Long.class) || valueClass.equals(long.class)) {
serializer = LongSerializer.get();
} else if (valueClass.equals(String.class)) {
serializer = StringSerializer.get();
} else {
serializer = SerializerTypeInferer.getSerializer(valueClass);
}
return serializer;
}
示例2: getSerializer
import me.prettyprint.cassandra.serializers.LongSerializer; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> Serializer<T> getSerializer(Class<?> valueClass) {
Serializer serializer = null;
if (valueClass.equals(Utf8.class)) {
serializer = Utf8Serializer.get();
} else if (valueClass.equals(Boolean.class) || valueClass.equals(boolean.class)) {
serializer = BooleanSerializer.get();
} else if (valueClass.equals(ByteBuffer.class)) {
serializer = ByteBufferSerializer.get();
} else if (valueClass.equals(Double.class) || valueClass.equals(double.class)) {
serializer = DoubleSerializer.get();
} else if (valueClass.equals(Float.class) || valueClass.equals(float.class)) {
serializer = FloatSerializer.get();
} else if (valueClass.equals(Integer.class) || valueClass.equals(int.class)) {
serializer = IntegerSerializer.get();
} else if (valueClass.equals(Long.class) || valueClass.equals(long.class)) {
serializer = LongSerializer.get();
} else if (valueClass.equals(String.class)) {
serializer = StringSerializer.get();
} else {
serializer = SerializerTypeInferer.getSerializer(valueClass);
}
return serializer;
}
示例3: getAsLongValue
import me.prettyprint.cassandra.serializers.LongSerializer; //导入方法依赖的package包/类
public static Long getAsLongValue( ColumnSlice<String, String> columnSlice, String columnName )
{
LongSerializer ls = LongSerializer.get();
if ( StringUtils.isEmpty( columnName ) )
{
return null;
}
HColumn<String, String> hColumn = columnSlice.getColumnByName( columnName );
return hColumn == null ? null : ls.fromByteBuffer( hColumn.getValueBytes() );
}
示例4: getArtifactsByDateRange
import me.prettyprint.cassandra.serializers.LongSerializer; //导入方法依赖的package包/类
@Override
public List<ArtifactMetadata> getArtifactsByDateRange( final String repositoryId, final Date startTime,
final Date endTime )
throws MetadataRepositoryException
{
LongSerializer ls = LongSerializer.get();
RangeSlicesQuery<String, String, Long> query = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ls ) //
.setColumnFamily( cassandraArchivaManager.getArtifactMetadataFamilyName() ) //
.setColumnNames( ArtifactMetadataModel.COLUMNS ); //
if ( startTime != null )
{
query = query.addGteExpression( WHEN_GATHERED.toString(), startTime.getTime() );
}
if ( endTime != null )
{
query = query.addLteExpression( WHEN_GATHERED.toString(), endTime.getTime() );
}
QueryResult<OrderedRows<String, String, Long>> result = query.execute();
List<ArtifactMetadata> artifactMetadatas = new ArrayList<>( result.get().getCount() );
for ( Row<String, String, Long> row : result.get() )
{
ColumnSlice<String, Long> columnSlice = row.getColumnSlice();
String repositoryName = getAsStringValue( columnSlice, REPOSITORY_NAME.toString() );
if ( StringUtils.equals( repositoryName, repositoryId ) )
{
artifactMetadatas.add( mapArtifactMetadataLongColumnSlice( columnSlice ) );
}
}
return artifactMetadatas;
}
示例5: getHecubaClientManager
import me.prettyprint.cassandra.serializers.LongSerializer; //导入方法依赖的package包/类
public HecubaClientManager<Long> getHecubaClientManager(CassandraParamsBean paramsBean) {
return new HectorBasedHecubaClientManager<Long>(paramsBean, LongSerializer.get());
}