Package org.apache.giraph.io.gora.utils

Examples of org.apache.giraph.io.gora.utils.KeyFactory


   * @return List<InputSplit> A list of splits
   */
  @Override
  public List<InputSplit> getSplits(JobContext context, int minSplitCountHint)
    throws IOException, InterruptedException {
    KeyFactory kFact = null;
    try {
      kFact = (KeyFactory) getKeyFactoryClass().newInstance();
    } catch (InstantiationException e) {
      LOG.error("Key factory was not instantiated. Please verify.");
      LOG.error(e.getMessage());
      e.printStackTrace();
    } catch (IllegalAccessException e) {
      LOG.error("Key factory was not instantiated. Please verify.");
      LOG.error(e.getMessage());
      e.printStackTrace();
    }
    String sKey = GIRAPH_GORA_START_KEY.get(getConf());
    String eKey = GIRAPH_GORA_END_KEY.get(getConf());
    if (sKey == null || sKey.isEmpty()) {
      LOG.warn("No start key has been defined.");
      LOG.warn("Querying all the data store.");
      sKey = null;
      eKey = null;
    }
    kFact.setDataStore(getDataStore());
    setStartKey(kFact.buildKey(sKey));
    setEndKey(kFact.buildKey(eKey));
    QueryBase tmpQuery = GoraUtils.getQuery(
        getDataStore(), getStartKey(), getEndKey());
    tmpQuery.setConf(context.getConfiguration());
    GORA_INPUT_FORMAT.setQuery(tmpQuery);
    List<InputSplit> splits = GORA_INPUT_FORMAT.getSplits(context);
View Full Code Here


   * @return List<InputSplit> A list of splits
   */
  @Override
  public List<InputSplit> getSplits(JobContext context, int minSplitCountHint)
    throws IOException, InterruptedException {
    KeyFactory kFact = null;
    try {
      kFact = (KeyFactory) getKeyFactoryClass().newInstance();
      kFact.setDataStore(getDataStore());
    } catch (InstantiationException e) {
      LOG.error("Key factory was not instantiated. Please verify.");
      LOG.error(e.getMessage());
      e.printStackTrace();
    } catch (IllegalAccessException e) {
      LOG.error("Key factory was not instantiated. Please verify.");
      LOG.error(e.getMessage());
      e.printStackTrace();
    }
    String sKey = GIRAPH_GORA_START_KEY.get(getConf());
    String eKey = GIRAPH_GORA_END_KEY.get(getConf());
    if (sKey == null || sKey.isEmpty()) {
      LOG.warn("No start key has been defined.");
      LOG.warn("Querying all the data store.");
      sKey = null;
      eKey = null;
    } else {
      setStartKey(kFact.buildKey(sKey));
      setEndKey(kFact.buildKey(eKey));
    }
    QueryBase tmpQuery = GoraUtils.getQuery(
        getDataStore(), getStartKey(), getEndKey());
    tmpQuery.setConf(getConf());
    GORA_INPUT_FORMAT.setQuery(tmpQuery);
View Full Code Here

TOP

Related Classes of org.apache.giraph.io.gora.utils.KeyFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.