public RecordSet(string Directory, string Name, Schema S, long MaxRecords) : this(S) { this.MaxRecords = MaxRecords; Header h = new Header(Directory, Name, 0, this, HeaderType.Table); this.Attach(h); BinarySerializer.FlushRecordSet(this); }
// Constructor // public RecordSet(Schema NewColumns, Header NewHeader, List<Record> NewCache, Key NewOrderBy) { this._Columns = NewColumns; this._Cache = NewCache; this._OrderBy = NewOrderBy; this._Head = NewHeader; if (NewHeader != null) { this._MaxRecordCount = NewHeader.MaxRecordCount; this._GhostName = NewHeader.Name; } else { this._MaxRecordCount = EstimateMaxRecords(NewColumns); this._GhostName = "CHUNK"; } }
public static KeyValueSet Open(Header h, FNodeSet Fields, AggregateSet CR) { RecordSet rs = BinarySerializer.BufferRecordSet(h.Path); KeyValueSet gbs = new KeyValueSet(Fields, CR); gbs.ImportFromInterim(rs); return gbs; }
public static void Save(Header H, KeyValueSet Data) { RecordSet rs = Data.ToInterim(); rs.Attach(H); BinarySerializer.FlushRecordSet(rs); }
// Statics // public static string FilePath(string Dir, string Name, HeaderType Type) { Header h = new Header(Dir.Trim(), Name.Trim(), 0, 0, 0, 0, 0, Type); return h.Path; }
private static RecordSet ReadRecordSet(BinaryReader Reader) { /* * Read: * Header * Schema * SortKey * Record Collection */ // Read header // Header h = new Header(BinarySerializer.ReadRecord(Reader, 10)); // Read schema // Schema s = new Schema(BinarySerializer.ReadRecords(Reader, h.ColumnCount, 4)); // Read key // Key k = new Key(BinarySerializer.ReadRecord(Reader, (int)h.KeyCount)); // Read record cache // List<Record> l = BinarySerializer.ReadRecords(Reader, h.RecordCount, s.Count); // Return recordset // return new RecordSet(s, h, l, k); }
public static RecordSet BufferRecordSet(Header H) { return BufferRecordSet(H.Path); }
private static RecordSet ReadRecordSetSafe2(byte[] Mem, int Location) { /* * Read: * Header * Schema * SortKey * Record Collection */ // Read header // Record rh; Location = ReadRecordSafe2(Mem, Location, 10, out rh); Header h = new Header(rh); // Read schema // List<Record> s_cache = new List<Record>(); Location = BinarySerializer.ReadRecordsSafe2(Mem, Location, h.ColumnCount, 4, s_cache); Schema s = new Schema(s_cache); // Read key // Record rk; Location = ReadRecordSafe2(Mem, Location, (int)h.KeyCount, out rk); Key k = new Key(rk); // Read record cache // List<Record> d_cache = new List<Record>(); Location = BinarySerializer.ReadRecordsSafe2(Mem, Location, (int)h.RecordCount, (int)h.ColumnCount, d_cache); // Return recordset // return new RecordSet(s, h, d_cache, k); }
public SmallIndexSet(string SinkDir, DataSet Data, Key K) : this(Data, K) { Header h = new Header(SinkDir, Header.TempName(), 0, this, HeaderType.Table); this.Attach(h); }
public static void RenameRecordSet(Header H, string NewName) { RenameRecordSet(H.Path, NewName); }
public static void DropRecordSet(Header H) { DropRecordSet(H.Path); }
public static bool Exists(Header Data) { return Exists(Data.Path); }
public RecordSet(string ColumnText, Header NewHeader) : this(new Schema(ColumnText), NewHeader) { }
public RecordSet(Schema NewColumns, Header NewHeader) : this(NewColumns, NewHeader, new List<Record>(), new Key()) { }
internal void Attach(Header Meta) { this._Head = Meta; }