Skip to content

Commit 62bf128

Browse files
Deprecate mapReduce.
Closes: #3945
1 parent d4dc138 commit 62bf128

File tree

8 files changed

+31
-6
lines changed

8 files changed

+31
-6
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2021 the original author or authors.
2+
* Copyright 2011-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -601,7 +601,9 @@ <T> GroupByResults<T> group(@Nullable Criteria criteria, String inputCollectionN
601601
* @param reduceFunction The JavaScript reduce function
602602
* @param entityClass The parametrized type of the returned list. Must not be {@literal null}.
603603
* @return The results of the map reduce operation
604+
* @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}.
604605
*/
606+
@Deprecated
605607
<T> MapReduceResults<T> mapReduce(String inputCollectionName, String mapFunction, String reduceFunction,
606608
Class<T> entityClass);
607609

@@ -614,7 +616,9 @@ <T> MapReduceResults<T> mapReduce(String inputCollectionName, String mapFunction
614616
* @param mapReduceOptions Options that specify detailed map-reduce behavior.
615617
* @param entityClass The parametrized type of the returned list. Must not be {@literal null}.
616618
* @return The results of the map reduce operation
619+
* @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}.
617620
*/
621+
@Deprecated
618622
<T> MapReduceResults<T> mapReduce(String inputCollectionName, String mapFunction, String reduceFunction,
619623
@Nullable MapReduceOptions mapReduceOptions, Class<T> entityClass);
620624

@@ -628,7 +632,9 @@ <T> MapReduceResults<T> mapReduce(String inputCollectionName, String mapFunction
628632
* @param reduceFunction The JavaScript reduce function
629633
* @param entityClass The parametrized type of the returned list. Must not be {@literal null}.
630634
* @return The results of the map reduce operation
635+
* @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}.
631636
*/
637+
@Deprecated
632638
<T> MapReduceResults<T> mapReduce(Query query, String inputCollectionName, String mapFunction, String reduceFunction,
633639
Class<T> entityClass);
634640

@@ -642,7 +648,9 @@ <T> MapReduceResults<T> mapReduce(Query query, String inputCollectionName, Strin
642648
* @param mapReduceOptions Options that specify detailed map-reduce behavior
643649
* @param entityClass The parametrized type of the returned list. Must not be {@literal null}.
644650
* @return The results of the map reduce operation
651+
* @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}.
645652
*/
653+
@Deprecated
646654
<T> MapReduceResults<T> mapReduce(Query query, String inputCollectionName, String mapFunction, String reduceFunction,
647655
@Nullable MapReduceOptions mapReduceOptions, Class<T> entityClass);
648656

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2021 the original author or authors.
2+
* Copyright 2010-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -1826,7 +1826,9 @@ public <T> MapReduceResults<T> mapReduce(Query query, String inputCollectionName
18261826
* @param resultType
18271827
* @return
18281828
* @since 2.1
1829+
* @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}.
18291830
*/
1831+
@Deprecated
18301832
public <T> List<T> mapReduce(Query query, Class<?> domainType, String inputCollectionName, String mapFunction,
18311833
String reduceFunction, @Nullable MapReduceOptions mapReduceOptions, Class<T> resultType) {
18321834

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java

+4
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,9 @@ <T> Flux<ChangeStreamEvent<T>> changeStream(@Nullable String database, @Nullable
15991599
* @param options additional options like output collection. Must not be {@literal null}.
16001600
* @return a {@link Flux} emitting the result document sequence. Never {@literal null}.
16011601
* @since 2.1
1602+
* @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}.
16021603
*/
1604+
@Deprecated
16031605
<T> Flux<T> mapReduce(Query filterQuery, Class<?> domainType, Class<T> resultType, String mapFunction,
16041606
String reduceFunction, MapReduceOptions options);
16051607

@@ -1617,7 +1619,9 @@ <T> Flux<T> mapReduce(Query filterQuery, Class<?> domainType, Class<T> resultTyp
16171619
* @param options additional options like output collection. Must not be {@literal null}.
16181620
* @return a {@link Flux} emitting the result document sequence. Never {@literal null}.
16191621
* @since 2.1
1622+
* @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}.
16201623
*/
1624+
@Deprecated
16211625
<T> Flux<T> mapReduce(Query filterQuery, Class<?> domainType, String inputCollectionName, Class<T> resultType,
16221626
String mapFunction, String reduceFunction, MapReduceOptions options);
16231627

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceCounts.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2021 the original author or authors.
2+
* Copyright 2010-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,9 @@
2020
*
2121
* @author Mark Pollack
2222
* @author Oliver Gierke
23+
* @deprecated since 3.4 in favor of {@link org.springframework.data.mongodb.core.aggregation}.
2324
*/
25+
@Deprecated
2426
public class MapReduceCounts {
2527

2628
public static final MapReduceCounts NONE = new MapReduceCounts(-1, -1, -1);

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceOptions.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2021 the original author or authors.
2+
* Copyright 2010-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,7 +30,9 @@
3030
* @author Oliver Gierke
3131
* @author Christoph Strobl
3232
* @author Mark Paluch
33+
* @deprecated since 3.4 in favor of {@link org.springframework.data.mongodb.core.aggregation}.
3334
*/
35+
@Deprecated
3436
public class MapReduceOptions {
3537

3638
private @Nullable String outputCollection;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceResults.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2021 the original author or authors.
2+
* Copyright 2011-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,7 +30,9 @@
3030
* @author Christoph Strobl
3131
* @author Mark Paluch
3232
* @param <T> The class in which the results are mapped onto, accessible via an iterator.
33+
* @deprecated since 3.4 in favor of {@link org.springframework.data.mongodb.core.aggregation}.
3334
*/
35+
@Deprecated
3436
public class MapReduceResults<T> implements Iterable<T> {
3537

3638
private final List<T> mappedResults;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceTiming.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2021 the original author or authors.
2+
* Copyright 2010-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,6 +15,10 @@
1515
*/
1616
package org.springframework.data.mongodb.core.mapreduce;
1717

18+
/**
19+
* @deprecated since 3.4 in favor of {@link org.springframework.data.mongodb.core.aggregation}.
20+
*/
21+
@Deprecated
1822
public class MapReduceTiming {
1923

2024
private long mapTime, emitLoopTime, totalTime;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/**
22
* Support for MongoDB map-reduce operations.
33
*/
4+
@Deprecated
45
@org.springframework.lang.NonNullApi
56
package org.springframework.data.mongodb.core.mapreduce;
67

0 commit comments

Comments
 (0)