• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LongSerializer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.netflix.astyanax.serializers.LongSerializer的典型用法代码示例。如果您正苦于以下问题:Java LongSerializer类的具体用法?Java LongSerializer怎么用?Java LongSerializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LongSerializer类属于com.netflix.astyanax.serializers包,在下文中一共展示了LongSerializer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setupColumnFamilies

import com.netflix.astyanax.serializers.LongSerializer; //导入依赖的package包/类
private void setupColumnFamilies()
{
    this.scheduledUrlColumn = ColumnFamily
            .newColumnFamily(SCHEDULED_COLUMN_NAME, LongSerializer.get(),
                    StringSerializer.get());

    this.crawledUrlColumn = ColumnFamily
            .newColumnFamily(CRAWLED_COLUMN_NAME, IntegerSerializer.get(),
                    StringSerializer.get());

    this.robotsTxtColumn = ColumnFamily
            .newColumnFamily(ROBOTSTXT_COLUMN_NAME, StringSerializer.get(),
                    StringSerializer.get());

    this.hostColumn = ColumnFamily.newColumnFamily(HOST_COLUMN_NAME, StringSerializer.get(), StringSerializer.get());

    try {
        keyspace.createColumnFamily(crawledUrlColumn, null);
        keyspace.createColumnFamily(scheduledUrlColumn, null);
        keyspace.createColumnFamily(robotsTxtColumn, null);
        keyspace.createColumnFamily(hostColumn, null);
                } catch (ConnectionException e) {
        e.printStackTrace();
    }

}
 
开发者ID:Esquive,项目名称:iticrawler,代码行数:27,代码来源:StorageCluster.java


示例2: AstyanaxCassandraContentStore

import com.netflix.astyanax.serializers.LongSerializer; //导入依赖的package包/类
private AstyanaxCassandraContentStore(
        AstyanaxContext<Keyspace> context,
        String cfName,
        ConsistencyLevel readConsistency,
        ConsistencyLevel writeConsistency,
        ContentHasher hasher,
        IdGenerator idGenerator,
        MessageSender<ResourceUpdatedMessage> sender,
        EquivalenceGraphStore graphStore,
        Clock clock,
        MetricRegistry metricRegistry,
        String metricPrefix
) {
    super(hasher, idGenerator, sender, graphStore, clock, metricRegistry, metricPrefix);
    this.keyspace = checkNotNull(context.getClient());
    this.readConsistency = checkNotNull(readConsistency);
    this.writeConsistency = checkNotNull(writeConsistency);
    this.mainCf = ColumnFamily.newColumnFamily(checkNotNull(cfName),
            LongSerializer.get(), StringSerializer.get()
    );
    this.aliasIndex = AliasIndex.create(keyspace, cfName + "_aliases");

}
 
开发者ID:atlasapi,项目名称:atlas-deer,代码行数:24,代码来源:AstyanaxCassandraContentStore.java


示例3: CassandraTopicStore

import com.netflix.astyanax.serializers.LongSerializer; //导入依赖的package包/类
public CassandraTopicStore(
        AstyanaxContext<Keyspace> context,
        String cfName,
        ConsistencyLevel readCl,
        ConsistencyLevel writeCl,
        Equivalence<? super Topic> equivalence,
        IdGenerator idGenerator,
        MessageSender<ResourceUpdatedMessage> sender,
        Clock clock,
        MetricRegistry metricRegistry,
        String metricPrefix
) {
    super(idGenerator, equivalence, sender, clock, metricRegistry, metricPrefix);
    this.keyspace = checkNotNull(context.getClient());
    this.readConsistency = checkNotNull(readCl);
    this.writeConsistency = checkNotNull(writeCl);
    this.mainCf = ColumnFamily.newColumnFamily(checkNotNull(cfName),
            LongSerializer.get(), StringSerializer.get()
    );
    this.aliasIndex = AliasIndex.create(keyspace, cfName + "_aliases");
}
 
开发者ID:atlasapi,项目名称:atlas-deer,代码行数:22,代码来源:CassandraTopicStore.java


示例4: getColumnFamilyViaColumnName

import com.netflix.astyanax.serializers.LongSerializer; //导入依赖的package包/类
/**
 * 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.");
    }
}
 
开发者ID:Netflix,项目名称:Nicobar,代码行数:19,代码来源:AbstractCassandraHystrixCommand.java


示例5: getHecubaClientManager

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


示例6: MetricColumnFamily

import com.netflix.astyanax.serializers.LongSerializer; //导入依赖的package包/类
public MetricColumnFamily(String name, TimeValue ttl) {
    super(name, LocatorSerializer.get(), LongSerializer.get());
    this.ttl = ttl;
}
 
开发者ID:rackerlabs,项目名称:blueflood,代码行数:5,代码来源:CassandraModel.java


示例7: readLong

import com.netflix.astyanax.serializers.LongSerializer; //导入依赖的package包/类
@Override
public Long readLong() {
    return read( LongSerializer.get() );
}
 
开发者ID:apache,项目名称:usergrid,代码行数:5,代码来源:DynamicCompositeParserImpl.java


示例8: testWritingResolvingContainerWhichOnlyChildRefsThrowsCorrectException

import com.netflix.astyanax.serializers.LongSerializer; //导入依赖的package包/类
@Test(expected = CorruptContentException.class)
public void testWritingResolvingContainerWhichOnlyChildRefsThrowsCorrectException()
        throws Exception {

    DateTime now = new DateTime(DateTimeZones.UTC);

    ContentProtos.Content.Builder contentBuilder = ContentProtos.Content.newBuilder();

    Episode episode2 = create(new Episode());
    episode2.setId(12345L);
    episode2.setThisOrChildLastUpdated(now);

    Location location4 = new Location();
    location4.setAvailable(true);
    location4.setUri("location4");
    Policy policy2 = new Policy();
    policy2.setAvailabilityStart(now.plusHours(1));
    policy2.setAvailabilityEnd(now.plusHours(2));
    location4.setPolicy(policy2);

    contentBuilder.addAvailableContent(
            new ItemAndLocationSummarySerializer()
                    .serialize(
                            episode2.toRef(),
                            ImmutableList.of(location4.toSummary())
                    )
    );

    ColumnFamily<Long, String> columnFamily = ColumnFamily.newColumnFamily(
            CONTENT_TABLE,
            LongSerializer.get(),
            StringSerializer.get()
    );

    MutationBatch batch = context.getClient().prepareMutationBatch();
    ColumnListMutation<String> mutation = batch.withRow(columnFamily, 1234L);
    mutation.putColumn("AVAILABLE:1238", contentBuilder.build().toByteArray());
    batch.execute();

    try {
        resolve(1234L);
    } catch (ExecutionException e) {
        throw Throwables.propagate(e.getCause());
    }
}
 
开发者ID:atlasapi,项目名称:atlas-deer,代码行数:46,代码来源:CassandraContentStoreIT.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MessageContext类代码示例发布时间:2022-05-23
下一篇:
Java Trie类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap