@Override public Throwable createException(String message, Throwable cause) { return new QueryException(message, cause); } });
@Override public Throwable createException(String message, Throwable cause) { return new QueryException(message, cause); } });
private void assertAllPartitionsQueried(BitSet mutablePartitionIds) { if (isResultFromAnyPartitionMissing(mutablePartitionIds)) { throw new QueryException("Query aborted. Could not execute query for all partitions. Missed " + mutablePartitionIds.cardinality() + " partitions"); } }
public PredicateBuilder and(Predicate predicate) { if (predicate != PredicateBuilder.this) { throw new QueryException("Illegal and statement expected: " + PredicateBuilder.class.getSimpleName() + ", found: " + ((predicate == null) ? "null" : predicate.getClass().getSimpleName())); } int index = lsPredicates.size() - 2; Predicate first = lsPredicates.remove(index); Predicate second = lsPredicates.remove(index); lsPredicates.add(Predicates.and(first, second)); return this; }
private void assertAllPartitionsQueried(BitSet finishedPartitions, int partitionCount) { if (hasMissingPartitions(finishedPartitions, partitionCount)) { int missedPartitionsCount = 0; for (int i = 0; i < partitionCount; i++) { if (!finishedPartitions.get(i)) { missedPartitionsCount++; } } throw new QueryException("Query aborted. Could not execute query for all partitions. Missed " + missedPartitionsCount + " partitions"); } }
private void assertAllPartitionsQueried(BitSet mutablePartitionIds) { if (isResultFromAnyPartitionMissing(mutablePartitionIds)) { throw new QueryException("Query aborted. Could not execute query for all partitions. Missed " + mutablePartitionIds.cardinality() + " partitions"); } }
private void assertAllPartitionsQueried(BitSet finishedPartitions, int partitionCount) { if (hasMissingPartitions(finishedPartitions, partitionCount)) { int missedPartitionsCount = 0; for (int i = 0; i < partitionCount; i++) { if (!finishedPartitions.get(i)) { missedPartitionsCount++; } } throw new QueryException("Query aborted. Could not execute query for all partitions. Missed " + missedPartitionsCount + " partitions"); } }
public PredicateBuilder and(Predicate predicate) { if (predicate != PredicateBuilder.this) { throw new QueryException("Illegal and statement expected: " + PredicateBuilder.class.getSimpleName() + ", found: " + ((predicate == null) ? "null" : predicate.getClass().getSimpleName())); } int index = lsPredicates.size() - 2; Predicate first = lsPredicates.remove(index); Predicate second = lsPredicates.remove(index); lsPredicates.add(Predicates.and(first, second)); return this; }
private Comparable convert(AttributeType entryAttributeType, Comparable entryAttributeValue, Comparable givenAttributeValue) { Class<?> entryAttributeClass = entryAttributeValue != null ? entryAttributeValue.getClass() : null; if (entryAttributeType == AttributeType.ENUM) { // if attribute type is enum, convert given attribute to enum string return entryAttributeType.getConverter().convert(givenAttributeValue); } else { // if given attribute value is already in expected type then there's no need for conversion. if (entryAttributeClass != null && entryAttributeClass.isAssignableFrom(givenAttributeValue.getClass())) { return givenAttributeValue; } else if (entryAttributeType != null) { return entryAttributeType.getConverter().convert(givenAttributeValue); } else { throw new QueryException("Unknown attribute type: " + givenAttributeValue.getClass().getName() + " for attribute: " + attributeName); } } }
private Comparable convert(AttributeType entryAttributeType, Class<?> entryAttributeClass, Comparable givenAttributeValue) { if (entryAttributeType == AttributeType.ENUM) { // if attribute type is enum, convert given attribute to enum string return entryAttributeType.getConverter().convert(givenAttributeValue); } else { // if given attribute value is already in expected type then there's no need for conversion. if (entryAttributeClass != null && entryAttributeClass.isAssignableFrom(givenAttributeValue.getClass())) { return givenAttributeValue; } else if (entryAttributeType != null) { return entryAttributeType.getConverter().convert(givenAttributeValue); } else { throw new QueryException("Unknown attribute type: " + givenAttributeValue.getClass().getName() + " for attribute: " + attributeName); } } }
public Object extract(Object target, String attributeName) { Object targetObject = getTargetObject(target); if (targetObject != null) { Getter getter = getGetter(targetObject, attributeName); try { return getter.getValue(targetObject, attributeName); } catch (Exception ex) { throw new QueryException(ex); } } return null; }
public Object extract(InternalSerializationService serializationService, Object target, String attributeName) { Object targetObject = getTargetObject(serializationService, target); if (targetObject != null) { Getter getter = getGetter(serializationService, targetObject, attributeName); try { return getter.getValue(targetObject, attributeName); } catch (Exception ex) { throw new QueryException(ex); } } return null; }
return getter; } catch (Throwable e) { throw new QueryException(e);
return getter; } catch (Throwable e) { throw new QueryException(e);