Package com.seeq.link.sdk.interfaces
Class GetCapsulesParameters
java.lang.Object
com.seeq.link.sdk.interfaces.GetCapsulesParameters
-
Constructor Summary
ConstructorsConstructorDescriptionGetCapsulesParameters
(ConditionConnectionMessages.ConditionRequestMessage conditionRequestMessage, Consumer<TimeInstant> cursorCallback) GetCapsulesParameters
(String dataId, TimeInstant startTime, TimeInstant endTime, int capsuleLimit, long maxDuration, Consumer<TimeInstant> cursorCallback) GetCapsulesParameters
(String dataId, TimeInstant startTime, TimeInstant endTime, com.google.common.collect.ImmutableList<ConditionConnectionMessages.ConditionRequestMessage.CapsulePropertyInfo> propertyInfo, int capsuleLimit, long maxDuration, Consumer<TimeInstant> cursorCallback) -
Method Summary
Modifier and TypeMethodDescriptionint
The maximum capsules that can be returned as part of this request.A connector-defined String that identifies the condition to retrieve data for.The end time for the requested data.The end time for the requested data plus the "maximum duration" for the condition.long
The maximum duration of capsules in the series in nanoseconds.The start time for the requested data, if queried in overlapping fashion.com.google.common.collect.ImmutableList<ConditionConnectionMessages.ConditionRequestMessage.CapsulePropertyInfo>
The start time for the requested data.boolean
If true, you can specify a time instant to SetLastCertainKey to indicate to Seeq that any conditions that start after a time instant are uncertain.void
IfisLastCertainKeyRequested()
returns true, you can (and should) invoke this method to indicate to Seeq that any capsules that start after a time instant are uncertain.
-
Constructor Details
-
GetCapsulesParameters
public GetCapsulesParameters(ConditionConnectionMessages.ConditionRequestMessage conditionRequestMessage, Consumer<TimeInstant> cursorCallback) -
GetCapsulesParameters
public GetCapsulesParameters(String dataId, TimeInstant startTime, TimeInstant endTime, int capsuleLimit, long maxDuration, Consumer<TimeInstant> cursorCallback) -
GetCapsulesParameters
public GetCapsulesParameters(String dataId, TimeInstant startTime, TimeInstant endTime, com.google.common.collect.ImmutableList<ConditionConnectionMessages.ConditionRequestMessage.CapsulePropertyInfo> propertyInfo, int capsuleLimit, long maxDuration, Consumer<TimeInstant> cursorCallback)
-
-
Method Details
-
getDataId
A connector-defined String that identifies the condition to retrieve data for.- Returns:
- connector-defined string that identifies the signal to retrieve data for.
-
getStartTime
The start time for the requested data. Return capsules that start at or after this time and start at or beforegetEndTime()
.
This is defined as the Seeq server query start minus the "maximum duration" for the condition, and represents the earliest possible time that a capsule may be relevant. This is useful when it is most natural to query capsules by start time; if querying by overlaps is more natural, usegetOverlappingStartTime()
instead.- Returns:
- start time for the requested capsules queried by their starts
- See Also:
-
getOverlappingStartTime
The start time for the requested data, if queried in overlapping fashion. Return capsules that end at or after this time, and start at or beforegetEndTime()
. In general querying by overlapping starts should only be used for conditions where capsules never overlap. This is because capsules must still be returned completely in order; that is, if a capsule overlaps the query interval, and another capsule starts after it but ends sooner and thus does not overlap the query interval, BOTH must be included. This is unlikely to result in a more efficient query thangetStartTime()
and so should not be used unless capsules are strictly non-overlapping.- Returns:
- start time for the requested capsules queried by their overlap
- See Also:
-
getEndTime
The end time for the requested data. Return capsules that start at or before this time, and start at or aftergetStartTime()
.- Returns:
- end time for the requested data
-
getExpandedEndTime
The end time for the requested data plus the "maximum duration" for the condition. This value represents the latest possible time that a capsule may be relevant for a given request.- Returns:
- expanded end time for the requested data
-
getPropertyInfo
public com.google.common.collect.ImmutableList<ConditionConnectionMessages.ConditionRequestMessage.CapsulePropertyInfo> getPropertyInfo()- Returns:
- Information on the condition's capsule properties, as defined during indexing.
-
getCapsuleLimit
public int getCapsuleLimit()The maximum capsules that can be returned as part of this request. Note that the connection need not enforce this limit, as no more capsules than the limit will be read from the stream that is returned from this method. This limit is provided for informational purposes to enable optimization where possible.- Returns:
- capsule limit for this request
-
getMaxDuration
public long getMaxDuration()The maximum duration of capsules in the series in nanoseconds.- Returns:
- maximum duration
-
isLastCertainKeyRequested
public boolean isLastCertainKeyRequested()If true, you can specify a time instant to SetLastCertainKey to indicate to Seeq that any conditions that start after a time instant are uncertain. If false, you cannot make such a method call (and should not try to calculate a time) because Seeq will not use the value. -
setLastCertainKey
IfisLastCertainKeyRequested()
returns true, you can (and should) invoke this method to indicate to Seeq that any capsules that start after a time instant are uncertain. IfisLastCertainKeyRequested()
is true, this method must be invoked at least once or all capsules returned will appear uncertain in Seeq. If all capsules are certain and new capsules always start after existing capsules, a good value for the the last certain key is the start of the most recent capsule in the condition. (If new capsules start at or after existing capsules, then decrement the key (one nanosecond earlier). In general, new capsules should always start after the last certain key.) If some capsules are uncertain, but new capsules come in by order of their starts, a good value for the last certain key is the start of the earliest uncertain capsule, decremented (i.e. one nanosecond earlier). If new capsules are not added in order of their start, it is recommended to use a last certain key far enough in the past that no new capsules will start before that key. This requires more knowledge of the capsules' meaning and should be a last resort, as it will lead to the condition and derived data appearing less certain in Seeq. You can invoke this method anytime afterConditionPullDatasourceConnection.getCapsules(GetCapsulesParameters)
is entered, and you may invoke it multiple times. If you do, the last invocation takes precedence. If you supply null for the key, it will clear any key set by a previous call.
-