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


Java RequestTimeoutException类代码示例

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


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

示例1: toThrift

import org.apache.cassandra.exceptions.RequestTimeoutException; //导入依赖的package包/类
public static TimedOutException toThrift(RequestTimeoutException e)
{
    TimedOutException toe = new TimedOutException();
    if (e instanceof WriteTimeoutException)
    {
        WriteTimeoutException wte = (WriteTimeoutException)e;
        toe.setAcknowledged_by(wte.received);
        if (wte.writeType == WriteType.BATCH_LOG)
            toe.setAcknowledged_by_batchlog(false);
        else if (wte.writeType == WriteType.BATCH)
            toe.setAcknowledged_by_batchlog(true);
        else if (wte.writeType == WriteType.CAS)
            toe.setPaxos_in_progress(true);
    }
    return toe;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:17,代码来源:ThriftConversion.java

示例2: rethrow

import org.apache.cassandra.exceptions.RequestTimeoutException; //导入依赖的package包/类
public static RuntimeException rethrow(RequestExecutionException e) throws UnavailableException, TimedOutException
{
    if (e instanceof RequestTimeoutException)
        throw toThrift((RequestTimeoutException)e);
    else
        throw new UnavailableException();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:ThriftConversion.java

示例3: rethrow

import org.apache.cassandra.exceptions.RequestTimeoutException; //导入依赖的package包/类
public static void rethrow(RequestExecutionException e) throws UnavailableException, TimedOutException
{
    if (e instanceof RequestTimeoutException)
        throw toThrift((RequestTimeoutException)e);
    else
        throw new UnavailableException();
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:8,代码来源:ThriftConversion.java

示例4: toThrift

import org.apache.cassandra.exceptions.RequestTimeoutException; //导入依赖的package包/类
public static TimedOutException toThrift(RequestTimeoutException e)
{
    TimedOutException toe = new TimedOutException();
    if (e instanceof WriteTimeoutException)
    {
        WriteTimeoutException wte = (WriteTimeoutException)e;
        toe.setAcknowledged_by(wte.received);
        if (wte.writeType == WriteType.BATCH_LOG)
            toe.setAcknowledged_by_batchlog(false);
        else if (wte.writeType == WriteType.BATCH)
            toe.setAcknowledged_by_batchlog(true);
    }
    return toe;
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:15,代码来源:ThriftConversion.java

示例5: execute

import org.apache.cassandra.exceptions.RequestTimeoutException; //导入依赖的package包/类
public List<Row> execute() throws RequestTimeoutException
{
    DataRange range = filter.dataRange;
    RowPosition lastKey = range.stopKey();

    IPartitioner<?> partitioner = DatabaseDescriptor.getPartitioner();

    final int maxRows = Math.min(filter.maxColumns(), Math.min(MAX_ROWS, filter.maxRows()));
    final List<Row> rows = new ArrayList<>(maxRows);

    Operation operationTree = null;

    try
    {
        operationTree = analyze();

        if (operationTree == null)
            return Collections.emptyList();

        operationTree.skipTo(((LongToken) range.keyRange().left.getToken()).token);

        intersection:
        while (operationTree.hasNext())
        {
            for (DecoratedKey key : operationTree.next())
            {
                if ((!lastKey.isMinimum(partitioner) && lastKey.compareTo(key) < 0) || rows.size() >= maxRows)
                    break intersection;

                if (!range.contains(key))
                    continue;

                Row row = getRow(key, filter);
                if (row != null && operationTree.satisfiedBy(row, null, !isColumnSlice(key)))
                    rows.add(row);
            }
        }
    }
    finally
    {
        FileUtils.closeQuietly(operationTree);
        controller.finish();
    }

    return rows;
}
 
开发者ID:xedin,项目名称:sasi,代码行数:47,代码来源:QueryPlan.java


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