ZihanLi58 commented on code in PR #3690:
URL: https://github.com/apache/gobblin/pull/3690#discussion_r1181944806
##########
gobblin-core/src/main/java/org/apache/gobblin/writer/PartitionedDataWriter.java:
##########
@@ -170,9 +175,12 @@ public DataWriter<D> get() {
try {
log.info(String.format("Adding one more writer to
loading cache of existing writer "
+ "with size = %d", partitionWriters.size()));
- return createPartitionWriter(key);
- } catch (IOException e) {
+ Future<DataWriter<D>> future =
createWriterPool.submit(() -> createPartitionWriter(key));
+ return future.get(writeTimeoutInterval,
TimeUnit.SECONDS);
Review Comment:
We won't need any config change here. If the job originally has a timeout
for writing one record, we will enforce the same timeout for creating one
writer, if the job does not have that timeout, we will have no timeout for
creating a writer as well.
##########
gobblin-core/src/main/java/org/apache/gobblin/writer/PartitionedDataWriter.java:
##########
@@ -170,9 +175,12 @@ public DataWriter<D> get() {
try {
log.info(String.format("Adding one more writer to
loading cache of existing writer "
+ "with size = %d", partitionWriters.size()));
- return createPartitionWriter(key);
- } catch (IOException e) {
+ Future<DataWriter<D>> future =
createWriterPool.submit(() -> createPartitionWriter(key));
+ return future.get(writeTimeoutInterval,
TimeUnit.SECONDS);
Review Comment:
We won't need any config change here. If the job originally has a timeout
for writing one record, we will enforce the same timeout for creating one
writer, if the job does not have that timeout, we will have no timeout for
creating a writer as well.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]