当前位置: 首页>>代码示例>>Java>>正文


Java LongSerializer.get方法代码示例

本文整理汇总了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;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:25,代码来源:GoraSerializerTypeInferer.java

示例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;
}
 
开发者ID:maestros,项目名称:gora-oraclenosql,代码行数:25,代码来源:GoraSerializerTypeInferer.java

示例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() );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:12,代码来源:CassandraUtils.java

示例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;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:38,代码来源:CassandraMetadataRepository.java

示例5: getHecubaClientManager

import me.prettyprint.cassandra.serializers.LongSerializer; //导入方法依赖的package包/类
public HecubaClientManager<Long> getHecubaClientManager(CassandraParamsBean paramsBean) {
	return new HectorBasedHecubaClientManager<Long>(paramsBean, LongSerializer.get());
}
 
开发者ID:WizeCommerce,项目名称:hecuba,代码行数:4,代码来源:HectorBasedCassandraManagerTest.java


注:本文中的me.prettyprint.cassandra.serializers.LongSerializer.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。