Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
VertexList |
|
| 1.0;1 |
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.comm; | |
20 | ||
21 | import org.apache.giraph.graph.Vertex; | |
22 | import org.apache.giraph.graph.BspUtils; | |
23 | import org.apache.giraph.utils.ArrayListWritable; | |
24 | import org.apache.hadoop.io.Writable; | |
25 | import org.apache.hadoop.io.WritableComparable; | |
26 | ||
27 | /** | |
28 | * Wrapper around {@link ArrayListWritable} that allows the vertex | |
29 | * class to be set prior to calling the default constructor. | |
30 | * | |
31 | * @param <I> Vertex index value | |
32 | * @param <V> Vertex value | |
33 | * @param <E> Edge value | |
34 | * @param <M> Message value | |
35 | */ | |
36 | @SuppressWarnings("rawtypes") | |
37 | public class VertexList<I extends WritableComparable, | |
38 | V extends Writable, E extends Writable, | |
39 | M extends Writable> | |
40 | extends ArrayListWritable<Vertex<I, V, E, M>> { | |
41 | /** Defining a layout version for a serializable class. */ | |
42 | private static final long serialVersionUID = 1000L; | |
43 | ||
44 | /** | |
45 | * Default constructor for reflection | |
46 | */ | |
47 | 22 | public VertexList() { } |
48 | ||
49 | @SuppressWarnings("unchecked") | |
50 | @Override | |
51 | public void setClass() { | |
52 | 0 | setClass((Class<Vertex<I, V, E, M>>) |
53 | BspUtils.<I, V, E, M>getVertexClass(getConf())); | |
54 | 0 | } |
55 | } |