WebHDFS REST API

WebHDFS REST API

HDFS의 전체 FileSystem/FileContext 인터페이스를 지원하는 HTTP REST API를 설명하는 문서예요. 인증, SSL, 프록시 사용자, CSRF 방지, 파일·디렉터리·스토리지 정책·XAttr·EC·스냅샷·위임 토큰 연산, JSON 스키마, HTTP 쿼리 파라미터 사전을 다룹니다.

출처: 문서

문서 규칙 (Document Conventions)

Monospaced | 명령, HTTP 요청·응답, 코드 블록에 사용됩니다.
<Monospaced> | 사용자가 입력한 값.
[Monospaced] | 선택 값. 값이 지정되지 않으면 기본값이 사용됩니다.
Italics | 중요한 구절과 단어.

소개 (Introduction)

HTTP REST API는 HDFS의 완전한 FileSystem/FileContext 인터페이스를 지원합니다. 연산과 이에 대응하는 FileSystem/FileContext 메서드는 다음 절에 나와 있습니다. "HTTP Query Parameter Dictionary" 절은 기본값, 유효 값 같은 파라미터 세부사항을 지정합니다.

연산 (Operations)

  • HTTP GET
    • 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)
    • LISTXATTRS (FileSystem.listXAttrs)
    • CHECKACCESS (FileSystem.access)
    • GETALLSTORAGEPOLICY (FileSystem.getAllStoragePolicies)
    • GETSTORAGEPOLICY (FileSystem.getStoragePolicy)
    • GETSNAPSHOTDIFF
    • GETSNAPSHOTDIFFLISTING
    • GETSNAPSHOTTABLEDIRECTORYLIST
    • GETSNAPSHOTLIST
    • GETFILEBLOCKLOCATIONS (FileSystem.getFileBlockLocations)
    • GETECPOLICY (HDFSErasureCoding.getErasureCodingPolicy)
    • GETSERVERDEFAULTS (FileSystem.getServerDefaults)
    • GETLINKTARGET (FileSystem.getLinkTarget)
    • GETFILELINKSTATUS (FileSystem.getFileLinkStatus)
    • GETSTATUS (FileSystem.getStatus)
    • GETECPOLICIES
    • GETECCODECS
    • GETTRASHROOTS (FileSystem.getTrashRoots)
  • HTTP PUT
    • 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)
  • HTTP POST
    • APPEND (FileSystem.append)
    • CONCAT (FileSystem.concat)
    • TRUNCATE (FileSystem.truncate)
    • UNSETSTORAGEPOLICY (FileSystem.unsetStoragePolicy)
    • UNSETECPOLICY (HDFSErasureCoding.unsetErasureCodingPolicy)
  • HTTP DELETE
    • DELETE (FileSystem.delete)
    • DELETESNAPSHOT (FileSystem.deleteSnapshot)

FileSystem URI와 HTTP URL

WebHDFS의 FileSystem 스킴은 "webhdfs://"입니다. WebHDFS FileSystem 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>

관련 문서: SSL Configurations for SWebHDFS

HDFS 설정 옵션

WebHDFS용 HDFS 설정 옵션은 다음과 같습니다.

속성 이름 설명
dfs.web.authentication.kerberos.principal HTTP 엔드포인트에서 Hadoop-Auth가 사용하는 HTTP Kerberos principal. HTTP Kerberos principal은 Kerberos HTTP SPNEGO 규격에 따라 반드시 'HTTP/'로 시작해야 합니다. "*" 값은 keytab에서 찾은 모든 HTTP principal을 사용합니다.
dfs.web.authentication.kerberos.keytab Hadoop-Auth가 HTTP 엔드포인트에서 사용하는 HTTP Kerberos principal의 자격증명이 담긴 Kerberos keytab 파일.
dfs.webhdfs.socket.connect-timeout 실패 전에 연결이 수립될 때까지 대기하는 시간. 시간 지속기간(숫자 + 단위 기호, 예: 2m)으로 지정합니다. 기본값 60s.
dfs.webhdfs.socket.read-timeout 실패 전에 데이터가 도착할 때까지 대기하는 시간. 기본값 60s.

인증 (Authentication)

보안이 꺼져 있으면 인증된 사용자는 user.name 쿼리 파라미터에 지정된 사용자 이름입니다. user.name 파라미터가 설정되지 않으면 서버는 기본 웹 사용자가 있으면 그 사용자로 인증 사용자를 설정하거나 오류 응답을 반환할 수 있습니다.

보안이 켜져 있으면 인증은 Hadoop 위임 토큰이나 Kerberos SPNEGO로 수행됩니다. delegation 쿼리 파라미터에 토큰이 설정되면 인증 사용자는 토큰에 인코딩된 사용자입니다. delegation 파라미터가 설정되지 않으면 사용자는 Kerberos SPNEGO로 인증됩니다.

curl 명령 도구를 사용한 예시는 다음과 같습니다.

  1. 보안이 꺼졌을 때의 인증:

    curl -i "http://:/webhdfs/v1/?[user.name=&]op=..."

  2. 보안이 켜졌을 때 Kerberos SPNEGO를 사용한 인증:

    curl -i --negotiate -u : "http://:/webhdfs/v1/?op=..."

  3. 보안이 켜졌을 때 Hadoop 위임 토큰을 사용한 인증:

    curl -i "http://:/webhdfs/v1/?delegation=&op=..."

관련 문서: Authentication for Hadoop HTTP web-consoles

추가로 WebHDFS는 클라이언트 쪽에서 OAuth2를 지원합니다. NameNode와 DataNode는 현재 OAuth2를 사용하는 클라이언트를 지원하지 않지만, WebHDFS REST 인터페이스를 구현하는 다른 백엔드는 지원할 수 있습니다.

WebHDFS는 기본적으로 두 가지 유형의 OAuth2 코드 그랜트(사용자가 제공한 refresh·access 토큰, 또는 사용자가 제공한 자격증명)를 지원하며, OAuth2 RFC에 따른 다른 OAuth2 인증이나 사용자 지정 인증을 구현하기 위한 플러그형 메커니즘을 제공합니다. 제공된 코드 그랜트 메커니즘을 사용할 때 WebHDFS 클라이언트는 필요에 따라 access 토큰을 갱신합니다.

OAuth2는 Kerberos SPENGO로 실행되지 않는 클라이언트에서만 활성화해야 합니다.

OAuth2 코드 그랜트 메커니즘 설명 이를 구현하는 dfs.webhdfs.oauth2.access.token.provider 값
Authorization Code Grant 사용자가 초기 access 토큰과 refresh 토큰을 제공하고, 이를 WebHDFS 요청 인증과 교체 access 토큰 획득에 각각 사용합니다. org.apache.hadoop.hdfs.web.oauth2.ConfRefreshTokenBasedAccessTokenProvider
Client Credentials Grant 사용자가 자격증명을 제공해 access 토큰을 얻고, 이를 WebHDFS 요청 인증에 사용합니다. org.apache.hadoop.hdfs.web.oauth2.ConfCredentialBasedAccessTokenProvider

OAuth2 인증을 제어하는 속성은 다음과 같습니다.

OAuth2 관련 속성 설명
dfs.webhdfs.oauth2.enabled OAuth2 인증을 켜/끄는 Boolean
dfs.webhdfs.oauth2.access.token.provider org.apache.hadoop.hdfs.web.oauth.AccessTokenProvider 구현의 클래스 이름. 위에서 설명한 두 가지가 코드에 포함되어 있으며, 사용자가 직접 구현을 지정할 수도 있습니다. 이 키의 기본값은 ConfCredentialBasedAccessTokenProvider 구현입니다.
dfs.webhdfs.oauth2.client.id 자격증명 또는 refresh 토큰으로 access 토큰을 얻는 데 사용되는 클라이언트 id
dfs.webhdfs.oauth2.refresh.url 자격증명 또는 refresh 토큰으로 bearer 토큰을 얻기 위해 POST하는 URL
dfs.webhdfs.oauth2.access.token (ConfRefreshTokenBasedAccessTokenProvider 사용 시 필수) 인증에 사용할 초기 access 토큰
dfs.webhdfs.oauth2.refresh.token (ConfRefreshTokenBasedAccessTokenProvider 사용 시 필수) 새 access 토큰을 얻는 데 사용할 초기 refresh 토큰
dfs.webhdfs.oauth2.refresh.token.expires.ms.since.epoch (ConfRefreshTokenBasedAccessTokenProvider 사용 시 필수) 1970년 1월 1일 이후 밀리초로 측정한 access 토큰 만료. 이 값은 OAuth 공급자가 제공하는 값과 다르며, 클라이언트 애플리케이션에 적합하도록 인터페이스에 설명된 대로 가공된 값
dfs.webhdfs.oauth2.credential (ConfCredentialBasedAccessTokenProvider 사용 시 필수) 초기 및 이후 access 토큰을 얻는 데 사용되는 자격증명.

SWebHDFS용 SSL 설정 (SSL Configurations for SWebHDFS)

SWebHDFS FileSystem(즉 swebhdfs 프로토콜)을 사용하려면 클라이언트 쪽에 SSL 설정 파일을 지정해야 합니다. 이 파일은 3가지 파라미터를 지정해야 합니다.

SSL 속성 설명
ssl.client.truststore.location NameNode 인증서가 포함된 trust-store 파일의 로컬 파일시스템 위치.
ssl.client.truststore.type (선택) trust-store 파일의 형식.
ssl.client.truststore.password (선택) trust-store 파일의 비밀번호.

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 설정 파일은 클라이언트 프로그램의 class-path에 있어야 하며 파일 이름은 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>

프록시 사용자 (Proxy Users)

프록시 사용자 기능이 활성화되면 프록시 사용자 P 는 다른 사용자 U 를 대신해 요청을 제출할 수 있습니다. 인증에서 위임 토큰이 제시되지 않는 한 U 의 사용자 이름은 doas 쿼리 파라미터에 지정해야 합니다. 그 경우 두 사용자 P 와 U 의 정보가 모두 위임 토큰에 인코딩되어야 합니다.

  1. 보안이 꺼졌을 때의 프록시 요청:

    curl -i "http://:/webhdfs/v1/?[user.name=&]doas=&op=..."

  2. 보안이 켜졌을 때 Kerberos SPNEGO를 사용한 프록시 요청:

    curl -i --negotiate -u : "http://:/webhdfs/v1/?doas=&op=..."

  3. 보안이 켜졌을 때 Hadoop 위임 토큰을 사용한 프록시 요청:

    curl -i "http://:/webhdfs/v1/?delegation=&op=..."

교차 사이트 요청 위조 방지 (Cross-Site Request Forgery Prevention)

WebHDFS는 교차 사이트 요청 위조(CSRF) 방지를 위한 선택적이고 구성 가능한 메커니즘을 지원합니다. 활성화하면 NameNode나 DataNode로 가는 WebHDFS HTTP 요청은 사용자 지정 HTTP 헤더를 포함해야 합니다. 구성 속성으로 어떤 HTTP 메서드가 보호되는지와 HTTP 헤더 이름을 조정할 수 있습니다. 헤더로 보내는 값은 중요하지 않습니다. 그 이름의 헤더 존재 여부만 필요합니다.

CSRF 방지를 활성화하면 WebHdfsFileSystem 클래스가 필요한 헤더를 보내도록 설정됩니다. 이는 hdfs dfs나 hadoop distcp 같은 CLI 명령이 webhdfs: URI와 함께 사용될 때 계속 올바르게 동작하도록 보장합니다.

CSRF 방지를 활성화하면 NameNode 웹 UI도 필요한 헤더를 보내도록 설정됩니다. CSRF 방지 활성화 후 NameNode를 다시 시작하면 NameNode 웹 UI의 기존 사용자는 새 설정을 찾기 위해 브라우저를 새로고침해야 합니다.

CSRF 방지를 제어하는 속성은 다음과 같습니다.

속성 설명 기본값
dfs.webhdfs.rest-csrf.enabled true면 WebHDFS의 교차 사이트 요청 위조(CSRF) 방지를 활성화합니다. WebHDFS 클라이언트도 이 속성을 사용해 HTTP 요청에 사용자 지정 CSRF 방지 헤더를 보내야 하는지 결정합니다. false
dfs.webhdfs.rest-csrf.custom-header dfs.webhdfs.rest-csrf.enabled를 true로 설정해 WebHDFS에 CSRF 방지가 활성화될 때 HTTP 요청이 보내야 하는 사용자 지정 헤더의 이름. WebHDFS 클라이언트도 이 속성을 사용합니다. X-XSRF-HEADER
dfs.webhdfs.rest-csrf.methods-to-ignore CSRF 방지가 활성화될 때 사용자 지정 헤더를 요구하지 않는 HTTP 메서드의 쉼표 구분 목록. GET,OPTIONS,HEAD,TRACE
dfs.webhdfs.rest-csrf.browser-useragents-regex CSRF 방지가 활성화될 때 HTTP 요청의 User-Agent 헤더와 일치시키는 정규식의 쉼표 구분 목록. 들어오는 User-Agent가 이 중 하나에 일치하면 브라우저가 보낸 것으로 간주하여 CSRF 방지를 적용합니다. 일치하지 않으면 브라우저가 아닌 것(스크립트 자동화 등)이 보낸 것으로 간주해 CSRF 방지를 적용하지 않습니다. 이는 CSRF 방지 헤더를 보내도록 업데이트되지 않은 기존 자동화와의 역호환성을 돕습니다. ^Mozilla.*,^Opera.*
dfs.datanode.httpserver.filter.handlers DataNode WebHDFS I/O 경로에 주입할 Netty servlet-style 필터 핸들러의 쉼표 구분 목록. 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 Retry Policy)

WebHDFS는 시간이 초과될 수 있는 대용량 파일의 탄력적 복사, 또는 복사 중 장애 조치가 일어날 수 있는 HA 클러스터 간 파일 복사를 위한 선택적이고 구성 가능한 재시도 정책을 지원합니다.

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 요청 필터링 (WebHDFS Request Filtering)

WebHDFS 프로토콜에서 데이터의 방향성을 제어해 보안되지 않은 네트워크에서의 데이터 쓰기만 허용할 수 있습니다. 활성화하려면 dfs.datanode.httpserver.filter.handlers에 org.apache.hadoop.hdfs.server.datanode.web.HostRestrictingAuthorizationFilterHandler가 포함되어 있어야 합니다. HostRestrictingAuthorizationFilter의 구성은 다음 속성으로 제어됩니다.

속성 설명 기본값
dfs.datanode.httpserver.filter.handlers DataNode WebHDFS I/O 경로에 주입할 Netty servlet-style 필터 핸들러의 쉼표 구분 목록. org.apache.hadoop.hdfs.server.datanode.web.RestCsrfPreventionFilterHandler
dfs.web.authentication.host.allow.rules user,network/bits,path glob 형식(새 줄 또는 ` 로 구분)으로 사용자가 파일을 읽는 것을 허용하는 규칙. 모든 _사용자_ 나 _network/bits_ 의 와일드카드에는 *`를 사용합니다.

파일 및 디렉터리 연산 (File and Directory Operations)

파일 생성 및 쓰기 (Create and Write to a File)

  • 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..."
    

클라이언트는 콘텐츠 길이가 0이고 Location 헤더에 파일의 WebHDFS URI가 있는 201 Created 응답을 받습니다.

    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, Section 8.2.3 참고). 안타깝게도 "Expect: 100-continue"를 올바르게 구현하지 않는 소프트웨어 라이브러리 버그(Jetty 6 HTTP 서버와 Java 6 HTTP 클라이언트 등)가 있습니다. 두 단계 생성/추가는 이러한 소프트웨어 라이브러리 버그에 대한 임시 해결책입니다.

관련 문서: overwrite, blocksize, replication, permission, buffersize, FileSystem.create

파일에 추가 (Append to a File)

  • 1단계: 리다이렉트를 자동으로 따라가지 않고 파일 데이터를 보내지 않는 HTTP POST 요청 제출.

    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..."}
  • 2단계: 추가하려는 파일 데이터와 함께 Location 헤더의 URL(noredirect를 지정했다면 반환된 응답)을 사용해 또 다른 HTTP POST 요청 제출.

    curl -i -X POST -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND..."
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

이 연산이 왜 두 단계를 요구하는지에 대한 설명은 이전 절의 주의를 참고하세요.

관련 문서: buffersize, FileSystem.append

파일 연결 (Concat File(s))

  • HTTP POST 요청 제출.

    curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CONCAT&sources=<PATHS>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: sources, FileSystem.concat

파일 열기 및 읽기 (Open and Read a File)

  • 리다이렉트를 자동으로 따라가는 HTTP GET 요청 제출.

    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!

관련 문서: offset, length, buffersize, FileSystem.open

디렉터리 만들기 (Make a Directory)

  • HTTP PUT 요청 제출.

    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 모드가 적용되지 않습니다("fs.permissions.umask-mode" 값 구성 효과 없음).

관련 문서: permission, FileSystem.mkdirs

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATESYMLINK
                          &destination=<PATH>[&createParent=<true |false>]"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: destination, createParent, FileSystem.createSymlink

파일/디렉터리 이름 바꾸기 (Rename a File/Directory)

  • HTTP PUT 요청 제출.

    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

파일/디렉터리 삭제 (Delete a File/Directory)

  • HTTP DELETE 요청 제출.

    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

파일 자르기 (Truncate a File)

  • HTTP POST 요청 제출.

    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

파일/디렉터리 상태 (Status of a File/Directory)

  • HTTP GET 요청 제출.

    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}
        "ecPolicy"        : "RS-6-3-1024k"
      }
    }

관련 문서: FileSystem.getFileStatus

디렉터리 나열 (List a Directory)

  • HTTP GET 요청 제출.

    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"
          },
          ...
        ]
      }
    }

관련 문서: FileSystem.listStatus

파일 나열 (List a File)

  • HTTP GET 요청 제출.

    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

디렉터리 반복 나열 (Iteratively List a Directory)

  • HTTP GET 요청 제출.

    curl -i  "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTSTATUS_BATCH&startAfter=<CHILD>"
    

클라이언트는 FileStatuses JSON 객체와 반복 정보를 포함하는 DirectoryListing 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
    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"
                        },
                        ...
                    ]
                }
            },
            "remainingEntries": 2
        }
    }

remainingEntries가 0이 아니면 디렉터리에 추가 항목이 있습니다. 다음 배치를 조회하려면 startAfter 파라미터를 현재 배치에서 반환된 마지막 항목의 pathSuffix로 설정하세요. 예:

curl -i  "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTSTATUS_BATCH&startAfter=bazfile"

디렉터리 항목의 다음 배치를 반환합니다.

    HTTP/1.1 200 OK
    Cache-Control: no-cache
    ...
    {
        "DirectoryListing": {
            "partialListing": {
                "FileStatuses": {
                    "FileStatus": [
                        {
                            "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

기타 파일시스템 연산 (Other File System Operations)

디렉터리 콘텐츠 요약 가져오기 (Get Content Summary of a Directory)

  • HTTP GET 요청 제출.

    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

디렉터리 쿼터 사용량 가져오기 (Get Quota Usage of a Directory)

  • HTTP GET 요청 제출.

    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

쿼터 설정 (Set Quota)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETQUOTA
                          &namespacequota=<QUOTA>[&storagespacequota=<QUOTA>]"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.setQuota

스토리지 유형별 쿼터 설정 (Set Quota By Storage Type)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETQUOTABYSTORAGETYPE
                          &storagetype=<STORAGETYPE>&storagespacequota=<QUOTA>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.setQuotaByStorageType

파일 체크섬 가져오기 (Get File Checksum)

  • HTTP GET 요청 제출.

    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

홈 디렉터리 가져오기 (Get Home Directory)

  • HTTP GET 요청 제출.

    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

휴지통 루트 가져오기 (Get Trash Root)

  • HTTP GET 요청 제출.

    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

암호화 존의 휴지통 루트에 대한 자세한 내용은 Transparent Encryption Guide를 참고하세요.

권한 설정 (Set Permission)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETPERMISSION
                          [&permission=<OCTAL>]"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: permission, FileSystem.setPermission

소유자 설정 (Set Owner)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETOWNER
                          [&owner=<USER>][&group=<GROUP>]"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: owner, group, FileSystem.setOwner

복제 계수 설정 (Set Replication Factor)

  • HTTP PUT 요청 제출.

    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

접근·수정 시각 설정 (Set Access or Modification Time)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETTIMES
                          [&modificationtime=<TIME>][&accesstime=<TIME>]"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: modificationtime, accesstime, FileSystem.setTimes

ACL 항목 수정 (Modify ACL Entries)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=MODIFYACLENTRIES
                          &aclspec=<ACLSPEC>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.modifyAclEntries

ACL 항목 제거 (Remove ACL Entries)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEACLENTRIES
                          &aclspec=<ACLSPEC>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.removeAclEntries

기본 ACL 제거 (Remove Default ACL)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEDEFAULTACL"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.removeDefaultAcl

ACL 제거 (Remove ACL)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEACL"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.removeAcl

ACL 설정 (Set ACL)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETACL
                          &aclspec=<ACLSPEC>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.setAcl

ACL 상태 가져오기 (Get ACL Status)

  • HTTP GET 요청 제출.

    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

접근 확인 (Check access)

  • HTTP GET 요청 제출.

    curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CHECKACCESS
                          &fsaction=<FSACTION>
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.access

서버 기본값 가져오기 (Get Server Defaults)

  • HTTP GET 요청 제출.

    curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETSERVERDEFAULTS"
    

클라이언트는 ServerDefaults JSON 객체가 담긴 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked

    {
        "FsServerDefaults": {
            "replication": 3,
            "encryptDataTransfer": "false",
            "defaultStoragePolicyId":7,
            "writePacketSize": 65536,
            "fileBufferSize": 4096,
            "checksumType": 2,
            "trashInterval": 10080,
            "keyProviderUri": "",
            "blockSize": 134217728,
            "bytesPerChecksum": 512
        }
    }

관련 문서: FileSystem.getServerDefaults

  • HTTP GET 요청 제출.

    curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETLINKTARGET"
    

클라이언트는 Path JSON 객체가 포함된 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked

    {"Path": "/user/username/targetFile"}

관련 문서: FileSystem.getLinkTarget

  • HTTP GET 요청 제출.

    curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILELINKSTATUS"
    

클라이언트는 FileStatus JSON 객체가 포함된 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked

    {
        "FileStatus": {
            "accessTime": 0,
            "blockSize": 0,
            "childrenNum":0,
            "fileId": 16388,
            "group": "supergroup",
            "length": 0,
            "modificationTime": 1681916788427,
            "owner": "hadoop",
            "pathSuffix": "",
            "permission": "777",
            "replication": 0,
            "storagePolicy": 0,
            "symlink": "/webHdfsTest/file",
            "type": "SYMLINK"
        }
    }

관련 문서: FileSystem.getFileLinkInfo

EC 정책 가져오기 (Get EC Policies)

  • HTTP GET 요청 제출.

    curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETECPOLICIES"
    

클라이언트는 ECPolicies JSON 객체가 담긴 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked

    {
      "ErasureCodingPolicies": {
        "ErasureCodingPolicyInfo": [
          {
            "state": "ENABLED",
            "policy": {
              "name": "RS-6-3-1024k",
              "schema": {
                "codecName": "rs",
                "numDataUnits": 6,
                "numParityUnits": 3,
                "extraOptions": {}
              },
              "cellSize": 1048576,
              "id": 1,
              "replicationPolicy": false,
              "codecName": "rs",
              "numDataUnits": 6,
              "numParityUnits": 3,
              "systemPolicy": true
            }
          }
        ]
      }
    }

상태 가져오기 (Get Status)

  • HTTP GET 요청 제출.

    curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETSTATUS"
    

클라이언트는 FsStatus JSON 객체가 담긴 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked

    {
        "FsStatus": {
            "used": 29229154304,
            "remaining": 292893392896,
            "capacity":322122547200
        }
    }

관련 문서: FileSystem.getStatus

EC 코덱 가져오기 (Get EC Codecs)

  • HTTP GET 요청 제출.

    curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETALLECCODECS"
    

클라이언트는 ECCodecs JSON 객체가 담긴 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked

    {
        "ErasureCodeCodecs": {
            "rs": "rs_native, rs_java",
            "rs-legacy": "rs-legacy_java",
            "xor":"xor_native, xor_java"
        }
    }

휴지통 루트들 가져오기 (Get Trash Roots)

  • HTTP GET 요청 제출.

    curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETTRASHROOTS
                          &allusers=<true|false>"
    

클라이언트는 Paths JSON 객체가 담긴 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked

    {
        "Paths": [{
            "blocksize": 0,
            "owner": "hadoop",
            "path": "/user/user0/.Trash",
            "length": 0,
            "permission": "755",
            "modification_time": 1693050205747,
            "isdir": true,
            "block_replication": 0,
            "access_time": 0,
            "group": "supergroup"
         }, {
            "blocksize": 0,
            "owner": "hadoop",
            "path": "/user/user1/.Trash",
            "length": 0,
            "permission": "755",
            "modification_time": 1693049382962,
            "isdir": true,
            "block_replication": 0,
            "access_time": 0,
            "group": "supergroup"
         }]
    }

관련 문서: FileSystem.getTrashRoots

스토리지 정책 연산 (Storage Policy Operations)

모든 스토리지 정책 가져오기 (Get all Storage Policies)

  • HTTP GET 요청 제출.

    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": false,
                   "creationFallbacks": ["DISK"],
                   "id": 14,
                   "name": "ALL_NVDIMM",
                   "replicationFallbacks": ["DISK"],
                   "storageTypes": ["NVDIMM"]
               },
               {
                   "copyOnCreateFile": true,
                   "creationFallbacks": ["DISK"],
                   "id": 15,
                   "name": "LAZY_PERSIST",
                   "replicationFallbacks": ["DISK"],
                   "storageTypes": ["RAM_DISK","DISK"]
               }
           ]
       }
    }

관련 문서: FileSystem.getAllStoragePolicies

스토리지 정책 설정 (Set Storage Policy)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETSTORAGEPOLICY
                          &storagepolicy=<policy>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.setStoragePolicy

스토리지 정책 해제 (Unset Storage Policy)

  • HTTP POST 요청 제출.

    curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=UNSETSTORAGEPOLICY"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.unsetStoragePolicy

스토리지 정책 가져오기 (Get Storage Policy)

  • HTTP GET 요청 제출.

    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

스토리지 정책 충족 (Satisfy Storage Policy)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SATISFYSTORAGEPOLICY"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: ArchivalStorage.satisfyStoragePolicy

파일 블록 위치 가져오기 (Get File Block Locations)

  • HTTP GET 요청 제출.

    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

확장 속성(XAttrs) 연산 (Extended Attributes(XAttrs) Operations)

XAttr 설정 (Set XAttr)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETXATTR
                          &xattr.name=<XATTRNAME>&xattr.value=<XATTRVALUE>
                          &flag=<FLAG>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.setXAttr

XAttr 제거 (Remove XAttr)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEXATTR
                          &xattr.name=<XATTRNAME>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.removeXAttr

XAttr 하나 가져오기 (Get an XAttr)

  • HTTP GET 요청 제출.

    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

여러 XAttr 가져오기 (Get multiple XAttrs)

  • HTTP GET 요청 제출.

    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

모든 XAttr 가져오기 (Get all XAttrs)

  • HTTP GET 요청 제출.

    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"
            },
            ...
        ]
    }

관련 문서: FileSystem.getXAttrs

모든 XAttr 나열 (List all XAttrs)

  • HTTP GET 요청 제출.

    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

이레이저 코딩 연산 (Erasure Coding Operations)

EC 정책 활성화 (Enable EC Policy)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=ENABLEECPOLICY
                          &ecpolicy=<policy>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: HDFSErasureCoding.enablePolicy

EC 정책 비활성화 (Disable EC Policy)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=DISABLEECPOLICY
                          &ecpolicy=<policy>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: HDFSErasureCoding.disablePolicy

EC 정책 설정 (Set EC Policy)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETECPOLICY
                          &ecpolicy=<policy>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: HDFSErasureCoding.setErasureCodingPolicy

EC 정책 가져오기 (Get EC Policy)

  • HTTP GET 요청 제출.

    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

EC 정책 해제 (Unset EC Policy)

  • HTTP POST 요청 제출.

    curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=UNSETECPOLICY
                         "
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: HDFSErasureCoding.unsetErasureCodingPolicy

스냅샷 연산 (Snapshot Operations)

스냅샷 허용 (Allow Snapshot)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=ALLOWSNAPSHOT"
    

성공하면 클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

스냅샷 불허 (Disallow Snapshot)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=DISALLOWSNAPSHOT"
    

성공하면 클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

스냅샷 만들기 (Create Snapshot)

  • HTTP PUT 요청 제출.

    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

스냅샷 삭제 (Delete Snapshot)

  • HTTP DELETE 요청 제출.

    curl -i -X DELETE "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=DELETESNAPSHOT&snapshotname=<SNAPSHOTNAME>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.deleteSnapshot

스냅샷 이름 바꾸기 (Rename Snapshot)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=RENAMESNAPSHOT
                       &oldsnapshotname=<SNAPSHOTNAME>&snapshotname=<SNAPSHOTNAME>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: FileSystem.renameSnapshot

스냅샷 차이 가져오기 (Get Snapshot Diff)

  • HTTP GET 요청 제출.

    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"}}

스냅샷 차이 반복 가져오기 (Get Snapshot Diff Iteratively)

  • HTTP GET 요청 제출.

    curl -i -X GET "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETSNAPSHOTDIFFLISTING
                       &oldsnapshotname=<SNAPSHOTNAME>&snapshotname=<SNAPSHOTNAME>&snapshotdiffstartpath=<STARTPATH>&snapshotdiffindex=<STARTINDEX>"
    

snapshotdiffstartpath와 snapshotdiffindex를 주지 않으면 각각 ""(빈 문자열)와 -1을 사용해 첫 번째 반복을 의미합니다.

클라이언트는 SnapshotDiffReportListing JSON 객체가 담긴 응답을 받습니다. 다음 반복에서 snapshotdiffstartpath와 snapshotdiffindex 값으로 lastPath와 lastIndex 값을 지정해야 합니다.

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked

    {"SnapshotDiffReportListing":{"createList":[],"deleteList":[],"isFromEarlier":true,"lastIndex":-1,"lastPath":"","modifyList":[]}}

스냅샷 가능 디렉터리 목록 가져오기 (Get Snapshottable Directory List)

  • HTTP GET 요청 제출.

    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
            }
        ]
    }

스냅샷 목록 가져오기 (Get Snapshot List)

  • HTTP GET 요청 제출.

    curl -i GET "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?"
    

이 호출은 스냅샷 가능 디렉터리의 스냅샷을 나열합니다. 클라이언트는 SnapshotList JSON 객체가 담긴 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked

    {
        "SnapshotList":
        [
            {
              "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"
                },
              "fullPath":"/",
              "snapshotID":0,
              "deletionStatus":ACTIVE
            }
        ]
    }

위임 토큰 연산 (Delegation Token Operations)

위임 토큰 가져오기 (Get Delegation Token)

  • HTTP GET 요청 제출.

    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..."
      }
    }

관련 문서: renewer, FileSystem.getDelegationToken, kind, service

위임 토큰 갱신 (Renew Delegation Token)

  • HTTP PUT 요청 제출.

    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

관련 문서: token, DelegationTokenAuthenticator.renewDelegationToken

위임 토큰 취소 (Cancel Delegation Token)

  • HTTP PUT 요청 제출.

    curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=CANCELDELEGATIONTOKEN&token=<TOKEN>"
    

클라이언트는 콘텐츠 길이가 0인 응답을 받습니다.

    HTTP/1.1 200 OK
    Content-Length: 0

관련 문서: token, DelegationTokenAuthenticator.cancelDelegationToken

오류 응답 (Error Responses)

연산이 실패하면 서버는 예외를 던질 수 있습니다. 오류 응답의 JSON 스키마는 RemoteException JSON Schema에 정의되어 있습니다. 아래 표는 예외를 HTTP 응답 코드에 매핑한 것입니다.

HTTP 응답 코드 (HTTP Response Codes)

예외 HTTP 응답 코드
IllegalArgumentException 400 Bad Request
UnsupportedOperationException 400 Bad Request
SecurityException 401 Unauthorized
IOException 403 Forbidden
FileNotFoundException 404 Not Found
RuntimeException 500 Internal Server Error

아래는 예외 응답의 예시입니다.

Illegal Argument Exception

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\": ..."
  }
}

Security Exception

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: ..."
  }
}

Access Control Exception

HTTP/1.1 403 Forbidden
Content-Type: application/json
Transfer-Encoding: chunked

{
  "RemoteException":
{
    "exception"    : "AccessControlException",
    "javaClassName": "org.apache.hadoop.security.AccessControlException",
    "message"      : "Permission denied: ..."
  }
}

File Not Found Exception

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"
  }
}

JSON 스키마 (JSON Schemas)

OPEN을 제외한 모든 연산은 콘텐츠 길이가 0인 응답이나 JSON 응답을 반환합니다. OPEN의 응답은 octet-stream입니다. JSON 스키마는 아래와 같습니다. JSON 스키마의 구문 정의는 draft-zyp-json-schema-03을 참고하세요.

주의 additionalProperties의 기본값은 추가 속성에 어떤 값도 허용하는 빈 스키마입니다. 따라서 모든 WebHDFS JSON 응답은 추가 속성을 허용합니다. 하지만 응답에 추가 속성이 포함되면 호환성 유지를 위해 선택 속성으로 간주됩니다.

ACL Status JSON Schema

{
  "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
        }
      }
    }
  }
}

XAttrs JSON Schema

{
  "name"      : "XAttrs",
  "properties":
  {
    "XAttrs":
    {
      "type"      : "array",
      "items":
      {
        "type"    : "object",
        "properties":
        {
          "name":
          {
            "description": "XAttr name.",
            "type"       : "string",
            "required"   : true
          },
          "value":
          {
            "description": "XAttr value.",
            "type"       : "string"
          }
        }
      }
    }
  }
}

XAttrNames JSON Schema

{
  "name"      : "XAttrNames",
  "properties":
  {
    "XAttrNames":
    {
      "description": "XAttr names.",
      "type"       : "string",
      "required"   : true
    }
  }
}

Boolean JSON Schema

{
  "name"      : "boolean",
  "properties":
  {
    "boolean":
    {
      "description": "A boolean value",
      "type"       : "boolean",
      "required"   : true
    }
  }
}

관련 문서: MKDIRS, RENAME, DELETE, SETREPLICATION

ContentSummary JSON Schema

{
  "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":
            {
              ... (consumed/quota, same pattern)
            },
            "SSD":
            {
              ... (consumed/quota, same pattern)
            }
          }
        }
      }
    }
  }
}

관련 문서: GETCONTENTSUMMARY

QuotaUsage JSON Schema

{
  "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": {...},
            "DISK": {...},
            "SSD": {...}
          }
        }
      }
    }
  }
}

관련 문서: GETQUOTAUSAGE

FileChecksum JSON Schema

{
  "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
        }
      }
    }
  }
}

FileStatus JSON Schema

{
  "name"      : "FileStatus",
  "properties":
  {
    "FileStatus": fileStatusProperties      //See FileStatus Properties
  }
}

관련 문서: FileStatus Properties, GETFILESTATUS, FileStatus

FileStatus Properties

fileStatusProperties는 FileStatus와 FileStatuses 양쪽 JSON 스키마에서 참조할 수 있도록 JavaScript 구문으로 정의합니다.

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
    },
    "aclBit":
    {
       "description": "Has ACLs set or not.",
       "type"       : "boolean",
    },
    "encBit":
    {
       "description": "Is Encrypted or not.",
       "type"       : "boolean",
    },
    "ecBit":
    {
       "description": "Is ErasureCoded or not.",
       "type"       : "boolean",
    },
    "ecPolicy":
    {
       "description": "The namenode of ErasureCodePolicy.",
       "type"       : "String",
    }
  }
};

FileStatuses JSON Schema

A FileStatuses JSON 객체는 FileStatus JSON 객체들의 배열을 나타냅니다.

{
  "name"      : "FileStatuses",
  "properties":
  {
    "FileStatuses":
    {
      "type"      : "object",
      "properties":
      {
        "FileStatus":
        {
          "description": "An array of FileStatus",
          "type"       : "array",
          "items"      : fileStatusProperties      //See FileStatus Properties
        }
      }
    }
  }
}

관련 문서: FileStatus Properties, LISTSTATUS, FileStatus

DirectoryListing JSON Schema

A 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
        }
      }
    }
  }

}

관련 문서: FileStatuses JSON Schema, LISTSTATUS_BATCH, FileStatus

Long JSON Schema

{
  "name"      : "long",
  "properties":
  {
    "long":
    {
      "description": "A long integer value",
      "type"       : "integer",
      "required"   : true
    }
  }
}

관련 문서: RENEWDELEGATIONTOKEN

Path JSON Schema

{
  "name"      : "Path",
  "properties":
  {
    "Path":
    {
      "description": "The string representation a Path.",
      "type"       : "string",
      "required"   : true
    }
  }
}

관련 문서: GETHOMEDIRECTORY, Path

RemoteException JSON Schema

{
  "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"
        }
      }
    }
  }
}

관련 문서: Error Responses

Token JSON Schema

{
  "name"      : "Token",
  "properties":
  {
    "Token": tokenProperties      //See Token Properties
  }
}

관련 문서: Token Properties, GETDELEGATIONTOKEN, Delegation의 주의.

Token Properties

tokenProperties는 Token JSON 스키마에서 참조할 수 있도록 JavaScript 구문으로 정의합니다.

var tokenProperties =
{
  "type"      : "object",
  "properties":
  {
    "urlString":
    {
      "description": "A delegation token encoded as a URL safe string.",
      "type"       : "string",
      "required"   : true
    }
  }
}

관련 문서: Token Properties, Delegation의 주의.

BlockStoragePolicy JSON Schema

{
  "name"      : "BlockStoragePolicy",
  "properties":
  {
    "BlockStoragePolicy": blockStoragePolicyProperties      //See BlockStoragePolicy Properties
  }
}

관련 문서: BlockStoragePolicy Properties, GETSTORAGEPOLICY

BlockStoragePolicy Properties

blockStoragePolicyProperties는 BlockStoragePolicy와 BlockStoragePolicies 양쪽 스키마에서 참조할 수 있도록 JavaScript 구문으로 정의합니다.

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
    }
  }
};

ECPolicy JSON Schema

{
  "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 Schema

A BlockStoragePolicies JSON 객체는 BlockStoragePolicy JSON 객체들의 배열을 나타냅니다.

{
  "name"      : "BlockStoragePolicies",
  "properties":
  {
    "BlockStoragePolicies":
    {
      "type"      : "object",
      "properties":
      {
        "BlockStoragePolicy":
        {
          "description": "An array of BlockStoragePolicy",
          "type"       : "array",
          "items"      : blockStoragePolicyProperties      //See BlockStoragePolicy Properties
        }
      }
    }
  }
}

SnapshotDiffReport JSON Schema

{
  "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
        }
      }
    }
  }
}

DiffReport Entries

diffReportEntries는 SnapshotDiffReport JSON 스키마에서 참조할 수 있도록 JavaScript 구문으로 정의합니다.

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
    }
  }
}

SnapshotDiffReportListing JSON Schema

{
  "name": "SnapshotDiffReportListing",
  "type": "object",
  "properties":
  {
    "SnapshotDiffReportListing":
    {
      "type"        : "object",
      "properties"  :
      {
        "isFromEarlier":
        {
          "description" : "the diff is calculated from older to newer snapshot or not",
          "type"        : "boolean",
          "required"    : true
        },
        "lastIndex":
        {
          "description" : "the last index of listing iteration",
          "type"        : "integer",
          "required"    : true
        },
        "lastPath":
        {
          "description" : "String representation of the last path of the listing iteration",
          "type"        : "string",
          "required"    : true
        },
        "modifyList":
        {
          "description": "An array of DiffReportListingEntry",
          "type"        : "array",
          "items"       : diffReportListingEntries,
          "required"    : true
        },
        "createList":
        {
          "description": "An array of DiffReportListingEntry",
          "type"        : "array",
          "items"       : diffReportListingEntries,
          "required"    : true
        },
        "deleteList":
        {
          "description": "An array of DiffReportListingEntry",
          "type"        : "array",
          "items"       : diffReportListingEntries,
          "required"    : true
        }
      }
    }
  }
}

DiffReportListing Entries

diffReportEntries는 SnapshotDiffReport JSON 스키마에서 참조할 수 있도록 JavaScript 구문으로 정의합니다.

var diffReportListingEntries =
{
  "type": "object",
  "properties":
  {
    "dirId":
    {
      "description" : "inode id of the directory",
      "type"        : "integer",
      "required"    : true
    },
    "fileId":
    {
      "description" : "inode id of the file",
      "type"        : "integer",
      "required"    : true
    },
    "isRereference":
    {
      "description" : "this is reference or not",
      "type"        : "boolean",
      "required"    : true
    },
    "sourcePath":
    {
      "description" : "string representation of path where changes have happened",
      "type"        : "string",
      "required"    : true
    },
    "targetPath":
    {
      "description" : "string representation of target path of rename op",
      "type"        : "string",
      "required"    : false
    }
  }
}

SnapshottableDirectoryList JSON Schema

{
  "name": "SnapshottableDirectoryList",
  "type": "object",
  "properties":
  {
    "SnapshottableDirectoryList":
    {
      "description": "An array of SnapshottableDirectoryStatus",
      "type"        : "array",
      "items"       : snapshottableDirectoryStatus,
      "required"    : true
    }
  }
}

SnapshottableDirectoryStatus

snapshottableDirectoryStatus는 SnapshottableDirectoryList JSON 스키마에서 참조할 수 있도록 JavaScript 구문으로 정의합니다.

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
    }
  }
}

SnapshotList JSON Schema

{
  "name": "SnapshotList",
  "type": "object",
  "properties":
  {
    "SnapshotList":
    {
      "description": "An array of SnapshotStatus",
      "type"        : "array",
      "items"       : snapshotStatus,
      "required"    : true
    }
  }
}

SnapshotStatus

snapshotStatus는 SnapshotList JSON 스키마에서 참조할 수 있도록 JavaScript 구문으로 정의합니다.

var snapshotStatus =
{
  "type": "object",
  "properties":
  {
    "dirStatus": fileStatusProperties,
    "fullPath":
    {
      "description" : "Full path of the parent of the snapshot",
      "type"        : "string",
      "required"    : true
    },
    "snapshotID":
    {
      "description" : "snapshot ID for the snapshot",
      "type"        : "integer",
      "required"    : true
    },
    "deletionStatus":
    {
      "description" : "Status showing whether the snapshot is active or in deleted state",
      "type"        : "string",
      "required"    : true
    }
  }
}

BlockLocations JSON Schema

A BlockLocations JSON 객체는 BlockLocation JSON 객체들의 배열을 나타냅니다.

{
  "name"      : "BlockLocations",
  "properties":
  {
    "BlockLocations":
    {
      "type"      : "object",
      "properties":
      {
        "BlockLocation":
        {
          "description": "An array of BlockLocation",
          "type"       : "array",
          "items"      : blockLocationProperties      //See BlockLocation Properties
        }
      }
    }
  }
}

관련 문서: BlockLocation Properties, GETFILEBLOCKLOCATIONS, BlockLocation

BlockLocation JSON Schema

{
  "name"      : "BlockLocation",
  "properties":
  {
    "BlockLocation": blockLocationProperties      //See BlockLocation Properties
  }
}

관련 문서: BlockLocation Properties, GETFILEBLOCKLOCATIONS, BlockLocation

BlockLocation Properties

blockLocationProperties는 BlockLocation과 BlockLocations 양쪽 JSON 스키마에서 참조할 수 있도록 JavaScript 구문으로 정의합니다.

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"
      }
    }
  }
};

Server Defaults JSON Schema

{
  "FsServerDefaults": {
    "replication": 3,
    "encryptDataTransfer": false,
    "defaultStoragePolicyId": 7,
    "writePacketSize": 65536,
    "fileBufferSize": 4096,
    "checksumType": 2,
    "trashInterval": 10080,
    "keyProviderUri": "",
    "blockSize": 134217728,
    "bytesPerChecksum": 512
  }
}

FsStatus JSON Schema

{
  "FsStatus": {
    "used": 29229154304,
    "remaining": 292893392896,
    "capacity": 322122547200
  }
}

EC Policies JSON Schema

{
  "ErasureCodingPolicies": {
    "ErasureCodingPolicyInfo": [
      {
        "state": "ENABLED",
        "policy": {
          "name": "RS-6-3-1024k",
          "schema": {
            "codecName": "rs",
            "numDataUnits": 6,
            "numParityUnits": 3,
            "extraOptions": {}
          },
          "cellSize": 1048576,
          "id": 1,
          "replicationPolicy": false,
          "codecName": "rs",
          "numDataUnits": 6,
          "numParityUnits": 3,
          "systemPolicy": true
        }
      }
    ]
  }
}

EC Codecs JSON Schema

{
  "ErasureCodingCodecs": {
    "rs": "rs_native, rs_java",
    "rs-legacy": "rs-legacy_java",
    "xor": "xor_native, xor_java"
  }
}

Paths JSON Schema

{
  "Paths": [{
    "blocksize": 0,
    "owner": "hadoop",
    "path": "/user/user0/.Trash",
    "length": 0,
    "permission": "755",
    "modification_time": 1693050205747,
    "isdir": true,
    "block_replication": 0,
    "access_time": 0,
    "group": "supergroup"
  }]
}

HTTP 쿼리 파라미터 사전 (HTTP Query Parameter Dictionary)

ACL Spec

이름 aclspec
설명 ACL 수정 연산에 포함되는 ACL 사양.
유형 String
기본값
유효 값 Permissions and HDFS 참고
구문 Permissions and HDFS 참고

XAttr 이름 (XAttr Name)

이름 xattr.name
설명 파일/디렉터리의 XAttr 이름.
유형 String
기본값
유효 값 user./trusted./system./security. 접두사가 붙은 모든 문자열
구문 user./trusted./system./security. 접두사가 붙은 모든 문자열

XAttr 값 (XAttr Value)

이름 xattr.value
설명 파일/디렉터리의 XAttr 값.
유형 String
기본값
유효 값 인코딩된 값.
구문 큰따옴표로 감싸거나 0x 또는 0s 접두사.

관련 문서: Extended Attributes

XAttr 설정 플래그 (XAttr set flag)

이름 flag
설명 XAttr 설정 플래그.
유형 String
기본값
유효 값 CREATE,REPLACE
구문 CREATE,REPLACE

관련 문서: Extended Attributes

XAttr 값 인코딩 (XAttr value encoding)

이름 encoding
설명 XAttr 값 인코딩.
유형 String
기본값
유효 값 text | hex | base64
구문 text | hex | base64

관련 문서: Extended Attributes

접근 시각 (Access Time)

이름 accesstime
설명 파일/디렉터리의 접근 시각.
유형 long
기본값 -1 (변경하지 않음을 의미)
유효 값 -1 또는 타임스탬프
구문 임의 정수.

관련 문서: SETTIMES

블록 크기 (Block Size)

이름 blocksize
설명 파일의 블록 크기.
유형 long
기본값 구성에 지정.
유효 값 > 0
구문 임의 정수.

관련 문서: CREATE

버퍼 크기 (Buffer Size)

이름 buffersize
설명 데이터 전송에 사용되는 버퍼의 크기.
유형 int
기본값 구성에 지정.
유효 값 > 0
구문 임의 정수.

관련 문서: CREATE, APPEND, OPEN

생성 플래그 (Create Flag)

이름 createflag
설명 파일 생성 중 처리할 가능한 플래그의 enum
유형 enumerated strings
기본값
유효 값 create, overwrite, append, sync_block의 합법적인 조합
구문 아래 주의 참고

다음 조합은 유효하지 않습니다: * append,create * create,append,overwrite

관련 문서: CREATE

부모 생성 (Create Parent)

이름 createparent
설명 부모 디렉터리가 없으면 생성해야 합니까?
유형 boolean
기본값 true
유효 값 true, false
구문 true

관련 문서: CREATESYMLINK

위임 (Delegation)

이름 delegation
설명 인증에 사용되는 위임 토큰.
유형 String
기본값
유효 값 인코딩된 토큰.
구문 아래 주의 참고

주의 위임 토큰은 URL 안전 문자열로 인코딩됩니다. 인코딩 상세는 org.apache.hadoop.security.token.Token의 encodeToUrlString()과 decodeFromUrlString(String)을 참고하세요.

관련 문서: Authentication

대상 (Destination)

이름 destination
설명 대상 경로.
유형 Path
기본값 (잘못된 경로)
유효 값 스킴과 authority가 없는 절대 FileSystem 경로.
구문 임의 경로.

관련 문서: CREATESYMLINK, RENAME

대신 수행 (Do As)

이름 doas
설명 프록시 사용자가 다른 사용자를 대신해 수행하도록 허용.
유형 String
기본값 null
유효 값 임의의 유효한 사용자 이름.
구문 임의 문자열.

관련 문서: Proxy Users

파일시스템 동작 (Fs Action)

이름 fsaction
설명 파일시스템 연산 read/write/execute
유형 String
기본값 null (잘못된 값)
유효 값 "[r-][w-][x-]" 정규식 패턴과 일치하는 문자열
구문 "[r-][w-][x-]"

관련 문서: CHECKACCESS

그룹 (Group)

이름 group
설명 그룹의 이름.
유형 String
기본값 (변경하지 않음을 의미)
유효 값 임의의 유효한 그룹 이름.
구문 임의 문자열.

관련 문서: SETOWNER

길이 (Length)

이름 length
설명 처리할 바이트 수.
유형 long
기본값 null (전체 파일을 의미)
유효 값 >= 0 또는 null
구문 임의 정수.

관련 문서: OPEN

수정 시각 (Modification Time)

이름 modificationtime
설명 파일/디렉터리의 수정 시각.
유형 long
기본값 -1 (변경하지 않음을 의미)
유효 값 -1 또는 타임스탬프
구문 임의 정수.

관련 문서: SETTIMES

새 길이 (New Length)

이름 newlength
설명 파일이 잘릴 크기.
유형 long
유효 값 >= 0
구문 임의 long.

오프셋 (Offset)

이름 offset
설명 시작 바이트 위치.
유형 long
기본값 0
유효 값 >= 0
구문 임의 정수.

관련 문서: OPEN

이전 스냅샷 이름 (Old Snapshot Name)

이름 oldsnapshotname
설명 이름을 바꿀 스냅샷의 이전 이름.
유형 String
기본값 null
유효 값 기존 스냅샷 이름.
구문 임의 문자열.

관련 문서: RENAMESNAPSHOT

연산 (Op)

이름 op
설명 실행할 연산의 이름.
유형 enum
기본값 null (잘못된 값)
유효 값 임의의 유효한 연산 이름.
구문 임의 문자열.

관련 문서: Operations

덮어쓰기 (Overwrite)

이름 overwrite
설명 파일이 이미 있으면 덮어써야 합니까?
유형 boolean
기본값 false
유효 값 true
구문 true

관련 문서: CREATE

소유자 (Owner)

이름 owner
설명 파일/디렉터리의 소유자 사용자 이름.
유형 String
기본값 (변경하지 않음을 의미)
유효 값 임의의 유효한 사용자 이름.
구문 임의 문자열.

관련 문서: SETOWNER

권한 (Permission)

이름 permission
설명 파일/디렉터리의 권한.
유형 Octal
기본값 파일은 644, 디렉터리는 755
유효 값 0 - 1777
구문 임의의 8진수 정수(선행 0은 생략 가능).

관련 문서: CREATE, MKDIRS, SETPERMISSION

재귀 (Recursive)

이름 recursive
설명 연산이 하위 디렉터리의 콘텐츠에도 작용해야 합니까?
유형 boolean
기본값 false
유효 값 true
구문 true

관련 문서: RENAME

갱신자 (Renewer)

이름 renewer
설명 위임 토큰 갱신자의 사용자 이름.
유형 String
기본값 (현재 사용자를 의미)
유효 값 임의의 유효한 사용자 이름.
구문 임의 문자열.

관련 문서: GETDELEGATIONTOKEN

복제 (Replication)

이름 replication
설명 파일의 복제 수.
유형 short
기본값 구성에 지정.
유효 값 > 0
구문 임의 정수.

관련 문서: CREATE, SETREPLICATION

스냅샷 이름 (Snapshot Name)

이름 snapshotname
설명 생성/삭제할 스냅샷의 이름. 또는 스냅샷 이름 변경의 새 이름.
유형 String
기본값 null
유효 값 임의의 유효한 스냅샷 이름.
구문 임의 문자열.

관련 문서: CREATESNAPSHOT, DELETESNAPSHOT, RENAMESNAPSHOT

원본 (Sources)

이름 sources
설명 원본 경로 목록.
유형 String
기본값
유효 값 스킴과 authority가 없는 쉼표 구분 절대 FileSystem 경로 목록.
구문 임의 문자열.

관련 문서: CONCAT

토큰 (Token)

이름 token
설명 연산에 사용되는 위임 토큰.
유형 String
기본값
유효 값 인코딩된 토큰.
구문 Delegation의 주의 참고.

관련 문서: RENEWDELEGATIONTOKEN, CANCELDELEGATIONTOKEN

토큰 종류 (Token Kind)

이름 kind
설명 요청된 위임 토큰의 종류
유형 String
기본값 (서버가 서비스의 기본 종류 설정)
유효 값 토큰 종류를 나타내는 문자열, 예: "HDFS_DELEGATION_TOKEN" 또는 "WEBHDFS delegation"
구문 임의 문자열.

관련 문서: GETDELEGATIONTOKEN

토큰 서비스 (Token Service)

이름 service
설명 토큰이 사용될 서비스의 이름, 예: namenode의 ip:port
유형 String
기본값
유효 값 문자열 형식의 ip:port 또는 서비스의 논리적 이름
구문 임의 문자열.

관련 문서: GETDELEGATIONTOKEN

사용자 이름 (Username)

이름 user.name
설명 인증된 사용자; Authentication 참고.
유형 String
기본값 null
유효 값 임의의 유효한 사용자 이름.
구문 임의 문자열.

관련 문서: Authentication

리다이렉트 안 함 (NoRedirect)

이름 noredirect
설명 응답이 HTTP 307 리다이렉트를 반환할지 HTTP 200 OK를 반환할지. Create and Write to a File 참고.
유형 boolean
기본값 false
유효 값 true
구문 true

관련 문서: Create and Write to a File

네임스페이스 쿼터 (Namespace Quota)

이름 namespacequota
설명 디렉터리 아래 네임스페이스 사용량(즉 파일/디렉터리 수)의 한도.
유형 String
기본값 Long.MAX_VALUE
유효 값 > 0.
구문 임의 정수.

관련 문서: SETQUOTA

저장 공간 쿼터 (Storage Space Quota)

이름 storagespacequota
설명 디렉터리 아래 저장 공간 사용량(바이트, 복제 포함)의 한도.
유형 String
기본값 Long.MAX_VALUE
유효 값 > 0.
구문 임의 정수.

관련 문서: SETQUOTA, SETQUOTABYSTORAGETYPE

스토리지 유형 (Storage Type)

이름 storagetype
설명 수정할 특정 스토리지 유형 쿼터의 스토리지 유형.
유형 String
기본값
유효 값 임의의 유효한 스토리지 유형.
구문 임의 문자열.

관련 문서: SETQUOTABYSTORAGETYPE

스토리지 정책 (Storage Policy)

이름 storagepolicy
설명 스토리지 정책의 이름.
유형 String
기본값
유효 값 임의의 유효한 스토리지 정책 이름; GETALLSTORAGEPOLICY 참고.
구문 임의 문자열.

관련 문서: SETSTORAGEPOLICY

이레이저 코딩 정책 (Erasure Coding Policy)

이름 ecpolicy
설명 이레이저 코딩 정책의 이름.
유형 String
기본값
유효 값 임의의 유효한 이레이저 코딩 정책 이름.
구문 임의 문자열.

관련 문서: ENABLEECPOLICY 또는 DISABLEECPOLICY

이후부터 시작 (Start After)

이름 startAfter
설명 liststatus 배치에서 반환된 마지막 항목.
유형 String
기본값
유효 값 임의의 유효한 파일/디렉터리 이름.
구문 임의 문자열.

관련 문서: LISTSTATUS_BATCH

더 알아보기 (Learn more)