-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-13508: Test scenario of two-phased rebalance #8385
Closed
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
08c0c1a
IGNITE-13508: added two-phase rebalance test
Sega76 600c0ba
IGNITE-13508: fix
Sega76 ecf4b1d
IGNITE-13508: fix
Sega76 9a642b2
IGNITE-13508: fix pydoc
Sega76 7257a29
IGNITE-13508: fix pydoc
Sega76 df0aef6
IGNITE-13508: fix comments
Sega76 233943f
IGNITE-13508: fix comments
Sega76 5eb455b
IGNITE-13508: added indexes
Sega76 46ce2eb
IGNITE-13508: added await_cluster_idle after rebalance
Sega76 3a9ef2b
IGNITE-13508: fix comments
Sega76 bb49d93
IGNITE-13508: set NUM_CELL=2
Sega76 40d61a5
IGNITE-13508: optimize cache_macro a bit
Sega76 33562ed
IGNITE-13508: added use globals cluster_size
Sega76 0290e1c
IGNITE-13508: fix comments
Sega76 2d2b88e
IGNITE-13508: fix comments
Sega76 1f396d2
IGNITE-13508: fix comments
Sega76 987caba
IGNITE-13508: fix comments
Sega76 c617c3a
Merge remote-tracking branch 'ignite/ignite-ducktape' into IGNITE-13508
Sega76 6234090
IGNITE-13508: fix comments
Sega76 78df8d1
IGNITE-13508: fix comments
Sega76 ca3976e
IGNITE-13508: fix versions
Sega76 0dd8561
Merge remote-tracking branch 'ignite/ignite-ducktape' into IGNITE-13508
Sega76 31de1d4
IGNITE-13508: remove LATEST_2_9
Sega76 d7788a1
Merge remote-tracking branch 'ignite/ignite-ducktape' into IGNITE-13508
Sega76 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
...ktests/src/main/java/org/apache/ignite/internal/ducktest/tests/DeleteDataApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* 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.ignite.internal.ducktest.tests; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Iterator; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.TreeSet; | ||
import java.util.concurrent.TimeUnit; | ||
import javax.cache.Cache; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import org.apache.ignite.IgniteCache; | ||
import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication; | ||
import org.apache.ignite.lang.IgniteFuture; | ||
|
||
/** | ||
* Deleting data from the cache. | ||
*/ | ||
public class DeleteDataApplication extends IgniteAwareApplication { | ||
/** {@inheritDoc} */ | ||
@Override public void run(JsonNode jNode) { | ||
String cacheName = jNode.get("cacheName").asText(); | ||
|
||
int size = jNode.get("size").asInt(); | ||
|
||
int batchSize = Optional.ofNullable(jNode.get("batchSize")) | ||
.map(JsonNode::asInt) | ||
.orElse(1000); | ||
|
||
IgniteCache<Object, Object> cache = ignite.getOrCreateCache(cacheName); | ||
|
||
log.info("Cache size before: " + cache.size()); | ||
|
||
markInitialized(); | ||
|
||
long start = System.currentTimeMillis(); | ||
|
||
Iterator<Cache.Entry<Object, Object>> iter = cache.iterator(); | ||
|
||
ArrayList<Object> keys = new ArrayList<>(size); | ||
|
||
for (int cnt = 0; iter.hasNext() && cnt < size; cnt++) | ||
keys.add(iter.next().getKey()); | ||
|
||
log.info("Start removing: " + keys.size()); | ||
|
||
int listSize = keys.size(); | ||
|
||
List<IgniteFuture<Void>> futures = new LinkedList<>(); | ||
|
||
for (int from = 0; from < listSize; from += batchSize) { | ||
int to = Math.min(from + batchSize, listSize); | ||
|
||
futures.add(cache.removeAllAsync(new TreeSet<>(keys.subList(from, to)))); | ||
} | ||
|
||
futures.forEach(f -> f.get(TimeUnit.MINUTES.toMillis(5))); | ||
|
||
log.info("Cache size after: " + cache.size()); | ||
|
||
recordResult("DURATION_SECONDS", TimeUnit.MILLISECONDS.toSeconds( System.currentTimeMillis() - start)); | ||
|
||
markFinished(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,17 +15,43 @@ | |
limitations under the License. | ||
#} | ||
|
||
|
||
{% macro rendezvous_backup_filter(affinity) %} | ||
<bean class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction"> | ||
<property name="affinityBackupFilter"> | ||
<bean class="org.apache.ignite.internal.ducktest.tests.cellular_affinity_test.CellularAffinityBackupFilter"> | ||
<constructor-arg value="{{ affinity.attr_name }}"/> | ||
</bean> | ||
</property> | ||
</bean> | ||
{% endmacro %} | ||
|
||
{% macro cache_configs(caches) %} | ||
{% if caches %} | ||
<property name="cacheConfiguration"> | ||
<list> | ||
{% for cache in caches %} | ||
<bean class="org.apache.ignite.configuration.CacheConfiguration"> | ||
<property name="name" value="{{ cache.name }}"/> | ||
{% if cache.cache_mode == 'PARTITIONED' %} | ||
<property name="backups" value="{{ cache.backups or 0 }}"/> | ||
<property name="backups" value="{{ cache.backups }}"/> | ||
<property name="cacheMode" value="{{ cache.cache_mode }}"/> | ||
<property name="atomicityMode" value="{{ cache.atomicity_mode }}"/> | ||
|
||
{% if cache.indexed_types %} | ||
<property name="indexedTypes"> | ||
<list> | ||
{% for class in cache.indexed_types %} | ||
<value>{{ class }}</value> | ||
{% endfor %} | ||
</list> | ||
</property> | ||
{% endif %} | ||
|
||
{% if cache.affinity and cache.affinity.name == 'BACKUP_FILTER' %} | ||
<property name="affinity"> | ||
{{ rendezvous_backup_filter(cache.affinity) }} | ||
</property> | ||
{% endif %} | ||
<property name="atomicityMode" value="{{ cache.atomicity_mode or 'ATOMIC' }}"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'ATOMIC' is default |
||
</bean> | ||
{% endfor %} | ||
</list> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,6 @@ discovery: | |
|
||
snapshot: | ||
- ../snapshot_test.py | ||
|
||
two_phased_rebalance: | ||
- ../two_phased_rebalanced_test.py.py |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is default