[ 
https://issues.apache.org/jira/browse/KUDU-1663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexey Serbin updated KUDU-1663:
--------------------------------
    Description: 
After reading the in-line doc for the subj. entities, one would expect the 
scanner from the following code to do its job on reading-what-you-have-written:

{code}
const uint64_t snapshot_timestamp = client->GetLatestObservedTimestamp();

KuduScanner scanner(table.get());
RETURN_NOT_OK(scanner.SetSnapshotRaw(snapshot_timestamp));
RETURN_NOT_OK(scanner.SetSelection(KuduClient::LEADER_ONLY));
RETURN_NOT_OK(scanner.SetReadMode(KuduScanner::READ_AT_SNAPSHOT));
RETURN_NOT_OK(scanner.Open());
{code}

However, it does not work.

To make it work, it's necessary to add extra 1 to the snapshot timestamp:

{code}
RETURN_NOT_OK(scanner.SetSnapshotRaw(snapshot_timestamp + 1));
{code}

  was:
After reading the in-line doc for the subj. entities, one would expect the 
scanner from the following code to do its job on reading-what-you-have-written:

{code}
const uint64_t snapshot_timestamp = client->GetLatestObservedTimestamp();

KuduScanner scanner(table.get());
RETURN_NOT_OK(scanner.SetSnapshotRaw(snapshot_timestamp));
RETURN_NOT_OK(scanner.SetReadMode(KuduScanner::READ_AT_SNAPSHOT));
RETURN_NOT_OK(scanner.Open());
{code}

However, it does not work.

To make it work, it's necessary to add extra 1 to the snapshot timestamp:

{code}
RETURN_NOT_OK(scanner.SetSnapshotRaw(snapshot_timestamp + 1));
{code}


> Clean-up in-code documentation for KuduScanner::ReadMode and 
> KuduClient::GetLatestObservedTimestamp
> ---------------------------------------------------------------------------------------------------
>
>                 Key: KUDU-1663
>                 URL: https://issues.apache.org/jira/browse/KUDU-1663
>             Project: Kudu
>          Issue Type: Bug
>          Components: api, client, documentation
>    Affects Versions: 1.0.0
>            Reporter: Alexey Serbin
>            Assignee: Alexey Serbin
>            Priority: Minor
>
> After reading the in-line doc for the subj. entities, one would expect the 
> scanner from the following code to do its job on 
> reading-what-you-have-written:
> {code}
> const uint64_t snapshot_timestamp = client->GetLatestObservedTimestamp();
> KuduScanner scanner(table.get());
> RETURN_NOT_OK(scanner.SetSnapshotRaw(snapshot_timestamp));
> RETURN_NOT_OK(scanner.SetSelection(KuduClient::LEADER_ONLY));
> RETURN_NOT_OK(scanner.SetReadMode(KuduScanner::READ_AT_SNAPSHOT));
> RETURN_NOT_OK(scanner.Open());
> {code}
> However, it does not work.
> To make it work, it's necessary to add extra 1 to the snapshot timestamp:
> {code}
> RETURN_NOT_OK(scanner.SetSnapshotRaw(snapshot_timestamp + 1));
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to