Skip to content

Commit 12e1fb2

Browse files
authored
Fix UDF missing redo raft log after restart
1 parent 77f350e commit 12e1fb2

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlan.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.apache.iotdb.confignode.consensus.request.write.function.CreateFunctionPlan;
5151
import org.apache.iotdb.confignode.consensus.request.write.function.DropTableModelFunctionPlan;
5252
import org.apache.iotdb.confignode.consensus.request.write.function.DropTreeModelFunctionPlan;
53+
import org.apache.iotdb.confignode.consensus.request.write.function.UpdateFunctionPlan;
5354
import org.apache.iotdb.confignode.consensus.request.write.model.CreateModelPlan;
5455
import org.apache.iotdb.confignode.consensus.request.write.model.DropModelInNodePlan;
5556
import org.apache.iotdb.confignode.consensus.request.write.model.DropModelPlan;
@@ -295,6 +296,9 @@ public static ConfigPhysicalPlan create(final ByteBuffer buffer) throws IOExcept
295296
case CreateFunction:
296297
plan = new CreateFunctionPlan();
297298
break;
299+
case UpdateFunction:
300+
plan = new UpdateFunctionPlan();
301+
break;
298302
case DropTreeModelFunction:
299303
plan = new DropTreeModelFunctionPlan();
300304
break;

iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
import org.apache.iotdb.confignode.consensus.request.write.function.CreateFunctionPlan;
8484
import org.apache.iotdb.confignode.consensus.request.write.function.DropTableModelFunctionPlan;
8585
import org.apache.iotdb.confignode.consensus.request.write.function.DropTreeModelFunctionPlan;
86+
import org.apache.iotdb.confignode.consensus.request.write.function.UpdateFunctionPlan;
8687
import org.apache.iotdb.confignode.consensus.request.write.partition.AddRegionLocationPlan;
8788
import org.apache.iotdb.confignode.consensus.request.write.partition.CreateDataPartitionPlan;
8889
import org.apache.iotdb.confignode.consensus.request.write.partition.CreateSchemaPartitionPlan;
@@ -1493,6 +1494,23 @@ public void CreateFunctionPlanTest() throws IOException {
14931494
Assert.assertEquals(createFunctionPlan0, createFunctionPlan1);
14941495
}
14951496

1497+
@Test
1498+
public void UpdateFunctionPlanTest() throws IOException {
1499+
UDFInformation udfInformation =
1500+
new UDFInformation(
1501+
"test1",
1502+
"test1",
1503+
UDFType.of(Model.TREE, FunctionType.NONE, true),
1504+
true,
1505+
"test1.jar",
1506+
"12345");
1507+
UpdateFunctionPlan updateFunctionPlan = new UpdateFunctionPlan(udfInformation);
1508+
UpdateFunctionPlan updateFunctionPlan1 =
1509+
(UpdateFunctionPlan)
1510+
ConfigPhysicalPlan.Factory.create(updateFunctionPlan.serializeToByteBuffer());
1511+
Assert.assertEquals(updateFunctionPlan, updateFunctionPlan1);
1512+
}
1513+
14961514
@Test
14971515
public void DropFunctionPlanTest() throws IOException {
14981516
DropTreeModelFunctionPlan dropTreeModelFunctionPlan0 = new DropTreeModelFunctionPlan("test");

0 commit comments

Comments
 (0)