forked from apache/eventmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,365 additions
and
38 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
45 changes: 45 additions & 0 deletions
45
eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/SyncConsistency.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,45 @@ | ||
package org.apache.eventmesh.common.remote.job; | ||
|
||
public enum SyncConsistency { | ||
/** 基于当前介质最新数据 */ | ||
MEDIA("M"), | ||
/** 基于当前的store记录的数据 */ | ||
STORE("S"), | ||
/** 基于当前的变更value,最终一致性 */ | ||
BASE("B"); | ||
|
||
private String value; | ||
|
||
SyncConsistency(String value){ | ||
this.value = value; | ||
} | ||
|
||
public static SyncConsistency valuesOf(String value) { | ||
SyncConsistency[] modes = values(); | ||
for (SyncConsistency mode : modes) { | ||
if (mode.value.equalsIgnoreCase(value)) { | ||
return mode; | ||
} | ||
} | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(String value) { | ||
this.value = value; | ||
} | ||
|
||
public boolean isMedia() { | ||
return this.equals(SyncConsistency.MEDIA); | ||
} | ||
|
||
public boolean isStore() { | ||
return this.equals(SyncConsistency.STORE); | ||
} | ||
|
||
public boolean isBase() { | ||
return this.equals(SyncConsistency.BASE); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
eventmesh-common/src/main/java/org/apache/eventmesh/common/remote/job/SyncMode.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,39 @@ | ||
package org.apache.eventmesh.common.remote.job; | ||
|
||
public enum SyncMode { | ||
/** 行记录 */ | ||
ROW("R"), | ||
/** 字段记录 */ | ||
FIELD("F"); | ||
|
||
private String value; | ||
|
||
SyncMode(String value){ | ||
this.value = value; | ||
} | ||
|
||
public static SyncMode valuesOf(String value) { | ||
SyncMode[] modes = values(); | ||
for (SyncMode mode : modes) { | ||
if (mode.value.equalsIgnoreCase(value)) { | ||
return mode; | ||
} | ||
} | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(String value) { | ||
this.value = value; | ||
} | ||
|
||
public boolean isRow() { | ||
return this.equals(SyncMode.ROW); | ||
} | ||
|
||
public boolean isField() { | ||
return this.equals(SyncMode.FIELD); | ||
} | ||
} |
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
Oops, something went wrong.