Skip to content

Commit 5526f16

Browse files
committed
HDFS-16354. Add description of GETSNAPSHOTDIFFLISTING to WebHDFS doc.
1 parent 98fe0d0 commit 5526f16

File tree

1 file changed

+124
-0
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/site/markdown

1 file changed

+124
-0
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/WebHDFS.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ The HTTP REST API supports the complete [FileSystem](../../api/org/apache/hadoop
5252
* [`GETALLSTORAGEPOLICY`](#Get_all_Storage_Policies) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getAllStoragePolicies)
5353
* [`GETSTORAGEPOLICY`](#Get_Storage_Policy) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getStoragePolicy)
5454
* [`GETSNAPSHOTDIFF`](#Get_Snapshot_Diff)
55+
* [`GETSNAPSHOTDIFFLISTING`](#Get_Snapshot_Diff_Iteratively)
5556
* [`GETSNAPSHOTTABLEDIRECTORYLIST`](#Get_Snapshottable_Directory_List)
5657
* [`GETSNAPSHOTLIST`](#Get_Snapshot_List)
5758
* [`GETFILEBLOCKLOCATIONS`](#Get_File_Block_Locations) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getFileBlockLocations)
@@ -1604,6 +1605,26 @@ See also: [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).renameSna
16041605

16051606
{"SnapshotDiffReport":{"diffList":[],"fromSnapshot":"s3","snapshotRoot":"/foo","toSnapshot":"s4"}}
16061607

1608+
### Get Snapshot Diff Iteratively
1609+
1610+
* Submit a HTTP GET request.
1611+
1612+
curl -X GET curl -i -X GET "http://localhost:9870/webhdfs/v1/foo?op=GETSNAPSHOTDIFFLISTING&oldsnapshotname=s4&snapshotname=s5"
1613+
1614+
curl -i GET "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETSNAPSHOTDIFFLISTING
1615+
&oldsnapshotname=<SNAPSHOTNAME>&snapshotname=<SNAPSHOTNAME>&snapshotdiffstartpath=<STARTPATH>&snapshotdiffindex=<STARTINDEX>
1616+
1617+
The client receives a response with a
1618+
[`SnapshotDiffReportListing` JSON object](#SnapshotDiffReportListing_JSON_Schema).
1619+
The value of `lastPath` and `lastIndex` must be specified as
1620+
the value of `snapshotdiffstartpath` and `snapshotdiffindex` respectively on next iteration.
1621+
1622+
HTTP/1.1 200 OK
1623+
Content-Type: application/json
1624+
Transfer-Encoding: chunked
1625+
1626+
{"SnapshotDiffReportListing":{"createList":[],"deleteList":[],"isFromEarlier":true,"lastIndex":-1,"lastPath":"","modifyList":[]}}
1627+
16071628
### Get Snapshottable Directory List
16081629

16091630
* Submit a HTTP GET request.
@@ -2665,6 +2686,109 @@ var diffReportEntries =
26652686
}
26662687
```
26672688

2689+
### SnapshotDiffReportListing JSON Schema
2690+
2691+
```json
2692+
{
2693+
"name": "SnapshotDiffReportListing",
2694+
"type": "object",
2695+
"properties":
2696+
{
2697+
"SnapshotDiffReportListing":
2698+
{
2699+
"type" : "object",
2700+
"properties" :
2701+
{
2702+
"isFromEarlier":
2703+
{
2704+
"description" : "the diff is calculated from older to newer snapshot or not",
2705+
"type" : "boolean",
2706+
"required" : true
2707+
},
2708+
"lastIndex":
2709+
{
2710+
"description" : "the last index of listing iteration",
2711+
"type" : "integer",
2712+
"required" : true
2713+
},
2714+
"lastPath":
2715+
{
2716+
"description" : "String representation of the last path of the listing iteration",
2717+
"type" : "string",
2718+
"required" : true
2719+
},
2720+
"modifyList":
2721+
{
2722+
"description": "An array of DiffReportListingEntry",
2723+
"type" : "array",
2724+
"items" : diffReportListingEntries,
2725+
"required" : true
2726+
},
2727+
"createList":
2728+
{
2729+
"description": "An array of DiffReportListingEntry",
2730+
"type" : "array",
2731+
"items" : diffReportListingEntries,
2732+
"required" : true
2733+
},
2734+
"deleteList":
2735+
{
2736+
"description": "An array of DiffReportListingEntry",
2737+
"type" : "array",
2738+
"items" : diffReportListingEntries,
2739+
"required" : true
2740+
}
2741+
}
2742+
}
2743+
}
2744+
}
2745+
```
2746+
2747+
#### DiffReportListing Entries
2748+
2749+
JavaScript syntax is used to define `diffReportEntries` so that it can be referred in `SnapshotDiffReport` JSON schema.
2750+
2751+
```javascript
2752+
var diffReportListingEntries =
2753+
{
2754+
"type": "object",
2755+
"properties":
2756+
{
2757+
"dirId":
2758+
{
2759+
"description" : "inode id of the directory",
2760+
"type" : "integer",
2761+
"required" : true
2762+
},
2763+
"fileId":
2764+
{
2765+
"description" : "inode id of the file",
2766+
"type" : "integer",
2767+
"required" : true
2768+
},
2769+
"isRereference":
2770+
{
2771+
"description" : "this is reference or not",
2772+
"type" : "boolean",
2773+
"required" : true
2774+
},
2775+
"sourcePath":
2776+
{
2777+
"description" : "string representation of path where changes have happened",
2778+
"type" : "string",
2779+
"required" : true
2780+
},
2781+
"targetPath":
2782+
{
2783+
"description" : "string representation of target path of rename op",
2784+
"type" : "string",
2785+
"required" : false
2786+
}
2787+
}
2788+
}
2789+
```
2790+
2791+
26682792
### SnapshottableDirectoryList JSON Schema
26692793

26702794
```json

0 commit comments

Comments
 (0)