Skip to content

Commit

Permalink
[feature](merge-cloud) Add cloud related operation types (apache#32769)
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter authored Mar 25, 2024
1 parent 18f1b6f commit 19f2ade
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,13 @@ public void readFields(DataInput in) throws IOException {
isRead = true;
break;
}
// FIXME: support cloud related operation types.
case OperationType.OP_UPDATE_CLOUD_REPLICA:
case OperationType.OP_MODIFY_TTL_SECONDS:
case OperationType.OP_MODIFY_CLOUD_WARM_UP_JOB: {
isRead = true;
break;
}
default: {
IOException e = new IOException();
LOG.error("UNKNOWN Operation Type {}", opCode, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,12 @@ public static void loadJournal(Env env, Long logId, JournalEntity journal) {
// TODO: implement this while statistics finished related work.
break;
}
case OperationType.OP_UPDATE_CLOUD_REPLICA:
case OperationType.OP_MODIFY_TTL_SECONDS:
case OperationType.OP_MODIFY_CLOUD_WARM_UP_JOB: {
// TODO: support cloud replated operation type.
break;
}
default: {
IOException e = new IOException();
LOG.error("UNKNOWN Operation Type {}", opCode, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ public class OperationType {

public static final short OP_ALTER_ROLE = 475;

// For cloud.
public static final short OP_UPDATE_CLOUD_REPLICA = 1000;
public static final short OP_MODIFY_TTL_SECONDS = 1001;
public static final short OP_MODIFY_CLOUD_WARM_UP_JOB = 1002;

/**
* Get opcode name by op code.
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ public static void read(File imageFile, Env env) throws IOException, DdlExceptio
LOG.info("Skip {} module since empty meta length in the end.", metaIndex.name);
continue;
}
// FIXME: pick cloudWarmUpJob and remove below codes.
if (metaIndex.name.equals("cloudWarmUpJob")) {
LOG.warn("meta modules {} is not supported yet, ignore and skip it", metaIndex.name);
// If this is the last module, nothing need to do.
if (i < metaFooter.metaIndices.size() - 1) {
IOUtils.skipFully(dis, metaFooter.metaIndices.get(i + 1).offset - metaIndex.offset);
}
continue;
}
// skip deprecated modules
if (PersistMetaModules.DEPRECATED_MODULE_NAMES.contains(metaIndex.name)) {
LOG.warn("meta modules {} is deprecated, ignore and skip it", metaIndex.name);
Expand Down

0 comments on commit 19f2ade

Please sign in to comment.