xuzhiwen1255 opened a new pull request, #6614:
URL: https://github.com/apache/iceberg/pull/6614
Solve the problems of #6455
cause :
> lazyTable() will open the catalog, then loadTable,loadTable will build
tableOps into the loaded table, After the table is loaded, the close method of
tableLoader is called. The close method closes the clientPool.At this point,
the clientPool has been passed into tableOps as a parameter. When planSplits
are needed in Enumerator, the refresh of table needs to be called, and the
clientPool in tableOps has been closed,therefore, the exception [Cannot get a
client from a closed pool] occurs.
```java
private SplitEnumerator<IcebergSourceSplit, IcebergEnumeratorState>
createEnumerator(
SplitEnumeratorContext<IcebergSourceSplit> enumContext,
@Nullable IcebergEnumeratorState enumState) {
SplitAssigner assigner;
if (enumState == null) {
assigner = assignerFactory.createAssigner();
} else {
LOG.info(
"Iceberg source restored {} splits from state for table {}",
enumState.pendingSplits().size(),
lazyTable().name());
assigner = assignerFactory.createAssigner(enumState.pendingSplits());
}
if (scanContext.isStreaming()) {
// TODO
ContinuousSplitPlanner splitPlanner =
new ContinuousSplitPlannerImpl(lazyTable(), scanContext,
planningThreadName());
return new ContinuousIcebergEnumerator(
enumContext, assigner, scanContext, splitPlanner, enumState);
} else {
List<IcebergSourceSplit> splits =
planSplitsForBatch(planningThreadName());
assigner.onDiscoveredSplits(splits);
return new StaticIcebergEnumerator(enumContext, assigner);
}
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]