// Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//   
//   public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//   
//   public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//   
//   public static final String HBASE_GRAPH_TABLE_COLFAM_PROPERTY_NAME = "property";
//   
//   public static final String HBASE_GRAPH_TABLE_COLFAM_PROPERTY_NAME_DELIMITER = "@";
// 
//   public static final String HBASE_GRAPH_TABLE_EDGE_DELIMITER_1 = "-->";
// 
//   public static final String HBASE_GRAPH_TABLE_EDGE_DELIMITER_2 = "-->";
// }


import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Counter;
import org.trend.hgraph.HBaseGraphConstants;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.lang.time.StopWatch;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.mapreduce.TableMapper;
      InterruptedException {
    int outgoingEdgeCount = outgoingRowKeys.size();
    outgoingEdgeCounter.increment(outgoingEdgeCount);
    double pageRankForEachOutgoing = pageRank / (double) outgoingEdgeCount;

    StopWatch sw = null;
    String outgoingRowKey = null;
    try {
      sw = new StopWatch();
      sw.start();
      for (int a = 0; a < outgoingRowKeys.size(); a++) {
        outgoingRowKey = outgoingRowKeys.get(a);
        strategy.write(outgoingRowKey, pageRankForEachOutgoing);
      }
      sw.stop();
      dispatchPrTimeConsumeCounter.increment(sw.getTime());
    } catch (IOException e) {
      System.err.println("failed while writing outgoingRowKey:" + outgoingRowKey);
      e.printStackTrace(System.err);
      throw e;
    } catch (InterruptedException e) {
      System.err.println("failed while writing outgoingRowKey:" + outgoingRowKey);
      e.printStackTrace(System.err);
      throw e;
    }
  }

  private static Scan getRowKeyOnlyScan(String rowKey) {
    Scan scan = new Scan();
    scan.setStartRow(Bytes.toBytes(rowKey
// Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//   
//   public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//   
//   public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//   
//   public static final String HBASE_GRAPH_TABLE_COLFAM_PROPERTY_NAME = "property";
//   
//   public static final String HBASE_GRAPH_TABLE_COLFAM_PROPERTY_NAME_DELIMITER = "@";
// 
//   public static final String HBASE_GRAPH_TABLE_EDGE_DELIMITER_1 = "-->";
// 
//   public static final String HBASE_GRAPH_TABLE_EDGE_DELIMITER_2 = "-->";
// }


// Path: src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculateInitPageRankMapper.java
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Counter;
import org.trend.hgraph.HBaseGraphConstants;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.lang.time.StopWatch;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.mapreduce.TableMapper;

      InterruptedException {
    int outgoingEdgeCount = outgoingRowKeys.size();
    outgoingEdgeCounter.increment(outgoingEdgeCount);
    double pageRankForEachOutgoing = pageRank / (double) outgoingEdgeCount;

    StopWatch sw = null;
    String outgoingRowKey = null;
    try {
      sw = new StopWatch();
      sw.start();
      for (int a = 0; a < outgoingRowKeys.size(); a++) {
        outgoingRowKey = outgoingRowKeys.get(a);
        strategy.write(outgoingRowKey, pageRankForEachOutgoing);
      }
      sw.stop();
      dispatchPrTimeConsumeCounter.increment(sw.getTime());
    } catch (IOException e) {
      System.err.println("failed while writing outgoingRowKey:" + outgoingRowKey);
      e.printStackTrace(System.err);
      throw e;
    } catch (InterruptedException e) {
      System.err.println("failed while writing outgoingRowKey:" + outgoingRowKey);
      e.printStackTrace(System.err);
      throw e;
    }
  }

  private static Scan getRowKeyOnlyScan(String rowKey) {
    Scan scan = new Scan();
    scan.setStartRow(Bytes.toBytes(rowKey
        + HBaseGraphConstants.HBASE_GRAPH_TABLE_EDGE_DELIMITER_1));