[
https://issues.apache.org/jira/browse/GOBBLIN-1442?focusedWorklogId=596343&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-596343
]
ASF GitHub Bot logged work on GOBBLIN-1442:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 13/May/21 20:01
Start Date: 13/May/21 20:01
Worklog Time Spent: 10m
Work Description: autumnust commented on a change in pull request #3278:
URL: https://github.com/apache/gobblin/pull/3278#discussion_r632069357
##########
File path:
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/writer/HiveMetadataWriter.java
##########
@@ -95,20 +95,21 @@ public HiveMetadataWriter(State state) throws IOException {
@Override
public void flush(String dbName, String tableName) throws IOException {
String tableKey = tableNameJoiner.join(dbName, tableName);
- log.info("start to flush table: " + tableKey);
- HashMap<List<String>, ListenableFuture<Void>> executionMap =
- this.currentExecutionMap.computeIfAbsent(tableKey, s -> new
HashMap<>());
- //iterator all execution to get the result to make sure they all succeeded
- for (HashMap.Entry<List<String>, ListenableFuture<Void>> execution :
executionMap.entrySet()) {
- try {
- execution.getValue().get(timeOutSeconds, TimeUnit.SECONDS);
- } catch (InterruptedException | ExecutionException | TimeoutException e)
{
- log.error("Error when getting the result of registration for table" +
tableKey);
- throw new RuntimeException(e);
+ if(this.currentExecutionMap.containsKey(tableKey)) {
+ log.info("start to flush table: " + tableKey);
+ HashMap<List<String>, ListenableFuture<Void>> executionMap =
this.currentExecutionMap.get(tableKey);
Review comment:
just to my own understanding, what the key (typed as `List<String`)
here?
##########
File path:
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/writer/HiveMetadataWriter.java
##########
@@ -95,20 +95,21 @@ public HiveMetadataWriter(State state) throws IOException {
@Override
public void flush(String dbName, String tableName) throws IOException {
String tableKey = tableNameJoiner.join(dbName, tableName);
- log.info("start to flush table: " + tableKey);
- HashMap<List<String>, ListenableFuture<Void>> executionMap =
- this.currentExecutionMap.computeIfAbsent(tableKey, s -> new
HashMap<>());
- //iterator all execution to get the result to make sure they all succeeded
- for (HashMap.Entry<List<String>, ListenableFuture<Void>> execution :
executionMap.entrySet()) {
- try {
- execution.getValue().get(timeOutSeconds, TimeUnit.SECONDS);
- } catch (InterruptedException | ExecutionException | TimeoutException e)
{
- log.error("Error when getting the result of registration for table" +
tableKey);
- throw new RuntimeException(e);
+ if(this.currentExecutionMap.containsKey(tableKey)) {
+ log.info("start to flush table: " + tableKey);
+ HashMap<List<String>, ListenableFuture<Void>> executionMap =
this.currentExecutionMap.get(tableKey);
+ //iterator all execution to get the result to make sure they all
succeeded
+ for (HashMap.Entry<List<String>, ListenableFuture<Void>> execution :
executionMap.entrySet()) {
+ try {
+ execution.getValue().get(timeOutSeconds, TimeUnit.SECONDS);
+ } catch (InterruptedException | ExecutionException | TimeoutException
e) {
+ log.error("Error when getting the result of registration for table"
+ tableKey);
+ throw new RuntimeException(e);
Review comment:
They could be combined as
```throw new RuntimeException("xxx", e)``` ?
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 596343)
Time Spent: 40m (was: 0.5h)
> Fix the bug of NoSuchElement Exception in HiveWriter
> ----------------------------------------------------
>
> Key: GOBBLIN-1442
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1442
> Project: Apache Gobblin
> Issue Type: Task
> Reporter: Zihan Li
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> After recent change, we see the default value of offsetRange in GMCE change
> to empty map, so add one more check to make sure the map is not empty so that
> we won't hit the exception
--
This message was sent by Atlassian Jira
(v8.3.4#803005)