@Override public ValueType getDeepestValueType() { return valueType.getDeepestValueType(); }
@Override public ValueType getDeepestValueType() { return valueType.getDeepestValueType(); }
@Override public boolean accept(FieldType fieldtype) { return fieldtype.getValueType().getDeepestValueType().getBaseName().equals("LINK"); } };
private static void extract(Object value, FieldType fieldType, LinkCollector collector, FieldType ctxField, RecordId ctxRecord, LRepository repository) throws RepositoryException, InterruptedException { ValueType valueType = fieldType.getValueType(); String baseType = valueType.getDeepestValueType().getBaseName(); if (baseType.equals("LINK") || baseType.equals("RECORD")) { extract(value, collector, ctxField, ctxRecord, repository); } }
private Set<BlobReference> getReferencedBlobs(FieldTypeImpl fieldType, Object value) throws BlobException { HashSet<BlobReference> referencedBlobs = new HashSet<BlobReference>(); ValueType valueType = fieldType.getValueType(); if ((valueType.getDeepestValueType() instanceof BlobValueType) && !isDeleteMarker(value)) { Set<Object> values = valueType.getValues(value); for (Object object : values) { referencedBlobs.add(new BlobReference((Blob) object, null, fieldType)); } } return referencedBlobs; }
/** * Direct 'evaluation' (content extraction, formatting) of a given field * from a record. Should only be called if the field is present in the * record. */ public List<String> format(String table, Record record, FieldType fieldType, boolean extractContent, String formatterName, LRepository repository) throws InterruptedException { Object value = record.getField(fieldType.getName()); List<IndexValue> indexValues; if (fieldType.getValueType().getBaseName().equals("LIST")) { List<Object> values = (List<Object>) value; indexValues = new ArrayList<IndexValue>(values.size()); for (int i = 0; i < values.size(); i++) { indexValues.add(new IndexValue(record, fieldType, i, values.get(i))); } } else { indexValues = Collections.singletonList(new IndexValue(record, fieldType, value)); } if (fieldType.getValueType().getDeepestValueType().getBaseName().equals("BLOB") && extractContent) { return extractContent(table, indexValues, repository); } Formatter formatter = conf.getFormatters().getFormatter(formatterName); return formatter.format(indexValues, repository); }
@Override public BlobAccess getBlobAccess(Record record, QName fieldName, FieldType fieldType, int...indexes) throws BlobException { if (!(fieldType.getValueType().getDeepestValueType() instanceof BlobValueType)) { throw new BlobException("Cannot read a blob from a non-blob field type: " + fieldType.getName()); } Blob blob = getBlobFromRecord(record, fieldName, fieldType, indexes); return registry.getBlobAccess(blob); }
throw new RuntimeException("Field metadata is currently not supported for versioned-mutable fields."); if (fieldType.getValueType().getDeepestValueType().getBaseName().equals("BLOB")) { throw new RuntimeException("Field metadata is currently not supported for BLOB fields.");
for (Entry<Long, byte[]> cell : cellsSet) { if (valueType.getDeepestValueType() instanceof BlobValueType) { Object blobValue = null; if (fieldType.getScope() == Scope.NON_VERSIONED) {
Object value = record.getField(fieldName); ValueType valueType = fieldType.getValueType(); if (!valueType.getDeepestValueType().getBaseName().equals("BLOB")) { throw new BlobNotFoundException("Blob could not be retrieved from '" + record.getId() + "', '" + fieldName + "' at index: " + Ints.join("/", indexes));
!value.getTargetFieldType().getValueType().getDeepestValueType().getBaseName().equals("BLOB")) { throw new IndexerConfException("extractContent is used for a non-blob value at " + LocationAttributes.getLocation(fieldEl));