本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}