public class MapReducerJdbcSinglethread<X> extends MapReducer<X>
| Modifier and Type | Field and Description |
|---|---|
protected long |
executionStartTimeMillis
Stores the start time of reduce/stream operation as returned by
System.currentTimeMillis(). |
bboxFilter, keytables, oshdb, timeout, tstamps, typeFilter| Constructor and Description |
|---|
MapReducerJdbcSinglethread(OSHDBDatabase oshdb,
Class<? extends OSHDBMapReducible> forClass) |
| Modifier and Type | Method and Description |
|---|---|
protected MapReducer<X> |
copy() |
protected <R,S> S |
flatMapReduceCellsOSMContributionGroupedById(SerializableFunction<List<OSMContribution>,Iterable<R>> mapper,
SerializableSupplier<S> identitySupplier,
SerializableBiFunction<S,R,S> accumulator,
SerializableBinaryOperator<S> combiner)
Generic "flat" version of the map-reduce used by the `OSMContributionView`, with by-osm-id
grouped input to the `mapper` function.
|
protected <R,S> S |
flatMapReduceCellsOSMEntitySnapshotGroupedById(SerializableFunction<List<OSMEntitySnapshot>,Iterable<R>> mapper,
SerializableSupplier<S> identitySupplier,
SerializableBiFunction<S,R,S> accumulator,
SerializableBinaryOperator<S> combiner)
Generic "flat" version of the map-reduce used by the `OSMEntitySnapshotView`, with by-osm-id
grouped input to the `mapper` function.
|
protected Stream<X> |
flatMapStreamCellsOSMContributionGroupedById(SerializableFunction<List<OSMContribution>,Iterable<X>> mapper) |
protected Stream<X> |
flatMapStreamCellsOSMEntitySnapshotGroupedById(SerializableFunction<List<OSMEntitySnapshot>,Iterable<X>> mapper) |
protected ResultSet |
getOshCellsRawDataFromDb(XYGridTree.CellIdRange cellIdRange) |
protected Stream<GridOSHEntity> |
getOshCellsStream(XYGridTree.CellIdRange cellIdRange) |
boolean |
isActive() |
boolean |
isCancelable()
Returns if the current backend can be canceled (e.g.
|
protected <R,S> S |
mapReduceCellsOSMContribution(SerializableFunction<OSMContribution,R> mapper,
SerializableSupplier<S> identitySupplier,
SerializableBiFunction<S,R,S> accumulator,
SerializableBinaryOperator<S> combiner)
Generic map-reduce used by the `OSMContributionView`.
|
protected <R,S> S |
mapReduceCellsOSMEntitySnapshot(SerializableFunction<OSMEntitySnapshot,R> mapper,
SerializableSupplier<S> identitySupplier,
SerializableBiFunction<S,R,S> accumulator,
SerializableBinaryOperator<S> combiner)
Generic map-reduce used by the `OSMEntitySnapshotView`.
|
protected Stream<X> |
mapStreamCellsOSMContribution(SerializableFunction<OSMContribution,X> mapper) |
protected Stream<X> |
mapStreamCellsOSMEntitySnapshot(SerializableFunction<OSMEntitySnapshot,X> mapper) |
default M |
osmType(OSMType type1,
OSMType... otherTypes)
Limits the analysis to the given osm entity types.
|
default M |
osmTypes(EnumSet<OSMType> typeFilter)
Deprecated.
replaced by
osmType(OSMType, OSMType...) |
default M |
osmTypes(OSMType type1,
OSMType... otherTypes)
Deprecated.
replaced by
osmType(OSMType, OSMType...) |
protected GridOSHEntity |
readOshCellRawData(ResultSet oshCellsRawData)
Returns data of one cell from the raw data stream.
|
default M |
where(Collection<OSMTag> keyValuePairs)
Deprecated.
replaced by
osmTag(Collection) |
default M |
where(OSMTag tag)
Deprecated.
replaced by
osmTag(OSMTagInterface) |
default M |
where(OSMTagKey key)
Deprecated.
replaced by
osmTag(OSMTagInterface) |
default M |
where(SerializablePredicate<OSMEntity> f)
|
default M |
where(String key)
Deprecated.
replaced by
osmTag(String) |
default M |
where(String key,
Collection<String> values)
Deprecated.
replaced by
osmTag(String, Collection) |
default M |
where(String key,
Pattern valuePattern)
Deprecated.
replaced by
osmTag(String, Pattern) |
default M |
where(String key,
String value)
Deprecated.
replaced by
osmTag(String, String) |
aggregateBy, aggregateBy, aggregateByGeometry, aggregateByTimestamp, aggregateByTimestamp, areaOfInterest, areaOfInterest, average, average, collect, count, countUniq, estimatedMedian, estimatedMedian, estimatedQuantile, estimatedQuantile, estimatedQuantiles, estimatedQuantiles, estimatedQuantiles, estimatedQuantiles, filter, flatMap, forEach, getCellIdRanges, getFilter, getPolyFilter, getPreFilter, getTagInterpreter, getTagTranslator, groupByEntity, keytables, map, osmEntityFilter, osmTag, osmTag, osmTag, osmTag, osmTag, osmTag, osmType, reduce, reduce, stream, sum, sum, tagInterpreter, timestamps, timestamps, timestamps, timestamps, timestamps, uniq, uniq, weightedAverageprotected long executionStartTimeMillis
System.currentTimeMillis(). Used to determine query timeouts.public MapReducerJdbcSinglethread(OSHDBDatabase oshdb, Class<? extends OSHDBMapReducible> forClass)
@NotNull protected MapReducer<X> copy()
copy in class MapReducer<X>public boolean isCancelable()
MapReducerisCancelable in class MapReducer<X>protected <R,S> S mapReduceCellsOSMContribution(SerializableFunction<OSMContribution,R> mapper, SerializableSupplier<S> identitySupplier, SerializableBiFunction<S,R,S> accumulator, SerializableBinaryOperator<S> combiner) throws Exception
MapReducerThe combination of the used types and identity/reducer functions must make "mathematical" sense:
Functionally, this interface is similar to Java8 Stream's reduce(identity,accumulator,combiner) interface.
mapReduceCellsOSMContribution in class MapReducer<X>R - the data type returned by the `mapper` functionS - the data type used to contain the "reduced" (intermediate and final) resultsmapper - a function that's called for each `OSMContribution`identitySupplier - a factory function that returns a new starting value to reduce results
into (e.g. when summing values, one needs to start at zero)accumulator - a function that takes a result from the `mapper` function (type <R>)
and an accumulation value (type <S>, e.g. the result of `identitySupplier()`) and
returns the "sum" of the two; contrary to `combiner`, this function is allowed to alter
(mutate) the state of the accumulation value (e.g. directly adding new values to an
existing Set object)combiner - a function that calculates the "sum" of two <S> values; this function
must be pure (have no side effects), and is not allowed to alter the state of the two
input objects it gets!Exceptionprotected <R,S> S flatMapReduceCellsOSMContributionGroupedById(SerializableFunction<List<OSMContribution>,Iterable<R>> mapper, SerializableSupplier<S> identitySupplier, SerializableBiFunction<S,R,S> accumulator, SerializableBinaryOperator<S> combiner) throws Exception
MapReducerContrary to the "normal" map-reduce, the "flat" version adds the possibility to return any number of results in the `mapper` function. Additionally, this interface provides the `mapper` function with a list of all `OSMContribution`s of a particular OSM entity. This is used to do more complex analyses that require the full edit history of the respective OSM entities as input.
The combination of the used types and identity/reducer functions must make "mathematical" sense:
Functionally, this interface is similar to Java8 Stream's reduce(identity,accumulator,combiner) interface.
flatMapReduceCellsOSMContributionGroupedById in class MapReducer<X>R - the data type returned by the `mapper` functionS - the data type used to contain the "reduced" (intermediate and final) resultsmapper - a function that's called for all `OSMContribution`s of a particular OSM entity;
returns a list of results (which can have any number of entries).identitySupplier - a factory function that returns a new starting value to reduce results
into (e.g. when summing values, one needs to start at zero)accumulator - a function that takes a result from the `mapper` function (type <R>)
and an accumulation value (type <S>, e.g. the result of `identitySupplier()`) and
returns the "sum" of the two; contrary to `combiner`, this function is allowed to alter
(mutate) the state of the accumulation value (e.g. directly adding new values to an
existing Set object)combiner - a function that calculates the "sum" of two <S> values; this function
must be pure (have no side effects), and is not allowed to alter the state of the two
input objects it gets!Exceptionprotected <R,S> S mapReduceCellsOSMEntitySnapshot(SerializableFunction<OSMEntitySnapshot,R> mapper, SerializableSupplier<S> identitySupplier, SerializableBiFunction<S,R,S> accumulator, SerializableBinaryOperator<S> combiner) throws Exception
MapReducerThe combination of the used types and identity/reducer functions must make "mathematical" sense:
Functionally, this interface is similar to Java8 Stream's reduce(identity,accumulator,combiner) interface.
mapReduceCellsOSMEntitySnapshot in class MapReducer<X>R - the data type returned by the `mapper` functionS - the data type used to contain the "reduced" (intermediate and final) resultsmapper - a function that's called for each `OSMEntitySnapshot`identitySupplier - a factory function that returns a new starting value to reduce results
into (e.g. when summing values, one needs to start at zero)accumulator - a function that takes a result from the `mapper` function (type <R>)
and an accumulation value (type <S>, e.g. the result of `identitySupplier()`) and
returns the "sum" of the two; contrary to `combiner`, this function is allowed to alter
(mutate) the state of the accumulation value (e.g. directly adding new values to an
existing Set object)combiner - a function that calculates the "sum" of two <S> values; this function
must be pure (have no side effects), and is not allowed to alter the state of the two
input objects it gets!Exceptionprotected <R,S> S flatMapReduceCellsOSMEntitySnapshotGroupedById(SerializableFunction<List<OSMEntitySnapshot>,Iterable<R>> mapper, SerializableSupplier<S> identitySupplier, SerializableBiFunction<S,R,S> accumulator, SerializableBinaryOperator<S> combiner) throws Exception
MapReducerContrary to the "normal" map-reduce, the "flat" version adds the possibility to return any number of results in the `mapper` function. Additionally, this interface provides the `mapper` function with a list of all `OSMContribution`s of a particular OSM entity. This is used to do more complex analyses that require the full list of snapshots of the respective OSM entities as input.
The combination of the used types and identity/reducer functions must make "mathematical" sense:
Functionally, this interface is similar to Java8 Stream's reduce(identity,accumulator,combiner) interface.
flatMapReduceCellsOSMEntitySnapshotGroupedById in class MapReducer<X>R - the data type returned by the `mapper` functionS - the data type used to contain the "reduced" (intermediate and final) resultsmapper - a function that's called for all `OSMEntitySnapshot`s of a particular OSM entity;
returns a list of results (which can have any number of entries)identitySupplier - a factory function that returns a new starting value to reduce results
into (e.g. when summing values, one needs to start at zero)accumulator - a function that takes a result from the `mapper` function (type <R>)
and an accumulation value (type <S>, e.g. the result of `identitySupplier()`) and
returns the "sum" of the two; contrary to `combiner`, this function is allowed to alter
(mutate) the state of the accumulation value (e.g. directly adding new values to an
existing Set object)combiner - a function that calculates the "sum" of two <S> values; this function
must be pure (have no side effects), and is not allowed to alter the state of the two
input objects it gets!Exceptionprotected Stream<X> mapStreamCellsOSMContribution(SerializableFunction<OSMContribution,X> mapper) throws Exception
mapStreamCellsOSMContribution in class MapReducer<X>Exceptionprotected Stream<X> flatMapStreamCellsOSMContributionGroupedById(SerializableFunction<List<OSMContribution>,Iterable<X>> mapper) throws Exception
flatMapStreamCellsOSMContributionGroupedById in class MapReducer<X>Exceptionprotected Stream<X> mapStreamCellsOSMEntitySnapshot(SerializableFunction<OSMEntitySnapshot,X> mapper) throws Exception
mapStreamCellsOSMEntitySnapshot in class MapReducer<X>Exceptionprotected Stream<X> flatMapStreamCellsOSMEntitySnapshotGroupedById(SerializableFunction<List<OSMEntitySnapshot>,Iterable<X>> mapper) throws Exception
flatMapStreamCellsOSMEntitySnapshotGroupedById in class MapReducer<X>Exceptionpublic boolean isActive()
protected ResultSet getOshCellsRawDataFromDb(XYGridTree.CellIdRange cellIdRange) throws SQLException
SQLExceptionprotected GridOSHEntity readOshCellRawData(ResultSet oshCellsRawData) throws IOException, ClassNotFoundException, SQLException
@Nonnull protected Stream<GridOSHEntity> getOshCellsStream(XYGridTree.CellIdRange cellIdRange)
public M osmType(OSMType type1, OSMType... otherTypes)
type1 - the set of osm types to filter (e.g. `OSMType.NODE`)otherTypes - more osm types which should be analyzed@Deprecated public M osmTypes(EnumSet<OSMType> typeFilter)
osmType(OSMType, OSMType...)@Deprecated public M osmTypes(OSMType type1, OSMType... otherTypes)
osmType(OSMType, OSMType...)@Deprecated public M where(SerializablePredicate<OSMEntity> f)
osmEntityFilter(org.heigit.bigspatialdata.oshdb.api.generic.function.SerializablePredicate<org.heigit.bigspatialdata.oshdb.osm.OSMEntity>)@Deprecated public M where(OSMTagKey key)
osmTag(OSMTagInterface)@Deprecated public M where(String key)
osmTag(String)@Deprecated public M where(OSMTag tag)
osmTag(OSMTagInterface)@Deprecated public M where(String key, String value)
osmTag(String, String)@Deprecated public M where(String key, Collection<String> values)
osmTag(String, Collection)@Deprecated public M where(String key, Pattern valuePattern)
osmTag(String, Pattern)@Deprecated public M where(Collection<OSMTag> keyValuePairs)
osmTag(Collection)Copyright © 2016–2020 HeiGIT. All rights reserved.