Search in sources :

Example 1 with InvalidDataException

use of com.alibaba.maxgraph.compiler.api.exception.InvalidDataException in project GraphScope by alibaba.

the class DataEncoder method getHashId.

private long getHashId(int labelId, Map<Integer, PropertyValue> operationProperties, List<Integer> pkIds) {
    List<byte[]> pks = new ArrayList<>(pkIds.size());
    for (int pkId : pkIds) {
        PropertyValue propertyValue = operationProperties.get(pkId);
        if (propertyValue == null) {
            throw new InvalidDataException("label [" + labelId + "], propertyId [" + pkId + "]");
        }
        byte[] valBytes = propertyValue.getValBytes();
        pks.add(valBytes);
    }
    return PkHashUtils.hash(labelId, pks);
}
Also used : ArrayList(java.util.ArrayList) InvalidDataException(com.alibaba.maxgraph.compiler.api.exception.InvalidDataException) PropertyValue(com.alibaba.maxgraph.sdkcommon.schema.PropertyValue)

Aggregations

InvalidDataException (com.alibaba.maxgraph.compiler.api.exception.InvalidDataException)1 PropertyValue (com.alibaba.maxgraph.sdkcommon.schema.PropertyValue)1 ArrayList (java.util.ArrayList)1