diff --git a/sdk/storage/azure-storage-file-datalake/GEN1_GEN2_MAPPING.md b/sdk/storage/azure-storage-file-datalake/GEN1_GEN2_MAPPING.md new file mode 100644 index 000000000000..d7c4bfe73d28 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/GEN1_GEN2_MAPPING.md @@ -0,0 +1,191 @@ +

Mapping from ADLS Gen1 API -> ADLS Gen2 API

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ADLS Gen1 APINote for Gen1 APIADLS Gen2 APINote for API Mapping
access/existsTo check if file/directory exists.N/AUser can use Gen2 API: create_file(if_none_match='*') or create_directory(if_none_match='*') so that the operation will fail on exist.
touchCreate empty filecreate_fileThe API has the same main purpose for Gen1 and Gen2. However Gen2 create_file API could accept more parameters along with creation.
mkdirMake new directorycreate_directoryThe API has the same main purpose for Gen1 and Gen2. However Gen2 create_directory API could accept more parameters along with creation.
stat/infoFile information for pathget_file_propertiesThe Gen1 API is split into two separate ones in ADLS Gen2.
get_directory_properties
unlink/remove/rmRemove a file or directorydelete_fileThe Gen1 API is split into two separate ones in ADLS Gen2.
delete_directory
rmdirRemove empty directorydelete_directoryDelete directory
ls/listdirList all elements under directory specified with pathget pathsget_paths(recursive=False) is equal to ls/listdir
walkWalk a path recursively and returns list of files and dirs(if parameter set)get_paths() or get_paths(recursive=True) is equal to walk. recursive is True by default.
putStream data from local filename to file at path.append_data together with flush_dataappend_data should be followed by flush_data , then the data is actually write into the file. append_data is just to stage the data, not actually write the data into file.
catReturn contents of fileread_filePut the expected range parameters in Gen2 API will achieve the same function of the 4 Gen1 APIs.
headReturn first bytes of file
tailReturn last bytes of file
read_blockRead a block of bytes from an ADL file
getStream data from file at path to local filenameread_filePassing a stream parameter in read_file should do the same thing as Gen1 get API does
rename/mvMove file between locations on ADLrename_fileCurrently ADLS Gen2 only support rename. Move isn't supported yet.
rename_directory
chownChange owner and/or owning groupset_access_controlUsers can set owner, group, acl etc. using the same API.
chmodChange access mode of path
set_aclSet the Access Control List (ACL) for a file or folder.
modify_acl_entriesModify existing Access Control List (ACL) entries on a file or folder. If the entry does not exist it is added, otherwise it is updated based on the spec passed in. No entries are removed by this process (unlike set_acl).
get_acl_statusGets Access Control List (ACL) entries for the specified file or directory.get_access_controlThe result will include owner, group, acl etc.
remove_acl_entriesRemove existing, named, Access Control List (ACL) entries on a file or folder.If the entry does not exist already it is ignored. Default entries cannot be removed this way, please use remove_default_acl for that. Unnamed entries cannot be removed in this way, please use remove_acl for that. Note: this is by default not recursive, and applies only to the file or folder specified.N/AProbably users can achieve the same purpose by calling set_access_control with related parameters.
remove_aclRemove the entire, non default, ACL from the file or folder, including unnamed entries. Default entries cannot be removed this way, please use remove_default_acl for that. Note: this is not recursive, and applies only to the file or folder specified.
remove_default_aclRemove the entire default ACL from the folder. Default entries do not exist on files, if a file is specified, this operation does nothing. Note: this is not recursive, and applies only to the folder specified.
openOpen a file for reading or writing to.N/AThere is no open file operation In ADLS Gen2. However users can do operations to the file directly, eg. append_data, flush_data, read_file
concat/mergeConcatenate a list of files into one new fileN/AN/A
cpNot implemented. Copy file between locations on ADLN/AN/A
currentReturn the most recently created AzureDLFileSystemN/AN/A
dfResource summary of path. eg. File count, directory countN/Aget_paths could be a helpful API. But user need to do further processing.
duBytes in keys at pathN/Aget_paths could be a helpful API. But user need to do further processing.
globFind files (not directories) by glob-matching.N/Aget_paths could be a helpful API. But user need to do further processing.
set_expirySet or remove the expiration time on the specified file. This operation can only be executed against files.N/AN/A
\ No newline at end of file