danny0405 commented on a change in pull request #2553:
URL: https://github.com/apache/hudi/pull/2553#discussion_r572784603
##########
File path:
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/table/HoodieFlinkCopyOnWriteTable.java
##########
@@ -61,14 +62,117 @@ protected HoodieFlinkCopyOnWriteTable(HoodieWriteConfig
config, HoodieEngineCont
super(config, context, metaClient);
}
+ /**
+ * Upsert a batch of new records into Hoodie table at the supplied
instantTime.
+ *
+ * <p>Specifies the write handle explicitly in order to have fine grained
control with
+ * the underneath file.
+ *
+ * @param context HoodieEngineContext
+ * @param writeHandle The write handle
+ * @param instantTime Instant Time for the action
+ * @param records hoodieRecords to upsert
+ * @return HoodieWriteMetadata
+ */
+ public HoodieWriteMetadata<List<WriteStatus>> upsert(
+ HoodieEngineContext context,
+ HoodieWriteHandle<?, ?, ?, ?> writeHandle,
+ String instantTime,
+ List<HoodieRecord<T>> records) {
+ return new FlinkUpsertCommitActionExecutor<>(context, writeHandle, config,
this, instantTime, records).execute();
+ }
+
+ /**
+ * Insert a batch of new records into Hoodie table at the supplied
instantTime.
+ *
+ * <p>Specifies the write handle explicitly in order to have fine grained
control with
+ * the underneath file.
+ *
+ * @param context HoodieEngineContext
+ * @param writeHandle The write handle
+ * @param instantTime Instant Time for the action
+ * @param records hoodieRecords to upsert
+ * @return HoodieWriteMetadata
+ */
+ public HoodieWriteMetadata<List<WriteStatus>> insert(
+ HoodieEngineContext context,
+ HoodieWriteHandle<?, ?, ?, ?> writeHandle,
+ String instantTime,
+ List<HoodieRecord<T>> records) {
+ return new FlinkInsertCommitActionExecutor<>(context, writeHandle, config,
this, instantTime, records).execute();
+ }
+
+ /**
+ * Deletes a list of {@link HoodieKey}s from the Hoodie table, at the
supplied instantTime {@link HoodieKey}s will be
+ * de-duped and non existent keys will be removed before deleting.
+ *
+ * <p>Specifies the write handle explicitly in order to have fine grained
control with
+ * the underneath file.
+ *
+ * @param context HoodieEngineContext
+ * @param writeHandle The write handle
+ * @param instantTime Instant Time for the action
+ * @param keys {@link List} of {@link HoodieKey}s to be deleted
+ * @return HoodieWriteMetadata
+ */
+ public HoodieWriteMetadata<List<WriteStatus>> delete(
+ HoodieEngineContext context,
+ HoodieWriteHandle<?, ?, ?, ?> writeHandle,
+ String instantTime,
+ List<HoodieKey> keys) {
+ return new FlinkDeleteCommitActionExecutor<>(context, writeHandle, config,
this, instantTime, keys).execute();
+ }
+
+ /**
+ * Upserts the given prepared records into the Hoodie table, at the supplied
instantTime.
+ *
+ * <p>This implementation requires that the input records are already
tagged, and de-duped if needed.
+ *
+ * <p>Specifies the write handle explicitly in order to have fine grained
control with
+ * the underneath file.
+ *
+ * @param context HoodieEngineContext
+ * @param instantTime Instant Time for the action
+ * @param preppedRecords hoodieRecords to upsert
+ * @return HoodieWriteMetadata
+ */
+ public HoodieWriteMetadata<List<WriteStatus>> upsertPrepped(
+ HoodieEngineContext context,
+ HoodieWriteHandle<?, ?, ?, ?> writeHandle,
+ String instantTime,
+ List<HoodieRecord<T>> preppedRecords) {
+ return new FlinkUpsertPreppedCommitActionExecutor<>(context, writeHandle,
config, this, instantTime, preppedRecords).execute();
+ }
+
+ /**
+ * Inserts the given prepared records into the Hoodie table, at the supplied
instantTime.
+ *
+ * <p>This implementation requires that the input records are already
tagged, and de-duped if needed.
+ *
+ * <p>Specifies the write handle explicitly in order to have fine grained
control with
+ * the underneath file.
+ *
+ * @param context HoodieEngineContext
+ * @param instantTime Instant Time for the action
+ * @param preppedRecords hoodieRecords to upsert
+ * @return HoodieWriteMetadata
+ */
+ public HoodieWriteMetadata<List<WriteStatus>> insertPrepped(
+ HoodieEngineContext context,
+ HoodieWriteHandle<?, ?, ?, ?> writeHandle,
+ String instantTime,
+ List<HoodieRecord<T>> preppedRecords) {
+ return new FlinkInsertPreppedCommitActionExecutor<>(context, writeHandle,
config, this, instantTime, preppedRecords).execute();
+ }
+
@Override
public HoodieWriteMetadata<List<WriteStatus>> upsert(HoodieEngineContext
context, String instantTime, List<HoodieRecord<T>> records) {
- return new FlinkUpsertCommitActionExecutor<>(context, config, this,
instantTime, records).execute();
+ throw new IllegalAccessError("This method should not be invoked");
Review comment:
Use `HoodieNotSupportedException` instead.
----------------------------------------------------------------
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]