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


Java MessagingService.VERSION_30属性代码示例

本文整理汇总了Java中org.apache.cassandra.net.MessagingService.VERSION_30属性的典型用法代码示例。如果您正苦于以下问题:Java MessagingService.VERSION_30属性的具体用法?Java MessagingService.VERSION_30怎么用?Java MessagingService.VERSION_30使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.cassandra.net.MessagingService的用法示例。


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

示例1: serialize

public void serialize(Inner inner, DataOutputPlus out, int version) throws IOException
{
    if (version < MessagingService.VERSION_30)
    {
        if (inner.hash == null)
            out.writeInt(-1);
        else
        {
            out.writeInt(inner.hash.length);
            out.write(inner.hash);
        }
    }
    Token.serializer.serialize(inner.token, out, version);
    Hashable.serializer.serialize(inner.lchild, out, version);
    Hashable.serializer.serialize(inner.rchild, out, version);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:16,代码来源:MerkleTree.java

示例2: StreamDeserializer

public StreamDeserializer(CFMetaData metadata, InputStream in, Version version, SerializationHeader header,
                          long totalSize, UUID sessionId) throws IOException
{
    this.metadata = metadata;
    // streaming pre-3.0 sstables require mark/reset support from source stream
    if (version.correspondingMessagingVersion() < MessagingService.VERSION_30)
    {
        logger.trace("Initializing rewindable input stream for reading legacy sstable with {} bytes with following " +
                     "parameters: initial_mem_buffer_size={}, max_mem_buffer_size={}, max_spill_file_size={}.",
                     totalSize, INITIAL_MEM_BUFFER_SIZE, MAX_MEM_BUFFER_SIZE, MAX_SPILL_FILE_SIZE);
        File bufferFile = getTempBufferFile(metadata, totalSize, sessionId);
        this.in = new RewindableDataInputStreamPlus(in, INITIAL_MEM_BUFFER_SIZE, MAX_MEM_BUFFER_SIZE, bufferFile, MAX_SPILL_FILE_SIZE);
    } else
        this.in = new DataInputPlus.DataInputStreamPlus(in);
    this.helper = new SerializationHelper(metadata, version.correspondingMessagingVersion(), SerializationHelper.Flag.PRESERVE_SIZE);
    this.header = header;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:StreamReader.java

示例3: deserialize

public PrepareResponse deserialize(DataInputPlus in, int version) throws IOException
{
    boolean success = in.readBoolean();
    Commit inProgress = Commit.serializer.deserialize(in, version);
    Commit mostRecent;
    if (version < MessagingService.VERSION_30)
    {
        UUID ballot = UUIDSerializer.serializer.deserialize(in, version);
        PartitionUpdate update = PartitionUpdate.serializer.deserialize(in, version, SerializationHelper.Flag.LOCAL, inProgress.update.partitionKey());
        mostRecent = new Commit(ballot, update);
    }
    else
    {
        mostRecent = Commit.serializer.deserialize(in, version);
    }
    return new PrepareResponse(success, inProgress, mostRecent);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:PrepareResponse.java

示例4: serializedSize

public long serializedSize(PrepareResponse response, int version)
{
    long size = TypeSizes.sizeof(response.promised)
              + Commit.serializer.serializedSize(response.inProgressCommit, version);

    if (version < MessagingService.VERSION_30)
    {
        size += UUIDSerializer.serializer.serializedSize(response.mostRecentCommit.ballot, version);
        size += PartitionUpdate.serializer.serializedSize(response.mostRecentCommit.update, version);
    }
    else
    {
        size += Commit.serializer.serializedSize(response.mostRecentCommit, version);
    }
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:16,代码来源:PrepareResponse.java

示例5: serialize

public void serialize(AbstractBounds<T> range, DataOutputPlus out, int version) throws IOException
{
    /*
     * The first int tells us if it's a range or bounds (depending on the value) _and_ if it's tokens or keys (depending on the
     * sign). We use negative kind for keys so as to preserve the serialization of token from older version.
     */
    if (version < MessagingService.VERSION_30)
        out.writeInt(kindInt(range));
    else
        out.writeByte(kindFlags(range));
    serializer.serialize(range.left, out, version);
    serializer.serialize(range.right, out, version);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:13,代码来源:AbstractBounds.java

示例6: serializedSize

public long serializedSize(AbstractBounds<T> ab, int version)
{
    int size = version < MessagingService.VERSION_30
             ? TypeSizes.sizeof(kindInt(ab))
             : 1;
    size += serializer.serializedSize(ab.left, version);
    size += serializer.serializedSize(ab.right, version);
    return size;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:9,代码来源:AbstractBounds.java

示例7: create

public static UnfilteredDeserializer create(CFMetaData metadata,
                                            DataInputPlus in,
                                            SerializationHeader header,
                                            SerializationHelper helper,
                                            DeletionTime partitionDeletion,
                                            boolean readAllAsDynamic)
{
    if (helper.version >= MessagingService.VERSION_30)
        return new CurrentDeserializer(metadata, in, header, helper);
    else
        return new OldFormatDeserializer(metadata, in, helper, partitionDeletion, readAllAsDynamic);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:12,代码来源:UnfilteredDeserializer.java

示例8: create

public static SSTableSimpleIterator create(CFMetaData metadata, DataInputPlus in, SerializationHeader header, SerializationHelper helper, DeletionTime partitionDeletion)
{
    if (helper.version < MessagingService.VERSION_30)
        return new OldFormatIterator(metadata, in, helper, partitionDeletion);
    else
        return new CurrentFormatIterator(metadata, in, header, helper);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:7,代码来源:SSTableSimpleIterator.java

示例9: createTombstoneOnly

public static SSTableSimpleIterator createTombstoneOnly(CFMetaData metadata, DataInputPlus in, SerializationHeader header, SerializationHelper helper, DeletionTime partitionDeletion)
{
    if (helper.version < MessagingService.VERSION_30)
        return new OldFormatTombstoneIterator(metadata, in, helper, partitionDeletion);
    else
        return new CurrentFormatTombstoneIterator(metadata, in, header, helper);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:7,代码来源:SSTableSimpleIterator.java

示例10: BigVersion

BigVersion(String version)
{
    super(instance, version);

    isLatestVersion = version.compareTo(current_version) == 0;
    hasSamplingLevel = version.compareTo("ka") >= 0;
    newStatsFile = version.compareTo("ka") >= 0;

    //For a while Adler32 was in use, now the CRC32 instrinsic is very good especially after Haswell
    //PureJavaCRC32 was always faster than Adler32. See CASSANDRA-8684
    ChecksumType checksumType = ChecksumType.CRC32;
    if (version.compareTo("ka") >= 0 && version.compareTo("ma") < 0)
        checksumType = ChecksumType.Adler32;
    this.uncompressedChecksumType = checksumType;

    checksumType = ChecksumType.CRC32;
    if (version.compareTo("jb") >= 0 && version.compareTo("ma") < 0)
        checksumType = ChecksumType.Adler32;
    this.compressedChecksumType = checksumType;

    hasRepairedAt = version.compareTo("ka") >= 0;
    tracksLegacyCounterShards = version.compareTo("ka") >= 0;

    newFileName = version.compareTo("la") >= 0;

    hasOldBfHashOrder = version.compareTo("ma") < 0;
    hasCompactionAncestors = version.compareTo("ma") < 0;
    storeRows = version.compareTo("ma") >= 0;
    correspondingMessagingVersion = storeRows
                                  ? MessagingService.VERSION_30
                                  : MessagingService.VERSION_21;

    hasBoundaries = version.compareTo("ma") < 0;
    hasCommitLogLowerBound = (version.compareTo("lb") >= 0 && version.compareTo("ma") < 0)
                             || version.compareTo("mb") >= 0;
    hasCommitLogIntervals = version.compareTo("mc") >= 0;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:37,代码来源:BigFormat.java

示例11: messagingVersion

static int messagingVersion(int hintsVersion)
{
    switch (hintsVersion)
    {
        case VERSION_30:
            return MessagingService.VERSION_30;
        default:
            throw new AssertionError();
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:10,代码来源:HintsDescriptor.java

示例12: deserialize

public Inner deserialize(DataInput in, IPartitioner p, int version) throws IOException
{
    if (version < MessagingService.VERSION_30)
    {
        int hashLen = in.readInt();
        byte[] hash = hashLen >= 0 ? new byte[hashLen] : null;
        if (hash != null)
            in.readFully(hash);
    }
    Token token = Token.serializer.deserialize(in, p, version);
    Hashable lchild = Hashable.serializer.deserialize(in, p, version);
    Hashable rchild = Hashable.serializer.deserialize(in, p, version);
    return new Inner(token, lchild, rchild);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:MerkleTree.java

示例13: serializedSize

public long serializedSize(Inner inner, int version)
{
    long size = 0;
    if (version < MessagingService.VERSION_30)
    {
        size += inner.hash == null
                           ? TypeSizes.sizeof(-1)
                           : TypeSizes.sizeof(inner.hash().length) + inner.hash().length;
    }

    size += Token.serializer.serializedSize(inner.token, version)
    + Hashable.serializer.serializedSize(inner.lchild, version)
    + Hashable.serializer.serializedSize(inner.rchild, version);
    return size;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:MerkleTree.java

示例14: serialize

public void serialize(PrepareResponse response, DataOutputPlus out, int version) throws IOException
{
    out.writeBoolean(response.promised);
    Commit.serializer.serialize(response.inProgressCommit, out, version);

    if (version < MessagingService.VERSION_30)
    {
        UUIDSerializer.serializer.serialize(response.mostRecentCommit.ballot, out, version);
        PartitionUpdate.serializer.serialize(response.mostRecentCommit.update, out, version);
    }
    else
    {
        Commit.serializer.serialize(response.mostRecentCommit, out, version);
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:PrepareResponse.java

示例15: serialize

public void serialize(Commit commit, DataOutputPlus out, int version) throws IOException
{
    if (version < MessagingService.VERSION_30)
        ByteBufferUtil.writeWithShortLength(commit.update.partitionKey().getKey(), out);

    UUIDSerializer.serializer.serialize(commit.ballot, out, version);
    PartitionUpdate.serializer.serialize(commit.update, out, version);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:Commit.java


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