Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDFS-16174. Refactor TempFile and TempDir in libhdfs++ #3303

Merged
merged 7 commits into from
Aug 17, 2021

Conversation

GauthamBanasandra
Copy link
Member

  • Implemented TempFile and
    TempDir in cc files for avoiding
    duplicate compilation of these
    classes.
  • Wrapped these classes in a
    TestUtils namespace.
  • Created an object library for
    TestUtils and added this as a
    target as necessary.

* Need to implement TempFile and
  TempDir in cc files for avoiding
  duplicate compilation of these
  classes.
* Implemented TempDir class
  in temp-dir.cc file.
* Creating an object library
  for test utils to help with
  modularization.
* Wrapped TempDir and
  TempFile in a TestUtils
  namespace.
* Added documentation for the
  TempDir class.
* Removed template type for
  it to be deduced automatically.
* Removed sys/stat.h from
  temp-dir.h as it was
  redundant.
@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 55s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 11 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 33m 55s trunk passed
+1 💚 compile 2m 36s trunk passed
+1 💚 mvnsite 0m 26s trunk passed
+1 💚 shadedclient 52m 59s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 14s the patch passed
+1 💚 compile 2m 25s the patch passed
+1 💚 cc 2m 25s the patch passed
+1 💚 golang 2m 25s the patch passed
+1 💚 javac 2m 25s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 0m 16s the patch passed
+1 💚 shadedclient 15m 44s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 90m 16s hadoop-hdfs-native-client in the patch passed.
+1 💚 asflicense 0m 29s The patch does not generate ASF License warnings.
165m 40s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/artifact/out/Dockerfile
GITHUB PR #3303
Optional Tests dupname asflicense compile cc mvnsite javac unit codespell golang
uname Linux 9c9221dca885 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 6a134c0
Default Java Red Hat, Inc.-1.8.0_292-b10
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/testReport/
Max. process+thread count 519 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs-native-client U: hadoop-hdfs-project/hadoop-hdfs-native-client
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/console
versions git=2.9.5 maven=3.6.3
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 25m 21s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 11 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 23m 18s trunk passed
+1 💚 compile 2m 44s trunk passed
+1 💚 mvnsite 0m 34s trunk passed
+1 💚 shadedclient 42m 41s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 19s the patch passed
+1 💚 compile 2m 33s the patch passed
+1 💚 cc 2m 33s the patch passed
+1 💚 golang 2m 33s the patch passed
+1 💚 javac 2m 33s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 0m 21s the patch passed
+1 💚 shadedclient 15m 48s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 87m 9s hadoop-hdfs-native-client in the patch passed.
+1 💚 asflicense 0m 38s The patch does not generate ASF License warnings.
177m 17s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/artifact/out/Dockerfile
GITHUB PR #3303
Optional Tests dupname asflicense compile cc mvnsite javac unit codespell golang
uname Linux e2bceae7ac0d 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 6a134c0
Default Java Red Hat, Inc.-1.8.0_302-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/testReport/
Max. process+thread count 529 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs-native-client U: hadoop-hdfs-project/hadoop-hdfs-native-client
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/console
versions git=2.27.0 maven=3.6.3
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 16m 1s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 11 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 30m 17s trunk passed
+1 💚 compile 3m 5s trunk passed
+1 💚 mvnsite 0m 27s trunk passed
+1 💚 shadedclient 55m 43s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 13s the patch passed
+1 💚 compile 2m 30s the patch passed
+1 💚 cc 2m 30s the patch passed
+1 💚 golang 2m 30s the patch passed
+1 💚 javac 2m 30s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 0m 16s the patch passed
+1 💚 shadedclient 20m 36s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 106m 20s hadoop-hdfs-native-client in the patch passed.
+1 💚 asflicense 0m 28s The patch does not generate ASF License warnings.
204m 34s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/artifact/out/Dockerfile
GITHUB PR #3303
Optional Tests dupname asflicense compile cc mvnsite javac unit codespell golang
uname Linux 0790c973e116 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 6a134c0
Default Java Debian-11.0.12+7-post-Debian-2
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/testReport/
Max. process+thread count 530 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs-native-client U: hadoop-hdfs-project/hadoop-hdfs-native-client
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/console
versions git=2.30.2 maven=3.6.3
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 2s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 11 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 22m 46s trunk passed
+1 💚 compile 2m 55s trunk passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 compile 2m 51s trunk passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 mvnsite 0m 22s trunk passed
+1 💚 shadedclient 44m 56s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 15s the patch passed
+1 💚 compile 2m 45s the patch passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 cc 2m 45s the patch passed
+1 💚 golang 2m 45s the patch passed
+1 💚 javac 2m 45s the patch passed
+1 💚 compile 2m 46s the patch passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 cc 2m 46s the patch passed
+1 💚 golang 2m 46s the patch passed
+1 💚 javac 2m 46s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 0m 15s the patch passed
+1 💚 shadedclient 15m 53s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 105m 7s hadoop-hdfs-native-client in the patch passed.
+1 💚 asflicense 0m 28s The patch does not generate ASF License warnings.
175m 53s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/artifact/out/Dockerfile
GITHUB PR #3303
Optional Tests dupname asflicense compile cc mvnsite javac unit codespell golang
uname Linux d5b9d26e29a8 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 6a134c0
Default Java Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/testReport/
Max. process+thread count 593 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs-native-client U: hadoop-hdfs-project/hadoop-hdfs-native-client
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3303/1/console
versions git=2.25.1 maven=3.6.3
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@@ -114,105 +111,6 @@ void writeDamagedConfig(const std::string& filename, Args... args) {
out.open(filename);
out << stream.rdbuf();
}

// TempDir: is deleted on destruction
class TempFile {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than reducing the size of this file, is there any benefit of having this? Or this is just a refactor at this point?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I've mentioned in the corresponding JIRA - https://issues.apache.org/jira/browse/HDFS-16174, header files should contain only the declaration of the class and method signatures. The implementation must be done in the cc files. Otherwise, these classes get recompiled everytime they're #included, leading to longer compilation times. Also, it's not a good C++ practice to combine declaration and implementation in the header file, unless it's a template class or method.

Another thing that I've done in this PR is to make this into a test utility library, so that it's more modular and can be imported anywhere in libhdfs++.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are valuable but let's make this a refactor PR to make it more explicit.

@GauthamBanasandra GauthamBanasandra changed the title HDFS-16174. Implement temp file and dir in cc files HDFS-16174. Refactor TempFile and TempDir Aug 16, 2021
@@ -114,105 +111,6 @@ void writeDamagedConfig(const std::string& filename, Args... args) {
out.open(filename);
out << stream.rdbuf();
}

// TempDir: is deleted on destruction
class TempFile {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are valuable but let's make this a refactor PR to make it more explicit.

@GauthamBanasandra GauthamBanasandra changed the title HDFS-16174. Refactor TempFile and TempDir HDFS-16174. Refactor TempFile and TempDir in libhdfs++ Aug 17, 2021
@goiri goiri merged commit 409878e into apache:trunk Aug 17, 2021
@GauthamBanasandra GauthamBanasandra deleted the refactor-temp branch August 18, 2021 03:12
kiran-maturi pushed a commit to kiran-maturi/hadoop that referenced this pull request Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants