WebHDFS.apt.vm 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769
  1. ~~ Licensed under the Apache License, Version 2.0 (the "License");
  2. ~~ you may not use this file except in compliance with the License.
  3. ~~ You may obtain a copy of the License at
  4. ~~
  5. ~~ http://www.apache.org/licenses/LICENSE-2.0
  6. ~~
  7. ~~ Unless required by applicable law or agreed to in writing, software
  8. ~~ distributed under the License is distributed on an "AS IS" BASIS,
  9. ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. ~~ See the License for the specific language governing permissions and
  11. ~~ limitations under the License. See accompanying LICENSE file.
  12. ---
  13. Hadoop Distributed File System-${project.version} - WebHDFS REST API
  14. ---
  15. ---
  16. ${maven.build.timestamp}
  17. WebHDFS REST API
  18. \[ {{{./index.html}Go Back}} \]
  19. %{toc|section=1|fromDepth=0}
  20. * {Document Conventions}
  21. *----------------------+-------------------------------------------------------------------------------+
  22. | <<<Monospaced>>> | Used for commands, HTTP request and responses and code blocks. |
  23. *----------------------+-------------------------------------------------------------------------------+
  24. | <<<\<Monospaced\>>>> | User entered values. |
  25. *----------------------+-------------------------------------------------------------------------------+
  26. | <<<[Monospaced]>>> | Optional values. When the value is not specified, the default value is used. |
  27. *----------------------+-------------------------------------------------------------------------------+
  28. | <Italics> | Important phrases and words. |
  29. *----------------------+-------------------------------------------------------------------------------+
  30. * {Introduction}
  31. The HTTP REST API supports the complete
  32. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}/{{{../../api/org/apache/hadoop/fs/FileContext.html}FileContext}}
  33. interface for HDFS.
  34. The operations and the corresponding FileSystem/FileContext methods are shown in the next section.
  35. The Section {{HTTP Query Parameter Dictionary}} specifies the parameter details
  36. such as the defaults and the valid values.
  37. ** {Operations}
  38. * HTTP GET
  39. * {{{Open and Read a File}<<<OPEN>>>}}
  40. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.open)
  41. * {{{Status of a File/Directory}<<<GETFILESTATUS>>>}}
  42. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileStatus)
  43. * {{<<<LISTSTATUS>>>}}
  44. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.listStatus)
  45. * {{{Get Content Summary of a Directory}<<<GETCONTENTSUMMARY>>>}}
  46. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getContentSummary)
  47. * {{{Get File Checksum}<<<GETFILECHECKSUM>>>}}
  48. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileChecksum)
  49. * {{{Get Home Directory}<<<GETHOMEDIRECTORY>>>}}
  50. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getHomeDirectory)
  51. * {{{Get Delegation Token}<<<GETDELEGATIONTOKEN>>>}}
  52. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationToken)
  53. * {{{Get Delegation Tokens}<<<GETDELEGATIONTOKENS>>>}}
  54. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationTokens)
  55. * HTTP PUT
  56. * {{{Create and Write to a File}<<<CREATE>>>}}
  57. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.create)
  58. * {{{Make a Directory}<<<MKDIRS>>>}}
  59. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.mkdirs)
  60. * {{{Create a Symbolic Link}<<<CREATESYMLINK>>>}}
  61. (see {{{../../api/org/apache/hadoop/fs/FileContext.html}FileContext}}.createSymlink)
  62. * {{{Rename a File/Directory}<<<RENAME>>>}}
  63. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.rename)
  64. * {{{Set Replication Factor}<<<SETREPLICATION>>>}}
  65. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setReplication)
  66. * {{{Set Owner}<<<SETOWNER>>>}}
  67. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setOwner)
  68. * {{{Set Permission}<<<SETPERMISSION>>>}}
  69. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setPermission)
  70. * {{{Set Access or Modification Time}<<<SETTIMES>>>}}
  71. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setTimes)
  72. * {{{Renew Delegation Token}<<<RENEWDELEGATIONTOKEN>>>}}
  73. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.renewDelegationToken)
  74. * {{{Cancel Delegation Token}<<<CANCELDELEGATIONTOKEN>>>}}
  75. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.cancelDelegationToken)
  76. * HTTP POST
  77. * {{{Append to a File}<<<APPEND>>>}}
  78. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.append)
  79. * HTTP DELETE
  80. * {{{Delete a File/Directory}<<<DELETE>>>}}
  81. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.delete)
  82. ** {FileSystem URIs vs HTTP URLs}
  83. The FileSystem scheme of WebHDFS is "<<<webhdfs://>>>".
  84. A WebHDFS FileSystem URI has the following format.
  85. +---------------------------------
  86. webhdfs://<HOST>:<HTTP_PORT>/<PATH>
  87. +---------------------------------
  88. The above WebHDFS URI corresponds to the below HDFS URI.
  89. +---------------------------------
  90. hdfs://<HOST>:<RPC_PORT>/<PATH>
  91. +---------------------------------
  92. In the REST API, the prefix "<<</webhdfs/v1>>>" is inserted in the path and a query is appended at the end.
  93. Therefore, the corresponding HTTP URL has the following format.
  94. +---------------------------------
  95. http://<HOST>:<HTTP_PORT>/webhdfs/v1/<PATH>?op=...
  96. +---------------------------------
  97. ** {HDFS Configuration Options}
  98. Below are the HDFS configuration options for WebHDFS.
  99. *-------------------------------------------------+---------------------------------------------------+
  100. || Property Name || Description |
  101. *-------------------------------------------------+---------------------------------------------------+
  102. | <<<dfs.webhdfs.enabled >>> | Enable/disable WebHDFS in Namenodes and Datanodes |
  103. *-------------------------------------------------+---------------------------------------------------+
  104. | <<<dfs.web.authentication.kerberos.principal>>> | The HTTP Kerberos principal used by Hadoop-Auth in the HTTP endpoint. The HTTP Kerberos principal MUST start with 'HTTP/' per Kerberos HTTP SPNEGO specification. |
  105. *-------------------------------------------------+---------------------------------------------------+
  106. | <<<dfs.web.authentication.kerberos.keytab >>> | The Kerberos keytab file with the credentials for the HTTP Kerberos principal used by Hadoop-Auth in the HTTP endpoint. |
  107. *-------------------------------------------------+---------------------------------------------------+
  108. * {Authentication}
  109. When security is <off>, the authenticated user is the username specified in the <<<user.name>>> query parameter.
  110. If the <<<user.name>>> parameter is not set,
  111. the server may either set the authenticated user to a default web user, if there is any, or return an error response.
  112. When security is <on>, authentication is performed by either Hadoop delegation token or Kerberos SPNEGO.
  113. If a token is set in the <<<delegation>>> query parameter, the authenticated user is the user encoded in the token.
  114. If the <<<delegation>>> parameter is not set, the user is authenticated by Kerberos SPNEGO.
  115. Below are examples using the <<<curl>>> command tool.
  116. [[1]] Authentication when security is off:
  117. +---------------------------------
  118. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?[user.name=<USER>&]op=..."
  119. +---------------------------------
  120. [[1]] Authentication using Kerberos SPNEGO when security is on:
  121. +---------------------------------
  122. curl -i --negotiate -u : "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=..."
  123. +---------------------------------
  124. [[1]] Authentication using Hadoop delegation token when security is on:
  125. +---------------------------------
  126. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?delegation=<TOKEN>&op=..."
  127. +---------------------------------
  128. * {Proxy Users}
  129. When the proxy user feature is enabled, a proxy user <P> may submit a request on behalf of another user <U>.
  130. The username of <U> must be specified in the <<<doas>>> query parameter unless a delegation token is presented in authentication.
  131. In such case, the information of both users <P> and <U> must be encoded in the delegation token.
  132. [[1]] A proxy request when security is off:
  133. +---------------------------------
  134. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?[user.name=<USER>&]doas=<USER>&op=..."
  135. +---------------------------------
  136. [[1]] A proxy request using Kerberos SPNEGO when security is on:
  137. +---------------------------------
  138. curl -i --negotiate -u : "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?doas=<USER>&op=..."
  139. +---------------------------------
  140. [[1]] A proxy request using Hadoop delegation token when security is on:
  141. +---------------------------------
  142. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?delegation=<TOKEN>&op=..."
  143. +---------------------------------
  144. * {File and Directory Operations}
  145. ** {Create and Write to a File}
  146. * Step 1: Submit a HTTP PUT request without automatically following redirects and without sending the file data.
  147. +---------------------------------
  148. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATE
  149. [&overwrite=<true|false>][&blocksize=<LONG>][&replication=<SHORT>]
  150. [&permission=<OCTAL>][&buffersize=<INT>]"
  151. +---------------------------------
  152. The request is redirected to a datanode where the file data is to be written:
  153. +---------------------------------
  154. HTTP/1.1 307 TEMPORARY_REDIRECT
  155. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE...
  156. Content-Length: 0
  157. +---------------------------------
  158. * Step 2: Submit another HTTP PUT request using the URL in the <<<Location>>> header with the file data to be written.
  159. +---------------------------------
  160. curl -i -X PUT -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE..."
  161. +---------------------------------
  162. The client receives a <<<201 Created>>> response with zero content length
  163. and the WebHDFS URI of the file in the <<<Location>>> header:
  164. +---------------------------------
  165. HTTP/1.1 201 Created
  166. Location: webhdfs://<HOST>:<PORT>/<PATH>
  167. Content-Length: 0
  168. +---------------------------------
  169. []
  170. <<Note>> that the reason of having two-step create/append is
  171. for preventing clients to send out data before the redirect.
  172. This issue is addressed by the "<<<Expect: 100-continue>>>" header in HTTP/1.1;
  173. see {{{http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3}RFC 2616, Section 8.2.3}}.
  174. Unfortunately, there are software library bugs (e.g. Jetty 6 HTTP server and Java 6 HTTP client),
  175. which do not correctly implement "<<<Expect: 100-continue>>>".
  176. The two-step create/append is a temporary workaround for the software library bugs.
  177. See also:
  178. {{{Overwrite}<<<overwrite>>>}},
  179. {{{Block Size}<<<blocksize>>>}},
  180. {{{Replication}<<<replication>>>}},
  181. {{{Permission}<<<permission>>>}},
  182. {{{Buffer Size}<<<buffersize>>>}},
  183. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.create
  184. ** {Append to a File}
  185. * Step 1: Submit a HTTP POST request without automatically following redirects and without sending the file data.
  186. +---------------------------------
  187. curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=APPEND[&buffersize=<INT>]"
  188. +---------------------------------
  189. The request is redirected to a datanode where the file data is to be appended:
  190. +---------------------------------
  191. HTTP/1.1 307 TEMPORARY_REDIRECT
  192. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND...
  193. Content-Length: 0
  194. +---------------------------------
  195. * Step 2: Submit another HTTP POST request using the URL in the <<<Location>>> header with the file data to be appended.
  196. +---------------------------------
  197. curl -i -X POST -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND..."
  198. +---------------------------------
  199. The client receives a response with zero content length:
  200. +---------------------------------
  201. HTTP/1.1 200 OK
  202. Content-Length: 0
  203. +---------------------------------
  204. []
  205. See the note in the previous section for the description of why this operation requires two steps.
  206. See also:
  207. {{{Buffer Size}<<<buffersize>>>}},
  208. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.append
  209. ** {Open and Read a File}
  210. * Submit a HTTP GET request with automatically following redirects.
  211. +---------------------------------
  212. curl -i -L "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=OPEN
  213. [&offset=<LONG>][&length=<LONG>][&buffersize=<INT>]"
  214. +---------------------------------
  215. The request is redirected to a datanode where the file data can be read:
  216. +---------------------------------
  217. HTTP/1.1 307 TEMPORARY_REDIRECT
  218. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=OPEN...
  219. Content-Length: 0
  220. +---------------------------------
  221. The client follows the redirect to the datanode and receives the file data:
  222. +---------------------------------
  223. HTTP/1.1 200 OK
  224. Content-Type: application/octet-stream
  225. Content-Length: 22
  226. Hello, webhdfs user!
  227. +---------------------------------
  228. []
  229. See also:
  230. {{{Offset}<<<offset>>>}},
  231. {{{Length}<<<length>>>}},
  232. {{{Buffer Size}<<<buffersize>>>}},
  233. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.open
  234. ** {Make a Directory}
  235. * Submit a HTTP PUT request.
  236. +---------------------------------
  237. curl -i -X PUT "http://<HOST>:<PORT>/<PATH>?op=MKDIRS[&permission=<OCTAL>]"
  238. +---------------------------------
  239. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  240. +---------------------------------
  241. HTTP/1.1 200 OK
  242. Content-Type: application/json
  243. Transfer-Encoding: chunked
  244. {"boolean": true}
  245. +---------------------------------
  246. []
  247. See also:
  248. {{{Permission}<<<permission>>>}},
  249. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.mkdirs
  250. ** {Create a Symbolic Link}
  251. * Submit a HTTP PUT request.
  252. +---------------------------------
  253. curl -i -X PUT "http://<HOST>:<PORT>/<PATH>?op=CREATESYMLINK
  254. &destination=<PATH>[&createParent=<true|false>]"
  255. +---------------------------------
  256. The client receives a response with zero content length:
  257. +---------------------------------
  258. HTTP/1.1 200 OK
  259. Content-Length: 0
  260. +---------------------------------
  261. []
  262. See also:
  263. {{{Destination}<<<destination>>>}},
  264. {{{Create Parent}<<<createParent>>>}},
  265. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.createSymlink
  266. ** {Rename a File/Directory}
  267. * Submit a HTTP PUT request.
  268. +---------------------------------
  269. curl -i -X PUT "<HOST>:<PORT>/webhdfs/v1/<PATH>?op=RENAME&destination=<PATH>"
  270. +---------------------------------
  271. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  272. +---------------------------------
  273. HTTP/1.1 200 OK
  274. Content-Type: application/json
  275. Transfer-Encoding: chunked
  276. {"boolean": true}
  277. +---------------------------------
  278. []
  279. See also:
  280. {{{Destination}<<<destination>>>}},
  281. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.rename
  282. ** {Delete a File/Directory}
  283. * Submit a HTTP DELETE request.
  284. +---------------------------------
  285. curl -i -X DELETE "http://<host>:<port>/webhdfs/v1/<path>?op=DELETE
  286. [&recursive=<true|false>]"
  287. +---------------------------------
  288. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  289. +---------------------------------
  290. HTTP/1.1 200 OK
  291. Content-Type: application/json
  292. Transfer-Encoding: chunked
  293. {"boolean": true}
  294. +---------------------------------
  295. []
  296. See also:
  297. {{{Recursive}<<<recursive>>>}},
  298. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.delete
  299. ** {Status of a File/Directory}
  300. * Submit a HTTP GET request.
  301. +---------------------------------
  302. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILESTATUS"
  303. +---------------------------------
  304. The client receives a response with a {{{FileStatus JSON Schema}<<<FileStatus>>> JSON object}}:
  305. +---------------------------------
  306. HTTP/1.1 200 OK
  307. Content-Type: application/json
  308. Transfer-Encoding: chunked
  309. {
  310. "FileStatus":
  311. {
  312. "accessTime" : 0,
  313. "blockSize" : 0,
  314. "group" : "supergroup",
  315. "length" : 0, //in bytes, zero for directories
  316. "modificationTime": 1320173277227,
  317. "owner" : "webuser",
  318. "pathSuffix" : "",
  319. "permission" : "777",
  320. "replication" : 0,
  321. "type" : "DIRECTORY" //enum {FILE, DIRECTORY, SYMLINK}
  322. }
  323. }
  324. +---------------------------------
  325. []
  326. See also:
  327. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileStatus
  328. ** {List a Directory}
  329. * Submit a HTTP GET request.
  330. +---------------------------------
  331. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTSTATUS"
  332. +---------------------------------
  333. The client receives a response with a {{{FileStatuses JSON Schema}<<<FileStatuses>>> JSON object}}:
  334. +---------------------------------
  335. HTTP/1.1 200 OK
  336. Content-Type: application/json
  337. Content-Length: 427
  338. {
  339. "FileStatuses":
  340. {
  341. "FileStatus":
  342. [
  343. {
  344. "accessTime" : 1320171722771,
  345. "blockSize" : 33554432,
  346. "group" : "supergroup",
  347. "length" : 24930,
  348. "modificationTime": 1320171722771,
  349. "owner" : "webuser",
  350. "pathSuffix" : "a.patch",
  351. "permission" : "644",
  352. "replication" : 1,
  353. "type" : "FILE"
  354. },
  355. {
  356. "accessTime" : 0,
  357. "blockSize" : 0,
  358. "group" : "supergroup",
  359. "length" : 0,
  360. "modificationTime": 1320895981256,
  361. "owner" : "szetszwo",
  362. "pathSuffix" : "bar",
  363. "permission" : "711",
  364. "replication" : 0,
  365. "type" : "DIRECTORY"
  366. },
  367. ...
  368. ]
  369. }
  370. }
  371. +---------------------------------
  372. []
  373. See also:
  374. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.listStatus
  375. * {Other File System Operations}
  376. ** {Get Content Summary of a Directory}
  377. * Submit a HTTP GET request.
  378. +---------------------------------
  379. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETCONTENTSUMMARY"
  380. +---------------------------------
  381. The client receives a response with a {{{ContentSummary JSON Schema}<<<ContentSummary>>> JSON object}}:
  382. +---------------------------------
  383. HTTP/1.1 200 OK
  384. Content-Type: application/json
  385. Transfer-Encoding: chunked
  386. {
  387. "ContentSummary":
  388. {
  389. "directoryCount": 2,
  390. "fileCount" : 1,
  391. "length" : 24930,
  392. "quota" : -1,
  393. "spaceConsumed" : 24930,
  394. "spaceQuota" : -1
  395. }
  396. }
  397. +---------------------------------
  398. []
  399. See also:
  400. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getContentSummary
  401. ** {Get File Checksum}
  402. * Submit a HTTP GET request.
  403. +---------------------------------
  404. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILECHECKSUM"
  405. +---------------------------------
  406. The request is redirected to a datanode:
  407. +---------------------------------
  408. HTTP/1.1 307 TEMPORARY_REDIRECT
  409. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=GETFILECHECKSUM...
  410. Content-Length: 0
  411. +---------------------------------
  412. The client follows the redirect to the datanode and receives a {{{FileChecksum JSON Schema}<<<FileChecksum>>> JSON object}}:
  413. +---------------------------------
  414. HTTP/1.1 200 OK
  415. Content-Type: application/json
  416. Transfer-Encoding: chunked
  417. {
  418. "FileChecksum":
  419. {
  420. "algorithm": "MD5-of-1MD5-of-512CRC32",
  421. "bytes" : "eadb10de24aa315748930df6e185c0d ...",
  422. "length" : 28
  423. }
  424. }
  425. +---------------------------------
  426. []
  427. See also:
  428. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileChecksum
  429. ** {Get Home Directory}
  430. * Submit a HTTP GET request.
  431. +---------------------------------
  432. curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETHOMEDIRECTORY"
  433. +---------------------------------
  434. The client receives a response with a {{{Path JSON Schema}<<<Path>>> JSON object}}:
  435. +---------------------------------
  436. HTTP/1.1 200 OK
  437. Content-Type: application/json
  438. Transfer-Encoding: chunked
  439. {"Path": "/user/szetszwo"}
  440. +---------------------------------
  441. []
  442. See also:
  443. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getHomeDirectory
  444. ** {Set Permission}
  445. * Submit a HTTP PUT request.
  446. +---------------------------------
  447. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETPERMISSION
  448. [&permission=<OCTAL>]"
  449. +---------------------------------
  450. The client receives a response with zero content length:
  451. +---------------------------------
  452. HTTP/1.1 200 OK
  453. Content-Length: 0
  454. +---------------------------------
  455. []
  456. See also:
  457. {{{Permission}<<<permission>>>}},
  458. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setPermission
  459. ** {Set Owner}
  460. * Submit a HTTP PUT request.
  461. +---------------------------------
  462. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETOWNER
  463. [&owner=<USER>][&group=<GROUP>]"
  464. +---------------------------------
  465. The client receives a response with zero content length:
  466. +---------------------------------
  467. HTTP/1.1 200 OK
  468. Content-Length: 0
  469. +---------------------------------
  470. []
  471. See also:
  472. {{{Owner}<<<owner>>>}},
  473. {{{Group}<<<group>>>}},
  474. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setOwner
  475. ** {Set Replication Factor}
  476. * Submit a HTTP PUT request.
  477. +---------------------------------
  478. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETREPLICATION
  479. [&replication=<SHORT>]"
  480. +---------------------------------
  481. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  482. +---------------------------------
  483. HTTP/1.1 200 OK
  484. Content-Type: application/json
  485. Transfer-Encoding: chunked
  486. {"boolean": true}
  487. +---------------------------------
  488. []
  489. See also:
  490. {{{Replication}<<<replication>>>}},
  491. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setReplication
  492. ** {Set Access or Modification Time}
  493. * Submit a HTTP PUT request.
  494. +---------------------------------
  495. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETTIMES
  496. [&modificationtime=<TIME>][&accesstime=<TIME>]"
  497. +---------------------------------
  498. The client receives a response with zero content length:
  499. +---------------------------------
  500. HTTP/1.1 200 OK
  501. Content-Length: 0
  502. +---------------------------------
  503. []
  504. See also:
  505. {{{Modification Time}<<<modificationtime>>>}},
  506. {{{Access Time}<<<accesstime>>>}},
  507. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setTimes
  508. * {Delegation Token Operations}
  509. ** {Get Delegation Token}
  510. * Submit a HTTP GET request.
  511. +---------------------------------
  512. curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETDELEGATIONTOKEN&renewer=<USER>"
  513. +---------------------------------
  514. The client receives a response with a {{{Token JSON Schema}<<<Token>>> JSON object}}:
  515. +---------------------------------
  516. HTTP/1.1 200 OK
  517. Content-Type: application/json
  518. Transfer-Encoding: chunked
  519. {
  520. "Token":
  521. {
  522. "urlString": "JQAIaG9y..."
  523. }
  524. }
  525. +---------------------------------
  526. []
  527. See also:
  528. {{{Renewer}<<<renewer>>>}},
  529. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationToken
  530. ** {Get Delegation Tokens}
  531. * Submit a HTTP GET request.
  532. +---------------------------------
  533. curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETDELEGATIONTOKENS&renewer=<USER>"
  534. +---------------------------------
  535. The client receives a response with a {{{Tokens JSON Schema}<<<Tokens>>> JSON object}}:
  536. +---------------------------------
  537. HTTP/1.1 200 OK
  538. Content-Type: application/json
  539. Transfer-Encoding: chunked
  540. {
  541. "Tokens":
  542. {
  543. "Token":
  544. [
  545. {
  546. "urlString":"KAAKSm9i ..."
  547. }
  548. ]
  549. }
  550. }
  551. +---------------------------------
  552. []
  553. See also:
  554. {{{Renewer}<<<renewer>>>}},
  555. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationTokens
  556. ** {Renew Delegation Token}
  557. * Submit a HTTP PUT request.
  558. +---------------------------------
  559. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=RENEWDELEGATIONTOKEN&token=<TOKEN>"
  560. +---------------------------------
  561. The client receives a response with a {{{Long JSON Schema}<<<long>>> JSON object}}:
  562. +---------------------------------
  563. HTTP/1.1 200 OK
  564. Content-Type: application/json
  565. Transfer-Encoding: chunked
  566. {"long": 1320962673997} //the new expiration time
  567. +---------------------------------
  568. []
  569. See also:
  570. {{{Token}<<<token>>>}},
  571. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.renewDelegationToken
  572. ** {Cancel Delegation Token}
  573. * Submit a HTTP PUT request.
  574. +---------------------------------
  575. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=CANCELDELEGATIONTOKEN&token=<TOKEN>"
  576. +---------------------------------
  577. The client receives a response with zero content length:
  578. +---------------------------------
  579. HTTP/1.1 200 OK
  580. Content-Length: 0
  581. +---------------------------------
  582. []
  583. See also:
  584. {{{Token}<<<token>>>}},
  585. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.cancelDelegationToken
  586. * {Error Responses}
  587. When an operation fails, the server may throw an exception.
  588. The JSON schema of error responses is defined in {{<<<RemoteException>>> JSON schema}}.
  589. The table below shows the mapping from exceptions to HTTP response codes.
  590. ** {HTTP Response Codes}
  591. *-------------------------------------+---------------------------------+
  592. || Exceptions || HTTP Response Codes |
  593. *-------------------------------------+---------------------------------+
  594. | <<<IllegalArgumentException >>> | <<<400 Bad Request >>> |
  595. *-------------------------------------+---------------------------------+
  596. | <<<UnsupportedOperationException>>> | <<<400 Bad Request >>> |
  597. *-------------------------------------+---------------------------------+
  598. | <<<SecurityException >>> | <<<401 Unauthorized >>> |
  599. *-------------------------------------+---------------------------------+
  600. | <<<IOException >>> | <<<403 Forbidden >>> |
  601. *-------------------------------------+---------------------------------+
  602. | <<<FileNotFoundException >>> | <<<404 Not Found >>> |
  603. *-------------------------------------+---------------------------------+
  604. | <<<RumtimeException >>> | <<<500 Internal Server Error>>> |
  605. *-------------------------------------+---------------------------------+
  606. Below are examples of exception responses.
  607. *** {Illegal Argument Exception}
  608. +---------------------------------
  609. HTTP/1.1 400 Bad Request
  610. Content-Type: application/json
  611. Transfer-Encoding: chunked
  612. {
  613. "RemoteException":
  614. {
  615. "exception" : "IllegalArgumentException",
  616. "javaClassName": "java.lang.IllegalArgumentException",
  617. "message" : "Invalid value for webhdfs parameter \"permission\": ..."
  618. }
  619. }
  620. +---------------------------------
  621. *** {Security Exception}
  622. +---------------------------------
  623. HTTP/1.1 401 Unauthorized
  624. Content-Type: application/json
  625. Transfer-Encoding: chunked
  626. {
  627. "RemoteException":
  628. {
  629. "exception" : "SecurityException",
  630. "javaClassName": "java.lang.SecurityException",
  631. "message" : "Failed to obtain user group information: ..."
  632. }
  633. }
  634. +---------------------------------
  635. *** {Access Control Exception}
  636. +---------------------------------
  637. HTTP/1.1 403 Forbidden
  638. Content-Type: application/json
  639. Transfer-Encoding: chunked
  640. {
  641. "RemoteException":
  642. {
  643. "exception" : "AccessControlException",
  644. "javaClassName": "org.apache.hadoop.security.AccessControlException",
  645. "message" : "Permission denied: ..."
  646. }
  647. }
  648. +---------------------------------
  649. *** {File Not Found Exception}
  650. +---------------------------------
  651. HTTP/1.1 404 Not Found
  652. Content-Type: application/json
  653. Transfer-Encoding: chunked
  654. {
  655. "RemoteException":
  656. {
  657. "exception" : "FileNotFoundException",
  658. "javaClassName": "java.io.FileNotFoundException",
  659. "message" : "File does not exist: /foo/a.patch"
  660. }
  661. }
  662. +---------------------------------
  663. * {JSON Schemas}
  664. All operations, except for {{{Open and Read a File}<<<OPEN>>>}},
  665. either return a zero-length response or a JSON response.
  666. For {{{Open and Read a File}<<<OPEN>>>}}, the response is an octet-stream.
  667. The JSON schemas are shown below.
  668. See {{{http://tools.ietf.org/id/draft-zyp-json-schema-03.html}draft-zyp-json-schema-03}}
  669. for the syntax definitions of the JSON schemas.
  670. ** {Boolean JSON Schema}
  671. +---------------------------------
  672. {
  673. "name" : "boolean",
  674. "properties":
  675. {
  676. "boolean":
  677. {
  678. "description": "A boolean value",
  679. "type" : "boolean",
  680. "required" : true
  681. }
  682. }
  683. }
  684. +---------------------------------
  685. See also:
  686. {{{Make a Directory}<<<MKDIRS>>>}},
  687. {{{Rename a File/Directory}<<<RENAME>>>}},
  688. {{{Delete a File/Directory}<<<DELETE>>>}},
  689. {{{Set Replication Factor}<<<SETREPLICATION>>>}}
  690. ** {ContentSummary JSON Schema}
  691. +---------------------------------
  692. {
  693. "name" : "ContentSummary",
  694. "properties":
  695. {
  696. "ContentSummary":
  697. {
  698. "type" : "object",
  699. "properties":
  700. {
  701. "directoryCount":
  702. {
  703. "description": "The number of directories.",
  704. "type" : "integer",
  705. "required" : true
  706. },
  707. "fileCount":
  708. {
  709. "description": "The number of files.",
  710. "type" : "integer",
  711. "required" : true
  712. },
  713. "length":
  714. {
  715. "description": "The number of bytes used by the content.",
  716. "type" : "integer",
  717. "required" : true
  718. },
  719. "quota":
  720. {
  721. "description": "The namespace quota of this directory.",
  722. "type" : "integer",
  723. "required" : true
  724. },
  725. "spaceConsumed":
  726. {
  727. "description": "The disk space consumed by the content.",
  728. "type" : "integer",
  729. "required" : true
  730. },
  731. "spaceQuota":
  732. {
  733. "description": "The disk space quota.",
  734. "type" : "integer",
  735. "required" : true
  736. }
  737. }
  738. }
  739. }
  740. }
  741. +---------------------------------
  742. See also:
  743. {{{Get Content Summary of a Directory}<<<GETCONTENTSUMMARY>>>}}
  744. ** {FileChecksum JSON Schema}
  745. +---------------------------------
  746. {
  747. "name" : "FileChecksum",
  748. "properties":
  749. {
  750. "FileChecksum":
  751. {
  752. "type" : "object",
  753. "properties":
  754. {
  755. "algorithm":
  756. {
  757. "description": "The name of the checksum algorithm.",
  758. "type" : "string",
  759. "required" : true
  760. },
  761. "bytes":
  762. {
  763. "description": "The byte sequence of the checksum in hexadecimal.",
  764. "type" : "string",
  765. "required" : true
  766. },
  767. "length":
  768. {
  769. "description": "The length of the bytes (not the length of the string).",
  770. "type" : "integer",
  771. "required" : true
  772. }
  773. }
  774. }
  775. }
  776. }
  777. +---------------------------------
  778. See also:
  779. {{{Get File Checksum}<<<GETFILECHECKSUM>>>}}
  780. ** {FileStatus JSON Schema}
  781. +---------------------------------
  782. {
  783. "name" : "FileStatus",
  784. "properties":
  785. {
  786. "FileStatus": fileStatusProperties //See FileStatus Properties
  787. }
  788. }
  789. +---------------------------------
  790. See also:
  791. {{{FileStatus Properties}<<<FileStatus>>> Properties}},
  792. {{{Status of a File/Directory}<<<GETFILESTATUS>>>}},
  793. {{{../../api/org/apache/hadoop/fs/FileStatus}FileStatus}}
  794. *** {FileStatus Properties}
  795. JavaScript syntax is used to define <<<fileStatusProperties>>>
  796. so that it can be referred in both <<<FileStatus>>> and <<<FileStatuses>>> JSON schemas.
  797. +---------------------------------
  798. var fileStatusProperties =
  799. {
  800. "type" : "object",
  801. "properties":
  802. {
  803. "accessTime":
  804. {
  805. "description": "The access time.",
  806. "type" : "integer",
  807. "required" : true
  808. },
  809. "blockSize":
  810. {
  811. "description": "The block size of a file.",
  812. "type" : "integer",
  813. "required" : true
  814. },
  815. "group":
  816. {
  817. "description": "The group owner.",
  818. "type" : "string",
  819. "required" : true
  820. },
  821. "length":
  822. {
  823. "description": "The number of bytes in a file.",
  824. "type" : "integer",
  825. "required" : true
  826. },
  827. "modificationTime":
  828. {
  829. "description": "The modification time.",
  830. "type" : "integer",
  831. "required" : true
  832. },
  833. "owner":
  834. {
  835. "description": "The user who is the owner.",
  836. "type" : "string",
  837. "required" : true
  838. },
  839. "pathSuffix":
  840. {
  841. "description": "The path suffix.",
  842. "type" : "string",
  843. "required" : true
  844. },
  845. "permission":
  846. {
  847. "description": "The permission represented as a octal string.",
  848. "type" : "string",
  849. "required" : true
  850. },
  851. "replication":
  852. {
  853. "description": "The number of replication of a file.",
  854. "type" : "integer",
  855. "required" : true
  856. },
  857. "symlink": //an optional property
  858. {
  859. "description": "The link target of a symlink.",
  860. "type" : "string"
  861. },
  862. "type":
  863. {
  864. "description": "The type of the path object.",
  865. "enum" : ["FILE", "DIRECTORY", "SYMLINK"],
  866. "required" : true
  867. }
  868. }
  869. };
  870. +---------------------------------
  871. ** {FileStatuses JSON Schema}
  872. A <<<FileStatuses>>> JSON object represents an array of <<<FileStatus>>> JSON objects.
  873. +---------------------------------
  874. {
  875. "name" : "FileStatuses",
  876. "properties":
  877. {
  878. "FileStatuses":
  879. {
  880. "type" : "object",
  881. "properties":
  882. {
  883. "FileStatus":
  884. {
  885. "description": "An array of FileStatus",
  886. "type" : "array",
  887. "items" : fileStatusProperties //See FileStatus Properties
  888. }
  889. }
  890. }
  891. }
  892. }
  893. +---------------------------------
  894. See also:
  895. {{{FileStatus Properties}<<<FileStatus>>> Properties}},
  896. {{{List a Directory}<<<LISTSTATUS>>>}},
  897. {{{../../api/org/apache/hadoop/fs/FileStatus}FileStatus}}
  898. ** {Long JSON Schema}
  899. +---------------------------------
  900. {
  901. "name" : "long",
  902. "properties":
  903. {
  904. "long":
  905. {
  906. "description": "A long integer value",
  907. "type" : "integer",
  908. "required" : true
  909. }
  910. }
  911. }
  912. +---------------------------------
  913. See also:
  914. {{{Renew Delegation Token}<<<RENEWDELEGATIONTOKEN>>>}},
  915. ** {Path JSON Schema}
  916. +---------------------------------
  917. {
  918. "name" : "Path",
  919. "properties":
  920. {
  921. "Path":
  922. {
  923. "description": "The string representation a Path.",
  924. "type" : "string",
  925. "required" : true
  926. }
  927. }
  928. }
  929. +---------------------------------
  930. See also:
  931. {{{Get Home Directory}<<<GETHOMEDIRECTORY>>>}},
  932. {{{../../api/org/apache/hadoop/fs/Path}Path}}
  933. ** {RemoteException JSON Schema}
  934. +---------------------------------
  935. {
  936. "name" : "RemoteException",
  937. "properties":
  938. {
  939. "RemoteException":
  940. {
  941. "type" : "object",
  942. "properties":
  943. {
  944. "exception":
  945. {
  946. "description": "Name of the exception",
  947. "type" : "string",
  948. "required" : true
  949. },
  950. "message":
  951. {
  952. "description": "Exception message",
  953. "type" : "string",
  954. "required" : true
  955. },
  956. "javaClassName": //an optional property
  957. {
  958. "description": "Java class name of the exception",
  959. "type" : "string",
  960. }
  961. }
  962. }
  963. }
  964. }
  965. +---------------------------------
  966. See also:
  967. {{Error Responses}}
  968. ** {Token JSON Schema}
  969. +---------------------------------
  970. {
  971. "name" : "Token",
  972. "properties":
  973. {
  974. "Token": tokenProperties //See Token Properties
  975. }
  976. }
  977. +---------------------------------
  978. See also:
  979. {{{Token Properties}<<<Token>>> Properties}},
  980. {{{Get Delegation Token}<<<GETDELEGATIONTOKEN>>>}},
  981. the note in {{Delegation}}.
  982. *** {Token Properties}
  983. JavaScript syntax is used to define <<<tokenProperties>>>
  984. so that it can be referred in both <<<Token>>> and <<<Tokens>>> JSON schemas.
  985. +---------------------------------
  986. var tokenProperties =
  987. {
  988. "type" : "object",
  989. "properties":
  990. {
  991. "urlString":
  992. {
  993. "description": "A delegation token encoded as a URL safe string.",
  994. "type" : "string",
  995. "required" : true
  996. }
  997. }
  998. }
  999. +---------------------------------
  1000. ** {Tokens JSON Schema}
  1001. A <<<Tokens>>> JSON object represents an array of <<<Token>>> JSON objects.
  1002. +---------------------------------
  1003. {
  1004. "name" : "Tokens",
  1005. "properties":
  1006. {
  1007. "Tokens":
  1008. {
  1009. "type" : "object",
  1010. "properties":
  1011. {
  1012. "Token":
  1013. {
  1014. "description": "An array of Token",
  1015. "type" : "array",
  1016. "items" : "Token": tokenProperties //See Token Properties
  1017. }
  1018. }
  1019. }
  1020. }
  1021. }
  1022. +---------------------------------
  1023. See also:
  1024. {{{Token Properties}<<<Token>>> Properties}},
  1025. {{{Get Delegation Tokens}<<<GETDELEGATIONTOKENS>>>}},
  1026. the note in {{Delegation}}.
  1027. * {HTTP Query Parameter Dictionary}
  1028. ** {Access Time}
  1029. *----------------+-------------------------------------------------------------------+
  1030. || Name | <<<accesstime>>> |
  1031. *----------------+-------------------------------------------------------------------+
  1032. || Description | The access time of a file/directory. |
  1033. *----------------+-------------------------------------------------------------------+
  1034. || Type | long |
  1035. *----------------+-------------------------------------------------------------------+
  1036. || Default Value | -1 (means keeping it unchanged) |
  1037. *----------------+-------------------------------------------------------------------+
  1038. || Valid Values | -1 or a timestamp |
  1039. *----------------+-------------------------------------------------------------------+
  1040. || Syntax | Any integer. |
  1041. *----------------+-------------------------------------------------------------------+
  1042. See also:
  1043. {{{Set Access or Modification Time}<<<SETTIMES>>>}}
  1044. ** {Block Size}
  1045. *----------------+-------------------------------------------------------------------+
  1046. || Name | <<<blocksize>>> |
  1047. *----------------+-------------------------------------------------------------------+
  1048. || Description | The block size of a file. |
  1049. *----------------+-------------------------------------------------------------------+
  1050. || Type | long |
  1051. *----------------+-------------------------------------------------------------------+
  1052. || Default Value | Specified in the configuration. |
  1053. *----------------+-------------------------------------------------------------------+
  1054. || Valid Values | \> 0 |
  1055. *----------------+-------------------------------------------------------------------+
  1056. || Syntax | Any integer. |
  1057. *----------------+-------------------------------------------------------------------+
  1058. See also:
  1059. {{{Create and Write to a File}<<<CREATE>>>}}
  1060. ** {Buffer Size}
  1061. *----------------+-------------------------------------------------------------------+
  1062. || Name | <<<buffersize>>> |
  1063. *----------------+-------------------------------------------------------------------+
  1064. || Description | The size of the buffer used in transferring data. |
  1065. *----------------+-------------------------------------------------------------------+
  1066. || Type | int |
  1067. *----------------+-------------------------------------------------------------------+
  1068. || Default Value | Specified in the configuration. |
  1069. *----------------+-------------------------------------------------------------------+
  1070. || Valid Values | \> 0 |
  1071. *----------------+-------------------------------------------------------------------+
  1072. || Syntax | Any integer. |
  1073. *----------------+-------------------------------------------------------------------+
  1074. See also:
  1075. {{{Create and Write to a File}<<<CREATE>>>}},
  1076. {{{Append to a File}<<<APPEND>>>}},
  1077. {{{Open and Read a File}<<<OPEN>>>}}
  1078. ** {Create Parent}
  1079. *----------------+-------------------------------------------------------------------+
  1080. || Name | <<<createparent>>> |
  1081. *----------------+-------------------------------------------------------------------+
  1082. || Description | If the parent directories do not exist, should they be created? |
  1083. *----------------+-------------------------------------------------------------------+
  1084. || Type | boolean |
  1085. *----------------+-------------------------------------------------------------------+
  1086. || Default Value | false |
  1087. *----------------+-------------------------------------------------------------------+
  1088. || Valid Values | true | false |
  1089. *----------------+-------------------------------------------------------------------+
  1090. || Syntax | true | false |
  1091. *----------------+-------------------------------------------------------------------+
  1092. See also:
  1093. {{{Create a Symbolic Link}<<<CREATESYMLINK>>>}}
  1094. ** {Delegation}
  1095. *----------------+-------------------------------------------------------------------+
  1096. || Name | <<<delegation>>> |
  1097. *----------------+-------------------------------------------------------------------+
  1098. || Description | The delegation token used for authentication. |
  1099. *----------------+-------------------------------------------------------------------+
  1100. || Type | String |
  1101. *----------------+-------------------------------------------------------------------+
  1102. || Default Value | \<empty\> |
  1103. *----------------+-------------------------------------------------------------------+
  1104. || Valid Values | An encoded token. |
  1105. *----------------+-------------------------------------------------------------------+
  1106. || Syntax | See the note below. |
  1107. *----------------+-------------------------------------------------------------------+
  1108. <<Note>> that delegation tokens are encoded as a URL safe string;
  1109. see <<<encodeToUrlString()>>>
  1110. and <<<decodeFromUrlString(String)>>>
  1111. in <<<org.apache.hadoop.security.token.Token>>> for the details of the encoding.
  1112. See also:
  1113. {{Authentication}}
  1114. ** {Destination}
  1115. *----------------+-------------------------------------------------------------------+
  1116. || Name | <<<destination>>> |
  1117. *----------------+-------------------------------------------------------------------+
  1118. || Description | The destination path. |
  1119. *----------------+-------------------------------------------------------------------+
  1120. || Type | Path |
  1121. *----------------+-------------------------------------------------------------------+
  1122. || Default Value | \<empty\> (an invalid path) |
  1123. *----------------+-------------------------------------------------------------------+
  1124. || Valid Values | An absolute FileSystem path without scheme and authority. |
  1125. *----------------+-------------------------------------------------------------------+
  1126. || Syntax | Any path. |
  1127. *----------------+-------------------------------------------------------------------+
  1128. See also:
  1129. {{{Create a Symbolic Link}<<<CREATESYMLINK>>>}},
  1130. {{{Rename a File/Directory}<<<RENAME>>>}}
  1131. ** {Do As}
  1132. *----------------+-------------------------------------------------------------------+
  1133. || Name | <<<doas>>> |
  1134. *----------------+-------------------------------------------------------------------+
  1135. || Description | Allowing a proxy user to do as another user. |
  1136. *----------------+-------------------------------------------------------------------+
  1137. || Type | String |
  1138. *----------------+-------------------------------------------------------------------+
  1139. || Default Value | null |
  1140. *----------------+-------------------------------------------------------------------+
  1141. || Valid Values | Any valid username. |
  1142. *----------------+-------------------------------------------------------------------+
  1143. || Syntax | Any string. |
  1144. *----------------+-------------------------------------------------------------------+
  1145. See also:
  1146. {{Proxy Users}}
  1147. ** {Group}
  1148. *----------------+-------------------------------------------------------------------+
  1149. || Name | <<<group>>> |
  1150. *----------------+-------------------------------------------------------------------+
  1151. || Description | The name of a group. |
  1152. *----------------+-------------------------------------------------------------------+
  1153. || Type | String |
  1154. *----------------+-------------------------------------------------------------------+
  1155. || Default Value | \<empty\> (means keeping it unchanged) |
  1156. *----------------+-------------------------------------------------------------------+
  1157. || Valid Values | Any valid group name. |
  1158. *----------------+-------------------------------------------------------------------+
  1159. || Syntax | Any string. |
  1160. *----------------+-------------------------------------------------------------------+
  1161. See also:
  1162. {{{Set Owner}<<<SETOWNER>>>}}
  1163. ** {Length}
  1164. *----------------+-------------------------------------------------------------------+
  1165. || Name | <<<length>>> |
  1166. *----------------+-------------------------------------------------------------------+
  1167. || Description | The number of bytes to be processed. |
  1168. *----------------+-------------------------------------------------------------------+
  1169. || Type | long |
  1170. *----------------+-------------------------------------------------------------------+
  1171. || Default Value | null (means the entire file) |
  1172. *----------------+-------------------------------------------------------------------+
  1173. || Valid Values | \>= 0 or null |
  1174. *----------------+-------------------------------------------------------------------+
  1175. || Syntax | Any integer. |
  1176. *----------------+-------------------------------------------------------------------+
  1177. See also:
  1178. {{{Open and Read a File}<<<OPEN>>>}}
  1179. ** {Modification Time}
  1180. *----------------+-------------------------------------------------------------------+
  1181. || Name | <<<modificationtime>>> |
  1182. *----------------+-------------------------------------------------------------------+
  1183. || Description | The modification time of a file/directory. |
  1184. *----------------+-------------------------------------------------------------------+
  1185. || Type | long |
  1186. *----------------+-------------------------------------------------------------------+
  1187. || Default Value | -1 (means keeping it unchanged) |
  1188. *----------------+-------------------------------------------------------------------+
  1189. || Valid Values | -1 or a timestamp |
  1190. *----------------+-------------------------------------------------------------------+
  1191. || Syntax | Any integer. |
  1192. *----------------+-------------------------------------------------------------------+
  1193. See also:
  1194. {{{Set Access or Modification Time}<<<SETTIMES>>>}}
  1195. ** {Offset}
  1196. *----------------+-------------------------------------------------------------------+
  1197. || Name | <<<offset>>> |
  1198. *----------------+-------------------------------------------------------------------+
  1199. || Description | The starting byte position. |
  1200. *----------------+-------------------------------------------------------------------+
  1201. || Type | long |
  1202. *----------------+-------------------------------------------------------------------+
  1203. || Default Value | 0 |
  1204. *----------------+-------------------------------------------------------------------+
  1205. || Valid Values | \>= 0 |
  1206. *----------------+-------------------------------------------------------------------+
  1207. || Syntax | Any integer. |
  1208. *----------------+-------------------------------------------------------------------+
  1209. See also:
  1210. {{{Open and Read a File}<<<OPEN>>>}}
  1211. ** {Op}
  1212. *----------------+-------------------------------------------------------------------+
  1213. || Name | <<<op>>> |
  1214. *----------------+-------------------------------------------------------------------+
  1215. || Description | The name of the operation to be executed. |
  1216. *----------------+-------------------------------------------------------------------+
  1217. || Type | enum |
  1218. *----------------+-------------------------------------------------------------------+
  1219. || Default Value | null (an invalid value) |
  1220. *----------------+-------------------------------------------------------------------+
  1221. || Valid Values | Any valid operation name. |
  1222. *----------------+-------------------------------------------------------------------+
  1223. || Syntax | Any string. |
  1224. *----------------+-------------------------------------------------------------------+
  1225. See also:
  1226. {{Operations}}
  1227. ** {Overwrite}
  1228. *----------------+-------------------------------------------------------------------+
  1229. || Name | <<<overwrite>>> |
  1230. *----------------+-------------------------------------------------------------------+
  1231. || Description | If a file already exists, should it be overwritten? |
  1232. *----------------+-------------------------------------------------------------------+
  1233. || Type | boolean |
  1234. *----------------+-------------------------------------------------------------------+
  1235. || Default Value | false |
  1236. *----------------+-------------------------------------------------------------------+
  1237. || Valid Values | true | false |
  1238. *----------------+-------------------------------------------------------------------+
  1239. || Syntax | true | false |
  1240. *----------------+-------------------------------------------------------------------+
  1241. See also:
  1242. {{{Create and Write to a File}<<<CREATE>>>}}
  1243. ** {Owner}
  1244. *----------------+-------------------------------------------------------------------+
  1245. || Name | <<<owner>>> |
  1246. *----------------+-------------------------------------------------------------------+
  1247. || Description | The username who is the owner of a file/directory. |
  1248. *----------------+-------------------------------------------------------------------+
  1249. || Type | String |
  1250. *----------------+-------------------------------------------------------------------+
  1251. || Default Value | \<empty\> (means keeping it unchanged) |
  1252. *----------------+-------------------------------------------------------------------+
  1253. || Valid Values | Any valid username. |
  1254. *----------------+-------------------------------------------------------------------+
  1255. || Syntax | Any string. |
  1256. *----------------+-------------------------------------------------------------------+
  1257. See also:
  1258. {{{Set Owner}<<<SETOWNER>>>}}
  1259. ** {Permission}
  1260. *----------------+-------------------------------------------------------------------+
  1261. || Name | <<<permission>>> |
  1262. *----------------+-------------------------------------------------------------------+
  1263. || Description | The permission of a file/directory. |
  1264. *----------------+-------------------------------------------------------------------+
  1265. || Type | Octal |
  1266. *----------------+-------------------------------------------------------------------+
  1267. || Default Value | 755 |
  1268. *----------------+-------------------------------------------------------------------+
  1269. || Valid Values | 0 - 1777 |
  1270. *----------------+-------------------------------------------------------------------+
  1271. || Syntax | Any radix-8 integer (leading zeros may be omitted.) |
  1272. *----------------+-------------------------------------------------------------------+
  1273. See also:
  1274. {{{Create and Write to a File}<<<CREATE>>>}},
  1275. {{{Make a Directory}<<<MKDIRS>>>}},
  1276. {{{Set Permission}<<<SETPERMISSION>>>}}
  1277. ** {Recursive}
  1278. *----------------+-------------------------------------------------------------------+
  1279. || Name | <<<recursive>>> |
  1280. *----------------+-------------------------------------------------------------------+
  1281. || Description | Should the operation act on the content in the subdirectories? |
  1282. *----------------+-------------------------------------------------------------------+
  1283. || Type | boolean |
  1284. *----------------+-------------------------------------------------------------------+
  1285. || Default Value | false |
  1286. *----------------+-------------------------------------------------------------------+
  1287. || Valid Values | true | false |
  1288. *----------------+-------------------------------------------------------------------+
  1289. || Syntax | true | false |
  1290. *----------------+-------------------------------------------------------------------+
  1291. See also:
  1292. {{{Rename a File/Directory}<<<RENAME>>>}}
  1293. ** {Renewer}
  1294. *----------------+-------------------------------------------------------------------+
  1295. || Name | <<<renewer>>> |
  1296. *----------------+-------------------------------------------------------------------+
  1297. || Description | The username of the renewer of a delegation token. |
  1298. *----------------+-------------------------------------------------------------------+
  1299. || Type | String |
  1300. *----------------+-------------------------------------------------------------------+
  1301. || Default Value | \<empty\> (means the current user) |
  1302. *----------------+-------------------------------------------------------------------+
  1303. || Valid Values | Any valid username. |
  1304. *----------------+-------------------------------------------------------------------+
  1305. || Syntax | Any string. |
  1306. *----------------+-------------------------------------------------------------------+
  1307. See also:
  1308. {{{Get Delegation Token}<<<GETDELEGATIONTOKEN>>>}},
  1309. {{{Get Delegation Tokens}<<<GETDELEGATIONTOKENS>>>}}
  1310. ** {Replication}
  1311. *----------------+-------------------------------------------------------------------+
  1312. || Name | <<<replication>>> |
  1313. *----------------+-------------------------------------------------------------------+
  1314. || Description | The number of replications of a file. |
  1315. *----------------+-------------------------------------------------------------------+
  1316. || Type | short |
  1317. *----------------+-------------------------------------------------------------------+
  1318. || Default Value | Specified in the configuration. |
  1319. *----------------+-------------------------------------------------------------------+
  1320. || Valid Values | \> 0 |
  1321. *----------------+-------------------------------------------------------------------+
  1322. || Syntax | Any integer. |
  1323. *----------------+-------------------------------------------------------------------+
  1324. See also:
  1325. {{{Create and Write to a File}<<<CREATE>>>}},
  1326. {{{Set Replication Factor}<<<SETREPLICATION>>>}}
  1327. ** {Token}
  1328. *----------------+-------------------------------------------------------------------+
  1329. || Name | <<<token>>> |
  1330. *----------------+-------------------------------------------------------------------+
  1331. || Description | The delegation token used for the operation. |
  1332. *----------------+-------------------------------------------------------------------+
  1333. || Type | String |
  1334. *----------------+-------------------------------------------------------------------+
  1335. || Default Value | \<empty\> |
  1336. *----------------+-------------------------------------------------------------------+
  1337. || Valid Values | An encoded token. |
  1338. *----------------+-------------------------------------------------------------------+
  1339. || Syntax | See the note in {{Delegation}}. |
  1340. *----------------+-------------------------------------------------------------------+
  1341. See also:
  1342. {{{Renew Delegation Token}<<<RENEWDELEGATIONTOKEN>>>}},
  1343. {{{Cancel Delegation Token}<<<CANCELDELEGATIONTOKEN>>>}}
  1344. ** {Username}
  1345. *----------------+-------------------------------------------------------------------+
  1346. || Name | <<<user.name>>> |
  1347. *----------------+-------------------------------------------------------------------+
  1348. || Description | The authenticated user; see {{Authentication}}. |
  1349. *----------------+-------------------------------------------------------------------+
  1350. || Type | String |
  1351. *----------------+-------------------------------------------------------------------+
  1352. || Default Value | null |
  1353. *----------------+-------------------------------------------------------------------+
  1354. || Valid Values | Any valid username. |
  1355. *----------------+-------------------------------------------------------------------+
  1356. || Syntax | Any string. |
  1357. *----------------+-------------------------------------------------------------------+
  1358. See also:
  1359. {{Authentication}}