internal UidSpaceMapperBundle(long strideLength, Cell[] cells, string[] fileNames) { Contract.Requires(cells.Length == fileNames.Length && cells.Length > 0); this.mappers = new UidSpaceMapper[fileNames.Length]; this.baseUID = cells[0].baseUID; this.supraUID = cells[cells.Length - 1].supraUID; for (int i = 0; i < fileNames.Length; i++) { Contract.Assert(i == 0 || cells[i].baseUID == cells[i - 1].supraUID); this.mappers[i] = new UidSpaceMapper(strideLength, baseUID, cells[i].baseUID, cells[i].numUrls, fileNames[i]); } }
internal LinkCell(Cell cell, BinaryReader rd) { this.numBytes = rd.ReadInt64(); this.numLinks = rd.ReadInt64(); this.indexStride = rd.ReadInt32(); this.compressionCode = (LinkCompression)rd.ReadUInt32(); this.cell = cell; this.startPos = -1; this.idxOffsets = null; this.bytes = null; }
private byte[][] idxUrls; // each byte[] is logically a UTF8-encoded string #endregion Fields #region Constructors internal UrlCell(Cell cell, BinaryReader rd) { this.numBytes = rd.ReadInt64(); this.indexStride = rd.ReadInt32(); this.cell = cell; this.startPos = -1; this.idxUrls = null; this.idxOffsets = null; this.bytes = null; this.hashToUidCache = null; this.hasher = new Hash64(); }
/// <summary> /// Reload a "partial" cell once it has been "completed". /// </summary> internal void Reload() { Contract.Assert(this.linkCell[0].numBytes == -1); Contract.Assert(this.linkCell[1].numBytes == -1); var tmp = new Cell(this.part, this.fileName, false); this.linkCell[0] = tmp.linkCell[0]; this.linkCell[1] = tmp.linkCell[1]; // No need to dispose of tmp }