-
Notifications
You must be signed in to change notification settings - Fork 234
/
azure.datalake.store.core.AzureDLFile.yml
171 lines (153 loc) · 4.94 KB
/
azure.datalake.store.core.AzureDLFile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
### YamlMime:PythonClass
uid: azure.datalake.store.core.AzureDLFile
name: AzureDLFile
fullName: azure.datalake.store.core.AzureDLFile
module: azure.datalake.store.core
inheritances:
- builtins.object
summary: Open ADL key as a file. Data is only loaded and cached on demand.
constructor:
syntax: AzureDLFile(azure, path, mode='rb', blocksize=33554432, delimiter=None)
parameters:
- name: azure
isRequired: true
types:
- <xref:<xref:azure.datalake.store.core.azure connection>>
- name: path
description: location of file
isRequired: true
types:
- <xref:azure.datalake.store.core.AzureDLPath>
- name: mode
defaultValue: rb
- name: blocksize
description: 'Size of the write or read-ahead buffer. For writing(and appending,
will be
truncated to 4MB (2**22).'
defaultValue: '33554432'
types:
- <xref:int>
- name: delimiter
description: 'If specified and in write mode, each flush will send data terminating
on this bytestring, potentially leaving some data in the buffer.'
defaultValue: None
types:
- <xref:bytes>
- <xref:None>
examples:
- "\n```\n\n>>> adl = AzureDLFileSystem() \n>>> with adl.open('my-dir/my-file.txt',\
\ mode='rb') as f: \n... f.read(10) \n```\n"
methods:
- uid: azure.datalake.store.core.AzureDLFile.close
name: close
summary: 'Close file
If in write mode, causes flush of any unwritten data.'
signature: close()
- uid: azure.datalake.store.core.AzureDLFile.flush
name: flush
summary: 'Write buffered data to ADL.
Without delimiter: Uploads the current buffer.
With delimiter: writes an amount of data less than or equal to the
block-size, which ends on the delimiter, until buffer is smaller than
the blocksize. If there is no delimiter in a block uploads whole block.
If force=True, flushes all data in the buffer, even if it doesn''t end
with a delimiter; appropriate when closing the file.'
signature: flush(syncFlag='METADATA', force=False)
parameters:
- name: syncFlag
defaultValue: METADATA
- name: force
defaultValue: 'False'
- uid: azure.datalake.store.core.AzureDLFile.info
name: info
summary: File information about this path
signature: info()
- uid: azure.datalake.store.core.AzureDLFile.next
name: next
signature: next()
- uid: azure.datalake.store.core.AzureDLFile.read
name: read
summary: Return data from cache, or fetch pieces as necessary
signature: read(length=-1)
parameters:
- name: length
description: Number of bytes to read; if <0, all remaining bytes.
defaultValue: '-1'
types:
- <xref:int >(<xref:-1>)
- uid: azure.datalake.store.core.AzureDLFile.read1
name: read1
summary: Return data from cache, or fetch pieces as necessary
signature: read1(length=-1)
parameters:
- name: length
description: Number of bytes to read; if <0, all remaining bytes.
defaultValue: '-1'
types:
- <xref:int >(<xref:-1>)
- uid: azure.datalake.store.core.AzureDLFile.readable
name: readable
summary: Return whether the AzureDLFile was opened for reading
signature: readable()
- uid: azure.datalake.store.core.AzureDLFile.readinto
name: readinto
summary: Reads data into buffer b
signature: readinto(b)
parameters:
- name: b
description: Buffer to which bytes are read into
isRequired: true
types:
- <xref:bytearray>
return:
types:
- <xref:Returns> <xref:number> <xref:of> <xref:bytes> <xref:read.>
- uid: azure.datalake.store.core.AzureDLFile.readline
name: readline
summary: 'Read and return a line from the stream.
If length is specified, at most size bytes will be read.'
signature: readline(length=-1)
parameters:
- name: length
defaultValue: '-1'
- uid: azure.datalake.store.core.AzureDLFile.readlines
name: readlines
summary: Return all lines in a file as a list
signature: readlines()
- uid: azure.datalake.store.core.AzureDLFile.seek
name: seek
summary: Set current file location
signature: seek(loc, whence=0)
parameters:
- name: loc
description: byte location
isRequired: true
types:
- <xref:int>
- name: whence
description: from start of file, current location or end of file, resp.
defaultValue: '0'
- uid: azure.datalake.store.core.AzureDLFile.seekable
name: seekable
summary: Return whether the AzureDLFile is seekable (only in read mode)
signature: seekable()
- uid: azure.datalake.store.core.AzureDLFile.tell
name: tell
summary: Current file location
signature: tell()
- uid: azure.datalake.store.core.AzureDLFile.writable
name: writable
summary: Return whether the AzureDLFile was opened for writing
signature: writable()
- uid: azure.datalake.store.core.AzureDLFile.write
name: write
summary: 'Write data to buffer.
Buffer only sent to ADL on flush() or if buffer is bigger than
blocksize.'
signature: write(data)
parameters:
- name: data
description: Set of bytes to be written.
isRequired: true
types:
- <xref:bytes>