README.txt 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. =============
  2. Building
  3. =============
  4. basic compilation:
  5. > mvn clean compile test-compile
  6. Compile, run tests and produce jar
  7. > mvn clean package
  8. =============
  9. Unit tests
  10. =============
  11. Most of the tests will run without additional configuration.
  12. For complete testing, configuration in src/test/resources is required:
  13. src/test/resources/azure-test.xml -> Defines Azure storage dependencies, including account information
  14. The other files in src/test/resources do not normally need alteration:
  15. log4j.properties -> Test logging setup
  16. hadoop-metrics2-azure-file-system.properties -> used to wire up instrumentation for testing
  17. From command-line
  18. ------------------
  19. Basic execution:
  20. > mvn test
  21. NOTES:
  22. - The mvn pom.xml includes src/test/resources in the runtime classpath
  23. - detailed output (such as log4j) appears in target\surefire-reports\TEST-{testName}.xml
  24. including log4j messages.
  25. Run the tests and generate report:
  26. > mvn site (at least once to setup some basics including images for the report)
  27. > mvn surefire-report:report (run and produce report)
  28. > mvn mvn surefire-report:report-only (produce report from last run)
  29. > mvn mvn surefire-report:report-only -DshowSuccess=false (produce report from last run, only show errors)
  30. > .\target\site\surefire-report.html (view the report)
  31. Via eclipse
  32. -------------
  33. Manually add src\test\resources to the classpath for test run configuration:
  34. - run menu|run configurations|{configuration}|classpath|User Entries|advanced|add folder
  35. Then run via junit test runner.
  36. NOTE:
  37. - if you change log4.properties, rebuild the project to refresh the eclipse cache.
  38. Run Tests against Mocked storage.
  39. ---------------------------------
  40. These run automatically and make use of an in-memory emulation of azure storage.
  41. Running tests against the Azure storage emulator
  42. ---------------------------------------------------
  43. A selection of tests can run against the Azure Storage Emulator which is
  44. a high-fidelity emulation of live Azure Storage. The emulator is sufficient for high-confidence testing.
  45. The emulator is a Windows executable that runs on a local machine.
  46. To use the emulator, install Azure SDK 2.3 and start the storage emulator
  47. See http://msdn.microsoft.com/en-us/library/azure/hh403989.aspx
  48. Enable the Azure emulator tests by setting
  49. fs.azure.test.emulator -> true
  50. in src\test\resources\azure-test.xml
  51. Known issues:
  52. Symptom: When running tests for emulator, you see the following failure message
  53. com.microsoft.windowsazure.storage.StorageException: The value for one of the HTTP headers is not in the correct format.
  54. Issue: The emulator can get into a confused state.
  55. Fix: Restart the Azure Emulator. Ensure it is v3.2 or later.
  56. Running tests against live Azure storage
  57. -------------------------------------------------------------------------
  58. In order to run WASB unit tests against a live Azure Storage account, add credentials to
  59. src\test\resources\azure-test.xml. These settings augment the hadoop configuration object.
  60. For live tests, set the following in azure-test.xml:
  61. 1. "fs.azure.test.account.name -> {azureStorageAccountName}
  62. 2. "fs.azure.account.key.{AccountName} -> {fullStorageKey}"
  63. ===================================
  64. Page Blob Support and Configuration
  65. ===================================
  66. The Azure Blob Storage interface for Hadoop supports two kinds of blobs, block blobs
  67. and page blobs. Block blobs are the default kind of blob and are good for most
  68. big-data use cases, like input data for Hive, Pig, analytical map-reduce jobs etc.
  69. Page blob handling in hadoop-azure was introduced to support HBase log files.
  70. Page blobs can be written any number of times, whereas block blobs can only be
  71. appended to 50,000 times before you run out of blocks and your writes will fail.
  72. That won't work for HBase logs, so page blob support was introduced to overcome
  73. this limitation.
  74. Page blobs can be used for other purposes beyond just HBase log files though.
  75. They support the Hadoop FileSystem interface. Page blobs can be up to 1TB in
  76. size, larger than the maximum 200GB size for block blobs.
  77. In order to have the files you create be page blobs, you must set the configuration
  78. variable fs.azure.page.blob.dir to a comma-separated list of folder names.
  79. E.g.
  80. /hbase/WALs,/hbase/oldWALs,/data/mypageblobfiles
  81. You can set this to simply / to make all files page blobs.
  82. The configuration option fs.azure.page.blob.size is the default initial
  83. size for a page blob. It must be 128MB or greater, and no more than 1TB,
  84. specified as an integer number of bytes.
  85. ====================
  86. Atomic Folder Rename
  87. ====================
  88. Azure storage stores files as a flat key/value store without formal support
  89. for folders. The hadoop-azure file system layer simulates folders on top
  90. of Azure storage. By default, folder rename in the hadoop-azure file system
  91. layer is not atomic. That means that a failure during a folder rename
  92. could, for example, leave some folders in the original directory and
  93. some in the new one.
  94. HBase depends on atomic folder rename. Hence, a configuration setting was
  95. introduced called fs.azure.atomic.rename.dir that allows you to specify a
  96. comma-separated list of directories to receive special treatment so that
  97. folder rename is made atomic. The default value of this setting is just /hbase.
  98. Redo will be applied to finish a folder rename that fails. A file
  99. <folderName>-renamePending.json may appear temporarily and is the record of
  100. the intention of the rename operation, to allow redo in event of a failure.
  101. =============
  102. Findbugs
  103. =============
  104. Run findbugs and show interactive GUI for review of problems
  105. > mvn findbugs:gui
  106. Run findbugs and fail build if errors are found:
  107. > mvn findbugs:check
  108. For help with findbugs plugin.
  109. > mvn findbugs:help
  110. =============
  111. Checkstyle
  112. =============
  113. Rules for checkstyle @ src\config\checkstyle.xml
  114. - these are based on a core set of standards, with exclusions for non-serious issues
  115. - as a general plan it would be good to turn on more rules over time.
  116. - Occasionally, run checkstyle with the default Sun rules by editing pom.xml.
  117. Command-line:
  118. > mvn checkstyle:check --> just test & fail build if violations found
  119. > mvn site checkstyle:checkstyle --> produce html report
  120. > . target\site\checkstyle.html --> view report.
  121. Eclipse:
  122. - add the checkstyle plugin: Help|Install, site=http://eclipse-cs.sf.net/update
  123. - window|preferences|checkstyle. Add src/config/checkstyle.xml. Set as default.
  124. - project|properties|create configurations as required, eg src/main/java -> src/config/checkstyle.xml
  125. NOTE:
  126. - After any change to the checkstyle rules xml, use window|preferences|checkstyle|{refresh}|OK
  127. =============
  128. Javadoc
  129. =============
  130. Command-line
  131. > mvn javadoc:javadoc