DATAMONGO-2449 - Polishing.
Reformat code. Tweak Javadoc. Original pull request: #827.
This commit is contained in:
@@ -169,11 +169,32 @@ public class Meta {
|
||||
return flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* When set to {@literal true}, aggregation stages can write data to disk.
|
||||
*
|
||||
* @return {@literal null} if not set.
|
||||
* @since 3.0
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getAllowDiskUse() {
|
||||
return allowDiskUse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set to {@literal true}, to allow aggregation stages to write data to disk.
|
||||
*
|
||||
* @param allowDiskUse use {@literal null} for server defaults.
|
||||
* @since 3.0
|
||||
*/
|
||||
public void setAllowDiskUse(@Nullable Boolean allowDiskUse) {
|
||||
this.allowDiskUse = allowDiskUse;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public boolean hasValues() {
|
||||
return !this.values.isEmpty() || !this.flags.isEmpty() || this.cursorBatchSize != null;
|
||||
return !this.values.isEmpty() || !this.flags.isEmpty() || this.cursorBatchSize != null || this.allowDiskUse != null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,27 +268,6 @@ public class Meta {
|
||||
return ObjectUtils.nullSafeEquals(this.flags, other.flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* When set to true, aggregation stages can write data to disk.
|
||||
*
|
||||
* @return {@literal null} if not set.
|
||||
* @since 3.0
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getAllowDiskUse() {
|
||||
return allowDiskUse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set to true, to allow aggregation stages to write data to disk.
|
||||
*
|
||||
* @param allowDiskUse use {@literal null} for server defaults.
|
||||
* @since 3.0
|
||||
*/
|
||||
public void setAllowDiskUse(@Nullable Boolean allowDiskUse) {
|
||||
this.allowDiskUse = allowDiskUse;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link CursorOption} represents {@code OP_QUERY} wire protocol flags to change the behavior of queries.
|
||||
*
|
||||
|
||||
@@ -46,7 +46,7 @@ public @interface Meta {
|
||||
* Sets the number of documents to return per batch. <br />
|
||||
* Use {@literal 0 (zero)} for no limit. A <strong>negative limit</strong> closes the cursor after returning a single
|
||||
* batch indicating to the server that the client will not ask for a subsequent one.
|
||||
*
|
||||
*
|
||||
* @return {@literal 0 (zero)} by default.
|
||||
* @since 2.1
|
||||
*/
|
||||
@@ -68,7 +68,7 @@ public @interface Meta {
|
||||
org.springframework.data.mongodb.core.query.Meta.CursorOption[] flags() default {};
|
||||
|
||||
/**
|
||||
* When set to true, aggregation stages can write data to disk.
|
||||
* When set to {@literal true}, aggregation stages can write data to disk.
|
||||
*
|
||||
* @return {@literal false} by default.
|
||||
* @since 3.0
|
||||
|
||||
@@ -94,7 +94,7 @@ class AggregationUtils {
|
||||
builder.cursorBatchSize(meta.getCursorBatchSize());
|
||||
}
|
||||
|
||||
if(meta.getMaxTimeMsec() != null && meta.getMaxTimeMsec() > 0) {
|
||||
if (meta.getMaxTimeMsec() != null && meta.getMaxTimeMsec() > 0) {
|
||||
builder.maxTime(Duration.ofMillis(meta.getMaxTimeMsec()));
|
||||
}
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ public class MongoQueryMethod extends QueryMethod {
|
||||
}
|
||||
}
|
||||
|
||||
if(meta.allowDiskUse()) {
|
||||
if (meta.allowDiskUse()) {
|
||||
metaAttributes.setAllowDiskUse(meta.allowDiskUse());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user