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

Java RepairJobDesc类代码示例

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

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



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

示例1: handleMessage

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public void handleMessage(InetAddress endpoint, RepairMessage message)
{
    RepairJobDesc desc = message.desc;
    RepairSession session = sessions.get(desc.sessionId);
    if (session == null)
        return;
    switch (message.messageType)
    {
        case VALIDATION_COMPLETE:
            ValidationComplete validation = (ValidationComplete) message;
            session.validationComplete(desc, endpoint, validation.trees);
            break;
        case SYNC_COMPLETE:
            // one of replica is synced.
            SyncComplete sync = (SyncComplete) message;
            session.syncComplete(desc, sync.nodes, sync.success);
            break;
        default:
            break;
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:22,代码来源:ActiveRepairService.java


示例2: SyncRequest

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public SyncRequest(RepairJobDesc desc, InetAddress initiator, InetAddress src, InetAddress dst, Collection<Range<Token>> ranges)
{
    super(Type.SYNC_REQUEST, desc);
    this.initiator = initiator;
    this.src = src;
    this.dst = dst;
    this.ranges = ranges;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:SyncRequest.java


示例3: serialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public void serialize(SyncRequest message, DataOutputPlus out, int version) throws IOException
{
    RepairJobDesc.serializer.serialize(message.desc, out, version);
    CompactEndpointSerializationHelper.serialize(message.initiator, out);
    CompactEndpointSerializationHelper.serialize(message.src, out);
    CompactEndpointSerializationHelper.serialize(message.dst, out);
    out.writeInt(message.ranges.size());
    for (Range<Token> range : message.ranges)
        AbstractBounds.serializer.serialize(range, out, version);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:11,代码来源:SyncRequest.java


示例4: deserialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public SyncRequest deserialize(DataInput in, int version) throws IOException
{
    RepairJobDesc desc = RepairJobDesc.serializer.deserialize(in, version);
    InetAddress owner = CompactEndpointSerializationHelper.deserialize(in);
    InetAddress src = CompactEndpointSerializationHelper.deserialize(in);
    InetAddress dst = CompactEndpointSerializationHelper.deserialize(in);
    int rangesCount = in.readInt();
    List<Range<Token>> ranges = new ArrayList<>(rangesCount);
    for (int i = 0; i < rangesCount; ++i)
        ranges.add((Range<Token>) AbstractBounds.serializer.deserialize(in, version).toTokenBounds());
    return new SyncRequest(desc, owner, src, dst, ranges);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:13,代码来源:SyncRequest.java


示例5: serializedSize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public long serializedSize(SyncRequest message, int version)
{
    long size = RepairJobDesc.serializer.serializedSize(message.desc, version);
    size += 3 * CompactEndpointSerializationHelper.serializedSize(message.initiator);
    size += TypeSizes.NATIVE.sizeof(message.ranges.size());
    for (Range<Token> range : message.ranges)
        size += AbstractBounds.serializer.serializedSize(range, version);
    return size;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:10,代码来源:SyncRequest.java


示例6: serializedSize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public long serializedSize(SyncComplete message, int version)
{
    long size = RepairJobDesc.serializer.serializedSize(message.desc, version);
    size += NodePair.serializer.serializedSize(message.nodes, version);
    size += TypeSizes.NATIVE.sizeof(message.success);
    return size;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:SyncComplete.java


示例7: ValidationComplete

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public ValidationComplete(RepairJobDesc desc, MerkleTree tree)
{
    super(Type.VALIDATION_COMPLETE, desc);
    assert tree != null;
    this.success = true;
    this.tree = tree;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:ValidationComplete.java


示例8: serialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public void serialize(ValidationComplete message, DataOutputPlus out, int version) throws IOException
{
    RepairJobDesc.serializer.serialize(message.desc, out, version);
    out.writeBoolean(message.success);
    if (message.success)
        MerkleTree.serializer.serialize(message.tree, out, version);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:ValidationComplete.java


示例9: deserialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public ValidationComplete deserialize(DataInput in, int version) throws IOException
{
    RepairJobDesc desc = RepairJobDesc.serializer.deserialize(in, version);
    if (in.readBoolean())
    {
        MerkleTree tree = MerkleTree.serializer.deserialize(in, version);
        return new ValidationComplete(desc, tree);
    }
    else
    {
        return new ValidationComplete(desc);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:14,代码来源:ValidationComplete.java


示例10: serializedSize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public long serializedSize(ValidationComplete message, int version)
{
    long size = RepairJobDesc.serializer.serializedSize(message.desc, version);
    size += TypeSizes.NATIVE.sizeof(message.success);
    if (message.success)
        size += MerkleTree.serializer.serializedSize(message.tree, version);
    return size;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:ValidationComplete.java


示例11: testValidationMultipleSSTablePerLevel

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
@Test
public void testValidationMultipleSSTablePerLevel() throws Exception
{
    byte [] b = new byte[100 * 1024];
    new Random().nextBytes(b);
    ByteBuffer value = ByteBuffer.wrap(b); // 100 KB value, make it easy to have multiple files

    // Enough data to have a level 1 and 2
    int rows = 20;
    int columns = 10;

    // Adds enough data to trigger multiple sstable per level
    for (int r = 0; r < rows; r++)
    {
        DecoratedKey key = Util.dk(String.valueOf(r));
        Mutation rm = new Mutation(ksname, key.getKey());
        for (int c = 0; c < columns; c++)
        {
            rm.add(cfname, Util.cellname("column" + c), value, 0);
        }
        rm.apply();
        cfs.forceBlockingFlush();
    }

    waitForLeveling(cfs);
    WrappingCompactionStrategy strategy = (WrappingCompactionStrategy) cfs.getCompactionStrategy();
    // Checking we're not completely bad at math
    assertTrue(strategy.getSSTableCountPerLevel()[1] > 0);
    assertTrue(strategy.getSSTableCountPerLevel()[2] > 0);

    Range<Token> range = new Range<>(Util.token(""), Util.token(""));
    int gcBefore = keyspace.getColumnFamilyStore(cfname).gcBefore(System.currentTimeMillis());
    UUID parentRepSession = UUID.randomUUID();
    ActiveRepairService.instance.registerParentRepairSession(parentRepSession, Arrays.asList(cfs), Arrays.asList(range));
    RepairJobDesc desc = new RepairJobDesc(parentRepSession, UUID.randomUUID(), ksname, cfname, range);
    Validator validator = new Validator(desc, FBUtilities.getBroadcastAddress(), gcBefore);
    CompactionManager.instance.submitValidation(cfs, validator).get();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:39,代码来源:LeveledCompactionStrategyTest.java


示例12: serialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public void serialize(SyncRequest message, DataOutput out, int version) throws IOException
{
    RepairJobDesc.serializer.serialize(message.desc, out, version);
    CompactEndpointSerializationHelper.serialize(message.initiator, out);
    CompactEndpointSerializationHelper.serialize(message.src, out);
    CompactEndpointSerializationHelper.serialize(message.dst, out);
    out.writeInt(message.ranges.size());
    for (Range<Token> range : message.ranges)
        AbstractBounds.serializer.serialize(range, out, version);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:11,代码来源:SyncRequest.java


示例13: serialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public void serialize(ValidationComplete message, DataOutput out, int version) throws IOException
{
    RepairJobDesc.serializer.serialize(message.desc, out, version);
    out.writeBoolean(message.success);
    if (message.success)
        MerkleTree.serializer.serialize(message.tree, out, version);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:8,代码来源:ValidationComplete.java


示例14: serialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public void serialize(SyncRequest message, DataOutputPlus out, int version) throws IOException
{
    RepairJobDesc.serializer.serialize(message.desc, out, version);
    CompactEndpointSerializationHelper.serialize(message.initiator, out);
    CompactEndpointSerializationHelper.serialize(message.src, out);
    CompactEndpointSerializationHelper.serialize(message.dst, out);
    out.writeInt(message.ranges.size());
    for (Range<Token> range : message.ranges)
    {
        MessagingService.validatePartitioner(range);
        AbstractBounds.tokenSerializer.serialize(range, out, version);
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:SyncRequest.java


示例15: deserialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public SyncRequest deserialize(DataInputPlus in, int version) throws IOException
{
    RepairJobDesc desc = RepairJobDesc.serializer.deserialize(in, version);
    InetAddress owner = CompactEndpointSerializationHelper.deserialize(in);
    InetAddress src = CompactEndpointSerializationHelper.deserialize(in);
    InetAddress dst = CompactEndpointSerializationHelper.deserialize(in);
    int rangesCount = in.readInt();
    List<Range<Token>> ranges = new ArrayList<>(rangesCount);
    for (int i = 0; i < rangesCount; ++i)
        ranges.add((Range<Token>) AbstractBounds.tokenSerializer.deserialize(in, MessagingService.globalPartitioner(), version));
    return new SyncRequest(desc, owner, src, dst, ranges);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:13,代码来源:SyncRequest.java


示例16: serializedSize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public long serializedSize(SyncRequest message, int version)
{
    long size = RepairJobDesc.serializer.serializedSize(message.desc, version);
    size += 3 * CompactEndpointSerializationHelper.serializedSize(message.initiator);
    size += TypeSizes.sizeof(message.ranges.size());
    for (Range<Token> range : message.ranges)
        size += AbstractBounds.tokenSerializer.serializedSize(range, version);
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:10,代码来源:SyncRequest.java


示例17: serializedSize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public long serializedSize(SyncComplete message, int version)
{
    long size = RepairJobDesc.serializer.serializedSize(message.desc, version);
    size += NodePair.serializer.serializedSize(message.nodes, version);
    size += TypeSizes.sizeof(message.success);
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:SyncComplete.java


示例18: serialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public void serialize(ValidationComplete message, DataOutputPlus out, int version) throws IOException
{
    RepairJobDesc.serializer.serialize(message.desc, out, version);
    out.writeBoolean(message.success());
    if (message.trees != null)
        MerkleTrees.serializer.serialize(message.trees, out, version);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:ValidationComplete.java


示例19: deserialize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public ValidationComplete deserialize(DataInputPlus in, int version) throws IOException
{
    RepairJobDesc desc = RepairJobDesc.serializer.deserialize(in, version);
    boolean success = in.readBoolean();

    if (success)
    {
        MerkleTrees trees = MerkleTrees.serializer.deserialize(in, version);
        return new ValidationComplete(desc, trees);
    }

    return new ValidationComplete(desc);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:ValidationComplete.java


示例20: serializedSize

import org.apache.cassandra.repair.RepairJobDesc; //导入依赖的package包/类
public long serializedSize(ValidationComplete message, int version)
{
    long size = RepairJobDesc.serializer.serializedSize(message.desc, version);
    size += TypeSizes.sizeof(message.success());
    if (message.trees != null)
        size += MerkleTrees.serializer.serializedSize(message.trees, version);
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:ValidationComplete.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java DoublesSketch类代码示例发布时间:2022-05-23
下一篇:
Java MapReduceIterable类代码示例发布时间: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