Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IGNITE-4336 Manual rebalance can't be requested twice
- Loading branch information
1 parent
59e6fec
commit 9a691c4
Showing
10 changed files
with
166 additions
and
32 deletions.
There are no files selected for viewing
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
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
75 changes: 75 additions & 0 deletions
75
...e/src/test/java/org/apache/ignite/internal/processors/cache/CacheRebalancingSelfTest.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,75 @@ | |||
/* | |||
* 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.processors.cache; | |||
|
|||
import org.apache.ignite.IgniteCache; | |||
import org.apache.ignite.configuration.CacheConfiguration; | |||
import org.apache.ignite.configuration.IgniteConfiguration; | |||
import org.apache.ignite.internal.IgniteEx; | |||
import org.apache.ignite.internal.IgniteInternalFuture; | |||
import org.apache.ignite.internal.util.future.IgniteFutureImpl; | |||
import org.apache.ignite.lang.IgniteFuture; | |||
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; | |||
|
|||
/** | |||
* Test for rebalancing. | |||
*/ | |||
public class CacheRebalancingSelfTest extends GridCommonAbstractTest { | |||
/** {@inheritDoc} */ | |||
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { | |||
IgniteConfiguration cfg = super.getConfiguration(gridName); | |||
|
|||
cfg.setCacheConfiguration(new CacheConfiguration()); | |||
|
|||
return cfg; | |||
} | |||
|
|||
/** | |||
* @throws Exception If failed. | |||
*/ | |||
public void testRebalanceFuture() throws Exception { | |||
IgniteEx ignite0 = startGrid(0); | |||
startGrid(1); | |||
|
|||
IgniteCache<Object, Object> cache = ignite0.cache(null); | |||
|
|||
IgniteFuture fut1 = cache.rebalance(); | |||
|
|||
fut1.get(); | |||
|
|||
startGrid(2); | |||
|
|||
IgniteFuture fut2 = cache.rebalance(); | |||
|
|||
assert internalFuture(fut2) != internalFuture(fut1); | |||
|
|||
fut2.get(); | |||
} | |||
|
|||
/** | |||
* @param future Future. | |||
* @return Internal future. | |||
*/ | |||
private static IgniteInternalFuture internalFuture(IgniteFuture future) { | |||
assert future instanceof IgniteFutureImpl; | |||
|
|||
return ((IgniteFutureImpl)future).internalFuture(); | |||
} | |||
|
|||
} |
Oops, something went wrong.