org.openrdf.query.QueryInterruptedException类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.openrdf.query.QueryInterruptedException类的一些代码示例,展示了QueryInterruptedException类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryInterruptedException类的具体详情如下:
包路径:org.openrdf.query.QueryInterruptedException
类名称:QueryInterruptedException

QueryInterruptedException介绍

[英]An exception indicating that the evaluation of a query has been interrupted, for example because it took too long to complete.
[中]一种异常,指示查询的计算已被中断,例如,因为它花费了太长时间才完成。

代码示例

代码示例来源:origin: org.openrdf.sesame/sesame-repository-sail

@Override
  protected void throwInterruptedException()
    throws QueryEvaluationException
  {
    throw new QueryInterruptedException("execution took too long");
  }
};

代码示例来源:origin: org.openrdf.sesame/sesame-repository-sparql

@Override
public void execute()
  throws UpdateExecutionException
{
  try {
    // execute update immediately
    SparqlSession client = getHttpClient();
    try {
      client.sendUpdate(getQueryLanguage(), getQueryString(), getBaseURI(), dataset, includeInferred,
          getMaxExecutionTime(), getBindingsArray());
    }
    catch (UnauthorizedException e) {
      throw new UpdateExecutionException(e.getMessage(), e);
    }
    catch (QueryInterruptedException e) {
      throw new UpdateExecutionException(e.getMessage(), e);
    }
    catch (MalformedQueryException e) {
      throw new UpdateExecutionException(e.getMessage(), e);
    }
    catch (IOException e) {
      throw new UpdateExecutionException(e.getMessage(), e);
    }
  }
  catch (RepositoryException e) {
    throw new UpdateExecutionException(e.getMessage(), e);
  }
}

代码示例来源:origin: apache/marmotta

@Override
  protected QueryEvaluationException convert(Exception e) {
    if (e instanceof ClosedByInterruptException) {
      return new QueryInterruptedException(e);
    }
    else if (e instanceof IOException) {
      return new QueryEvaluationException(e);
    }
    else if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
    else if (e == null) {
      throw new IllegalArgumentException("e must not be null");
    }
    else {
      throw new IllegalArgumentException("Unexpected exception type: " + e.getClass());
    }
  }
};

代码示例来源:origin: apache/marmotta

@Override
  protected QueryEvaluationException convert(Exception e) {
    if (e instanceof ClosedByInterruptException) {
      return new QueryInterruptedException(e);
    }
    else if (e instanceof IOException) {
      return new QueryEvaluationException(e);
    }
    else if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
    else if (e == null) {
      throw new IllegalArgumentException("e must not be null");
    }
    else {
      throw new IllegalArgumentException("Unexpected exception type: " + e.getClass());
    }
  }
};

代码示例来源:origin: apache/marmotta

@Override
  protected QueryEvaluationException convert(Exception e) {
    if (e instanceof ClosedByInterruptException) {
      return new QueryInterruptedException(e);
    }
    if (e instanceof IOException) {
      return new QueryEvaluationException(e);
    }
    if (e instanceof SailException) {
      if(e.getCause() instanceof ResultInterruptedException) {
        return new QueryInterruptedException(e);
      }
      return new QueryEvaluationException(e);
    }
    if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
    if (e == null) {
      throw new IllegalArgumentException("e must not be null");
    }
    throw new IllegalArgumentException("Unexpected exception type: " + e.getClass(),e);
  }
};

代码示例来源:origin: org.apache.marmotta/kiwi-triplestore

@Override
  protected QueryEvaluationException convert(Exception e) {
    if (e instanceof ClosedByInterruptException) {
      return new QueryInterruptedException(e);
    }
    if (e instanceof IOException) {
      return new QueryEvaluationException(e);
    }
    if (e instanceof SailException) {
      if(e.getCause() instanceof ResultInterruptedException) {
        return new QueryInterruptedException(e);
      }
      return new QueryEvaluationException(e);
    }
    if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
    if (e == null) {
      throw new IllegalArgumentException("e must not be null");
    }
    throw new IllegalArgumentException("Unexpected exception type: " + e.getClass(),e);
  }
};

代码示例来源:origin: apache/marmotta

queryStatement.close();
  throw new QueryInterruptedException("SPARQL query execution cancelled");
} catch (ExecutionException e) {
  log.error("error executing SPARQL query", e.getCause());
    throw new QueryEvaluationException(e.getCause());
  } else if (e.getCause() instanceof InterruptedException) {
    throw new QueryInterruptedException(e.getCause());
  } else {
    throw new QueryEvaluationException("error executing SPARQL query", e);

代码示例来源:origin: org.openrdf.sesame/sesame-http-client

throw new UnauthorizedException();
case HttpURLConnection.HTTP_UNAVAILABLE: // 503
  throw new QueryInterruptedException();
default:
  ErrorInfo errInfo = getErrorInfo(response);

代码示例来源:origin: blazegraph/database

throw new QueryInterruptedException(t);

代码示例来源:origin: com.blazegraph/bigdata-core

throw new QueryInterruptedException(t);

相关文章

微信公众号

最新文章

更多

QueryInterruptedException类方法