- Notifications
You must be signed in to change notification settings - Fork691
Wip/wan tx grouping module 1#7083
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Draft
albertogpz wants to merge20 commits intoapache:developChoose a base branch fromNordix:wip/wan-tx-grouping-module_1
base:develop
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Draft
Changes from1 commit
Commits
Show all changes
20 commits Select commitHold shift + click to select a range
042013d
GEODE-6588: Cleanup GatewaySenderAttributes
jake-at-work2457963
GEODE-6588: Cleanup AbstractGatewaySender
jake-at-work8c2d23e
GEODE-6588: Cleanup GatewaySenderFactoryImpl
jake-at-workae74a42
MODULE: Extract interface for GatewaySenderAttributes.
jake-at-work7a3d45c
MODULE: Split out some factories.
jake-at-work35b072e
MODULE: Extract out TX grouping factories.
jake-at-workf7c0d21
MODULE: Create TX grouping sender impls.
jake-at-work477a823
MODULE: Remove AbstractGatwaySender.mustGroupTransactionEvents()
jake-at-work0be467b
MODULE: Stupid simple module.
jake-at-work07884e8
MODULE: ServiceLoader
jake-at-work5aa6bc7
MODULE: Move tests
jake-at-work1959233
MODULE: Move remaining tx-grouping functionality and DUnit tests
albertogpz74f9274
MODULE: Fix some GatewaySenderFactoryImpl tests
albertogpza7416a3
MODULE: Do not allow changing group-transaction-events
albertogpz0c3d814
MODULE: Add gfsh create tx-grouping gw-sender cases.
albertogpz43194d0
Updated with Kirk's first review comments
albertogpzcbe859d
remove() refactored as suggested on jbarrett's review
albertogpz8c2f77d
Use --type=TxGroupingParallelGatewaySender... as suggested in jbarret…
albertogpz77db403
Added exceptions to public API changes
albertogpz4ce6664
Fix tests
albertogpzFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
MODULE: Move tests
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit5aa6bc7bc25d3f7d2f20d7b2ab9b31d40aacaedc
There are no files selected for viewing
7 changes: 7 additions & 0 deletionsgeode-wan-txgrouping/build.gradle
This file contains hidden or 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
52 changes: 52 additions & 0 deletions...ache/wan/internal/txgrouping/parallel/TxGroupingParallelGatewaySenderTypeFactoryTest.java
This file contains hidden or 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,52 @@ | ||
/* | ||
* 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.wan.internal.txgrouping.parallel; | ||
import static org.assertj.core.api.Assertions.assertThatNoException; | ||
import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
import org.junit.Test; | ||
import org.apache.geode.internal.cache.wan.GatewaySenderException; | ||
import org.apache.geode.internal.cache.wan.MutableGatewaySenderAttributes; | ||
public class TxGroupingParallelGatewaySenderTypeFactoryTest { | ||
final TxGroupingParallelGatewaySenderTypeFactory factory = | ||
new TxGroupingParallelGatewaySenderTypeFactory(); | ||
@Test | ||
public void validateThrowsIfBatchConflationEnabled() { | ||
final MutableGatewaySenderAttributes attributes = mock(MutableGatewaySenderAttributes.class); | ||
when(attributes.isBatchConflationEnabled()).thenReturn(true); | ||
assertThatThrownBy(() -> factory.validate(attributes)) | ||
.isInstanceOf(GatewaySenderException.class) | ||
.hasMessageContaining( | ||
"both group transaction events set to true and batch conflation enabled"); | ||
} | ||
@Test | ||
public void validateDoesNotThrowsIfBatchConflationDisabled() { | ||
final MutableGatewaySenderAttributes attributes = mock(MutableGatewaySenderAttributes.class); | ||
when(attributes.isBatchConflationEnabled()).thenReturn(false); | ||
assertThatNoException().isThrownBy(() -> factory.validate(attributes)); | ||
} | ||
} |
69 changes: 69 additions & 0 deletions...de/cache/wan/internal/txgrouping/serial/TxGroupingSerialGatewaySenderTypeFactoryTest.java
This file contains hidden or 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,69 @@ | ||
/* | ||
* 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.wan.internal.txgrouping.serial; | ||
import static org.assertj.core.api.Assertions.assertThatNoException; | ||
import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
import org.junit.Test; | ||
import org.apache.geode.internal.cache.wan.GatewaySenderException; | ||
import org.apache.geode.internal.cache.wan.MutableGatewaySenderAttributes; | ||
public class TxGroupingSerialGatewaySenderTypeFactoryTest { | ||
final TxGroupingSerialGatewaySenderTypeFactory factory = | ||
new TxGroupingSerialGatewaySenderTypeFactory(); | ||
final MutableGatewaySenderAttributes attributes = mock(MutableGatewaySenderAttributes.class); | ||
@Test | ||
public void validateThrowsIfBatchConflationEnabled() { | ||
when(attributes.isBatchConflationEnabled()).thenReturn(true); | ||
assertThatThrownBy(() -> factory.validate(attributes)) | ||
.isInstanceOf(GatewaySenderException.class) | ||
.hasMessageContaining( | ||
"both group transaction events set to true and batch conflation enabled"); | ||
} | ||
@Test | ||
public void validateDoesNotThrowsIfBatchConflationDisabled() { | ||
when(attributes.isBatchConflationEnabled()).thenReturn(false); | ||
assertThatNoException().isThrownBy(() -> factory.validate(attributes)); | ||
} | ||
@Test | ||
public void validateThrowsIfDispatcherThreadsGreaterThan1() { | ||
when(attributes.getDispatcherThreads()).thenReturn(2); | ||
assertThatThrownBy(() -> factory.validate(attributes)) | ||
.isInstanceOf(GatewaySenderException.class).hasMessageContaining( | ||
"cannot be created with group transaction events set to true when dispatcher threads is greater than 1"); | ||
} | ||
@Test | ||
public void validateDoesNotThrow() { | ||
when(attributes.getDispatcherThreads()).thenReturn(1); | ||
assertThatNoException().isThrownBy(() -> factory.validate(attributes)); | ||
} | ||
} |
3 changes: 0 additions & 3 deletionsgeode-wan/build.gradle
This file contains hidden or 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
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.