|
|
|
@ -70,6 +70,19 @@ public class Meta { |
|
|
|
this.allowDiskUse = source.allowDiskUse; |
|
|
|
this.allowDiskUse = source.allowDiskUse; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Return whether the maximum time limit for processing operations is set. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return {@code true} if set; {@code false} otherwise. |
|
|
|
|
|
|
|
* @since 3.4.12 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public boolean hasMaxTime() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long maxTimeMsec = getMaxTimeMsec(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return maxTimeMsec != null && maxTimeMsec > 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return {@literal null} if not set. |
|
|
|
* @return {@literal null} if not set. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -78,6 +91,26 @@ public class Meta { |
|
|
|
return getValue(MetaKey.MAX_TIME_MS.key); |
|
|
|
return getValue(MetaKey.MAX_TIME_MS.key); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the required maximum time limit in milliseconds or throws {@link IllegalStateException} if the maximum time |
|
|
|
|
|
|
|
* limit is not set. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return the maximum time limit in milliseconds for processing operations. |
|
|
|
|
|
|
|
* @throws IllegalStateException if the maximum time limit is not set |
|
|
|
|
|
|
|
* @see #hasMaxTime() |
|
|
|
|
|
|
|
* @since 3.4.12 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public Long getRequiredMaxTimeMsec() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long maxTimeMsec = getMaxTimeMsec(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (maxTimeMsec == null) { |
|
|
|
|
|
|
|
throw new IllegalStateException("Maximum time limit in milliseconds not set"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return maxTimeMsec; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the maximum time limit in milliseconds for processing operations. |
|
|
|
* Set the maximum time limit in milliseconds for processing operations. |
|
|
|
* |
|
|
|
* |
|
|
|
@ -112,12 +145,13 @@ public class Meta { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Add a comment to the query that is propagated to the profile log. |
|
|
|
* Return whether the comment is set. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param comment |
|
|
|
* @return {@code true} if set; {@code false} otherwise. |
|
|
|
|
|
|
|
* @since 3.4.12 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setComment(String comment) { |
|
|
|
public boolean hasComment() { |
|
|
|
setValue(MetaKey.COMMENT.key, comment); |
|
|
|
return StringUtils.hasText(getComment()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -128,6 +162,34 @@ public class Meta { |
|
|
|
return getValue(MetaKey.COMMENT.key); |
|
|
|
return getValue(MetaKey.COMMENT.key); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the required comment or throws {@link IllegalStateException} if the comment is not set. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return the comment. |
|
|
|
|
|
|
|
* @throws IllegalStateException if the comment is not set |
|
|
|
|
|
|
|
* @see #hasComment() |
|
|
|
|
|
|
|
* @since 3.4.12 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public String getRequiredComment() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String comment = getComment(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (comment == null) { |
|
|
|
|
|
|
|
throw new IllegalStateException("Comment not set"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return comment; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Add a comment to the query that is propagated to the profile log. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param comment |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void setComment(String comment) { |
|
|
|
|
|
|
|
setValue(MetaKey.COMMENT.key, comment); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return {@literal null} if not set. |
|
|
|
* @return {@literal null} if not set. |
|
|
|
* @since 2.1 |
|
|
|
* @since 2.1 |
|
|
|
|