Exemplo n.º 1
0
        public CombinerTask(ICombinerFactory combiner, MapReduceTask p)
        {
            this.combinerFactory = combiner;
            this.parent          = p;
            combiners            = new HashVector();

            // initializing and synchronizing the queue
            this.combinerInputQueue = new Queue();
            Queue synchQueue = Queue.Synchronized(combinerInputQueue);

            this.combinerInputQueue = synchQueue;
        }
Exemplo n.º 2
0
        public MapReduceTask(CacheBase parent, TaskCallback callback,
                             IMapper mapper,
                             ICombinerFactory combiner,
                             IReducerFactory reducer,
                             MapReduceInput inputProvider,
                             MapReduceOutput outputProvider,
                             Filter filter, CacheRuntimeContext context, int chunkSize, int maxExceps)
        {
            this._parent       = parent;
            this.Callback      = callback;
            this._context      = context;
            this.maxExceptions = maxExceps;

            this.mapperTask = new MapperTask(mapper, inputProvider, filter != null ? filter.KeyFilter : null, this);

            if (reducer != null)
            {
                ReducerConfigured = true;
                this.reducerTask  = new ReducerTask(reducer, this);
            }
            else
            {
                ReducerConfigured = true;
                this.reducerTask  = new ReducerTask(new IdentityReducerFactory(), this);
            }
            if (combiner != null)
            {
                CombinerConfigured = true;
                this.combinerTask  = new CombinerTask(combiner, this);
            }

            throttlingMgr       = new MapReduceThrottlingManager(chunkSize, this);
            this.outputProvider = outputProvider;

            if (_parent != null && _parent is LocalCacheImpl)
            {
                isLocal      = true;
                participants = new Hashtable();
                participants.Add(new Address(_parent.Context.Render.IPAddress, _parent.Context.Render.Port), new NodeTaskStatus());
            }
#if !CLIENT
            if (_parent != null && _parent is ClusterCacheBase)
            {
                ArrayList   list = ((ClusterCacheBase)_parent).ActiveServers;
                IEnumerator it   = list.GetEnumerator();
                participants = new Hashtable();
                while (it.MoveNext())
                {
                    participants.Add(it.Current, new NodeTaskStatus());
                }

                if (parent is PartitionedServerCache)
                {
                    distributionMgr = ((PartitionedServerCache)parent).DistributionMgr;
                }
            }
#endif

            //Queue itialization and synchronization
            Queue syncQueue = Queue.Synchronized(reducerDataQueue);
            this.reducerDataQueue = syncQueue;
        }
Exemplo n.º 3
0
 public MapReduceTask(IMapper mapper, ICombinerFactory combinerFactory, IReducerFactory reducerFactory)
 {
     this.Mapper   = mapper;
     this.Combiner = combinerFactory;
     this.Reducer  = reducerFactory;
 }