You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/05/13 22:04:53 UTC
[GitHub] [incubator-gobblin] ZihanLi58 opened a new pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
ZihanLi58 opened a new pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986
…oid inconsistency
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
### JIRA
- [ ] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
- https://issues.apache.org/jira/browse/GOBBLIN-1147
### Description
- [ ] Here are some details about my PR, including screenshots (if applicable):
Since the rename with overwrite option method in FileSystem is exposed as protected, so I created a FileSyatemAdapter in the package org.apache.hadoop.fs to call it and expose it as public method.
### Tests
- [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
Test in pipeline that the rename can succeed
### Commits
- [ ] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
2. Subject is limited to 50 characters
3. Subject does not end with a period
4. Subject uses the imperative mood ("add", not "adding")
5. Body wraps at 72 characters
6. Body explains "what" and "why", not "how"
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [incubator-gobblin] autumnust commented on a change in pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
Posted by GitBox <gi...@apache.org>.
autumnust commented on a change in pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986#discussion_r425563714
##########
File path: gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
##########
@@ -266,19 +268,25 @@ public static void renamePath(FileSystem fs, Path oldName, Path newName) throws
* {@link FileSystem#rename(Path, Path)} returns False.
*/
public static void renamePath(FileSystem fs, Path oldName, Path newName, boolean overwrite) throws IOException {
- if (!fs.exists(oldName)) {
- throw new FileNotFoundException(String.format("Failed to rename %s to %s: src not found", oldName, newName));
- }
- if (fs.exists(newName)) {
- if (overwrite) {
- HadoopUtils.moveToTrash(fs, newName);
- } else {
- throw new FileAlreadyExistsException(
- String.format("Failed to rename %s to %s: dst already exists", oldName, newName));
+ //In default implementation of rename with rewrite option in FileSystem, if the parent dir of dst does not exist, it will throw exception,
+ //Which will fail some of our job unintentionally. So we only call that method when fs is an instance of DistributedFileSystem to avoid inconsistency problem
Review comment:
Are you referring to the fact that the implementation of rename in DistributedFileSystem is guaranteed to be atomic? I am not getting this comment.
##########
File path: gobblin-utility/src/main/java/org/apache/hadoop/fs/FileSystemAdapter.java
##########
@@ -0,0 +1,27 @@
+/*
+ * 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.hadoop.fs;
+
+import java.io.IOException;
+
+
+public class FileSystemAdapter {
+ public static void rename(FileSystem fs, Path src, Path dst, Options.Rename options) throws IOException {
Review comment:
`FileContext` is introduced to handle the protected problem of rename : http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#rename-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.Options.Rename...-
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [incubator-gobblin] codecov-io commented on pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986#issuecomment-628825947
# [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=h1) Report
> Merging [#2986](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/239115778a08590d7ab5dfa32334efabe0e4fb49&el=desc) will **increase** coverage by `3.08%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #2986 +/- ##
===========================================
+ Coverage 4.09% 7.17% +3.08%
- Complexity 751 1247 +496
===========================================
Files 1947 1948 +1
Lines 73807 73974 +167
Branches 8145 8182 +37
===========================================
+ Hits 3019 5305 +2286
+ Misses 70468 68162 -2306
- Partials 320 507 +187
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...n/java/org/apache/gobblin/writer/FsDataWriter.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3dyaXRlci9Gc0RhdGFXcml0ZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
| [...main/java/org/apache/gobblin/util/HadoopUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvSGFkb29wVXRpbHMuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
| [...n/java/org/apache/hadoop/fs/FileSystemAdapter.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvZnMvRmlsZVN5c3RlbUFkYXB0ZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
| [...ain/java/org/apache/gobblin/writer/JdbcWriter.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1tb2R1bGVzL2dvYmJsaW4tc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3dyaXRlci9KZGJjV3JpdGVyLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
| [...ache/gobblin/runtime/spec\_catalog/FlowCatalog.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvc3BlY19jYXRhbG9nL0Zsb3dDYXRhbG9nLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
| [...e/gobblin/writer/commands/MySqlWriterCommands.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1tb2R1bGVzL2dvYmJsaW4tc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3dyaXRlci9jb21tYW5kcy9NeVNxbFdyaXRlckNvbW1hbmRzLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
| [...obblin/writer/commands/PostgresWriterCommands.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1tb2R1bGVzL2dvYmJsaW4tc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3dyaXRlci9jb21tYW5kcy9Qb3N0Z3Jlc1dyaXRlckNvbW1hbmRzLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
| [.../modules/scheduler/GobblinServiceJobScheduler.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1zZXJ2aWNlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3NlcnZpY2UvbW9kdWxlcy9zY2hlZHVsZXIvR29iYmxpblNlcnZpY2VKb2JTY2hlZHVsZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
| [...ache/gobblin/compaction/mapreduce/MRCompactor.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb21wYWN0aW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NvbXBhY3Rpb24vbWFwcmVkdWNlL01SQ29tcGFjdG9yLmphdmE=) | `1.89% <0.00%> (+1.89%)` | `1.00% <0.00%> (+1.00%)` | |
| ... and [75 more](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=footer). Last update [2391157...6fb80f1](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
Posted by GitBox <gi...@apache.org>.
sv2000 commented on a change in pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986#discussion_r425568355
##########
File path: gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
##########
@@ -266,19 +268,25 @@ public static void renamePath(FileSystem fs, Path oldName, Path newName) throws
* {@link FileSystem#rename(Path, Path)} returns False.
*/
public static void renamePath(FileSystem fs, Path oldName, Path newName, boolean overwrite) throws IOException {
- if (!fs.exists(oldName)) {
- throw new FileNotFoundException(String.format("Failed to rename %s to %s: src not found", oldName, newName));
- }
- if (fs.exists(newName)) {
- if (overwrite) {
- HadoopUtils.moveToTrash(fs, newName);
- } else {
- throw new FileAlreadyExistsException(
- String.format("Failed to rename %s to %s: dst already exists", oldName, newName));
+ //In default implementation of rename with rewrite option in FileSystem, if the parent dir of dst does not exist, it will throw exception,
+ //Which will fail some of our job unintentionally. So we only call that method when fs is an instance of DistributedFileSystem to avoid inconsistency problem
+ if(fs instanceof DistributedFileSystem) {
+ Options.Rename renameOptions = (overwrite) ? Options.Rename.OVERWRITE : Options.Rename.NONE;
+ FileSystemAdapter.rename(fs, oldName, newName, renameOptions);
Review comment:
Do we need the FileSystemAdapter class? Can't we directly call fs.rename(src,dest,options) here?
##########
File path: gobblin-core/src/main/java/org/apache/gobblin/writer/FsDataWriter.java
##########
@@ -262,7 +262,7 @@ public void commit()
LOG.info(String.format("Moving data from %s to %s", this.stagingFile, this.outputFile));
// For the same reason as deleting the staging file if it already exists, overwrite
// the output file if it already exists to prevent task retry from being blocked.
- HadoopUtils.renamePath(this.fileContext, this.stagingFile, this.outputFile, true);
+ HadoopUtils.renamePath(this.fs, this.stagingFile, this.outputFile, true);
Review comment:
Did you forget to remove the fileContext member variable from this class?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [incubator-gobblin] ZihanLi58 commented on a change in pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
Posted by GitBox <gi...@apache.org>.
ZihanLi58 commented on a change in pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986#discussion_r425567954
##########
File path: gobblin-utility/src/main/java/org/apache/hadoop/fs/FileSystemAdapter.java
##########
@@ -0,0 +1,27 @@
+/*
+ * 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.hadoop.fs;
+
+import java.io.IOException;
+
+
+public class FileSystemAdapter {
+ public static void rename(FileSystem fs, Path src, Path dst, Options.Rename options) throws IOException {
Review comment:
Yeah, but in FsDataWriter, when we try to use fc to do rename and fs to check the existence, underlying they are using different dfsClients, and we may face inconsistency issue. So we try to use the same dsfClient to do rename here.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [incubator-gobblin] ZihanLi58 commented on a change in pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
Posted by GitBox <gi...@apache.org>.
ZihanLi58 commented on a change in pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986#discussion_r425567371
##########
File path: gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
##########
@@ -266,19 +268,25 @@ public static void renamePath(FileSystem fs, Path oldName, Path newName) throws
* {@link FileSystem#rename(Path, Path)} returns False.
*/
public static void renamePath(FileSystem fs, Path oldName, Path newName, boolean overwrite) throws IOException {
- if (!fs.exists(oldName)) {
- throw new FileNotFoundException(String.format("Failed to rename %s to %s: src not found", oldName, newName));
- }
- if (fs.exists(newName)) {
- if (overwrite) {
- HadoopUtils.moveToTrash(fs, newName);
- } else {
- throw new FileAlreadyExistsException(
- String.format("Failed to rename %s to %s: dst already exists", oldName, newName));
+ //In default implementation of rename with rewrite option in FileSystem, if the parent dir of dst does not exist, it will throw exception,
+ //Which will fail some of our job unintentionally. So we only call that method when fs is an instance of DistributedFileSystem to avoid inconsistency problem
Review comment:
No, here I mean if we direct call FileSystem.rename, if it's not a DistributedFileSystem, it will try to use the default implementation in FileSystem.class, which will throw exception when parent of dst doe not exist.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [incubator-gobblin] codecov-io edited a comment on pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986#issuecomment-628825947
# [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=h1) Report
> Merging [#2986](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/239115778a08590d7ab5dfa32334efabe0e4fb49&el=desc) will **increase** coverage by `39.01%`.
> The diff coverage is `4.76%`.
[](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #2986 +/- ##
=============================================
+ Coverage 4.09% 43.10% +39.01%
- Complexity 751 8758 +8007
=============================================
Files 1947 1947
Lines 73807 73978 +171
Branches 8145 8183 +38
=============================================
+ Hits 3019 31887 +28868
+ Misses 70468 39060 -31408
- Partials 320 3031 +2711
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [.../action/CompactionCompleteFileOperationAction.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb21wYWN0aW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NvbXBhY3Rpb24vYWN0aW9uL0NvbXBhY3Rpb25Db21wbGV0ZUZpbGVPcGVyYXRpb25BY3Rpb24uamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
| [...main/java/org/apache/gobblin/util/HadoopUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvSGFkb29wVXRpbHMuamF2YQ==) | `29.90% <0.00%> (+29.90%)` | `24.00 <0.00> (+24.00)` | |
| [...n/java/org/apache/gobblin/writer/FsDataWriter.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3dyaXRlci9Gc0RhdGFXcml0ZXIuamF2YQ==) | `69.72% <50.00%> (+69.72%)` | `15.00 <0.00> (+15.00)` | |
| [...gobblin/runtime/mapreduce/GobblinOutputFormat.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvbWFwcmVkdWNlL0dvYmJsaW5PdXRwdXRGb3JtYXQuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-2.00%)` | |
| [...askStateCollectorServiceHiveRegHandlerFactory.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvVGFza1N0YXRlQ29sbGVjdG9yU2VydmljZUhpdmVSZWdIYW5kbGVyRmFjdG9yeS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-2.00%)` | |
| [...re/filesystem/FsDatasetStateStoreEntryManager.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvbWV0YXN0b3JlL2ZpbGVzeXN0ZW0vRnNEYXRhc2V0U3RhdGVTdG9yZUVudHJ5TWFuYWdlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-3.00%)` | |
| [...in/runtime/mapreduce/CustomizedProgresserBase.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvbWFwcmVkdWNlL0N1c3RvbWl6ZWRQcm9ncmVzc2VyQmFzZS5qYXZh) | `0.00% <0.00%> (-83.34%)` | `0.00% <0.00%> (-1.00%)` | |
| [...rg/apache/gobblin/runtime/ZkDatasetStateStore.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1tb2R1bGVzL2dvYmJsaW4taGVsaXgvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vcnVudGltZS9aa0RhdGFzZXRTdGF0ZVN0b3JlLmphdmE=) | `0.00% <0.00%> (-80.77%)` | `0.00% <0.00%> (-7.00%)` | |
| [...lin/runtime/locks/LegacyJobLockFactoryManager.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvbG9ja3MvTGVnYWN5Sm9iTG9ja0ZhY3RvcnlNYW5hZ2VyLmphdmE=) | `0.00% <0.00%> (-78.58%)` | `0.00% <0.00%> (-2.00%)` | |
| [.../apache/gobblin/metastore/ZkStateStoreFactory.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree#diff-Z29iYmxpbi1tb2R1bGVzL2dvYmJsaW4taGVsaXgvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vbWV0YXN0b3JlL1prU3RhdGVTdG9yZUZhY3RvcnkuamF2YQ==) | `0.00% <0.00%> (-71.43%)` | `0.00% <0.00%> (-2.00%)` | |
| ... and [1117 more](https://codecov.io/gh/apache/incubator-gobblin/pull/2986/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=footer). Last update [2391157...d498a7f](https://codecov.io/gh/apache/incubator-gobblin/pull/2986?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [incubator-gobblin] asfgit closed pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [incubator-gobblin] ZihanLi58 commented on a change in pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
Posted by GitBox <gi...@apache.org>.
ZihanLi58 commented on a change in pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986#discussion_r425571520
##########
File path: gobblin-core/src/main/java/org/apache/gobblin/writer/FsDataWriter.java
##########
@@ -262,7 +262,7 @@ public void commit()
LOG.info(String.format("Moving data from %s to %s", this.stagingFile, this.outputFile));
// For the same reason as deleting the staging file if it already exists, overwrite
// the output file if it already exists to prevent task retry from being blocked.
- HadoopUtils.renamePath(this.fileContext, this.stagingFile, this.outputFile, true);
+ HadoopUtils.renamePath(this.fs, this.stagingFile, this.outputFile, true);
Review comment:
This is intentional, as we don't know if there is any subclass use this member. So I leave it to make backward consistency
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [incubator-gobblin] ZihanLi58 commented on a change in pull request #2986: [GOBBLIN-1147]Use one dfsClient in FsDataWriter to to rename and exists check to av…
Posted by GitBox <gi...@apache.org>.
ZihanLi58 commented on a change in pull request #2986:
URL: https://github.com/apache/incubator-gobblin/pull/2986#discussion_r425571767
##########
File path: gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
##########
@@ -266,19 +268,25 @@ public static void renamePath(FileSystem fs, Path oldName, Path newName) throws
* {@link FileSystem#rename(Path, Path)} returns False.
*/
public static void renamePath(FileSystem fs, Path oldName, Path newName, boolean overwrite) throws IOException {
- if (!fs.exists(oldName)) {
- throw new FileNotFoundException(String.format("Failed to rename %s to %s: src not found", oldName, newName));
- }
- if (fs.exists(newName)) {
- if (overwrite) {
- HadoopUtils.moveToTrash(fs, newName);
- } else {
- throw new FileAlreadyExistsException(
- String.format("Failed to rename %s to %s: dst already exists", oldName, newName));
+ //In default implementation of rename with rewrite option in FileSystem, if the parent dir of dst does not exist, it will throw exception,
+ //Which will fail some of our job unintentionally. So we only call that method when fs is an instance of DistributedFileSystem to avoid inconsistency problem
+ if(fs instanceof DistributedFileSystem) {
+ Options.Rename renameOptions = (overwrite) ? Options.Rename.OVERWRITE : Options.Rename.NONE;
+ FileSystemAdapter.rename(fs, oldName, newName, renameOptions);
Review comment:
Good catch, I just realize that DistributedFileSystem expose that method as public method.
----------------------------------------------------------------
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:
users@infra.apache.org