Exemplo n.º 1
0
        private void MoveExistingResultsToTree(NestedMapResultsSection section)
        {
            Type = MapResultsStorageType.Tree;

            var byteType = (byte)Type;

            using (Slice.External(_indexContext.Allocator, &byteType, sizeof(byte), out Slice val))
                _mapReduceContext.ResultsStoreTypes.Add((long)_reduceKeyHash, val);
            InitializeTree(create: true);

            section.MoveTo(Tree);
        }
Exemplo n.º 2
0
        public MapReduceResultsStore(ulong reduceKeyHash, MapResultsStorageType type, TransactionOperationContext indexContext, MapReduceIndexingContext mapReduceContext, bool create)
        {
            _reduceKeyHash    = reduceKeyHash;
            Type              = type;
            _indexContext     = indexContext;
            _mapReduceContext = mapReduceContext;
            _tx = indexContext.Transaction.InnerTransaction;

            switch (Type)
            {
            case MapResultsStorageType.Tree:
                InitializeTree(create);
                break;

            case MapResultsStorageType.Nested:
                _nestedValueKeyScope = Slice.From(indexContext.Allocator, NestedValuesPrefix + reduceKeyHash, ByteStringType.Immutable, out _nestedValueKey);
                break;

            default:
                throw new ArgumentOutOfRangeException(Type.ToString());
            }
        }