[HADOOP] 파이썬에서 다중 응답 분석
HADOOP파이썬에서 다중 응답 분석
나는 하둡 (webhdfs)에 액세스 할 수 curl 명령을 사용하고 및 HTTP 응답 구문 분석을위한 파이썬을 사용하고 있습니다.
그러나 컬 명령을 소성 후, 복수 응답이 반환되고있다.
curl -i "http://host:50070/webhdfs/v1/user/hduser/pigtest?op=GETFILESTATUS"
HTTP/1.1 401 Authentication required
Cache-Control: no-cache
Expires: Thu, 14 Jan 2016 10:04:23 GMT
Date: Thu, 14 Jan 2016 10:04:23 GMT
Pragma: no-cache
Expires: Thu, 14 Jan 2016 10:04:23 GMT
Date: Thu, 14 Jan 2016 10:04:23 GMT
Pragma: no-cache
Content-Type: plain/text
Transfer-Encoding: chunked
Server: Jetty(6.1.26.hwx)
HTTP/1.1 200 OK
Cache-Control: no-cache
Expires: Thu, 14 Jan 2016 10:04:23 GMT
Date: Thu, 14 Jan 2016 10:04:23 GMT
Pragma: no-cache
Expires: Thu, 14 Jan 2016 10:04:23 GMT
Date: Thu, 14 Jan 2016 10:04:23 GMT
Pragma: no-cache
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26.hwx)
{"FileStatus":{"accessTime":1452062206193,"blockSize":134217728,"childrenNum":0,"fileId":39295,"group":"hdfs","length":753,"modificationTime":1452062206392,"owner":"hduser","pathSuffix":"","permission":"644","replication":2,"storagePolicy":0,"type":"FILE"}}
파이썬에서 어떻게 이러한 복수 응답을 구문 분석합니까?
감사
해결법
from https://stackoverflow.com/questions/34786880/multiple-response-parsing-in-python by cc-by-sa and MIT license
'HADOOP' 카테고리의 다른 글
[HADOOP] 어떻게 별도의 자바 프로그램 내에서 클러스터 스파크 프로그램을 실행하려면? (0) | 2019.10.17 |
---|---|
[HADOOP] 하둡 돼지 : 조건에 조인 (예 tab1.COL1 LIKE (%의 tab2.col2 %)로.) (0) | 2019.10.17 |
[HADOOP] 배쉬 파일 설정을 이해하려고 노력 / 구조 (0) | 2019.10.17 |
[HADOOP] 불꽃을 사용하여에서 SBT 원사에 대한 오류 (0) | 2019.10.16 |
[HADOOP] 어떻게 하이브에서 더블 구분 기호 (||) 할 수 있습니까? (0) | 2019.10.16 |