Search in sources :

Example 11 with Empty

use of org.hypertrace.entity.data.service.v1.Empty in project entity-service by hypertrace.

the class DocStoreConverter method transformNonListRhsFilterTypes.

private static Filter transformNonListRhsFilterTypes(AttributeFilter filter) {
    try {
        Filter f = new Filter();
        f.setFieldName(filter.getName());
        f.setOp(transform(filter.getOperator()));
        transform(filter.getAttributeValue(), f, isPartOfAttributeMap(f.getFieldName()));
        // Set child filters to empty string
        f.setChildFilters(new Filter[] {});
        return f;
    } catch (IOException ioe) {
        throw new IllegalArgumentException(String.format("transformNonListRhsFilterTypes: Error converting filter for query. Filter:  %s", filter), ioe);
    }
}
Also used : Filter(org.hypertrace.core.documentstore.Filter) AttributeFilter(org.hypertrace.entity.data.service.v1.AttributeFilter) IOException(java.io.IOException)

Example 12 with Empty

use of org.hypertrace.entity.data.service.v1.Empty in project entity-service by hypertrace.

the class DocStoreConverter method createEqFilterForAttributeValue.

private static Filter createEqFilterForAttributeValue(String fieldName, AttributeValue attributeValue) {
    Filter f = new Filter();
    f.setFieldName(fieldName);
    f.setOp(Op.EQ);
    f.setValue(prepareRhsValueForSpecialValueListCase(attributeValue));
    // Set child filters to empty array
    f.setChildFilters(new Filter[] {});
    return f;
}
Also used : Filter(org.hypertrace.core.documentstore.Filter) AttributeFilter(org.hypertrace.entity.data.service.v1.AttributeFilter)

Aggregations

Filter (org.hypertrace.core.documentstore.Filter)7 Entity (org.hypertrace.entity.data.service.v1.Entity)6 AttributeFilter (org.hypertrace.entity.data.service.v1.AttributeFilter)5 ServiceException (com.google.protobuf.ServiceException)4 IOException (java.io.IOException)4 Key (org.hypertrace.core.documentstore.Key)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 Iterator (java.util.Iterator)3 List (java.util.List)3 Document (org.hypertrace.core.documentstore.Document)3 JSONDocument (org.hypertrace.core.documentstore.JSONDocument)3 EnrichedEntity (org.hypertrace.entity.data.service.v1.EnrichedEntity)3 EntityRelationship (org.hypertrace.entity.data.service.v1.EntityRelationship)3 Query (org.hypertrace.entity.data.service.v1.Query)3 Test (org.junit.jupiter.api.Test)3 Streams (com.google.common.collect.Streams)2 Descriptors (com.google.protobuf.Descriptors)2 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)2 Message (com.google.protobuf.Message)2