protected ReduceMapResultsBase(Index index, T indexDefinition, IndexStorage indexStorage, MetricCounters metrics, MapReduceIndexingContext mapReduceContext)
 {
     _index            = index;
     _indexDefinition  = indexDefinition;
     _indexStorage     = indexStorage;
     _metrics          = metrics;
     _mapReduceContext = mapReduceContext;
     _logger           = LoggingSource.Instance.GetLogger <ReduceMapResultsBase <T> >(indexStorage.DocumentDatabase.Name);
 }
        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());
            }
        }