Search in sources :

Example 1 with LimitExceedException

use of com.baidu.hugegraph.exception.LimitExceedException in project incubator-hugegraph by apache.

the class HugeTask method checkPropertySize.

private void checkPropertySize(int propertyLength, String propertyName) {
    long propertyLimit = BytesBuffer.STRING_LEN_MAX;
    HugeGraph graph = this.scheduler().graph();
    if (propertyName.equals(P.INPUT)) {
        propertyLimit = graph.option(CoreOptions.TASK_INPUT_SIZE_LIMIT);
    } else if (propertyName.equals(P.RESULT)) {
        propertyLimit = graph.option(CoreOptions.TASK_RESULT_SIZE_LIMIT);
    }
    if (propertyLength > propertyLimit) {
        throw new LimitExceedException("Task %s size %s exceeded limit %s bytes", P.unhide(propertyName), propertyLength, propertyLimit);
    }
}
Also used : HugeGraph(com.baidu.hugegraph.HugeGraph) LimitExceedException(com.baidu.hugegraph.exception.LimitExceedException)

Aggregations

HugeGraph (com.baidu.hugegraph.HugeGraph)1 LimitExceedException (com.baidu.hugegraph.exception.LimitExceedException)1