private Slice CreateMappedResultKey(int view, string reduceKey) { var sliceWriter = new SliceWriter(12); sliceWriter.WriteBigEndian(view); sliceWriter.WriteBigEndian(Hashing.XXHash64.CalculateRaw(reduceKey)); return(sliceWriter.CreateSlice()); }
private Slice CreateScheduleReductionKey(int view, int level, string reduceKey) { var sliceWriter = new SliceWriter(16); sliceWriter.WriteBigEndian(view); sliceWriter.WriteBigEndian(level); sliceWriter.WriteBigEndian(Hashing.XXHash64.CalculateRaw(reduceKey)); return(sliceWriter.CreateSlice()); }
private Slice CreateReduceResultsWithBucketKey(int view, string reduceKey, int level, int bucket) { var sliceWriter = new SliceWriter(20); sliceWriter.WriteBigEndian(view); sliceWriter.WriteBigEndian(Hashing.XXHash64.CalculateRaw(reduceKey)); sliceWriter.WriteBigEndian(level); sliceWriter.WriteBigEndian(bucket); return(sliceWriter.CreateSlice()); }
protected Slice CreateViewKey(int view) { var sliceWriter = new SliceWriter(4); sliceWriter.WriteBigEndian(view); return(sliceWriter.CreateSlice()); }
private Slice CreateBucketAndEtagKey(int bucket, Etag id) { var sliceWriter = new SliceWriter(20); sliceWriter.WriteBigEndian(bucket); sliceWriter.Write(id.ToByteArray()); return(sliceWriter.CreateSlice()); }
private Slice GetNextEtagKey() { var nextEtag = ++lastEtag; var keyWriter = new SliceWriter(keyBuffer); keyWriter.WriteBigEndian(nextEtag); return(keyWriter.CreateSlice()); }
public void DeleteIndexEntry(long id) { var sliceWriter = new SliceWriter(8); sliceWriter.WriteBigEndian(id); _currentDocumentIdSlice = sliceWriter.CreateSlice(); _writeBatch.Add(_currentDocumentIdSlice, Stream.Null, "deletes"); }
public static Slice ToSlice(this long val, ByteStringContext context) { lock (_writerSync) //precaution, should be uncontested { _int64Writer.Reset(); _int64Writer.WriteBigEndian(val); return(_int64Writer.CreateSlice(context)); } }
public void Commit() { ThrowIfDisposed(); if (_hasIdChanged) { var valueWriter = new SliceWriter(sizeof(long)); valueWriter.WriteBigEndian(_nextId); MetadataTree.Add(_nextIdKey, valueWriter.CreateSlice(_storage.ByteStringContext)); } _tx.Commit(); }
public void NewIndexEntry() { if (AutoFlush && _writeBatch.Size() > FlushThresholdBytes) { Flush(); } CurrentDocumentId = _parent.NextDocumentId(); var sliceWriter = new SliceWriter(8); sliceWriter.WriteBigEndian(CurrentDocumentId); _currentDocumentIdSlice = sliceWriter.CreateSlice(); _writeBatch.Add(_currentDocumentIdSlice, Stream.Null, "docs"); }
private Slice CreateMappedResultWithBucketKey(int view, string reduceKey, int bucket) { var sliceWriter = new SliceWriter(16); sliceWriter.WriteBigEndian(view); sliceWriter.WriteBigEndian(Hashing.XXHash64.CalculateRaw(reduceKey)); sliceWriter.WriteBigEndian(bucket); return sliceWriter.CreateSlice(); }
private Slice CreateReduceResultsKey(int view, string reduceKey, int level) { var sliceWriter = new SliceWriter(16); sliceWriter.WriteBigEndian(view); sliceWriter.WriteBigEndian(Hashing.XXHash64.CalculateRaw(reduceKey)); sliceWriter.WriteBigEndian(level); return sliceWriter.CreateSlice(); }
private Slice CreateBucketAndEtagKey(int bucket, Etag id) { var sliceWriter = new SliceWriter(20); sliceWriter.WriteBigEndian(bucket); sliceWriter.Write(id.ToByteArray()); return sliceWriter.CreateSlice(); }