[
https://issues.apache.org/jira/browse/IGNITE-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14679880#comment-14679880
]
Denis Magda edited comment on IGNITE-946 at 8/10/15 9:58 AM:
-------------------------------------------------------------
Dmitriy,
1. I've looked over the code and the documentation is correct - it's not a
plain cluster's topology version but the version plus number of seconds...
I have no idea why this mess was created, why it is called "topologyVersion" at
all. This so called "topologyVersion" is used in many places in our code and I
will not be surprised if such usage brought bugs. I'll start a discussion on
the dev list regarding this.
2. Irrelevant, see 1) above.
3. This is a versioned entry unique order. Each time a cache entry for a given
key is updated a new {{VersionedEntry}} with increased order is created.
Updated the documentation.
4. This is a local node order at the time when the entry with a given pair of
key and value has been created.
5. According to the source code this is version's creation time. Renamed from
{{globalTime}} to {{creationTime}}. The field is used in the transactional mode
as well.
The latest version of the API.
{noformat}
public interface VersionedEntry<K, V> extends Cache.Entry<K, V> {
/**
* Gets the topology version at the time when the entry with a given pair
of key and value has been created.
*
* @return Topology version plus number of seconds from the start time of
the first grid node.
*/
public int topologyVersion();
/**
* Gets versioned entry unique order.
* Each time a cache entry for a given key is updated a new {@code
VersionedEntry} with increased order is created.
*
* @return Versioned entry unique order.
*/
public long order();
/**
* Gets local node order at the time when the entry with a given pair of
key and value has been created.
*
* @return Local node order on which this version has been assigned.
*/
public int nodeOrder();
/**
* Gets the time when the entry with a given pair of key and value has been
created.
*
* @return Time in milliseconds.
*/
public long creationTime();
}
{noformat}
was (Author: dmagda):
Dmitriy,
1. I've looked over the code and the documentation is correct - it's not a
plain cluster's topology version but the version plus number of seconds...
I have no idea why this mess was created, why it is called "topologyVersion" at
all. This so called "topologyVersion" is used in many places in our code and I
will not be surprised if such usage brought bugs. I'll start a discussion on
the dev list regarding this.
2. Irrelevant, see 1) above.
3. This is a versioned entry unique order. Each time a cache entry for a given
key is updated a new {@code VersionedEntry} with increased order is created.
Updated the documentation.
4. This is a local node order at the time when the entry with a given pair of
key and value has been created.
5. According to the source code this is version's creation time. Renamed from
{{globalTime}} to {{creationTime}}. The field is used in the transactional mode
as well.
The latest version of the API.
{noformat}
public interface VersionedEntry<K, V> extends Cache.Entry<K, V> {
/**
* Gets the topology version at the time when the entry with a given pair
of key and value has been created.
*
* @return Topology version plus number of seconds from the start time of
the first grid node.
*/
public int topologyVersion();
/**
* Gets versioned entry unique order.
* Each time a cache entry for a given key is updated a new {@code
VersionedEntry} with increased order is created.
*
* @return Versioned entry unique order.
*/
public long order();
/**
* Gets local node order at the time when the entry with a given pair of
key and value has been created.
*
* @return Local node order on which this version has been assigned.
*/
public int nodeOrder();
/**
* Gets the time when the entry with a given pair of key and value has been
created.
*
* @return Time in milliseconds.
*/
public long creationTime();
}
{noformat}
> Need to expose versioned cache entry to public API
> --------------------------------------------------
>
> Key: IGNITE-946
> URL: https://issues.apache.org/jira/browse/IGNITE-946
> Project: Ignite
> Issue Type: Bug
> Components: cache
> Affects Versions: sprint-4
> Reporter: Valentin Kulichenko
> Assignee: Denis Magda
> Priority: Critical
> Labels: Usability
> Fix For: ignite-1.4
>
> Attachments: ignite-946-2.patch, ignite-946.patch
>
>
> Currently we have versioned entry, but it's not available on public API, but
> knowing version can be useful in some cases. Need to make it accessible via
> {{unwrap}} method.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)