[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2022-06-08 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17551836#comment-17551836
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 28d31d89de607d8947fe17890b5a951dfc895299 in geode's branch 
refs/heads/feature/GEODE-7665 from zhouxh
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=28d31d89de ]

GEODE-7683: introduce BR.cmnClearRegion

Co-authored-by: Xiaojian Zhou 

GEODE-7684: Create messaging class for PR Clear (#4689)

* Added new message class and test

Co-authored-by: Benjamin Ross 
Co-authored-by: Donal Evans 

GEODE-7682: add PR.clear  API (#4755)

* GEODE-7683: introduce BR.cmnClearRegion

Co-authored-by: Xiaojian Zhou 

PR.clear's event id should be created and used in BR (#4805)

* GEODE-7857: PR.clear's event id should be created and used in BR

GEODE-7912: cacheWriter should be triggered when PR.clear (#4882)

Co-authored-by: Anil 
Co-authored-by: Xiaojian Zhou 

GEODE-7983: Clear region writer callbacks should not be invoked for bucket 
regions (#4954)

GEODE-7676: Add PR clear with expiration tests (#4970)

Added distributed tests to verify the clear operation on Partitioned
Regions works as expected when expiration is configured.

- Added unit and distributed tests.
- Fixed LocalRegion class to clear the entryExpiryTasks Map whenever
  the cancelAllEntryExpiryTasks method is invoked.

GEODE-7667: Add a 'clear' gfsh command for PR and RR clear (#4818)

* Added clear command and modified remove functionality to clear PR

Authored-by: Benjamin Ross 

GEODE-7676: Conversion of duration to seconds.

GEODE-7894: Moving expiry tasks to AbstractRegion.

GEODE-7667: Fixing test to include PR clear help text.

GEODE-7678 (2nd PR) - Support for cache-listener and client-notification for 
Partitioned Region Clear operation  (#5124)

* GEODE-7678: Add support for cache listener and client notification for PR 
clear

The changes are made to PR clear messaging and locking mechanism to preserve
cache-listener and client-events ordering during concurrent cache operation
while clear in progress.

GEODE-7669 Test coverage for Partitioned Region clear with Overflow enabled 
(#5189)

Authored-by: Jianxia Chen 

GEODE-8173: Add unit test (coverage) for PartitionedRegionClear class. (#5208)

* GEODE-8173: Add unit test (coverage) for PartitionedRegionClear class.
Co-authored-by: anilkumar gingade 

GEODE-8334: PR.clear should sync with putAll or removeAll on rvvLock (#5365)

Co-authored-by: Xiaojian Zhou 
Co-authored-by: Anil Gingade 

GEODE-8361: Use Set instead of List to track cleared buckets (#5379)

- Refactor PartitionRegionClear to use Set instead of List
- Some other changes to remove warnings/alerts from PartitionedRegionClear and 
PartitionedRegionClearMessage

Authored-by: Donal Evans 

GEODE-7670: PR Clear with Concurrent Ops DUnitTests (#4848)

Added distributed tests to verify that the clear operation on
Partitioned Regions works as expected when there are other
concurrent operations happening on the cache (put, putAll, get,
remove, removeAll, members added and members removed).

GEODE-7680: PR.clear must be successful when interacting with rebalance (#5095)

- Added DUnit tests to confirm that clear does not interfere with
rebalance or vice versa
- Test when member departs during clear/rebalance
- Test when member joins during clear/rebalance
- Fixed typo in PartitionedRegionClearWithExpirationDUnitTest
- Fixed typo in PartitionedRegion
- Call assignBucketsToPartitions() on leader colocated region during clear
instead of target region

Authored-by: Donal Evans 

GEODE-7846: Adding Stats for Partitioned Region Clear (#5391)

Added stats to CachePerfStats for PR Clear
- Changed clears to 'regionClears' and 'bucketClears' to differentiate between 
the number of times the region was cleared and the number of times a bucket was 
cleared in a PartitionedRegion
- Added Local and Total duration stats to record how long clear has been 
running for a specific region, as well as how long it was spent clearing any 
specific member

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

fix rebase compiling error

GEODE-7845 blocking PR region clear if one or more server versions are too old 
(#5577)

- if a server is running an old version when a PR clear is invoked
by the client, the client will receive a ServerOperationException
with a cause of ServerVersionMismatchException.

GEODE-7845: Adding a cleaner simpler test. (#5622)

- Changed the test for ServerVersionMismatchException to be more readable.

GEODE-7845: Now behaving with clients of various versions. (#5645)

- added functionality that would allow the tests to be run using various 
versions of the clients against and and new versions of the server.

GEODE-7858: PR.clear notify client should let the queue holder member to 

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2021-04-13 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17320400#comment-17320400
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 248a56aefcf72e0c60e197b377adc6542662bdc2 in geode's branch 
refs/heads/feature/GEODE-7665 from zhouxh
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=248a56a ]

GEODE-7683: introduce BR.cmnClearRegion

Co-authored-by: Xiaojian Zhou 

GEODE-7684: Create messaging class for PR Clear (#4689)

* Added new message class and test

Co-authored-by: Benjamin Ross 
Co-authored-by: Donal Evans 

GEODE-7682: add PR.clear  API (#4755)

* GEODE-7683: introduce BR.cmnClearRegion

Co-authored-by: Xiaojian Zhou 

PR.clear's event id should be created and used in BR (#4805)

* GEODE-7857: PR.clear's event id should be created and used in BR

GEODE-7912: cacheWriter should be triggered when PR.clear (#4882)

Co-authored-by: Anil 
Co-authored-by: Xiaojian Zhou 

GEODE-7983: Clear region writer callbacks should not be invoked for bucket 
regions (#4954)

GEODE-7676: Add PR clear with expiration tests (#4970)

Added distributed tests to verify the clear operation on Partitioned
Regions works as expected when expiration is configured.

- Added unit and distributed tests.
- Fixed LocalRegion class to clear the entryExpiryTasks Map whenever
  the cancelAllEntryExpiryTasks method is invoked.

GEODE-7667: Add a 'clear' gfsh command for PR and RR clear (#4818)

* Added clear command and modified remove functionality to clear PR

Authored-by: Benjamin Ross 

GEODE-7676: Conversion of duration to seconds.

GEODE-7894: Moving expiry tasks to AbstractRegion.

GEODE-7667: Fixing test to include PR clear help text.

GEODE-7678 (2nd PR) - Support for cache-listener and client-notification for 
Partitioned Region Clear operation  (#5124)

* GEODE-7678: Add support for cache listener and client notification for PR 
clear

The changes are made to PR clear messaging and locking mechanism to preserve
cache-listener and client-events ordering during concurrent cache operation
while clear in progress.

GEODE-7669 Test coverage for Partitioned Region clear with Overflow enabled 
(#5189)

Authored-by: Jianxia Chen 

GEODE-8173: Add unit test (coverage) for PartitionedRegionClear class. (#5208)

* GEODE-8173: Add unit test (coverage) for PartitionedRegionClear class.
Co-authored-by: anilkumar gingade 

GEODE-8334: PR.clear should sync with putAll or removeAll on rvvLock (#5365)

Co-authored-by: Xiaojian Zhou 
Co-authored-by: Anil Gingade 

GEODE-8361: Use Set instead of List to track cleared buckets (#5379)

- Refactor PartitionRegionClear to use Set instead of List
- Some other changes to remove warnings/alerts from PartitionedRegionClear and 
PartitionedRegionClearMessage

Authored-by: Donal Evans 

GEODE-7670: PR Clear with Concurrent Ops DUnitTests (#4848)

Added distributed tests to verify that the clear operation on
Partitioned Regions works as expected when there are other
concurrent operations happening on the cache (put, putAll, get,
remove, removeAll, members added and members removed).

GEODE-7680: PR.clear must be successful when interacting with rebalance (#5095)

- Added DUnit tests to confirm that clear does not interfere with
rebalance or vice versa
- Test when member departs during clear/rebalance
- Test when member joins during clear/rebalance
- Fixed typo in PartitionedRegionClearWithExpirationDUnitTest
- Fixed typo in PartitionedRegion
- Call assignBucketsToPartitions() on leader colocated region during clear
instead of target region

Authored-by: Donal Evans 

GEODE-7846: Adding Stats for Partitioned Region Clear (#5391)

Added stats to CachePerfStats for PR Clear
- Changed clears to 'regionClears' and 'bucketClears' to differentiate between 
the number of times the region was cleared and the number of times a bucket was 
cleared in a PartitionedRegion
- Added Local and Total duration stats to record how long clear has been 
running for a specific region, as well as how long it was spent clearing any 
specific member

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

fix rebase compiling error

GEODE-7845 blocking PR region clear if one or more server versions are too old 
(#5577)

- if a server is running an old version when a PR clear is invoked
by the client, the client will receive a ServerOperationException
with a cause of ServerVersionMismatchException.

GEODE-7845: Adding a cleaner simpler test. (#5622)

- Changed the test for ServerVersionMismatchException to be more readable.

GEODE-7845: Now behaving with clients of various versions. (#5645)

- added functionality that would allow the tests to be run using various 
versions of the clients against and and new versions of the server.

GEODE-7858: PR.clear notify client should let the queue holder member to 

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2021-04-05 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17315163#comment-17315163
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 4e0be976d00df25bfdc2ff14084543a5891b6228 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=4e0be97 ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-12-01 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17241795#comment-17241795
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 17b1a29497f9bd095126e66536ea34b0d0807d07 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=17b1a29 ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-28 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17222377#comment-17222377
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 157f46569cab286dbc9a9dd7e84aeda27cd7ea32 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=157f465 ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-28 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17222368#comment-17222368
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 157f46569cab286dbc9a9dd7e84aeda27cd7ea32 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=157f465 ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17214183#comment-17214183
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 4bf638afb85840636f9fc35107afbed8122ce6b8 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=4bf638a ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17214172#comment-17214172
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 4bf638afb85840636f9fc35107afbed8122ce6b8 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=4bf638a ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17214160#comment-17214160
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 4bf638afb85840636f9fc35107afbed8122ce6b8 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=4bf638a ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17214150#comment-17214150
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 4bf638afb85840636f9fc35107afbed8122ce6b8 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=4bf638a ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17214139#comment-17214139
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit 4bf638afb85840636f9fc35107afbed8122ce6b8 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=4bf638a ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-02 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17206481#comment-17206481
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit c9e4a62f8da2e052c4e3e4dc1e467e00f6b3a4f3 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=c9e4a62 ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-02 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17206468#comment-17206468
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit c9e4a62f8da2e052c4e3e4dc1e467e00f6b3a4f3 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=c9e4a62 ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-02 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17206455#comment-17206455
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit c9e4a62f8da2e052c4e3e4dc1e467e00f6b3a4f3 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=c9e4a62 ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-02 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17206443#comment-17206443
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit c9e4a62f8da2e052c4e3e4dc1e467e00f6b3a4f3 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=c9e4a62 ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-10-02 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17206430#comment-17206430
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit c9e4a62f8da2e052c4e3e4dc1e467e00f6b3a4f3 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=c9e4a62 ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-09-08 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17192410#comment-17192410
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jinmeiliao merged pull request #5436:
URL: https://github.com/apache/geode/pull/5436


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-09-08 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17192412#comment-17192412
 ] 

ASF subversion and git services commented on GEODE-7672:


Commit e0e00bd6798d4aff8c34d4b64655f7c1c12e4db5 in geode's branch 
refs/heads/feature/GEODE-7665 from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=e0e00bd ]

GEODE-7672: add dunit test to verify OQL index after PR clear. (#5436)

* require rvv lock when create index

> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-09-08 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17192351#comment-17192351
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jinmeiliao commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r485085252



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,374 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.junit.rules.VMProvider.invokeInEveryMember;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ServerOperationException;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.AsyncInvocation;
+import org.apache.geode.test.dunit.DUnitBlackboard;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+import org.apache.geode.test.junit.rules.ExecutorServiceRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(4, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  private static DUnitBlackboard blackboard;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  @Rule
+  public ExecutorServiceRule executor = ExecutorServiceRule.builder().build();
+
+  private ClientCache clientCache;
+  private Region cities;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(2, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region))
+  .extracting(Index::getName).containsExactlyInAnyOrder("cityId", 
"cityName");
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region))
+  

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-09-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17188875#comment-17188875
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

mhansonp commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r481498899



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,374 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.junit.rules.VMProvider.invokeInEveryMember;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ServerOperationException;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.AsyncInvocation;
+import org.apache.geode.test.dunit.DUnitBlackboard;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+import org.apache.geode.test.junit.rules.ExecutorServiceRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(4, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  private static DUnitBlackboard blackboard;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  @Rule
+  public ExecutorServiceRule executor = ExecutorServiceRule.builder().build();
+
+  private ClientCache clientCache;
+  private Region cities;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(2, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region))
+  .extracting(Index::getName).containsExactlyInAnyOrder("cityId", 
"cityName");
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region))
+  

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-09-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17188874#comment-17188874
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

mhansonp commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r481498183



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,374 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.junit.rules.VMProvider.invokeInEveryMember;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ServerOperationException;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.AsyncInvocation;
+import org.apache.geode.test.dunit.DUnitBlackboard;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+import org.apache.geode.test.junit.rules.ExecutorServiceRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(4, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  private static DUnitBlackboard blackboard;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  @Rule
+  public ExecutorServiceRule executor = ExecutorServiceRule.builder().build();
+
+  private ClientCache clientCache;
+  private Region cities;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(2, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region))
+  .extracting(Index::getName).containsExactlyInAnyOrder("cityId", 
"cityName");
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region))
+  

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-09-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17188873#comment-17188873
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

mhansonp commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r481498183



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,374 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.junit.rules.VMProvider.invokeInEveryMember;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ServerOperationException;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.AsyncInvocation;
+import org.apache.geode.test.dunit.DUnitBlackboard;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+import org.apache.geode.test.junit.rules.ExecutorServiceRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(4, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  private static DUnitBlackboard blackboard;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  @Rule
+  public ExecutorServiceRule executor = ExecutorServiceRule.builder().build();
+
+  private ClientCache clientCache;
+  private Region cities;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(2, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region))
+  .extracting(Index::getName).containsExactlyInAnyOrder("cityId", 
"cityName");
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region))
+  

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-09-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17188868#comment-17188868
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

mhansonp commented on pull request #5436:
URL: https://github.com/apache/geode/pull/5436#issuecomment-685193313


   I made some updates on mhansonp minorcleanup to resolve warnings.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons, pull-request-available
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-08-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17186590#comment-17186590
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jinmeiliao commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r479359658



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,369 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.junit.rules.VMProvider.invokeInEveryMember;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ServerOperationException;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.AsyncInvocation;
+import org.apache.geode.test.dunit.DUnitBlackboard;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+import org.apache.geode.test.junit.rules.ExecutorServiceRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(4, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  private static DUnitBlackboard blackboard;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  @Rule
+  public ExecutorServiceRule executor = ExecutorServiceRule.builder().build();
+
+  private ClientCache clientCache;
+  private Region cities;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(2, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region))
+  .extracting(Index::getName).containsExactlyInAnyOrder("cityId", 
"cityName");
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region))
+  

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-08-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17186588#comment-17186588
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jinmeiliao commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r479357437



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,369 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.junit.rules.VMProvider.invokeInEveryMember;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ServerOperationException;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.AsyncInvocation;
+import org.apache.geode.test.dunit.DUnitBlackboard;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+import org.apache.geode.test.junit.rules.ExecutorServiceRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(4, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  private static DUnitBlackboard blackboard;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  @Rule
+  public ExecutorServiceRule executor = ExecutorServiceRule.builder().build();
+
+  private ClientCache clientCache;
+  private Region cities;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(2, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");

Review comment:
   I believe even with just one iteration, it's still a range index. There 
are only 2 kinds of index now: range or key. Hash is deprecated. 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific 

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-08-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17186070#comment-17186070
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

agingade commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r478637836



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,369 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.junit.rules.VMProvider.invokeInEveryMember;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ServerOperationException;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.AsyncInvocation;
+import org.apache.geode.test.dunit.DUnitBlackboard;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+import org.apache.geode.test.junit.rules.ExecutorServiceRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(4, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  private static DUnitBlackboard blackboard;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  @Rule
+  public ExecutorServiceRule executor = ExecutorServiceRule.builder().build();
+
+  private ClientCache clientCache;
+  private Region cities;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(2, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");

Review comment:
   Another most commonly used index is range index; which gets created when 
multiple iterators are used in index expression, can you please add that one 
into the test.
   qs.createIndex("sIndex", "pos.secId",
   "portfolio.values val, val.positions.values pos");

##
File path: 

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-08-26 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17185282#comment-17185282
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jinmeiliao commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r477410555



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(2, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  private ClientCache clientCache;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(0, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+  }
+
+  // before every test method, create the client cache and region
+  @Before
+  public void before() throws Exception {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+clientCache = 
clientCacheRule.withLocatorConnection(locatorPort).createCache();
+  }
+
+  @Test
+  public void verifyQuerySucceedsAfterClear() throws Exception {
+Region cities = clientCacheRule.createProxyRegion("cities");
+// put in some data
+IntStream.range(0, 100).forEach(i -> cities.put(i, new City(i)));
+
+MemberVM.invokeInEveryMember(() -> {
+  InternalCache internalCache = 

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-08-25 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17184799#comment-17184799
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jchen21 commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r476893010



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(2, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  private ClientCache clientCache;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(0, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+  }
+
+  // before every test method, create the client cache and region
+  @Before
+  public void before() throws Exception {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+clientCache = 
clientCacheRule.withLocatorConnection(locatorPort).createCache();
+  }
+
+  @Test
+  public void verifyQuerySucceedsAfterClear() throws Exception {
+Region cities = clientCacheRule.createProxyRegion("cities");
+// put in some data
+IntStream.range(0, 100).forEach(i -> cities.put(i, new City(i)));
+
+MemberVM.invokeInEveryMember(() -> {
+  InternalCache internalCache = ClusterStartupRule.getCache();

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-08-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17176632#comment-17176632
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jinmeiliao commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r469576684



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(2, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  private ClientCache clientCache;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(0, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+  }
+
+  // before every test method, create the client cache and region
+  @Before
+  public void before() throws Exception {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+clientCache = 
clientCacheRule.withLocatorConnection(locatorPort).createCache();
+  }
+
+  @Test
+  public void verifyQuerySucceedsAfterClear() throws Exception {
+Region cities = clientCacheRule.createProxyRegion("cities");
+// put in some data
+IntStream.range(0, 100).forEach(i -> cities.put(i, new City(i)));
+
+MemberVM.invokeInEveryMember(() -> {
+  InternalCache internalCache = 

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-08-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17176631#comment-17176631
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jinmeiliao commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r469576129



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(2, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  private ClientCache clientCache;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(0, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+  }
+
+  // before every test method, create the client cache and region
+  @Before
+  public void before() throws Exception {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+clientCache = 
clientCacheRule.withLocatorConnection(locatorPort).createCache();
+  }
+
+  @Test
+  public void verifyQuerySucceedsAfterClear() throws Exception {
+Region cities = clientCacheRule.createProxyRegion("cities");
+// put in some data
+IntStream.range(0, 100).forEach(i -> cities.put(i, new City(i)));

Review comment:
   Yes, the PR is also to make sure this change won't break other tests. 
It's better 

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-08-11 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17175768#comment-17175768
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jchen21 commented on a change in pull request #5436:
URL: https://github.com/apache/geode/pull/5436#discussion_r468778063



##
File path: 
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRClearQueryIndexDUnitTest.java
##
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.query.partitioned;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.data.City;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ClientCacheRule;
+
+public class PRClearQueryIndexDUnitTest {
+  public static final String MUMBAI_QUERY = "select * from /cities c where 
c.name = 'MUMBAI'";
+  public static final String ID_10_QUERY = "select * from /cities c where c.id 
= 10";
+  @ClassRule
+  public static ClusterStartupRule cluster = new ClusterStartupRule(2, true);
+
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  @Rule
+  public ClientCacheRule clientCacheRule = new ClientCacheRule();
+
+  private ClientCache clientCache;
+
+  // class test setup. set up the servers, regions and indexes on the servers
+  @BeforeClass
+  public static void beforeClass() {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+server1 = cluster.startServerVM(0, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+server2 = cluster.startServerVM(1, s -> 
s.withConnectionToLocator(locatorPort)
+.withProperty(SERIALIZABLE_OBJECT_FILTER, 
"org.apache.geode.cache.query.data.*")
+.withRegion(RegionShortcut.PARTITION, "cities"));
+
+server1.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  // create indexes
+  QueryService queryService = cache.getQueryService();
+  queryService.createKeyIndex("cityId", "c.id", "/cities c");
+  queryService.createIndex("cityName", "c.name", "/cities c");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+
+server2.invoke(() -> {
+  Cache cache = ClusterStartupRule.getCache();
+  Region region = cache.getRegion("cities");
+  assertThat(cache.getQueryService().getIndexes(region)).hasSize(2);
+});
+  }
+
+  // before every test method, create the client cache and region
+  @Before
+  public void before() throws Exception {
+int locatorPort = ClusterStartupRule.getDUnitLocatorPort();
+clientCache = 
clientCacheRule.withLocatorConnection(locatorPort).createCache();
+  }
+
+  @Test
+  public void verifyQuerySucceedsAfterClear() throws Exception {
+Region cities = clientCacheRule.createProxyRegion("cities");
+// put in some data
+IntStream.range(0, 100).forEach(i -> cities.put(i, new City(i)));
+
+MemberVM.invokeInEveryMember(() -> {
+  InternalCache internalCache = ClusterStartupRule.getCache();

[jira] [Commented] (GEODE-7672) Partitioned Region clear will successfully update the OQL indexes

2020-08-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173442#comment-17173442
 ] 

ASF GitHub Bot commented on GEODE-7672:
---

jinmeiliao opened a new pull request #5436:
URL: https://github.com/apache/geode/pull/5436


   * allow ClusterStartupRule to launch dunit default locator



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Partitioned Region clear will successfully update the OQL indexes
> -
>
> Key: GEODE-7672
> URL: https://issues.apache.org/jira/browse/GEODE-7672
> Project: Geode
>  Issue Type: Sub-task
>  Components: regions
>Reporter: Nabarun Nag
>Assignee: Jianxia Chen
>Priority: Major
>  Labels: GeodeCommons
>
> Clear operations are successfully updates the OQL indexes
>  
> Acceptance :
>  * Passing Dunit tests where OQL queries using indexes return correct results 
> after the region is cleared
>  * clear operation and index updates are successful when clear operation is 
> executed when the puts are occurring which are trying to update the OQL index.
>  * Unit tests to ensure that index sizes are zero after the region is cleaned
>  * Test coverage to when a member departs in this scenario
>  * Test coverage to when a member restarts in this scenario
>  * Unit tests with complete code coverage for the newly written code.
>  
> analyze if these tests are needed for offheap?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)