@@ -52,6 +52,7 @@ The HTTP REST API supports the complete [FileSystem](../../api/org/apache/hadoop
52
52
* [ ` GETALLSTORAGEPOLICY ` ] ( #Get_all_Storage_Policies ) (see [ FileSystem] ( ../../api/org/apache/hadoop/fs/FileSystem.html ) .getAllStoragePolicies)
53
53
* [ ` GETSTORAGEPOLICY ` ] ( #Get_Storage_Policy ) (see [ FileSystem] ( ../../api/org/apache/hadoop/fs/FileSystem.html ) .getStoragePolicy)
54
54
* [ ` GETSNAPSHOTDIFF ` ] ( #Get_Snapshot_Diff )
55
+ * [ ` GETSNAPSHOTDIFFLISTING ` ] ( #Get_Snapshot_Diff_Iteratively )
55
56
* [ ` GETSNAPSHOTTABLEDIRECTORYLIST ` ] ( #Get_Snapshottable_Directory_List )
56
57
* [ ` GETSNAPSHOTLIST ` ] ( #Get_Snapshot_List )
57
58
* [ ` 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
1604
1605
1605
1606
{"SnapshotDiffReport":{"diffList":[],"fromSnapshot":"s3","snapshotRoot":"/foo","toSnapshot":"s4"}}
1606
1607
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
+
1607
1628
### Get Snapshottable Directory List
1608
1629
1609
1630
* Submit a HTTP GET request.
@@ -2665,6 +2686,109 @@ var diffReportEntries =
2665
2686
}
2666
2687
```
2667
2688
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
+
2668
2792
### SnapshottableDirectoryList JSON Schema
2669
2793
2670
2794
``` json
0 commit comments