hk-lrzy commented on a change in pull request #3024:
URL: https://github.com/apache/hudi/pull/3024#discussion_r644650661



##########
File path: 
hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/BucketAssignFunction.java
##########
@@ -168,31 +150,28 @@ public void initializeState(FunctionInitializationContext 
context) {
       
indexStateDesc.enableTimeToLive(StateTtlConfigUtil.createTtlConfig((long) ttl));
     }
     indexState = context.getKeyedStateStore().getMapState(indexStateDesc);
-    if (bootstrapIndex) {
-      MapStateDescriptor<String, Integer> partitionLoadStateDesc =
-          new MapStateDescriptor<>("partitionLoadState", Types.STRING, 
Types.INT);
-      partitionLoadState = 
context.getKeyedStateStore().getMapState(partitionLoadStateDesc);
-    }
   }
 
-  @SuppressWarnings("unchecked")
   @Override
   public void processElement(I value, Context ctx, Collector<O> out) throws 
Exception {
+    if (value instanceof BootstrapRecord) {
+      BootstrapRecord bootstrapRecord = (BootstrapRecord) value;
+      indexState.put(bootstrapRecord.getRecordKey(), 
(HoodieRecordGlobalLocation) bootstrapRecord.getCurrentLocation());

Review comment:
       need add `out.collect(value)`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to