// Path: benchmark/giraph/betweennessCentrality/BCNode.java
// public class BCNode implements Writable {
// 	// properties
// 	public float BC;
// 	public float sigma;
// 	public float delta;
// 	public float __S3prop;
// 	public int level;
// 	public ArrayList<LongWritable> revNodeId; // reverse edges (node IDs)
// 
// 	public BCNode() {
// 		// Default constructor needed for Giraph
// 		revNodeId = new ArrayList<LongWritable>();
// 	}
// 
// 	// Initalize with initData
// 	public BCNode(float bc) {
// 		BC = bc;
// 	}
// 
// 	public float getBC() {
// 		return BC;
// 	}
// 
// 	@Override
// 	public void write(DataOutput out) throws IOException {
// 		out.writeFloat(BC);
// 		out.writeFloat(sigma);
// 		out.writeFloat(delta);
// 		out.writeFloat(__S3prop);
// 		out.writeInt(level);
// 		out.writeInt(revNodeId.size());
// 		for (LongWritable node : revNodeId) {
// 			node.write(out);
// 		}
// 	}
// 
// 	@Override
// 	public void readFields(DataInput in) throws IOException {
// 		BC = in.readFloat();
// 		sigma = in.readFloat();
// 		delta = in.readFloat();
// 		__S3prop = in.readFloat();
// 		level = in.readInt();
// 		int _node_count = in.readInt();
// 		revNodeId = new ArrayList<LongWritable>();
// 		for (int i = 0; i < _node_count; i++) {
// 			revNodeId.get(i).readFields(in);
// 		}
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "" + BC;
// 	}
// }
// 
// Path: benchmark/giraph/betweennessCentrality/BCMessage.java
// public class BCMessage implements Writable {
// 	public BCMessage() {
// 	}
// 
// 	public byte m_type;
// 
// 	public BCMessage(byte type) {
// 		m_type = type;
// 	}
// 
// 	// union of all message fields
// 	public long l0;
// 	public float f0;
// 	public float f1;
// 
// 	@Override
// 	public void write(DataOutput out) throws IOException {
// 		out.writeByte(m_type);
// 		if (m_type == 0) {
// 			out.writeLong(l0);
// 		} else if (m_type == 1) {
// 		} else if (m_type == 2) {
// 			out.writeFloat(f0);
// 		} else if (m_type == 3) {
// 			out.writeFloat(f0);
// 			out.writeFloat(f1);
// 		}
// 	}
// 
// 	@Override
// 	public void readFields(DataInput in) throws IOException {
// 		m_type = in.readByte();
// 		if (m_type == 0) {
// 			l0 = in.readLong();
// 		} else if (m_type == 1) {
// 		} else if (m_type == 2) {
// 			f0 = in.readFloat();
// 		} else if (m_type == 3) {
// 			f0 = in.readFloat();
// 			f1 = in.readFloat();
// 		}
// 	}
// }


import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.Writable;
import org.apache.giraph.io.formats.BCNode;
import org.apache.giraph.io.formats.BCMessage;
import org.apache.giraph.edge.Edge;
import org.apache.giraph.edge.EdgeFactory;
import org.apache.giraph.graph.Vertex;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.FloatWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.json.JSONArray;
import org.json.JSONException;
import com.google.common.collect.Lists;
import java.io.IOException;
import java.util.List;
package org.apache.giraph.io.formats;
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */






/**
  * VertexInputFormat that features <code>long</code> vertex ID's,
  * <code>BCNode</code> vertex values and <code>float</code>
  * out-edge weights, and <code>BCMessage</code> message types,
  *  specified in JSON format.
  */
public class JsonLongBCNodeFloatBCMessageVertexInputFormat extends
  TextVertexInputFormat<LongWritable, BCNode, FloatWritable> {

  @Override
  public TextVertexReader createVertexReader(InputSplit split,
      TaskAttemptContext context) {
    return new JsonLongDoubleFloatDoubleVertexReader();
  }

  class JsonLongDoubleFloatDoubleVertexReader extends
    TextVertexReaderFromEachLineProcessedHandlingExceptions<JSONArray,
    JSONException> {

    @Override
    protected JSONArray preprocessLine(Text line) throws JSONException {
      return new JSONArray(line.toString());
    }

    @Override
    protected LongWritable getId(JSONArray jsonVertex) throws JSONException,
              IOException {
      return new LongWritable(jsonVertex.getLong(0));
    }

    @Override
    protected BCNode getValue(JSONArray jsonVertex) throws
      JSONException, IOException {
      return new BCNode();
    }

    @Override
    protected Iterable<Edge<LongWritable, FloatWritable>> getEdges(
        JSONArray jsonVertex) throws JSONException, IOException {
      JSONArray jsonEdgeArray = jsonVertex.getJSONArray(2);
      List<Edge<LongWritable, FloatWritable>> edges =
// Path: benchmark/giraph/betweennessCentrality/BCNode.java
// public class BCNode implements Writable {
// 	// properties
// 	public float BC;
// 	public float sigma;
// 	public float delta;
// 	public float __S3prop;
// 	public int level;
// 	public ArrayList<LongWritable> revNodeId; // reverse edges (node IDs)
// 
// 	public BCNode() {
// 		// Default constructor needed for Giraph
// 		revNodeId = new ArrayList<LongWritable>();
// 	}
// 
// 	// Initalize with initData
// 	public BCNode(float bc) {
// 		BC = bc;
// 	}
// 
// 	public float getBC() {
// 		return BC;
// 	}
// 
// 	@Override
// 	public void write(DataOutput out) throws IOException {
// 		out.writeFloat(BC);
// 		out.writeFloat(sigma);
// 		out.writeFloat(delta);
// 		out.writeFloat(__S3prop);
// 		out.writeInt(level);
// 		out.writeInt(revNodeId.size());
// 		for (LongWritable node : revNodeId) {
// 			node.write(out);
// 		}
// 	}
// 
// 	@Override
// 	public void readFields(DataInput in) throws IOException {
// 		BC = in.readFloat();
// 		sigma = in.readFloat();
// 		delta = in.readFloat();
// 		__S3prop = in.readFloat();
// 		level = in.readInt();
// 		int _node_count = in.readInt();
// 		revNodeId = new ArrayList<LongWritable>();
// 		for (int i = 0; i < _node_count; i++) {
// 			revNodeId.get(i).readFields(in);
// 		}
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "" + BC;
// 	}
// }
// 
// Path: benchmark/giraph/betweennessCentrality/BCMessage.java
// public class BCMessage implements Writable {
// 	public BCMessage() {
// 	}
// 
// 	public byte m_type;
// 
// 	public BCMessage(byte type) {
// 		m_type = type;
// 	}
// 
// 	// union of all message fields
// 	public long l0;
// 	public float f0;
// 	public float f1;
// 
// 	@Override
// 	public void write(DataOutput out) throws IOException {
// 		out.writeByte(m_type);
// 		if (m_type == 0) {
// 			out.writeLong(l0);
// 		} else if (m_type == 1) {
// 		} else if (m_type == 2) {
// 			out.writeFloat(f0);
// 		} else if (m_type == 3) {
// 			out.writeFloat(f0);
// 			out.writeFloat(f1);
// 		}
// 	}
// 
// 	@Override
// 	public void readFields(DataInput in) throws IOException {
// 		m_type = in.readByte();
// 		if (m_type == 0) {
// 			l0 = in.readLong();
// 		} else if (m_type == 1) {
// 		} else if (m_type == 2) {
// 			f0 = in.readFloat();
// 		} else if (m_type == 3) {
// 			f0 = in.readFloat();
// 			f1 = in.readFloat();
// 		}
// 	}
// }


// Path: benchmark/giraph/betweennessCentrality/JsonLongBCNodeFloatBCMessageVertexInputFormat.java
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.Writable;
import org.apache.giraph.io.formats.BCNode;
import org.apache.giraph.io.formats.BCMessage;
import org.apache.giraph.edge.Edge;
import org.apache.giraph.edge.EdgeFactory;
import org.apache.giraph.graph.Vertex;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.FloatWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.json.JSONArray;
import org.json.JSONException;
import com.google.common.collect.Lists;
import java.io.IOException;
import java.util.List;

package org.apache.giraph.io.formats;
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */






/**
  * VertexInputFormat that features <code>long</code> vertex ID's,
  * <code>BCNode</code> vertex values and <code>float</code>
  * out-edge weights, and <code>BCMessage</code> message types,
  *  specified in JSON format.
  */
public class JsonLongBCNodeFloatBCMessageVertexInputFormat extends
  TextVertexInputFormat<LongWritable, BCNode, FloatWritable> {

  @Override
  public TextVertexReader createVertexReader(InputSplit split,
      TaskAttemptContext context) {
    return new JsonLongDoubleFloatDoubleVertexReader();
  }

  class JsonLongDoubleFloatDoubleVertexReader extends
    TextVertexReaderFromEachLineProcessedHandlingExceptions<JSONArray,
    JSONException> {

    @Override
    protected JSONArray preprocessLine(Text line) throws JSONException {
      return new JSONArray(line.toString());
    }

    @Override
    protected LongWritable getId(JSONArray jsonVertex) throws JSONException,
              IOException {
      return new LongWritable(jsonVertex.getLong(0));
    }

    @Override
    protected BCNode getValue(JSONArray jsonVertex) throws
      JSONException, IOException {
      return new BCNode();
    }

    @Override
    protected Iterable<Edge<LongWritable, FloatWritable>> getEdges(
        JSONArray jsonVertex) throws JSONException, IOException {
      JSONArray jsonEdgeArray = jsonVertex.getJSONArray(2);
      List<Edge<LongWritable, FloatWritable>> edges =
          Lists.newArrayListWithCapacity(jsonEdgeArray.length());