Coverage Report - org.apache.giraph.worker.MappingInputSplitsCallableFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
MappingInputSplitsCallableFactory
0%
0/9
N/A
0
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *     http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 
 19  
 package org.apache.giraph.worker;
 20  
 
 21  
 import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 22  
 import org.apache.giraph.graph.VertexEdgeCount;
 23  
 import org.apache.giraph.io.MappingInputFormat;
 24  
 import org.apache.giraph.utils.CallableFactory;
 25  
 import org.apache.hadoop.io.Writable;
 26  
 import org.apache.hadoop.io.WritableComparable;
 27  
 import org.apache.hadoop.mapreduce.Mapper;
 28  
 
 29  
 /**
 30  
  * Factory for {@link org.apache.giraph.worker.MappingInputSplitsCallable}s.
 31  
  *
 32  
  * @param <I> vertexId type
 33  
  * @param <V> vertexValue type
 34  
  * @param <E> edgeValue type
 35  
  * @param <B> mappingTarget type
 36  
  */
 37  0
 public class MappingInputSplitsCallableFactory<I extends WritableComparable,
 38  
   V extends Writable, E extends Writable, B extends Writable>
 39  
   implements CallableFactory<VertexEdgeCount> {
 40  
   /** Mapping input format */
 41  
   private final MappingInputFormat<I, V, E, B> mappingInputFormat;
 42  
   /** Mapper context. */
 43  
   private final Mapper<?, ?, ?, ?>.Context context;
 44  
   /** Configuration. */
 45  
   private final ImmutableClassesGiraphConfiguration<I, V, E> configuration;
 46  
   /** {@link BspServiceWorker} we're running on. */
 47  
   private final BspServiceWorker<I, V, E> bspServiceWorker;
 48  
   /** Handler for input splits */
 49  
   private final WorkerInputSplitsHandler splitsHandler;
 50  
 
 51  
   /**
 52  
    * Constructor.
 53  
    *
 54  
    * @param mappingInputFormat Mapping input format
 55  
    * @param context Mapper context
 56  
    * @param configuration Configuration
 57  
    * @param bspServiceWorker Calling {@link BspServiceWorker}
 58  
    * @param splitsHandler Splits handler
 59  
    */
 60  
   public MappingInputSplitsCallableFactory(
 61  
       MappingInputFormat<I, V, E, B> mappingInputFormat,
 62  
       Mapper<?, ?, ?, ?>.Context context,
 63  
       ImmutableClassesGiraphConfiguration<I, V, E> configuration,
 64  
       BspServiceWorker<I, V, E> bspServiceWorker,
 65  0
       WorkerInputSplitsHandler splitsHandler) {
 66  0
     this.mappingInputFormat = mappingInputFormat;
 67  0
     this.context = context;
 68  0
     this.configuration = configuration;
 69  0
     this.bspServiceWorker = bspServiceWorker;
 70  0
     this.splitsHandler = splitsHandler;
 71  0
   }
 72  
 
 73  
   @Override
 74  
   public InputSplitsCallable<I, V, E> newCallable(int threadId) {
 75  0
     return new MappingInputSplitsCallable<>(
 76  
         mappingInputFormat,
 77  
         context,
 78  
         configuration,
 79  
         bspServiceWorker,
 80  
         splitsHandler);
 81  
   }
 82  
 }