You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "thexiay (via GitHub)" <gi...@apache.org> on 2023/04/06 06:18:22 UTC

[GitHub] [inlong] thexiay opened a new pull request, #7791: [Improve][Sort] Add Presort to reduce discrete partitions when ingesting data into iceberg

thexiay opened a new pull request, #7791:
URL: https://github.com/apache/inlong/pull/7791

   ### Prepare a Pull Request
   *(Change the title refer to the following example)*
   
   - Title Example: [Improve][Sort] Add Presort to reduce discrete partitions when ingesting data into iceberg
   
   *(The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)*
   
   - Fixes #XYZ
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve?*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] GanfengTan commented on a diff in pull request #7791: [Improve][Sort] Add Presort to reduce discrete partitions when ingesting data into iceberg

Posted by "GanfengTan (via GitHub)" <gi...@apache.org>.
GanfengTan commented on code in PR #7791:
URL: https://github.com/apache/inlong/pull/7791#discussion_r1162433301


##########
inlong-sort/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/sink/GroupedPartitionedDeltaWriter.java:
##########
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.sort.iceberg.sink;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.types.logical.RowType;
+import org.apache.iceberg.FileFormat;
+import org.apache.iceberg.PartitionKey;
+import org.apache.iceberg.PartitionSpec;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.io.FileAppenderFactory;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.OutputFileFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy;
+import java.util.concurrent.TimeUnit;
+
+public class GroupedPartitionedDeltaWriter extends org.apache.inlong.sort.iceberg.sink.trick.BaseDeltaTaskWriter {
+
+    private static final Logger LOG = LoggerFactory.getLogger(GroupedPartitionedDeltaWriter.class);
+
+    private static final ExecutorService CLOSE_EXECUTOR_SERVICE = new ThreadPoolExecutor(
+            10,
+            20,
+            100L,
+            TimeUnit.MILLISECONDS,
+            new LinkedBlockingQueue<>(100),
+            new ThreadFactoryBuilder().setNameFormat("iceberg-writer-close-thread-%s").build(),
+            new CallerRunsPolicy());
+

Review Comment:
   This definition specifies whether the size of all variables is appropriate for the user.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] thexiay closed pull request #7791: [Improve][Sort] Add Presort to reduce discrete partitions when ingesting data into iceberg

Posted by "thexiay (via GitHub)" <gi...@apache.org>.
thexiay closed pull request #7791: [Improve][Sort] Add Presort to reduce discrete partitions when ingesting data into iceberg
URL: https://github.com/apache/inlong/pull/7791


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on pull request #7791: [Improve][Sort] Add Presort to reduce discrete partitions when ingesting data into iceberg

Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on PR #7791:
URL: https://github.com/apache/inlong/pull/7791#issuecomment-1499822012

   Please check the PR title, and enrich the description of the PR, thanks.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] thexiay commented on pull request #7791: [Improve][Sort] Add Presort to reduce discrete partitions when ingesting data into iceberg

Posted by "thexiay (via GitHub)" <gi...@apache.org>.
thexiay commented on PR #7791:
URL: https://github.com/apache/inlong/pull/7791#issuecomment-1504479608

   i will refactor this pr itno few prs later:
   1. 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org