use of org.apache.rya.api.resolver.RyaTypeResolverException in project incubator-rya by apache.
the class AccumuloPcjSerializer method convert.
@Override
public BindingSet convert(byte[] bindingSetBytes, VariableOrder varOrder) throws BindingSetConversionException {
checkNotNull(bindingSetBytes);
checkNotNull(varOrder);
try {
// Slice the row into bindings.
List<byte[]> values = splitlByDelimByte(bindingSetBytes);
String[] varOrderStrings = varOrder.toArray();
checkArgument(values.size() == varOrderStrings.length);
// Convert the Binding bytes into a BindingSet.
final QueryBindingSet bindingSet = new QueryBindingSet();
for (int i = 0; i < varOrderStrings.length; i++) {
byte[] valueBytes = values.get(i);
if (valueBytes.length > 0) {
String name = varOrderStrings[i];
Value value = deserializeValue(valueBytes);
bindingSet.addBinding(name, value);
}
}
return bindingSet;
} catch (RyaTypeResolverException e) {
throw new BindingSetConversionException("Could not convert the byte[] into a BindingSet.", e);
}
}
Aggregations