Class CachedDataSet
- java.lang.Object
-
- it.bancaditalia.oss.vtl.impl.types.dataset.AbstractDataSet
-
- it.bancaditalia.oss.vtl.impl.types.dataset.NamedDataSet
-
- it.bancaditalia.oss.vtl.impl.session.CachedDataSet
-
- All Implemented Interfaces:
DataSet
,VTLValue
,Serializable
,Iterable<DataPoint>
public class CachedDataSet extends NamedDataSet
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CachedDataSet(VTLSessionImpl session, NamedDataSet delegate)
CachedDataSet(VTLSessionImpl session, String alias, DataSet delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<Map<DataStructureComponent<ComponentRole.Identifier,?,?>,ScalarValue<?,?,?,?>>,Set<DataPoint>>
createCache(Set<DataStructureComponent<ComponentRole.Identifier,?,?>> keys)
protected Stream<DataPoint>
createUnindexedCache(boolean unlockWhenComplete)
DataSet
filteredMappedJoin(DataSetMetadata metadata, DataSet other, SerBiPredicate<DataPoint,DataPoint> predicate, SerBinaryOperator<DataPoint> mergeOp)
Creates a new DataSet by joining each DataPoint of this DataSet to all indexed DataPoints of another DataSet by matching the common identifiers.boolean
isCacheable()
<A,T,TT>
Stream<T>streamByKeys(Set<DataStructureComponent<ComponentRole.Identifier,?,?>> keys, Map<DataStructureComponent<ComponentRole.Identifier,?,?>,ScalarValue<?,?,?,?>> filter, SerCollector<DataPoint,A,TT> groupCollector, SerBiFunction<TT,Map<DataStructureComponent<ComponentRole.Identifier,?,?>,ScalarValue<?,?,?,?>>,T> finisher)
Groups all the datapoints of this DataSet having the same values for the specified identifiers, and performs a mutable reduction over each of a chosen subset of the groups, and applying a final transformation.protected Stream<DataPoint>
streamDataPoints()
-
Methods inherited from class it.bancaditalia.oss.vtl.impl.types.dataset.NamedDataSet
getAlias, getDelegate, getMatching, streamTo, streamTo, toString
-
Methods inherited from class it.bancaditalia.oss.vtl.impl.types.dataset.AbstractDataSet
aggr, analytic, filter, filteredMappedJoinWithIndex, getComponent, getMetadata, mapKeepingKeys, membership, stream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.bancaditalia.oss.vtl.model.data.DataSet
analytic, analytic, contains, getComponent, getComponent, getComponent, getComponents, getComponents, isIndexed, iterator, mappedJoin, notContains, size, streamByKeys, streamByKeys, streamByKeys
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
CachedDataSet
public CachedDataSet(VTLSessionImpl session, String alias, DataSet delegate)
-
CachedDataSet
public CachedDataSet(VTLSessionImpl session, NamedDataSet delegate)
-
-
Method Detail
-
streamByKeys
public <A,T,TT> Stream<T> streamByKeys(Set<DataStructureComponent<ComponentRole.Identifier,?,?>> keys, Map<DataStructureComponent<ComponentRole.Identifier,?,?>,ScalarValue<?,?,?,?>> filter, SerCollector<DataPoint,A,TT> groupCollector, SerBiFunction<TT,Map<DataStructureComponent<ComponentRole.Identifier,?,?>,ScalarValue<?,?,?,?>>,T> finisher)
Description copied from interface:DataSet
Groups all the datapoints of this DataSet having the same values for the specified identifiers, and performs a mutable reduction over each of a chosen subset of the groups, and applying a final transformation.- Specified by:
streamByKeys
in interfaceDataSet
- Overrides:
streamByKeys
in classAbstractDataSet
T
- the type of the result of the computation.- Parameters:
keys
- theComponentRole.Identifier
s used to group the datapointsfilter
- aMap
ofComponentRole.Identifier
's values used to exclude matching groupsgroupCollector
- aCollector
applied to each group to produce the resultfinisher
- aBiFunction
to apply to the group key and result to produce the final result- Returns:
- a
Stream
of<T>
objects containing the result of the computation for each group.
-
streamDataPoints
protected Stream<DataPoint> streamDataPoints()
- Overrides:
streamDataPoints
in classNamedDataSet
-
filteredMappedJoin
public DataSet filteredMappedJoin(DataSetMetadata metadata, DataSet other, SerBiPredicate<DataPoint,DataPoint> predicate, SerBinaryOperator<DataPoint> mergeOp)
Description copied from interface:DataSet
Creates a new DataSet by joining each DataPoint of this DataSet to all indexed DataPoints of another DataSet by matching the common identifiers.- Specified by:
filteredMappedJoin
in interfaceDataSet
- Overrides:
filteredMappedJoin
in classAbstractDataSet
- Parameters:
metadata
- Thestructure
the new DataSet must conform to.other
- another DataSet that will be indexed and joined to each DataPoint of this DataSet.predicate
- aBiPredicate
used to select only a subset of the joinedDataPoint
s.mergeOp
- aBinaryOperator
that merges two selected joined DataPoints together into one.- Returns:
- The new DataSet.
-
createCache
protected Map<Map<DataStructureComponent<ComponentRole.Identifier,?,?>,ScalarValue<?,?,?,?>>,Set<DataPoint>> createCache(Set<DataStructureComponent<ComponentRole.Identifier,?,?>> keys)
-
isCacheable
public boolean isCacheable()
- Returns:
- true if this DataSet can be cached
-
-