Comments (2)
@marcocappolimases as stated in #21 (comment), you are proposing a method which can accept negative values. The same approach can be applied to the Seek
method proposed in this issue. One drawback with the actual implementation of Seek
with negative values is that backends (librdkafka, OpenDDS) uses negative values for their internal purposes and specific negative values have well-known behavior. Since real offsets are positive monotonic incremental values and negative values are only special, I propose to change the signature of the Seek
to add an optional parameter which defines if the offset is Absolute or Relative, so it is possible to distinguish when a negative value refers to something in the past of the data stream or it is a special value. The same behavior can be applied to the Seek
method that accepts a timestamp.
In the issue you proposed a DateTme
type which is undoubtedly related to .NET (C#). Both C# and Java implementations are wrappers around the C++ implementation: in #21 (comment) there is a proposal about timestamp, but the low layer measures the timestamp as milliseconds from epoch (UTC) and the base type is something similar to the offset one. At C++ level the problem will be to distinguish between Seek
method for offset and timestamp: my idea to solve this inchoerence is to add another optional parameter which defines which kind of input is receiving the Seek
method. The final signature will be something like the following one:
typedef enum class DDM_SEEKCONTEXT
{
OFFSET = 0x1, /**< Seek on offset */
TIMESTAMP = 0x2, /**< Seek on timestamp */
} DDM_SEEKCONTEXT;
typedef enum class DDM_SEEKKIND
{
ABSOLUTE = 0x1, /**< Absolute seek */
RELATIVE = 0x2, /**< Relative seek */
} DDM_SEEKKIND;
virtual OPERATION_RESULT SeekChannel(CHANNEL_HANDLE_PARAMETER, int64_t position, DDM_SEEKCONTEXT context = DDM_SEEKCONTEXT::OFFSET, DDM_SEEKKIND kind = DDM_SEEKKIND::ABSOLUTE) = 0;
The previous implementation will be open for further extensions, adding more values to DDM_SEEKCONTEXT
and DDM_SEEKKIND
, without changing again the low level interface.
from datadistributionmanager.
@mariomastrodicasa the solution seems optimal for C++.
I think that the implementation I proposed in the Issue can be used to call transparently both an absolute or a relative seek.
from datadistributionmanager.
Related Issues (20)
- access violation in initialize with KafkaConfiguration
- Add Maven or Gradle to publish JAR to online repositories
- Async channel behavior continuously emit OnConditionOrError with a DDM_NO_DATA_RETURNED message
- Channel configured in transmission mode receives messages. HOT 1
- Doing two times a complete cycle of channel creation, the second call to CreateSmartChannel requires 5 minutes to complete. HOT 2
- Make disposable the classes interacting with native code HOT 1
- Under heavy stress condition the published payload is not correct HOT 1
- Wrong parameter passed for AutoOffsetReset in KafkaChannelConfiguration HOT 2
- Add a method to retrieve the actual Channel offset HOT 5
- Upgrade to .NET 6
- Add management of transactions in Apache Kafka client
- Workflows are referencing vulnerable actions
- Split published artifacts HOT 1
- Remove .NET 5 due to its End of Support
- Upgrade OpenDDS and librdkafka as soos as possible
- Use GitHub cache instead of FTP site to use OpenDDS artifacts within Pull Request and Release workflows HOT 1
- Clean up commented code
- Align web-site style to masesgroup.com
- Add .NET 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datadistributionmanager.