Skip to content
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

SCB-976 Clean up the saga-core module and rename the package name. #351

Merged
merged 13 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions acceptance-tests/acceptance-pack-dubbo-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>acceptance-tests</artifactId>
<groupId>org.apache.servicecomb.saga</groupId>
<groupId>org.apache.servicecomb.pack</groupId>
<version>0.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>Saga:Acceptance Tests::Pack::Dubbo</name>
<name>Pack:Acceptance Tests::Dubbo</name>
<artifactId>acceptance-pack-dubbo</artifactId>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.acceptance.dubbodemo;
package org.apache.servicecomb.pack.acceptance.dubbodemo;

import static io.restassured.RestAssured.given;
import static java.util.concurrent.TimeUnit.SECONDS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.acceptance.dubbodemo;
package org.apache.servicecomb.pack.acceptance.dubbodemo;

import org.junit.runner.RunWith;

Expand Down
4 changes: 2 additions & 2 deletions acceptance-tests/acceptance-pack-spring-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>acceptance-tests</artifactId>
<groupId>org.apache.servicecomb.saga</groupId>
<groupId>org.apache.servicecomb.pack</groupId>
<version>0.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>acceptance-pack-spring</artifactId>
<name>Saga:Acceptance Tests::Pack::Spring</name>
<name>Pack:Acceptance Tests::Spring</name>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga;
package org.apache.servicecomb.pack;

import static io.restassured.RestAssured.given;
import static java.util.concurrent.TimeUnit.SECONDS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga;
package org.apache.servicecomb.pack;

import org.junit.runner.RunWith;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
###############################################################

RULE throw exception
CLASS org.apache.servicecomb.saga.demo.pack.booking.BookingController
CLASS org.apache.servicecomb.pack.demo.booking.BookingController
METHOD postCarBooking
AT ENTRY
IF TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
###############################################################

RULE set the saga timeout to 5s
INTERFACE org.apache.servicecomb.saga.omega.context.annotations.SagaStart
INTERFACE org.apache.servicecomb.pack.omega.context.annotations.SagaStart
METHOD timeout
AT EXIT
IF TRUE
DO RETURN 5
ENDRULE

RULE sleep when postBooking until timeout happens
CLASS org.apache.servicecomb.saga.demo.pack.booking.BookingController
CLASS org.apache.servicecomb.pack.demo.booking.BookingController
METHOD postBooking
AT ENTRY
IF TRUE
Expand Down
4 changes: 2 additions & 2 deletions acceptance-tests/acceptance-pack-tcc-spring-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>acceptance-tests</artifactId>
<groupId>org.apache.servicecomb.saga</groupId>
<groupId>org.apache.servicecomb.pack</groupId>
<version>0.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>acceptance-pack-tcc-spring-demo</artifactId>
<name>Saga:Acceptance Tests::Pack::TCC::Spring</name>
<name>Pack:Acceptance Tests::TCC::Spring</name>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga;
package org.apache.servicecomb.pack;

import static io.restassured.RestAssured.given;
import static java.util.concurrent.TimeUnit.SECONDS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga;
package org.apache.servicecomb.pack;

import org.junit.runner.RunWith;

Expand Down
4 changes: 2 additions & 2 deletions acceptance-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>saga</artifactId>
<groupId>org.apache.servicecomb.saga</groupId>
<groupId>org.apache.servicecomb.pack</groupId>
<version>0.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>acceptance-tests</artifactId>
<name>Saga:Acceptance Tests</name>
<name>Pack:Acceptance Tests</name>
<packaging>pom</packaging>
<modules>
<module>acceptance-pack-dubbo-demo</module>
Expand Down
2 changes: 1 addition & 1 deletion alpha/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# alpha-server

The alpha-server works as the pack leader to keep the consistency of transactions.
For more information, see [saga pack design](https://github.com/apache/servicecomb-saga/blob/master/docs/design.md)
For more information, see [pack design](https://github.com/apache/servicecomb-pack/blob/master/docs/design.md)

## Build and Run

Expand Down
6 changes: 3 additions & 3 deletions alpha/alpha-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>alpha</artifactId>
<groupId>org.apache.servicecomb.saga</groupId>
<groupId>org.apache.servicecomb.pack</groupId>
<version>0.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>alpha-core</artifactId>
<name>Saga::Alpha::Core</name>
<name>Pack::Alpha::Core</name>

<dependencies>
<dependency>
<groupId>org.apache.servicecomb.saga</groupId>
<groupId>org.apache.servicecomb.pack</groupId>
<artifactId>pack-common</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

public class AlphaException extends RuntimeException {
public AlphaException(String cause) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;

import static org.apache.servicecomb.saga.alpha.core.TaskStatus.NEW;
package org.apache.servicecomb.pack.alpha.core;

import java.util.Date;

Expand Down Expand Up @@ -85,7 +83,7 @@ public Command(long id,
String compensationMethod,
byte[] payloads) {

this(id, serviceName, instanceId, globalTxId, localTxId, parentTxId, compensationMethod, payloads, NEW.name());
this(id, serviceName, instanceId, globalTxId, localTxId, parentTxId, compensationMethod, payloads, TaskStatus.NEW.name());
}

public Command(TxEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import static java.util.Collections.emptyMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.apache.servicecomb.saga.alpha.core.TaskStatus.NEW;
import static org.apache.servicecomb.saga.common.EventType.SagaEndedEvent;
import static org.apache.servicecomb.saga.common.EventType.TxAbortedEvent;
import static org.apache.servicecomb.saga.common.EventType.TxEndedEvent;
import static org.apache.servicecomb.saga.common.EventType.TxStartedEvent;
import static org.apache.servicecomb.pack.common.EventType.SagaEndedEvent;
import static org.apache.servicecomb.pack.common.EventType.TxAbortedEvent;
import static org.apache.servicecomb.pack.common.EventType.TxEndedEvent;
import static org.apache.servicecomb.pack.common.EventType.TxStartedEvent;

import java.lang.invoke.MethodHandles;
import java.util.List;
Expand Down Expand Up @@ -235,6 +234,6 @@ private TxTimeout txTimeoutOf(TxEvent event) {
event.parentTxId(),
event.type(),
event.expiryTime(),
NEW.name());
TaskStatus.NEW.name());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

public interface OmegaCallback {
void compensate(TxEvent event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import static java.util.concurrent.TimeUnit.MILLISECONDS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import java.lang.invoke.MethodHandles;
import java.util.concurrent.BlockingQueue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

public enum TaskStatus {
NEW,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import static org.apache.servicecomb.saga.common.EventType.SagaEndedEvent;
import static org.apache.servicecomb.saga.common.EventType.TxAbortedEvent;
import static org.apache.servicecomb.saga.common.EventType.TxStartedEvent;
import static org.apache.servicecomb.pack.common.EventType.SagaEndedEvent;
import static org.apache.servicecomb.pack.common.EventType.TxAbortedEvent;
import static org.apache.servicecomb.pack.common.EventType.TxStartedEvent;

import java.lang.invoke.MethodHandles;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import static java.util.concurrent.TimeUnit.SECONDS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import java.util.List;
import java.util.Optional;
import org.apache.servicecomb.saga.common.EventType;
import org.apache.servicecomb.pack.common.EventType;

/**
* Repository for {@link TxEvent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import java.util.Date;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.servicecomb.saga.alpha.core;
package org.apache.servicecomb.pack.alpha.core;

import java.util.List;

Expand Down
Loading