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


Java Commit.emptyCommit方法代码示例

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


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

示例1: loadPaxosState

import org.apache.cassandra.service.paxos.Commit; //导入方法依赖的package包/类
public static PaxosState loadPaxosState(ByteBuffer key, CFMetaData metadata)
{
    String req = "SELECT * FROM system.%s WHERE row_key = ? AND cf_id = ?";
    UntypedResultSet results = executeInternal(String.format(req, PAXOS_CF), key, metadata.cfId);
    if (results.isEmpty())
        return new PaxosState(key, metadata);
    UntypedResultSet.Row row = results.one();
    Commit promised = row.has("in_progress_ballot")
                    ? new Commit(key, row.getUUID("in_progress_ballot"), ArrayBackedSortedColumns.factory.create(metadata))
                    : Commit.emptyCommit(key, metadata);
    // either we have both a recently accepted ballot and update or we have neither
    Commit accepted = row.has("proposal")
                    ? new Commit(key, row.getUUID("proposal_ballot"), ColumnFamily.fromBytes(row.getBytes("proposal")))
                    : Commit.emptyCommit(key, metadata);
    // either most_recent_commit and most_recent_commit_at will both be set, or neither
    Commit mostRecent = row.has("most_recent_commit")
                      ? new Commit(key, row.getUUID("most_recent_commit_at"), ColumnFamily.fromBytes(row.getBytes("most_recent_commit")))
                      : Commit.emptyCommit(key, metadata);
    return new PaxosState(promised, accepted, mostRecent);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:21,代码来源:SystemKeyspace.java

示例2: loadPaxosState

import org.apache.cassandra.service.paxos.Commit; //导入方法依赖的package包/类
public static PaxosState loadPaxosState(ByteBuffer key, CFMetaData metadata)
{
    String req = "SELECT * FROM system.%s WHERE row_key = 0x%s AND cf_id = %s";
    UntypedResultSet results = processInternal(String.format(req, PAXOS_CF, ByteBufferUtil.bytesToHex(key), metadata.cfId));
    if (results.isEmpty())
        return new PaxosState(key, metadata);
    UntypedResultSet.Row row = results.one();
    Commit promised = new Commit(key, row.getUUID("in_progress_ballot"), EmptyColumns.factory.create(metadata));
    // either we have both a recently accepted ballot and update or we have neither
    Commit accepted = row.has("proposal")
                    ? new Commit(key, row.getUUID("proposal_ballot"), ColumnFamily.fromBytes(row.getBytes("proposal")))
                    : Commit.emptyCommit(key, metadata);
    // either most_recent_commit and most_recent_commit_at will both be set, or neither
    Commit mostRecent = row.has("most_recent_commit")
                      ? new Commit(key, row.getUUID("most_recent_commit_at"), ColumnFamily.fromBytes(row.getBytes("most_recent_commit")))
                      : Commit.emptyCommit(key, metadata);
    return new PaxosState(promised, accepted, mostRecent);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:19,代码来源:SystemKeyspace.java

示例3: loadPaxosState

import org.apache.cassandra.service.paxos.Commit; //导入方法依赖的package包/类
public static PaxosState loadPaxosState(DecoratedKey key, CFMetaData metadata, int nowInSec)
{
    String req = "SELECT * FROM system.%s WHERE row_key = ? AND cf_id = ?";
    UntypedResultSet results = QueryProcessor.executeInternalWithNow(nowInSec, String.format(req, PAXOS), key.getKey(), metadata.cfId);
    if (results.isEmpty())
        return new PaxosState(key, metadata);
    UntypedResultSet.Row row = results.one();
    Commit promised = row.has("in_progress_ballot")
                    ? new Commit(row.getUUID("in_progress_ballot"), new PartitionUpdate(metadata, key, metadata.partitionColumns(), 1))
                    : Commit.emptyCommit(key, metadata);
    // either we have both a recently accepted ballot and update or we have neither
    int proposalVersion = row.has("proposal_version") ? row.getInt("proposal_version") : MessagingService.VERSION_21;
    Commit accepted = row.has("proposal")
                    ? new Commit(row.getUUID("proposal_ballot"), PartitionUpdate.fromBytes(row.getBytes("proposal"), proposalVersion, key))
                    : Commit.emptyCommit(key, metadata);
    // either most_recent_commit and most_recent_commit_at will both be set, or neither
    int mostRecentVersion = row.has("most_recent_commit_version") ? row.getInt("most_recent_commit_version") : MessagingService.VERSION_21;
    Commit mostRecent = row.has("most_recent_commit")
                      ? new Commit(row.getUUID("most_recent_commit_at"), PartitionUpdate.fromBytes(row.getBytes("most_recent_commit"), mostRecentVersion, key))
                      : Commit.emptyCommit(key, metadata);
    return new PaxosState(promised, accepted, mostRecent);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:23,代码来源:SystemKeyspace.java

示例4: loadPaxosState

import org.apache.cassandra.service.paxos.Commit; //导入方法依赖的package包/类
public static PaxosState loadPaxosState(ByteBuffer key, CFMetaData metadata)
{
    String req = "SELECT * FROM system.%s WHERE row_key = 0x%s AND cf_id = %s";
    UntypedResultSet results = processInternal(String.format(req, PAXOS_CF, ByteBufferUtil.bytesToHex(key), metadata.cfId));
    if (results.isEmpty())
        return new PaxosState(key, metadata);
    UntypedResultSet.Row row = results.one();
    Commit promised = row.has("in_progress_ballot")
                    ? new Commit(key, row.getUUID("in_progress_ballot"), EmptyColumns.factory.create(metadata))
                    : Commit.emptyCommit(key, metadata);
    // either we have both a recently accepted ballot and update or we have neither
    Commit accepted = row.has("proposal")
                    ? new Commit(key, row.getUUID("proposal_ballot"), ColumnFamily.fromBytes(row.getBytes("proposal")))
                    : Commit.emptyCommit(key, metadata);
    // either most_recent_commit and most_recent_commit_at will both be set, or neither
    Commit mostRecent = row.has("most_recent_commit")
                      ? new Commit(key, row.getUUID("most_recent_commit_at"), ColumnFamily.fromBytes(row.getBytes("most_recent_commit")))
                      : Commit.emptyCommit(key, metadata);
    return new PaxosState(promised, accepted, mostRecent);
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:21,代码来源:SystemKeyspace.java

示例5: loadPaxosState

import org.apache.cassandra.service.paxos.Commit; //导入方法依赖的package包/类
public static PaxosState loadPaxosState(ByteBuffer key, CFMetaData metadata)
{
    String req = "SELECT * FROM system.%s WHERE row_key = 0x%s AND cf_id = %s";
    UntypedResultSet results = processInternal(String.format(req, PAXOS_CF, ByteBufferUtil.bytesToHex(key), metadata.cfId));
    if (results.isEmpty())
        return new PaxosState(key, metadata);
    UntypedResultSet.Row row = results.one();
    Commit promised = row.has("in_progress_ballot")
                    ? new Commit(key, row.getUUID("in_progress_ballot"), ArrayBackedSortedColumns.factory.create(metadata))
                    : Commit.emptyCommit(key, metadata);
    // either we have both a recently accepted ballot and update or we have neither
    Commit accepted = row.has("proposal")
                    ? new Commit(key, row.getUUID("proposal_ballot"), ColumnFamily.fromBytes(row.getBytes("proposal")))
                    : Commit.emptyCommit(key, metadata);
    // either most_recent_commit and most_recent_commit_at will both be set, or neither
    Commit mostRecent = row.has("most_recent_commit")
                      ? new Commit(key, row.getUUID("most_recent_commit_at"), ColumnFamily.fromBytes(row.getBytes("most_recent_commit")))
                      : Commit.emptyCommit(key, metadata);
    return new PaxosState(promised, accepted, mostRecent);
}
 
开发者ID:rajath26,项目名称:cassandra-trunk,代码行数:21,代码来源:SystemKeyspace.java


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