|
15 | 15 |
|
16 | 16 | namespace Microsoft.ML.Runtime.Data
|
17 | 17 | {
|
18 |
| - public sealed partial class TextLoader : IDataLoader |
| 18 | + public sealed partial class TextLoader |
19 | 19 | {
|
20 | 20 | private sealed class Cursor : RootCursorBase, IRowCursor
|
21 | 21 | {
|
@@ -49,7 +49,6 @@ private static void SetupCursor(TextLoader parent, bool[] active, int n,
|
49 | 49 | {
|
50 | 50 | // Note that files is allowed to be empty.
|
51 | 51 | Contracts.AssertValue(parent);
|
52 |
| - Contracts.AssertValue(parent._files); |
53 | 52 | Contracts.Assert(active == null || active.Length == parent._bindings.Infos.Length);
|
54 | 53 |
|
55 | 54 | var bindings = parent._bindings;
|
@@ -88,7 +87,6 @@ private static void SetupCursor(TextLoader parent, bool[] active, int n,
|
88 | 87 | private Cursor(TextLoader parent, ParseStats stats, bool[] active, LineReader reader, int srcNeeded, int cthd)
|
89 | 88 | : base(parent._host)
|
90 | 89 | {
|
91 |
| - Ch.AssertValue(parent._files); |
92 | 90 | Ch.Assert(active == null || active.Length == parent._bindings.Infos.Length);
|
93 | 91 | Ch.AssertValue(reader);
|
94 | 92 | Ch.AssertValue(stats);
|
@@ -138,37 +136,37 @@ private Cursor(TextLoader parent, ParseStats stats, bool[] active, LineReader re
|
138 | 136 | }
|
139 | 137 | }
|
140 | 138 |
|
141 |
| - public static IRowCursor Create(TextLoader parent, bool[] active) |
| 139 | + public static IRowCursor Create(TextLoader parent, IMultiStreamSource files, bool[] active) |
142 | 140 | {
|
143 | 141 | // Note that files is allowed to be empty.
|
144 | 142 | Contracts.AssertValue(parent);
|
145 |
| - Contracts.AssertValue(parent._files); |
| 143 | + Contracts.AssertValue(files); |
146 | 144 | Contracts.Assert(active == null || active.Length == parent._bindings.Infos.Length);
|
147 | 145 |
|
148 | 146 | int srcNeeded;
|
149 | 147 | int cthd;
|
150 | 148 | SetupCursor(parent, active, 0, out srcNeeded, out cthd);
|
151 | 149 | Contracts.Assert(cthd > 0);
|
152 | 150 |
|
153 |
| - var reader = new LineReader(parent._files, BatchSize, 100, parent.HasHeader, parent._maxRows, 1); |
| 151 | + var reader = new LineReader(files, BatchSize, 100, parent.HasHeader, parent._maxRows, 1); |
154 | 152 | var stats = new ParseStats(parent._host, 1);
|
155 | 153 | return new Cursor(parent, stats, active, reader, srcNeeded, cthd);
|
156 | 154 | }
|
157 | 155 |
|
158 | 156 | public static IRowCursor[] CreateSet(out IRowCursorConsolidator consolidator,
|
159 |
| - TextLoader parent, bool[] active, int n) |
| 157 | + TextLoader parent, IMultiStreamSource files, bool[] active, int n) |
160 | 158 | {
|
161 | 159 | // Note that files is allowed to be empty.
|
162 | 160 | Contracts.AssertValue(parent);
|
163 |
| - Contracts.AssertValue(parent._files); |
| 161 | + Contracts.AssertValue(files); |
164 | 162 | Contracts.Assert(active == null || active.Length == parent._bindings.Infos.Length);
|
165 | 163 |
|
166 | 164 | int srcNeeded;
|
167 | 165 | int cthd;
|
168 | 166 | SetupCursor(parent, active, n, out srcNeeded, out cthd);
|
169 | 167 | Contracts.Assert(cthd > 0);
|
170 | 168 |
|
171 |
| - var reader = new LineReader(parent._files, BatchSize, 100, parent.HasHeader, parent._maxRows, cthd); |
| 169 | + var reader = new LineReader(files, BatchSize, 100, parent.HasHeader, parent._maxRows, cthd); |
172 | 170 | var stats = new ParseStats(parent._host, cthd);
|
173 | 171 | if (cthd <= 1)
|
174 | 172 | {
|
|
0 commit comments