public Map<String, Object> getProvidedValues() { return constraints.getProvidedValues(); }
@Override public void write(E entity) { StorageKey key = getAccessor().keyFor(entity, constraints.getProvidedValues(), partitionStratKey); if (!keyPredicate.apply(key)) { throw new IllegalArgumentException("View does not contain entity: " + entity); } wrappedWriter.write(entity); }
@Override public void initialize() { if (key == null) { // restore transient objects from serializable versions PartitionStrategy strategy = PartitionStrategyParser.parse(strategyString); Schema schema = new Schema.Parser().parse(schemaString); this.key = new AvroStorageKey(strategy, schema); this.accessor = DataModelUtil.accessor(type, schema); if (constraints != null) { this.provided = Constraints .fromQueryMap(schema, strategy, constraints) .getProvidedValues(); } } count = 0; }
@Override public void write(E entity) { StorageKey key = getAccessor().keyFor(entity, constraints.getProvidedValues(), partitionStratKey); if (!keyPredicate.apply(key)) { throw new IllegalArgumentException("View does not contain entity: " + entity); } wrappedWriter.write(entity); }