等寬字體 |
用於命令、HTTP 要求和回應以及程式碼區塊。 |
---|---|
<Monospaced> |
使用者輸入的值。 |
[Monospaced] |
選用值。當未指定值時,將使用預設值。 |
斜體 | 重要的片語和字詞。 |
HTTP REST API 支援 HDFS 的完整 FileSystem/FileContext 介面。操作和對應的 FileSystem/FileContext 方法顯示在下一個區段。區段 HTTP 查詢參數字典 指定參數詳細資料,例如預設值和有效值。
OPEN
(請參閱 FileSystem.open)GETFILESTATUS
(請參閱 FileSystem.getFileStatus)LISTSTATUS
(請參閱 FileSystem.listStatus)LISTSTATUS_BATCH
(請參閱 FileSystem.listStatusIterator)GETCONTENTSUMMARY
(請參閱 FileSystem.getContentSummary)GETQUOTAUSAGE
(請參閱 FileSystem.getQuotaUsage)GETFILECHECKSUM
(請參閱 FileSystem.getFileChecksum)GETHOMEDIRECTORY
(請參閱 FileSystem.getHomeDirectory)GETDELEGATIONTOKEN
(請參閱 FileSystem.getDelegationToken)GETTRASHROOT
(請參閱 FileSystem.getTrashRoot)GETXATTRS
(請參閱 FileSystem.getXAttr)GETXATTRS
(請參閱 FileSystem.getXAttrs)GETXATTRS
(請參閱 FileSystem.getXAttrs)LISTXATTRS
(請參閱 FileSystem.listXAttrs)CHECKACCESS
(請參閱 FileSystem.access)GETALLSTORAGEPOLICY
(請參閱 FileSystem.getAllStoragePolicies)GETSTORAGEPOLICY
(請參閱 FileSystem.getStoragePolicy)GETSNAPSHOTDIFF
GETSNAPSHOTTABLEDIRECTORYLIST
GETFILEBLOCKLOCATIONS
(請參閱 FileSystem.getFileBlockLocations)GETECPOLICY
(請參閱 HDFSErasureCoding.getErasureCodingPolicy)CREATE
(請參閱 FileSystem.create)MKDIRS
(請參閱 FileSystem.mkdirs)CREATESYMLINK
(請參閱 FileContext.createSymlink)RENAME
(請參閱 FileSystem.rename)SETREPLICATION
(請參閱 FileSystem.setReplication)SETOWNER
(請參閱 FileSystem.setOwner)SETPERMISSION
(請參閱 FileSystem.setPermission)SETTIMES
(請參閱 FileSystem.setTimes)RENEWDELEGATIONTOKEN
(請參閱 DelegationTokenAuthenticator.renewDelegationToken)CANCELDELEGATIONTOKEN
(請參閱 DelegationTokenAuthenticator.cancelDelegationToken)ALLOWSNAPSHOT
DISALLOWSNAPSHOT
CREATESNAPSHOT
(請參閱 FileSystem.createSnapshot)RENAMESNAPSHOT
(請參閱 FileSystem.renameSnapshot)SETXATTR
(請參閱 FileSystem.setXAttr)REMOVEXATTR
(請參閱 FileSystem.removeXAttr)SETSTORAGEPOLICY
(請參閱 FileSystem.setStoragePolicy)SATISFYSTORAGEPOLICY
(請參閱 ArchivalStorage.satisfyStoragePolicy)ENABLEECPOLICY
(請參閱 HDFSErasureCoding.enablePolicy)DISABLEECPOLICY
(請參閱 HDFSErasureCoding.disablePolicy)SETECPOLICY
(請參閱 HDFSErasureCoding.setErasureCodingPolicy)APPEND
(請參閱 FileSystem.append)CONCAT
(請參閱 FileSystem.concat)TRUNCATE
(請參閱 FileSystem.truncate)UNSETSTORAGEPOLICY
(請參閱 FileSystem.unsetStoragePolicy)UNSETECPOLICY
(請參閱 HDFSErasureCoding.unsetErasureCodingPolicy)DELETE
(請參閱 FileSystem.delete)DELETESNAPSHOT
(請參閱 FileSystem.deleteSnapshot)WebHDFS 的檔案系統架構為「webhdfs://
」。WebHDFS 檔案系統 URI 格式如下。
webhdfs://<HOST>:<HTTP_PORT>/<PATH>
上述 WebHDFS URI 對應到下列 HDFS URI。
hdfs://<HOST>:<RPC_PORT>/<PATH>
在 REST API 中,字首「/webhdfs/v1
」會插入路徑中,並在結尾附加查詢。因此,對應的 HTTP URL 格式如下。
http://<HOST>:<HTTP_PORT>/webhdfs/v1/<PATH>?op=...
請注意,如果 WebHDFS 使用 SSL 保護,則架構應為「swebhdfs://
」。
swebhdfs://<HOST>:<HTTP_PORT>/<PATH>
另請參閱:SWebHDFS 的 SSL 設定
以下是 WebHDFS 的 HDFS 設定選項。
屬性名稱 | 說明 |
---|---|
dfs.web.authentication.kerberos.principal |
HTTP 端點中 Hadoop-Auth 使用的 HTTP Kerberos 主體。根據 Kerberos HTTP SPNEGO 規範,HTTP Kerberos 主體必須以「HTTP/」開頭。值「*」將使用 keytab 中找到的所有 HTTP 主體。 |
dfs.web.authentication.kerberos.keytab |
HTTP 端點中 Hadoop-Auth 使用的 HTTP Kerberos 主體的 Kerberos keytab 檔案,其中包含憑證。 |
dfs.webhdfs.socket.connect-timeout |
在建立連線失敗前,等待連線建立的時間長度。指定為時間持續時間,即數值後接單位符號,例如 2m 表示兩分鐘。預設為 60 秒。 |
dfs.webhdfs.socket.read-timeout |
在資料到達前,等待的時間長度。預設為 60 秒。 |
當安全性為 關閉 時,經過驗證的使用者為 user.name
查詢參數中指定的使用者名稱。如果未設定 user.name
參數,伺服器可能會將經過驗證的使用者設定為預設網路使用者(如果有),或傳回錯誤回應。
當安全性為 開啟 時,驗證會透過 Hadoop 委派權杖或 Kerberos SPNEGO 執行。如果在 delegation
查詢參數中設定權杖,經過驗證的使用者會是權杖中編碼的使用者。如果未設定 delegation
參數,使用者會透過 Kerberos SPNEGO 進行驗證。
以下是使用 curl
指令工具的範例。
安全性關閉時的驗證
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?[user.name=<USER>&]op=..."
安全性開啟時,使用 Kerberos SPNEGO 進行驗證
curl -i --negotiate -u : "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=..."
安全性開啟時,使用 Hadoop 委派權杖進行驗證
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?delegation=<TOKEN>&op=..."
另請參閱:Hadoop HTTP 網路主控台的驗證
此外,WebHDFS 在用戶端支援 OAuth2。目前,Namenode 和 Datanodes 不支援使用 OAuth2 的用戶端,但實作 WebHDFS REST 介面的其他後端可能會支援。
預設情況下,WebHDFS 支援兩種 OAuth2 授權代碼(使用者提供的更新和存取權杖或使用者提供的憑證),並提供可插入的機制來實作其他 OAuth2 驗證,根據 OAuth2 RFC 或自訂驗證。在使用任一種提供的授權代碼機制時,WebHDFS 用戶端會在必要時更新存取權杖。
OAuth2 應該只對未與 Kerberos SPENGO 一起執行的用戶端啟用。
OAuth2 授權代碼機制 | 說明 | 實作授權代碼的 dfs.webhdfs.oauth2.access.token.provider 值 |
---|---|---|
授權碼授權 | 使用者提供初始存取權杖和更新權杖,然後分別用於驗證 WebHDFS 要求和取得替代存取權杖。 | org.apache.hadoop.hdfs.web.oauth2.ConfRefreshTokenBasedAccessTokenProvider |
用戶端憑證授權 | 使用者提供用於取得存取權杖的憑證,然後用於驗證 WebHDFS 要求。 | org.apache.hadoop.hdfs.web.oauth2.ConfCredentialBasedAccessTokenProvider |
下列屬性控制 OAuth2 驗證。
OAuth2 相關屬性 | 說明 |
---|---|
dfs.webhdfs.oauth2.enabled |
布林值,用於啟用/停用 OAuth2 驗證 |
dfs.webhdfs.oauth2.access.token.provider |
org.apache.hadoop.hdfs.web.oauth.AccessTokenProvider 實作的類別名稱。如上所述,程式碼中提供了兩個,或使用者可以指定使用者提供的實作。此組態金鑰的預設值為 ConfCredentialBasedAccessTokenProvider 實作。 |
dfs.webhdfs.oauth2.client.id |
用於取得存取權杖的用戶端 ID,可以是憑證或更新權杖 |
dfs.webhdfs.oauth2.refresh.url |
URL,用於張貼以取得使用憑證或更新權杖的持有者權杖 |
dfs.webhdfs.oauth2.access.token |
(如果使用 ConfRefreshTokenBasedAccessTokenProvider 則為必填) 用於驗證的初始存取權杖 |
dfs.webhdfs.oauth2.refresh.token |
(如果使用 ConfRefreshTokenBasedAccessTokenProvider 則為必填) 用於取得新存取權杖的初始更新權杖 |
dfs.webhdfs.oauth2.refresh.token.expires.ms.since.epoch |
(如果使用 ConfRefreshTokenBasedAccessTokenProvider 則為必填) 存取權杖過期時間,以自 1970 年 1 月 1 日起的毫秒數為單位。請注意,這與 OAuth 提供者提供的數值不同,並且已根據介面進行調整,以適合用戶端應用程式 |
dfs.webhdfs.oauth2.credential |
(如果使用 ConfCredentialBasedAccessTokenProvider 則為必填) 用於取得初始和後續存取權杖的憑證。 |
若要使用 SWebHDFS FileSystem (即使用 swebhdfs 協定),需要在用戶端指定 SSL 組態檔。這必須指定 3 個參數
SSL 屬性 | 說明 |
---|---|
ssl.client.truststore.location |
信任儲存檔檔案的本機檔案系統位置,其中包含 NameNode 的憑證。 |
ssl.client.truststore.type |
(選用) 信任儲存檔檔案的格式。 |
ssl.client.truststore.password |
(選用) 信任儲存檔檔案的密碼。 |
以下是 SSL 組態範例檔 (ssl-client.xml)
<configuration> <property> <name>ssl.client.truststore.location</name> <value>/work/keystore.jks</value> <description>Truststore to be used by clients. Must be specified.</description> </property> <property> <name>ssl.client.truststore.password</name> <value>changeme</value> <description>Optional. Default value is "".</description> </property> <property> <name>ssl.client.truststore.type</name> <value>jks</value> <description>Optional. Default value is "jks".</description> </property> </configuration>
SSL 組態檔必須在用戶端程式的類別路徑中,且檔名需要在 core-site.xml 中指定
<property> <name>hadoop.ssl.client.conf</name> <value>ssl-client.xml</value> <description> Resource file from which ssl client keystore information will be extracted. This file is looked up in the classpath, typically it should be in Hadoop conf/ directory. Default value is "ssl-client.xml". </description> </property>
當啟用代理使用者功能時,代理使用者 P 可以代表另一位使用者 U 提交要求。U 的使用者名稱必須在 doas
查詢參數中指定,除非在驗證中提供委派權杖。在這種情況下,P 和 U 兩位使用者的資訊都必須編碼在委派權杖中。
安全性關閉時的代理請求
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?[user.name=<USER>&]doas=<USER>&op=..."
安全性開啟時使用 Kerberos SPNEGO 的代理請求
curl -i --negotiate -u : "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?doas=<USER>&op=..."
安全性開啟時使用 Hadoop 委派令牌的代理請求
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?delegation=<TOKEN>&op=..."
WebHDFS 支援一個可選擇的、可設定的跨網站請求偽造 (CSRF) 防護機制。啟用後,WebHDFS HTTP 請求至 NameNode 或 DataNode 必須包含自訂 HTTP 標頭。設定內容允許調整受保護的特定 HTTP 方法和 HTTP 標頭名稱。標頭中傳送的值無關緊要。僅需要標頭名稱存在即可。
啟用 CSRF 防護也會設定 WebHdfsFileSystem
類別以傳送必要的標頭。這可確保 CLI 指令,例如 hdfs dfs
和 hadoop distcp
,在與 webhdfs:
URI 搭配使用時,仍能正常運作。
啟用 CSRF 防護也會設定 NameNode 網頁使用者介面以傳送必要的標頭。在啟用 CSRF 防護並重新啟動 NameNode 之後,NameNode 網頁使用者介面的現有使用者需要重新整理瀏覽器,以重新載入頁面並找到新的設定。
下列內容控制 CSRF 防護。
內容 | 說明 | 預設值 |
---|---|---|
dfs.webhdfs.rest-csrf.enabled |
如果為 true,則啟用 WebHDFS 防護,以防止跨網站請求偽造 (CSRF)。WebHDFS 用戶端也會使用這個內容來判斷是否需要在 HTTP 請求中傳送自訂 CSRF 防護標頭。 | false |
dfs.webhdfs.rest-csrf.custom-header |
HTTP 請求必須傳送的自訂標頭名稱,當透過將 dfs.webhdfs.rest-csrf.enabled 設定為 true 來為 WebHDFS 啟用防護跨網站請求偽造 (CSRF) 時。WebHDFS 用戶端也會使用這個內容來判斷是否需要在 HTTP 請求中傳送自訂 CSRF 防護標頭。 | X-XSRF-HEADER |
dfs.webhdfs.rest-csrf.methods-to-ignore |
HTTP 方法的逗號分隔清單,當透過將 dfs.webhdfs.rest-csrf.enabled 設定為 true 來為 WebHDFS 啟用防護跨網站請求偽造 (CSRF) 時,不需在 HTTP 請求中包含自訂標頭。WebHDFS 用戶端也會使用這個內容來判斷是否需要在 HTTP 請求中傳送自訂 CSRF 防護標頭。 | GET,OPTIONS,HEAD,TRACE |
dfs.webhdfs.rest-csrf.browser-useragents-regex |
逗號分隔的正規表示式清單,用於比對 HTTP 請求的 User-Agent 標頭,當透過將 dfs.webhdfs.reset-csrf.enabled 設定為 true 來為 WebHDFS 啟用防護跨網站請求偽造 (CSRF) 時。如果輸入的 User-Agent 與任何一個正規表示式相符,則請求會被視為由瀏覽器傳送,因此會強制執行 CSRF 防護。如果請求的 User-Agent 與任何一個正規表示式都不相符,則請求會被視為由瀏覽器以外的項目傳送,例如腳本自動化。在這種情況下,CSRF 不是潛在的攻擊媒介,因此不會強制執行防護。這有助於達成與現有自動化的向後相容性,而現有自動化尚未更新為傳送 CSRF 防護標頭。 | ^Mozilla.*,^Opera.* |
dfs.datanode.httpserver.filter.handlers |
以逗號分隔的 Netty servlet 風格過濾器處理常式,用於注入 Datanode WebHDFS I/O 路徑 | org.apache.hadoop.hdfs.server.datanode.web.RestCsrfPreventionFilterHandler |
以下是一個使用 -H
選項在要求中包含自訂標頭的 curl
呼叫範例。
curl -i -L -X PUT -H 'X-XSRF-HEADER: ""' 'http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATE'
WebHDFS 支援一個可選擇的、可設定的重試政策,用於復原可能會逾時的大型檔案複製,或在複製期間可能會故障轉移的高可用性叢集之間複製檔案。
下列屬性控制 WebHDFS 重試和故障轉移政策。
內容 | 說明 | 預設值 |
---|---|---|
dfs.http.client.retry.policy.enabled |
如果為「true」,啟用 WebHDFS 伺服器的重試政策。如果為「false」,關閉重試政策。 | false |
dfs.http.client.retry.policy.spec |
指定 WebHDFS 伺服器多重線性隨機重試的政策,例如給定重試次數和睡眠時間的成對 (n0, t0), (n1, t1), …,前 n0 次重試平均睡眠 t0 毫秒,接下來的 n1 次重試平均睡眠 t1 毫秒,依此類推。 | 10000,6,60000,10 |
dfs.http.client.failover.max.attempts |
指定 WebHDFS 伺服器在網路例外狀況下故障轉移的最大嘗試次數。 | 15 |
dfs.http.client.retry.max.attempts |
指定 WebHDFS 伺服器的最大重試嘗試次數,如果重試嘗試次數和故障轉移嘗試次數的差值大於最大重試嘗試次數,將不會再重試。 | 10 |
dfs.http.client.failover.sleep.base.millis |
指定 WebHDFS 伺服器計算重試或故障轉移之間指數增加的睡眠時間的毫秒數基礎量。 | 500 |
dfs.http.client.failover.sleep.max.millis |
指定 WebHDFS 伺服器重試或故障轉移之間睡眠時間的毫秒數上限。 | 15000 |
可以控制 WebHDFS 協定中資料的方向,只允許從不安全的網路寫入資料。要啟用,必須確保 dfs.datanode.httpserver.filter.handlers
包含 org.apache.hadoop.hdfs.server.datanode.web.HostRestrictingAuthorizationFilterHandler
。HostRestrictingAuthorizationFilter
的設定透過下列屬性控制。
內容 | 說明 | 預設值 |
---|---|---|
dfs.datanode.httpserver.filter.handlers |
以逗號分隔的 Netty servlet 風格過濾器處理常式,用於注入 Datanode WebHDFS I/O 路徑 | org.apache.hadoop.hdfs.server.datanode.web.RestCsrfPreventionFilterHandler |
dfs.web.authentication.host.allow.rules |
允許使用者以 使用者,網路/位元,路徑 glob 換行符號或 | 分隔的格式讀取檔案的規則。對所有 使用者 或 網路/位元 使用 * 作為萬用字元。 |
nothing - 預設為無人可透過 WebHDFS 讀取 |
步驟 1:提交 HTTP PUT 要求,不要自動追蹤重新導向,也不要傳送檔案資料。
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATE [&overwrite=<true |false>][&blocksize=<LONG>][&replication=<SHORT>] [&permission=<OCTAL>][&buffersize=<INT>][&noredirect=<true|false>]"
通常要求會重新導向至要寫入檔案資料的資料節點。
HTTP/1.1 307 TEMPORARY_REDIRECT Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE... Content-Length: 0
不過,如果您不希望自動重新導向,可以設定 noredirect 旗標。
HTTP/1.1 200 OK Content-Type: application/json {"Location":"http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE..."}
步驟 2:使用 Location
標頭中的 URL(或在您指定 noredirect 時傳回的回應)提交另一個 HTTP PUT 要求,其中包含要寫入的檔案資料。
curl -i -X PUT -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE..."
客戶端會收到一個 201 Created
回應,其內容長度為零,以及 Location
標頭中檔案的 WebHDFS URI
HTTP/1.1 201 Created Location: webhdfs://<HOST>:<PORT>/<PATH> Content-Length: 0
如果未指定權限,新建立的檔案將被指定為預設 644 權限。伺服器端不會套用 umask 模式(因此 NameNode 端設定的「fs.permissions.umask-mode」值設定不會產生作用)。
注意,使用兩步驟建立/附加的原因是為了防止客戶端在重新導向之前傳送資料。此問題已在 HTTP/1.1 中的「Expect: 100-continue
」標頭中解決;請參閱 RFC 2616,第 8.2.3 節。很不幸地,有些軟體程式庫有錯誤(例如 Jetty 6 HTTP 伺服器和 Java 6 HTTP 客戶端),無法正確實作「Expect: 100-continue
」。兩步驟建立/附加是軟體程式庫錯誤的暫時解決方法。
curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=APPEND[&buffersize=<INT>][&noredirect=<true|false>]"
通常,要求會重新導向至資料節點,檔案資料會附加到該節點
HTTP/1.1 307 TEMPORARY_REDIRECT Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND... Content-Length: 0
不過,如果您不希望自動重新導向,可以設定 noredirect 旗標。
HTTP/1.1 200 OK Content-Type: application/json {"Location":"http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND..."}
Location
標頭中的 URL(或在您指定 noredirect 的情況下傳回的回應)提交另一個 HTTP POST 要求,其中包含要附加的檔案資料。
curl -i -X POST -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND..."
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
請參閱前一節中的說明,了解此操作為何需要兩個步驟。
另請參閱:緩衝區大小
、FileSystem.append
curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CONCAT&sources=<PATHS>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:來源
、FileSystem.concat
curl -i -L "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=OPEN [&offset=<LONG>][&length=<LONG>][&buffersize=<INT>][&noredirect=<true|false>]"
通常,要求會重新導向至資料節點,檔案資料可以在該節點讀取
HTTP/1.1 307 TEMPORARY_REDIRECT Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=OPEN... Content-Length: 0
但是,如果您不想自動重新導向,可以設定 noredirect 旗標。
HTTP/1.1 200 OK Content-Type: application/json {"Location":"http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=OPEN..."}
客戶端會追蹤重新導向至資料節點,並接收檔案資料
HTTP/1.1 200 OK Content-Type: application/octet-stream Content-Length: 22 Hello, webhdfs user!
另請參閱:偏移量
、長度
、緩衝區大小
、FileSystem.open
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=MKDIRS[&permission=<OCTAL>]"
客戶端收到回應,其中包含 boolean
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"boolean": true}
如果未指定任何權限,新建立的目錄預設會具有 755 權限。伺服器端不會套用 umask 模式(因此,在 NameNode 端設定的「fs.permissions.umask-mode」值設定不會產生任何作用)。
另請參閱:permission
、FileSystem.mkdirs
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATESYMLINK &destination=<PATH>[&createParent=<true |false>]"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:destination
、createParent
、FileSystem.createSymlink
curl -i -X PUT "<HOST>:<PORT>/webhdfs/v1/<PATH>?op=RENAME&destination=<PATH>"
客戶端收到回應,其中包含 boolean
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"boolean": true}
另請參閱:destination
、FileSystem.rename
curl -i -X DELETE "http://<host>:<port>/webhdfs/v1/<path>?op=DELETE [&recursive=<true |false>]"
客戶端收到回應,其中包含 boolean
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"boolean": true}
另請參閱:recursive
、FileSystem.delete
curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=TRUNCATE&newlength=<LONG>"
客戶端收到回應,其中包含 boolean
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"boolean": true}
另請參閱:newlength
、FileSystem.truncate
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILESTATUS"
客戶端收到回應,其中包含 FileStatus
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "FileStatus": { "accessTime" : 0, "blockSize" : 0, "group" : "supergroup", "length" : 0, //in bytes, zero for directories "modificationTime": 1320173277227, "owner" : "webuser", "pathSuffix" : "", "permission" : "777", "replication" : 0, "snapshotEnabled" : true "type" : "DIRECTORY" //enum {FILE, DIRECTORY, SYMLINK} } }
另請參閱:FileSystem.getFileStatus
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTSTATUS"
客戶端收到回應,其中包含 FileStatuses
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 427 { "FileStatuses": { "FileStatus": [ { "accessTime" : 1320171722771, "blockSize" : 33554432, "childrenNum" : 0, "fileId" : 16388, "group" : "supergroup", "length" : 24930, "modificationTime": 1320171722771, "owner" : "webuser", "pathSuffix" : "a.patch", "permission" : "644", "replication" : 1, "storagePolicy" : 0, "type" : "FILE" }, { "accessTime" : 0, "blockSize" : 0, "childrenNum" : 0, "fileId" : 16389, "group" : "supergroup", "length" : 0, "modificationTime": 1320895981256, "owner" : "username", "pathSuffix" : "bar", "permission" : "711", "replication" : 0, "snapshotEnabled" : true "type" : "DIRECTORY" }, ... ] } }
另請參閱:FileSystem.listStatus
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTSTATUS"
客戶端收到回應,其中包含 FileStatuses
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 427 { "FileStatuses": { "FileStatus": [ { "accessTime" : 1320171722771, "blockSize" : 33554432, "childrenNum" : 0, "fileId" : 16390, "group" : "supergroup", "length" : 1366, "modificationTime": 1501770633062, "owner" : "webuser", "pathSuffix" : "", "permission" : "644", "replication" : 1, "storagePolicy" : 0, "type" : "FILE" } ] } }
另請參閱:FileSystem.listStatus
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTSTATUS_BATCH&startAfter=<CHILD>"
客戶端收到回應,其中包含 DirectoryListing
JSON 物件,其中包含 FileStatuses
JSON 物件,以及反覆運算資訊
HTTP/1.1 200 OK Cache-Control: no-cache Expires: Thu, 08 Sep 2016 03:40:38 GMT Date: Thu, 08 Sep 2016 03:40:38 GMT Pragma: no-cache Expires: Thu, 08 Sep 2016 03:40:38 GMT Date: Thu, 08 Sep 2016 03:40:38 GMT Pragma: no-cache Content-Type: application/json X-FRAME-OPTIONS: SAMEORIGIN Transfer-Encoding: chunked Server: Jetty(6.1.26) { "DirectoryListing": { "partialListing": { "FileStatuses": { "FileStatus": [ { "accessTime": 0, "blockSize": 0, "childrenNum": 0, "fileId": 16387, "group": "supergroup", "length": 0, "modificationTime": 1473305882563, "owner": "andrew", "pathSuffix": "bardir", "permission": "755", "replication": 0, "storagePolicy": 0, "type": "DIRECTORY" }, { "accessTime": 1473305896945, "blockSize": 1024, "childrenNum": 0, "fileId": 16388, "group": "supergroup", "length": 0, "modificationTime": 1473305896965, "owner": "andrew", "pathSuffix": "bazfile", "permission": "644", "replication": 3, "storagePolicy": 0, "type": "FILE" } ] } }, "remainingEntries": 2 } }
如果 remainingEntries
為非零,目錄中還有其他項目。若要查詢下一批次,請將 startAfter
參數設定為目前批次中最後一個項目所傳回的 pathSuffix
。例如
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTSTATUS_BATCH&startAfter=bazfile"
這將傳回下一批次的目錄項目
HTTP/1.1 200 OK Cache-Control: no-cache Expires: Thu, 08 Sep 2016 03:43:20 GMT Date: Thu, 08 Sep 2016 03:43:20 GMT Pragma: no-cache Expires: Thu, 08 Sep 2016 03:43:20 GMT Date: Thu, 08 Sep 2016 03:43:20 GMT Pragma: no-cache Content-Type: application/json X-FRAME-OPTIONS: SAMEORIGIN Transfer-Encoding: chunked Server: Jetty(6.1.26) { "DirectoryListing": { "partialListing": { "FileStatuses": { "FileStatus": [ { "accessTime": 0, "blockSize": 0, "childrenNum": 0, "fileId": 16386, "group": "supergroup", "length": 0, "modificationTime": 1473305878951, "owner": "andrew", "pathSuffix": "foodir", "permission": "755", "replication": 0, "storagePolicy": 0, "type": "DIRECTORY" }, { "accessTime": 1473305902864, "blockSize": 1024, "childrenNum": 0, "fileId": 16389, "group": "supergroup", "length": 0, "modificationTime": 1473305902878, "owner": "andrew", "pathSuffix": "quxfile", "permission": "644", "replication": 3, "storagePolicy": 0, "type": "FILE" } ] } }, "remainingEntries": 0 } }
批次大小由 NameNode 上的 dfs.ls.limit
選項控制。
另請參閱:FileSystem.listStatusIterator
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETCONTENTSUMMARY"
客戶端收到回應,其中包含 ContentSummary
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "ContentSummary": { "directoryCount": 2, "ecPolicy" : "RS-6-3-1024k", "fileCount" : 1, "length" : 24930, "quota" : -1, "spaceConsumed" : 24930, "spaceQuota" : -1, "typeQuota": { "ARCHIVE": { "consumed": 500, "quota": 10000 }, "DISK": { "consumed": 500, "quota": 10000 }, "SSD": { "consumed": 500, "quota": 10000 } } } }
另請參閱:FileSystem.getContentSummary
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETQUOTAUSAGE"
客戶端收到回應,其中包含 QuotaUsage
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "QuotaUsage": { "fileAndDirectoryCount": 1, "quota" : 100, "spaceConsumed" : 24930, "spaceQuota" : 100000, "typeQuota": { "ARCHIVE": { "consumed": 500, "quota": 10000 }, "DISK": { "consumed": 500, "quota": 10000 }, "SSD": { "consumed": 500, "quota": 10000 } } } }
另請參閱:FileSystem.getQuotaUsage
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETQUOTA &namespacequota=<QUOTA>[&storagespacequota=<QUOTA>]"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.setQuota
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETQUOTABYSTORAGETYPE &storagetype=<STORAGETYPE>&storagespacequota=<QUOTA>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.setQuotaByStorageType
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILECHECKSUM"
通常會將要求重新導向至資料節點
HTTP/1.1 307 TEMPORARY_REDIRECT Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=GETFILECHECKSUM... Content-Length: 0
不過,如果您不希望自動重新導向,可以設定 noredirect 旗標。
HTTP/1.1 200 OK Content-Type: application/json {"Location":"http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=GETFILECHECKSUM..."}
客戶端會追蹤重新導向至資料節點的動作,並收到 FileChecksum
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "FileChecksum": { "algorithm": "MD5-of-1MD5-of-512CRC32", "bytes" : "eadb10de24aa315748930df6e185c0d ...", "length" : 28 } }
另請參閱:FileSystem.getFileChecksum
curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETHOMEDIRECTORY"
客戶端收到回應,其中包含 Path
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"Path": "/user/username"}
另請參閱:FileSystem.getHomeDirectory
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETTRASHROOT"
客戶端收到回應,其中包含 Path
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"Path": "/user/username/.Trash"}
如果路徑是加密區域路徑,且使用者有該路徑的權限,客戶端會收到類似這樣的回應
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"Path": "/PATH/.Trash/username"}
另請參閱:FileSystem.getTrashRoot
有關加密區域中資源回收筒根目錄的詳細資訊,請參閱 透明加密指南。
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETPERMISSION [&permission=<OCTAL>]"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:permission
、FileSystem.setPermission
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETOWNER [&owner=<USER>][&group=<GROUP>]"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:owner
、group
、FileSystem.setOwner
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETREPLICATION [&replication=<SHORT>]"
客戶端收到回應,其中包含 boolean
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"boolean": true}
另請參閱:replication
、FileSystem.setReplication
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETTIMES [&modificationtime=<TIME>][&accesstime=<TIME>]"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:modificationtime
、accesstime
、FileSystem.setTimes
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=MODIFYACLENTRIES &aclspec=<ACLSPEC>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.modifyAclEntries
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEACLENTRIES &aclspec=<ACLSPEC>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.removeAclEntries
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEDEFAULTACL"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.removeDefaultAcl
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEACL"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.removeAcl
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETACL &aclspec=<ACLSPEC>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.setAcl
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETACLSTATUS"
用戶端收到回應,其中包含 AclStatus
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "AclStatus": { "entries": [ "user:carla:rw-", "group::r-x" ], "group": "supergroup", "owner": "hadoop", "permission":"775", "stickyBit": false } }
另請參閱:FileSystem.getAclStatus
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CHECKACCESS &fsaction=<FSACTION>
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.access
curl -i "http://<HOST>:<PORT>/webhdfs/v1?op=GETALLSTORAGEPOLICY"
用戶端收到回應,其中包含 BlockStoragePolicies
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "BlockStoragePolicies": { "BlockStoragePolicy": [ { "copyOnCreateFile": false, "creationFallbacks": [], "id": 2, "name": "COLD", "replicationFallbacks": [], "storageTypes": ["ARCHIVE"] }, { "copyOnCreateFile": false, "creationFallbacks": ["DISK","ARCHIVE"], "id": 5, "name": "WARM", "replicationFallbacks": ["DISK","ARCHIVE"], "storageTypes": ["DISK","ARCHIVE"] }, { "copyOnCreateFile": false, "creationFallbacks": [], "id": 7, "name": "HOT", "replicationFallbacks": ["ARCHIVE"], "storageTypes": ["DISK"] }, { "copyOnCreateFile": false, "creationFallbacks": ["SSD","DISK"], "id": 10,"name": "ONE_SSD", "replicationFallbacks": ["SSD","DISK"], "storageTypes": ["SSD","DISK"] }, { "copyOnCreateFile": false, "creationFallbacks": ["DISK"], "id": 12, "name": "ALL_SSD", "replicationFallbacks": ["DISK"], "storageTypes": ["SSD"] }, { "copyOnCreateFile": true, "creationFallbacks": ["DISK"], "id": 15, "name": "LAZY_PERSIST", "replicationFallbacks": ["DISK"], "storageTypes": ["RAM_DISK","DISK"] } ] } }
另請參閱:FileSystem.getAllStoragePolicies
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETSTORAGEPOLICY &storagepolicy=<policy>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.setStoragePolicy
curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=UNSETSTORAGEPOLICY"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.unsetStoragePolicy
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETSTORAGEPOLICY"
用戶端收到回應,其中包含 BlockStoragePolicy
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "BlockStoragePolicy": { "copyOnCreateFile": false, "creationFallbacks": [], "id":7, "name":"HOT", "replicationFallbacks":["ARCHIVE"], "storageTypes":["DISK"] } }
另請參閱:FileSystem.getStoragePolicy
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SATISFYSTORAGEPOLICY"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:ArchivalStorage.satisfyStoragePolicy
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILEBLOCKLOCATIONS
用戶端收到回應,其中包含 BlockLocations
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "BlockLocations" : { "BlockLocation": [ { "cachedHosts" : [], "corrupt" : false, "hosts" : ["host"], "length" : 134217728, // length of this block "names" : ["host:ip"], "offset" : 0, // offset of the block in the file "storageTypes" : ["DISK"], // enum {RAM_DISK, SSD, DISK, ARCHIVE} "topologyPaths" : ["/default-rack/hostname:ip"] }, { "cachedHosts" : [], "corrupt" : false, "hosts" : ["host"], "length" : 62599364, "names" : ["host:ip"], "offset" : 134217728, "storageTypes" : ["DISK"], "topologyPaths" : ["/default-rack/hostname:ip"] }, ... ] } }
另請參閱:offset
、length
、FileSystem.getFileBlockLocations
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETXATTR &xattr.name=<XATTRNAME>&xattr.value=<XATTRVALUE> &flag=<FLAG>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.setXAttr
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEXATTR &xattr.name=<XATTRNAME>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.removeXAttr
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETXATTRS &xattr.name=<XATTRNAME>&encoding=<ENCODING>"
用戶端收到回應,其中包含 XAttrs
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "XAttrs": [ { "name":"XATTRNAME", "value":"XATTRVALUE" } ] }
另請參閱:FileSystem.getXAttr
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETXATTRS &xattr.name=<XATTRNAME1>&xattr.name=<XATTRNAME2> &encoding=<ENCODING>"
用戶端收到回應,其中包含 XAttrs
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "XAttrs": [ { "name":"XATTRNAME1", "value":"XATTRVALUE1" }, { "name":"XATTRNAME2", "value":"XATTRVALUE2" } ] }
另請參閱:FileSystem.getXAttrs
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETXATTRS &encoding=<ENCODING>"
用戶端收到回應,其中包含 XAttrs
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "XAttrs": [ { "name":"XATTRNAME1", "value":"XATTRVALUE1" }, { "name":"XATTRNAME2", "value":"XATTRVALUE2" }, { "name":"XATTRNAME3", "value":"XATTRVALUE3" } ] }
另請參閱:FileSystem.getXAttrs
curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTXATTRS"
客戶端會收到回應,其中包含 XAttrNames
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "XAttrNames":"[\"XATTRNAME1\",\"XATTRNAME2\",\"XATTRNAME3\"]" }
另請參閱:FileSystem.listXAttrs
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=ENABLEECPOLICY &ecpolicy=<policy>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:HDFSErasureCoding.enablePolicy
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=DISABLEECPOLICY &ecpolicy=<policy>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:HDFSErasureCoding.disablePolicy
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETECPOLICY &ecpolicy=<policy>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:HDFSErasureCoding.setErasureCodingPolicy
curl -i -X GET "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETECPOLICY "
客戶端會收到回應,其中包含 ECPolicy
JSON 物件
{ "name": "RS-10-4-1024k", "schema": { "codecName": "rs", "numDataUnits": 10, "numParityUnits": 4, "extraOptions": {} } "cellSize": 1048576, "id":5, "codecname":"rs", "numDataUnits": 10, "numParityUnits": 4, "replicationpolicy":false, "systemPolicy":true }
另請參閱:HDFSErasureCoding.getErasureCodingPolicy
curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=UNSETECPOLICY "
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:HDFSErasureCoding.unsetErasureCodingPolicy
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=ALLOWSNAPSHOT"
客戶端會收到回應,其中包含零內容長度,表示成功
HTTP/1.1 200 OK Content-Length: 0
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=DISALLOWSNAPSHOT"
客戶端會收到回應,其中包含零內容長度,表示成功
HTTP/1.1 200 OK Content-Length: 0
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATESNAPSHOT[&snapshotname=<SNAPSHOTNAME>]"
客戶端收到回應,其中包含 Path
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"Path": "/user/username/.snapshot/s1"}
另請參閱:FileSystem.createSnapshot
curl -i -X DELETE "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=DELETESNAPSHOT&snapshotname=<SNAPSHOTNAME>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.deleteSnapshot
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=RENAMESNAPSHOT &oldsnapshotname=<SNAPSHOTNAME>&snapshotname=<SNAPSHOTNAME>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:FileSystem.renameSnapshot
curl -i GET "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETSNAPSHOTDIFF &oldsnapshotname=<SNAPSHOTNAME>&snapshotname=<SNAPSHOTNAME>"
客戶端會收到回應,其中包含 SnapshotDiffReport
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"SnapshotDiffReport":{"diffList":[],"fromSnapshot":"s3","snapshotRoot":"/foo","toSnapshot":"s4"}}
curl -i GET "http://<HOST>:<PORT>/webhdfs/v1/?user.name=<USER>&op=GETSNAPSHOTTABLEDIRECTORYLIST"
如果 USER 不是 hdfs 超級使用者,呼叫只會列出使用者擁有的可建立快照目錄。如果 USER 是 hdfs 超級使用者,呼叫會列出所有可建立快照的目錄。客戶端會收到回應,其中包含 SnapshottableDirectoryList
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "SnapshottableDirectoryList": [ { "dirStatus": { "accessTime":0, "blockSize":0, "childrenNum":0, "fileId":16386, "group":"hadoop", "length":0, "modificationTime":1520761889225, "owner":"random", "pathSuffix":"bar", "permission":"755", "replication":0, "storagePolicy":0, "type":"DIRECTORY" }, "parentFullPath":"/", "snapshotNumber":0, "snapshotQuota":65536 } ] }
curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETDELEGATIONTOKEN [&renewer=<USER>][&service=<SERVICE>][&kind=<KIND>]"
客戶端會收到回應,其中包含 Token
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked { "Token": { "urlString": "JQAIaG9y..." } }
另請參閱:更新者
、FileSystem.getDelegationToken、種類
、服務
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=RENEWDELEGATIONTOKEN&token=<TOKEN>"
客戶端會收到回應,其中包含 long
JSON 物件
HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked {"long": 1320962673997} //the new expiration time
另請參閱:權杖
、DelegationTokenAuthenticator.renewDelegationToken
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=CANCELDELEGATIONTOKEN&token=<TOKEN>"
客戶端會收到內容長度為零的回應
HTTP/1.1 200 OK Content-Length: 0
另請參閱:權杖
、DelegationTokenAuthenticator.cancelDelegationToken
當操作失敗時,伺服器可能會擲回例外。錯誤回應的 JSON 架構定義於 RemoteException JSON 架構 中。下表顯示從例外對應到 HTTP 回應代碼的對應。
例外 | HTTP 回應代碼 |
---|---|
IllegalArgumentException |
400 錯誤的請求 |
UnsupportedOperationException |
400 錯誤的請求 |
SecurityException |
401 未授權 |
IOException |
403 禁止 |
FileNotFoundException |
404 找不到 |
RuntimeException |
500 內部伺服器錯誤 |
以下是例外回應的範例。
HTTP/1.1 400 Bad Request Content-Type: application/json Transfer-Encoding: chunked { "RemoteException": { "exception" : "IllegalArgumentException", "javaClassName": "java.lang.IllegalArgumentException", "message" : "Invalid value for webhdfs parameter \"permission\": ..." } }
HTTP/1.1 401 Unauthorized Content-Type: application/json Transfer-Encoding: chunked { "RemoteException": { "exception" : "SecurityException", "javaClassName": "java.lang.SecurityException", "message" : "Failed to obtain user group information: ..." } }
HTTP/1.1 403 Forbidden Content-Type: application/json Transfer-Encoding: chunked { "RemoteException": { "exception" : "AccessControlException", "javaClassName": "org.apache.hadoop.security.AccessControlException", "message" : "Permission denied: ..." } }
HTTP/1.1 404 Not Found Content-Type: application/json Transfer-Encoding: chunked { "RemoteException": { "exception" : "FileNotFoundException", "javaClassName": "java.io.FileNotFoundException", "message" : "File does not exist: /foo/a.patch" } }
除了 OPEN
以外的所有操作,會傳回零長度回應或 JSON 回應。對於 OPEN
,回應是八位元串流。JSON 架構如下所示。請參閱 draft-zyp-json-schema-03 以取得 JSON 架構的語法定義。
請注意,additionalProperties
的預設值是空架構,允許任何值用於額外的屬性。因此,所有 WebHDFS JSON 回應允許任何額外的屬性。但是,如果額外的屬性包含在回應中,它們會被視為選用屬性,以維持相容性。
{ "name" : "AclStatus", "properties": { "AclStatus": { "type" : "object", "properties": { "entries": { "type": "array", "items": { "description": "ACL entry.", "type": "string" } }, "group": { "description": "The group owner.", "type" : "string", "required" : true }, "owner": { "description": "The user who is the owner.", "type" : "string", "required" : true }, "stickyBit": { "description": "True if the sticky bit is on.", "type" : "boolean", "required" : true } } } } }
{ "name" : "XAttrs", "properties": { "XAttrs": { "type" : "array", "items": { "type" : "object", "properties": { "name": { "description": "XAttr name.", "type" : "string", "required" : true }, "value": { "description": "XAttr value.", "type" : "string" } } } } } }
{ "name" : "XAttrNames", "properties": { "XAttrNames": { "description": "XAttr names.", "type" : "string", "required" : true } } }
{ "name" : "boolean", "properties": { "boolean": { "description": "A boolean value", "type" : "boolean", "required" : true } } }
另請參閱:MKDIRS
、RENAME
、DELETE
、SETREPLICATION
{ "name" : "ContentSummary", "properties": { "ContentSummary": { "type" : "object", "properties": { "directoryCount": { "description": "The number of directories.", "type" : "integer", "required" : true }, "fileCount": { "description": "The number of files.", "type" : "integer", "required" : true }, "length": { "description": "The number of bytes used by the content.", "type" : "integer", "required" : true }, "quota": { "description": "The namespace quota of this directory.", "type" : "integer", "required" : true }, "spaceConsumed": { "description": "The disk space consumed by the content.", "type" : "integer", "required" : true }, "spaceQuota": { "description": "The disk space quota.", "type" : "integer", "required" : true }, "typeQuota": { "type" : "object", "properties": { "ARCHIVE": { "type" : "object", "properties": { "consumed": { "description": "The storage type space consumed.", "type" : "integer", "required" : true }, "quota": { "description": "The storage type quota.", "type" : "integer", "required" : true } } }, "DISK": { "type" : "object", "properties": { "consumed": { "description": "The storage type space consumed.", "type" : "integer", "required" : true }, "quota": { "description": "The storage type quota.", "type" : "integer", "required" : true } } }, "SSD": { "type" : "object", "properties": { "consumed": { "description": "The storage type space consumed.", "type" : "integer", "required" : true }, "quota": { "description": "The storage type quota.", "type" : "integer", "required" : true } } } } } } } } }
另請參閱:GETCONTENTSUMMARY
{ "name" : "QuotaUsage", "properties": { "QuotaUsage": { "type" : "object", "properties": { "fileAndDirectoryCount": { "description": "The number of files and directories.", "type" : "integer", "required" : true }, "quota": { "description": "The namespace quota of this directory.", "type" : "integer", "required" : true }, "spaceConsumed": { "description": "The disk space consumed by the content.", "type" : "integer", "required" : true }, "spaceQuota": { "description": "The disk space quota.", "type" : "integer", "required" : true }, "typeQuota": { "type" : "object", "properties": { "ARCHIVE": { "type" : "object", "properties": { "consumed": { "description": "The storage type space consumed.", "type" : "integer", "required" : true }, "quota": { "description": "The storage type quota.", "type" : "integer", "required" : true } } }, "DISK": { "type" : "object", "properties": { "consumed": { "description": "The storage type space consumed.", "type" : "integer", "required" : true }, "quota": { "description": "The storage type quota.", "type" : "integer", "required" : true } } }, "SSD": { "type" : "object", "properties": { "consumed": { "description": "The storage type space consumed.", "type" : "integer", "required" : true }, "quota": { "description": "The storage type quota.", "type" : "integer", "required" : true } } } } } } } } }
另請參閱:GETQUOTAUSAGE
{ "name" : "FileChecksum", "properties": { "FileChecksum": { "type" : "object", "properties": { "algorithm": { "description": "The name of the checksum algorithm.", "type" : "string", "required" : true }, "bytes": { "description": "The byte sequence of the checksum in hexadecimal.", "type" : "string", "required" : true }, "length": { "description": "The length of the bytes (not the length of the string).", "type" : "integer", "required" : true } } } } }
{ "name" : "FileStatus", "properties": { "FileStatus": fileStatusProperties //See FileStatus Properties } }
另請參閱:FileStatus
屬性、GETFILESTATUS
、FileStatus
JavaScript 語法用於定義 fileStatusProperties
,以便可以在 FileStatus
和 FileStatuses
JSON 架構中參考它。
var fileStatusProperties = { "type" : "object", "properties": { "accessTime": { "description": "The access time.", "type" : "integer", "required" : true }, "blockSize": { "description": "The block size of a file.", "type" : "integer", "required" : true }, "group": { "description": "The group owner.", "type" : "string", "required" : true }, "length": { "description": "The number of bytes in a file.", "type" : "integer", "required" : true }, "modificationTime": { "description": "The modification time.", "type" : "integer", "required" : true }, "owner": { "description": "The user who is the owner.", "type" : "string", "required" : true }, "pathSuffix": { "description": "The path suffix.", "type" : "string", "required" : true }, "permission": { "description": "The permission represented as a octal string.", "type" : "string", "required" : true }, "replication": { "description": "The number of replication of a file.", "type" : "integer", "required" : true }, "symlink": //an optional property { "description": "The link target of a symlink.", "type" : "string" }, "type": { "description": "The type of the path object.", "enum" : ["FILE", "DIRECTORY", "SYMLINK"], "required" : true } } };
FileStatuses
JSON 物件表示 FileStatus
JSON 物件陣列。
{ "name" : "FileStatuses", "properties": { "FileStatuses": { "type" : "object", "properties": { "FileStatus": { "description": "An array of FileStatus", "type" : "array", "items" : fileStatusProperties //See FileStatus Properties } } } } }
DirectoryListing
JSON 物件表示目錄條目的批次,同時反覆列出目錄。它包含 FileStatuses
JSON 物件以及反覆運算資訊。
{ "name" : "DirectoryListing", "properties": { "DirectoryListing": { "type" : "object", "properties": { "partialListing": { "description": "A partial directory listing", "type" : "object", // A FileStatuses object "required" : true }, "remainingEntries": { "description": "Number of remaining entries", "type" : "integer", "required" : true } } } } }
{ "name" : "long", "properties": { "long": { "description": "A long integer value", "type" : "integer", "required" : true } } }
另請參閱:RENEWDELEGATIONTOKEN
、
{ "name" : "Path", "properties": { "Path": { "description": "The string representation a Path.", "type" : "string", "required" : true } } }
另請參閱:GETHOMEDIRECTORY
、Path
{ "name" : "RemoteException", "properties": { "RemoteException": { "type" : "object", "properties": { "exception": { "description": "Name of the exception", "type" : "string", "required" : true }, "message": { "description": "Exception message", "type" : "string", "required" : true }, "javaClassName": //an optional property { "description": "Java class name of the exception", "type" : "string" } } } } }
另請參閱:錯誤回應
{ "name" : "Token", "properties": { "Token": tokenProperties //See Token Properties } }
另請參閱:Token
屬性、GETDELEGATIONTOKEN
、委派 中的注意事項。
JavaScript 語法用於定義 tokenProperties
,以便可以在 Token
JSON 架構中參考它。
var tokenProperties = { "type" : "object", "properties": { "urlString": { "description": "A delegation token encoded as a URL safe string.", "type" : "string", "required" : true } } }
{ "name" : "BlockStoragePolicy", "properties": { "BlockStoragePolicy": blockStoragePolicyProperties //See BlockStoragePolicy Properties } }
另請參閱:BlockStoragePolicy
屬性、GETSTORAGEPOLICY
JavaScript 語法用於定義 blockStoragePolicyProperties
,以便可以在 BlockStoragePolicy
和 BlockStoragePolicies
JSON 架構中參考它。
var blockStoragePolicyProperties = { "type" : "object", "properties": { "id": { "description": "Policy ID.", "type" : "integer", "required" : true }, "name": { "description": "Policy name.", "type" : "string", "required" : true }, "storageTypes": { "description": "An array of storage types for block placement.", "type" : "array", "required" : true "items" : { "type": "string" } }, "replicationFallbacks": { "description": "An array of fallback storage types for replication.", "type" : "array", "required" : true "items" : { "type": "string" } }, "creationFallbacks": { "description": "An array of fallback storage types for file creation.", "type" : "array", "required" : true "items" : { "type": "string" } }, "copyOnCreateFile": { "description": "If set then the policy cannot be changed after file creation.", "type" : "boolean", "required" : true } } };
{ "name": "RS-10-4-1024k", schema { "codecName": "rs", "numDataUnits": 10, "numParityUnits": 4, "extraOptions": {} } "cellSize": 1048576, "id":5, "codecname":"rs", "numDataUnits": 10, "numParityUnits": 4, "replicationpolicy":false, "systemPolicy":true }
BlockStoragePolicies
JSON 物件表示 BlockStoragePolicy
JSON 物件陣列。
{ "name" : "BlockStoragePolicies", "properties": { "BlockStoragePolicies": { "type" : "object", "properties": { "BlockStoragePolicy": { "description": "An array of BlockStoragePolicy", "type" : "array", "items" : blockStoragePolicyProperties //See BlockStoragePolicy Properties } } } } }
{ "name": "SnapshotDiffReport", "type": "object", "properties": { "SnapshotDiffReport": { "type" : "object", "properties" : { "diffList": { "description": "An array of DiffReportEntry", "type" : "array", "items" : diffReportEntries, "required" : true }, "fromSnapshot": { "description": "Source snapshot", "type" : "string", "required" : true }, "snapshotRoot": { "description" : "String representation of snapshot root path", "type" : "string", "required" : true }, "toSnapshot": { "description" : "Destination snapshot", "type" : "string", "required" : true } } } } }
使用 JavaScript 語法定義 diffReportEntries
,以便可以在 SnapshotDiffReport
JSON 架構中參照它。
var diffReportEntries = { "type": "object", "properties": { "sourcePath": { "description" : "Source path name relative to snapshot root", "type" : "string", "required" : true }, "targetPath": { "description" : "Target path relative to snapshot root used for renames", "type" : "string", "required" : true }, "type": { "description" : "Type of diff report entry", "enum" : ["CREATE", "MODIFY", "DELETE", "RENAME"], "required" : true } } }
{ "name": "SnapshottableDirectoryList", "type": "object", "properties": { "SnapshottableDirectoryList": { "description": "An array of SnapshottableDirectoryStatus", "type" : "array", "items" : snapshottableDirectoryStatus, "required" : true } } }
使用 JavaScript 語法定義 snapshottableDirectoryStatus
,以便可以在 SnapshottableDirectoryList
JSON 架構中參照它。
var snapshottableDirectoryStatus = { "type": "object", "properties": { "dirStatus": fileStatusProperties, "parentFullPath": { "description" : "Full path of the parent of snapshottable directory", "type" : "string", "required" : true }, "snapshotNumber": { "description" : "Number of snapshots created on the snapshottable directory", "type" : "integer", "required" : true }, "snapshotQuota": { "description" : "Total number of snapshots allowed on the snapshottable directory", "type" : "integer", "required" : true } } }
BlockLocations
JSON 物件表示 BlockLocation
JSON 物件陣列。
{ "name" : "BlockLocations", "properties": { "BlockLocations": { "type" : "object", "properties": { "BlockLocation": { "description": "An array of BlockLocation", "type" : "array", "items" : blockLocationProperties //See BlockLocation Properties } } } } }
{ "name" : "BlockLocation", "properties": { "BlockLocation": blockLocationProperties //See BlockLocation Properties } }
另請參閱 BlockLocation
屬性、GETFILEBLOCKLOCATIONS
、BlockLocation
使用 JavaScript 語法定義 blockLocationProperties
,以便可以在 BlockLocation
和 BlockLocations
JSON 架構中參照它。
var blockLocationProperties = { "type" : "object", "properties": { "cachedHosts": { "description": "Datanode hostnames with a cached replica", "type" : "array", "required" : "true", "items" : { "description": "A datanode hostname", "type" : "string" } }, "corrupt": { "description": "True if the block is corrupted", "type" : "boolean", "required" : "true" }, "hosts": { "description": "Datanode hostnames store the block", "type" : "array", "required" : "true", "items" : { "description": "A datanode hostname", "type" : "string" } }, "length": { "description": "Length of the block", "type" : "integer", "required" : "true" }, "names": { "description": "Datanode IP:xferPort for accessing the block", "type" : "array", "required" : "true", "items" : { "description": "DatanodeIP:xferPort", "type" : "string" } }, "offset": { "description": "Offset of the block in the file", "type" : "integer", "required" : "true" }, "storageTypes": { "description": "Storage type of each replica", "type" : "array", "required" : "true", "items" : { "description": "Storage type", "enum" : ["RAM_DISK", "SSD", "DISK", "ARCHIVE"] } }, "topologyPaths": { "description": "Datanode addresses in network topology", "type" : "array", "required" : "true", "items" : { "description": "/rack/host:ip", "type" : "string" } } } };
名稱 | aclspec |
---|---|
說明 | 包含在 ACL 修改作業中的 ACL 規範。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 請參閱 權限和 HDFS。 |
語法 | 請參閱 權限和 HDFS。 |
名稱 | xattr.name |
---|---|
說明 | 檔案/目錄的 XAttr 名稱。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 任何字串,開頭為 user./trusted./system./security.. |
語法 | 任何字串,開頭為 user./trusted./system./security.. |
名稱 | xattr.value |
---|---|
說明 | 檔案/目錄的 XAttr 值。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 編碼值。 |
語法 | 用雙引號括起來或開頭為 0x 或 0s。 |
另請參閱:延伸屬性
名稱 | flag |
---|---|
說明 | XAttr 設定旗標。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | CREATE、REPLACE。 |
語法 | CREATE、REPLACE。 |
另請參閱:延伸屬性
名稱 | encoding | ||
---|---|---|---|
說明 | XAttr 值編碼。 | ||
類型 | 字串 | ||
預設值 | <empty> | ||
有效值 | text | hex | base64 |
語法 | text | hex | base64 |
另請參閱:延伸屬性
名稱 | accesstime |
---|---|
說明 | 檔案/目錄的存取時間。 |
類型 | long |
預設值 | -1(表示保持不變) |
有效值 | -1 或時間戳記 |
語法 | 任何整數。 |
另請參閱:SETTIMES
名稱 | blocksize |
---|---|
說明 | 檔案的區塊大小。 |
類型 | long |
預設值 | 在組態中指定。 |
有效值 | > 0 |
語法 | 任何整數。 |
另請參閱:CREATE
名稱 | 緩衝區大小 |
---|---|
說明 | 傳輸資料時所使用的緩衝區大小。 |
類型 | int |
預設值 | 在組態中指定。 |
有效值 | > 0 |
語法 | 任何整數。 |
名稱 | createflag |
---|---|
說明 | 建立檔案時可能處理的旗標列舉 |
類型 | 列舉字串 |
預設值 | <empty> |
有效值 | 建立、覆寫、附加和同步區塊的合法組合 |
語法 | 請參閱下方的註解 |
下列組合無效:* 附加、建立 * 建立、附加、覆寫
另請參閱:CREATE
名稱 | createparent |
---|---|
說明 | 如果父目錄不存在,是否應該建立? |
類型 | 布林值 |
預設值 | true |
有效值 | true、false |
語法 | true |
另請參閱:CREATESYMLINK
名稱 | delegation |
---|---|
說明 | 用於驗證的委派權杖。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 編碼權杖。 |
語法 | 請參閱下方的註解。 |
請注意委派權杖編碼為 URL 安全字串;請參閱 org.apache.hadoop.security.token.Token
中的 encodeToUrlString()
和 decodeFromUrlString(String)
以了解編碼詳細資訊。
另請參閱:驗證
名稱 | destination |
---|---|
說明 | 目的地路徑。 |
類型 | 路徑 |
預設值 | <empty>(無效路徑) |
有效值 | 不含架構和授權的絕對檔案系統路徑。 |
語法 | 任何路徑。 |
另請參閱:CREATESYMLINK
、RENAME
名稱 | doas |
---|---|
說明 | 允許代理使用者以其他使用者的身分執行。 |
類型 | 字串 |
預設值 | null |
有效值 | 任何有效的使用者名稱。 |
語法 | 任何字串。 |
另請參閱:代理使用者
名稱 | fsaction |
---|---|
說明 | 檔案系統操作讀取/寫入/執行 |
類型 | 字串 |
預設值 | null(無效值) |
有效值 | 符合正規表示式模式 "[r-][w-][x-] " 的字串 |
語法 | "[r-][w-][x-] " |
另請參閱:CHECKACCESS
、
名稱 | group |
---|---|
說明 | 群組名稱。 |
類型 | 字串 |
預設值 | <empty>(表示保持不變) |
有效值 | 任何有效的群組名稱。 |
語法 | 任何字串。 |
另請參閱:SETOWNER
名稱 | length |
---|---|
說明 | 要處理的位元組數。 |
類型 | long |
預設值 | null(表示整個檔案) |
有效值 | >= 0 或 null |
語法 | 任何整數。 |
另請參閱:OPEN
名稱 | modificationtime |
---|---|
說明 | 檔案/目錄的修改時間。 |
類型 | long |
預設值 | -1(表示保持不變) |
有效值 | -1 或時間戳記 |
語法 | 任何整數。 |
另請參閱:SETTIMES
名稱 | newlength |
---|---|
說明 | 要將檔案截斷為的大小。 |
類型 | long |
有效值 | >= 0 |
語法 | 任何長度。 |
名稱 | offset |
---|---|
說明 | 起始位元組位置。 |
類型 | long |
預設值 | 0 |
有效值 | >= 0 |
語法 | 任何整數。 |
另請參閱:OPEN
名稱 | oldsnapshotname |
---|---|
說明 | 要重新命名的舊快照名稱。 |
類型 | 字串 |
預設值 | null |
有效值 | 現有的快照名稱。 |
語法 | 任何字串。 |
另請參閱:RENAMESNAPSHOT
名稱 | op |
---|---|
說明 | 要執行的操作名稱。 |
類型 | 列舉 |
預設值 | null(無效值) |
有效值 | 任何有效的操作名稱。 |
語法 | 任何字串。 |
另請參閱:操作
名稱 | overwrite |
---|---|
說明 | 如果檔案已存在,是否應覆寫? |
類型 | 布林值 |
預設值 | false |
有效值 | true |
語法 | true |
另請參閱:CREATE
名稱 | owner |
---|---|
說明 | 擁有檔案/目錄的使用者名稱。 |
類型 | 字串 |
預設值 | <empty>(表示保持不變) |
有效值 | 任何有效的使用者名稱。 |
語法 | 任何字串。 |
另請參閱:SETOWNER
名稱 | permission |
---|---|
說明 | 檔案/目錄的權限。 |
類型 | 八進位 |
預設值 | 檔案為 644,目錄為 755 |
有效值 | 0 - 1777 |
語法 | 任何基數 8 整數(可以省略前導零。) |
另請參閱:CREATE
、MKDIRS
、SETPERMISSION
名稱 | recursive |
---|---|
說明 | 操作是否應作用於子目錄中的內容? |
類型 | 布林值 |
預設值 | false |
有效值 | true |
語法 | true |
另請參閱:RENAME
名稱 | renewer |
---|---|
說明 | 委派權杖更新者的使用者名稱。 |
類型 | 字串 |
預設值 | <empty>(表示目前的使用者) |
有效值 | 任何有效的使用者名稱。 |
語法 | 任何字串。 |
另請參閱:GETDELEGATIONTOKEN
名稱 | replication |
---|---|
說明 | 檔案的複製次數。 |
類型 | short |
預設值 | 在組態中指定。 |
有效值 | > 0 |
語法 | 任何整數。 |
另請參閱:CREATE
、SETREPLICATION
名稱 | snapshotname |
---|---|
說明 | 要建立/刪除的快照名稱。或快照重新命名的新的名稱。 |
類型 | 字串 |
預設值 | null |
有效值 | 任何有效的快照名稱。 |
語法 | 任何字串。 |
名稱 | sources |
---|---|
說明 | 來源路徑清單。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 不含方案和授權的逗號分隔絕對 FileSystem 路徑清單。 |
語法 | 任何字串。 |
另請參閱:CONCAT
名稱 | token |
---|---|
說明 | 用於操作的委派權杖。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 編碼權杖。 |
語法 | 請參閱 委派 中的注意事項。 |
名稱 | kind |
---|---|
說明 | 要求的委派權杖種類 |
類型 | 字串 |
預設值 | <empty>(伺服器設定服務的預設種類) |
有效值 | 代表令牌類型的字串,例如「HDFS_DELEGATION_TOKEN」或「WEBHDFS delegation」 |
語法 | 任何字串。 |
另請參閱:GETDELEGATIONTOKEN
名稱 | 服務 |
---|---|
說明 | 令牌應使用的服務名稱,例如名稱節點的 ip:port |
類型 | 字串 |
預設值 | <empty> |
有效值 | 字串格式的 ip:port 或服務的邏輯名稱 |
語法 | 任何字串。 |
另請參閱:GETDELEGATIONTOKEN
名稱 | user.name |
---|---|
說明 | 經過驗證的使用者;請參閱 驗證。 |
類型 | 字串 |
預設值 | null |
有效值 | 任何有效的使用者名稱。 |
語法 | 任何字串。 |
另請參閱:驗證
名稱 | noredirect |
---|---|
說明 | 回應應傳回 HTTP 307 重新導向或 HTTP 200 OK。請參閱 建立檔案並寫入檔案。 |
類型 | 布林值 |
預設值 | false |
有效值 | true |
語法 | true |
另請參閱:建立檔案並寫入檔案
名稱 | namespacequota |
---|---|
說明 | 目錄下命名空間使用限制,即檔案/目錄數量。 |
類型 | 字串 |
預設值 | Long.MAX_VALUE |
有效值 | > 0. |
語法 | 任何整數。 |
另請參閱:SETQUOTA
名稱 | storagespacequota |
---|---|
說明 | 目錄下儲存空間使用限制(以位元組為單位,包括複製)。 |
類型 | 字串 |
預設值 | Long.MAX_VALUE |
有效值 | > 0. |
語法 | 任何整數。 |
名稱 | storagetype |
---|---|
說明 | 要修改的特定儲存類型配額的儲存類型。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 任何有效的儲存類型。 |
語法 | 任何字串。 |
名稱 | storagepolicy |
---|---|
說明 | 儲存政策的名稱。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 任何有效的儲存政策名稱;請參閱 GETALLSTORAGEPOLICY。 |
語法 | 任何字串。 |
另請參閱:SETSTORAGEPOLICY
名稱 | ecpolicy |
---|---|
說明 | 刪除編碼政策的名稱。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 任何有效的刪除編碼政策名稱; |
語法 | 任何字串。 |
另請參閱:ENABLEECPOLICY
或 DISABLEECPOLICY
名稱 | startAfter |
---|---|
說明 | liststatus 批次中傳回的最後一個項目。 |
類型 | 字串 |
預設值 | <empty> |
有效值 | 任何有效的檔案/目錄名稱。 |
語法 | 任何字串。 |
另請參閱:LISTSTATUS_BATCH