當前位置: 首頁>>代碼示例>>Java>>正文


Java ExecException.getMessage方法代碼示例

本文整理匯總了Java中org.apache.pig.backend.executionengine.ExecException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java ExecException.getMessage方法的具體用法?Java ExecException.getMessage怎麽用?Java ExecException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.pig.backend.executionengine.ExecException的用法示例。


在下文中一共展示了ExecException.getMessage方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDataBagFromSketch

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
static DataBag createDataBagFromSketch(final VarOptItemsSketch<Tuple> sketch) {
  final DataBag output = BAG_FACTORY.newDefaultBag();

  final VarOptItemsSamples<Tuple> samples = sketch.getSketchSamples();

  try {
    // create (weight, item) tuples to add to output bag
    for (final VarOptItemsSamples<Tuple>.WeightedSample ws : samples) {
      final Tuple weightedSample = TUPLE_FACTORY.newTuple(2);
      weightedSample.set(0, ws.getWeight());
      weightedSample.set(1, ws.getItem());
      output.add(weightedSample);
    }
  } catch (final ExecException e) {
    throw new RuntimeException("Pig error: " + e.getMessage(), e);
  }

  return output;
}
 
開發者ID:DataSketches,項目名稱:sketches-pig,代碼行數:20,代碼來源:VarOptCommonImpl.java

示例2: createJoinPlans

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
/**
 * Configures the Local Rearrange operators to get keys out of tuple.
 * @throws ExecException 
 */
private void createJoinPlans(MultiMap<PhysicalOperator, PhysicalPlan> inpPlans, List<List<Byte>> keyTypes) throws PlanException{

    int i=-1;
    for (PhysicalOperator inpPhyOp : inpPlans.keySet()) {
        ++i;
        POLocalRearrange lr = new POLocalRearrange(genKey());
        try {
            lr.setIndex(i);
        } catch (ExecException e) {
            throw new PlanException(e.getMessage(),e.getErrorCode(),e.getErrorSource(),e);
        }
        lr.setResultType(DataType.TUPLE);
        lr.setKeyType(keyTypes.get(i).size() > 1 ? DataType.TUPLE : keyTypes.get(i).get(0));
        lr.setPlans(inpPlans.get(inpPhyOp));
        LRs[i]= lr;
    }
}
 
開發者ID:sigmoidanalytics,項目名稱:spork-streaming,代碼行數:22,代碼來源:POMergeJoin.java

示例3: exec

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
@Override
public DataBag exec(Tuple input) throws IOException {    
    try {
        DataBag output = BagFactory.getInstance().newDefaultBag();
        String str = input.get(0).toString();
    
        String title = str;

        if (title != null) {
            List<String> nGrams = makeNGrams(title);
            
            for (Iterator<String> it = nGrams.iterator(); it.hasNext(); ) {
                Tuple t = TupleFactory.getInstance().newTuple(1);
                t.set(0, it.next());
                output.add(t);
            }
        }
    
        return output;
    } catch (ExecException ee) {
        IOException ioe = new IOException(ee.getMessage());
        ioe.initCause(ee);
        throw ioe;
    }
}
 
開發者ID:sigmoidanalytics,項目名稱:spork-streaming,代碼行數:26,代碼來源:TestEvalPipelineLocal.java

示例4: exec

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
@Override
public DataBag exec(Tuple input) throws IOException {
    try {
        DataBag output = BagFactory.getInstance().newDefaultBag();
        Iterator<Tuple> it = (DataType.toBag(input.get(0))).iterator();
        while(it.hasNext()) {
            Tuple t = it.next();
            Tuple newT = TupleFactory.getInstance().newTuple(2);
            newT.set(0, field0);
            newT.set(1, t.get(0).toString());
            output.add(newT);
        }

        return output;
    } catch (ExecException ee) {
        IOException ioe = new IOException(ee.getMessage());
        ioe.initCause(ee);
        throw ioe;
    }
}
 
開發者ID:sigmoidanalytics,項目名稱:spork-streaming,代碼行數:21,代碼來源:TestMapReduce.java

示例5: createJoinPlans

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
/**
 * Configures the Local Rearrange operators to get keys out of tuple.
 * @throws ExecException
 */
private void createJoinPlans(MultiMap<PhysicalOperator, PhysicalPlan> inpPlans, List<List<Byte>> keyTypes) throws PlanException{

    int i=-1;
    for (PhysicalOperator inpPhyOp : inpPlans.keySet()) {
        ++i;
        POLocalRearrange lr = new POLocalRearrange(genKey());
        try {
            lr.setIndex(i);
        } catch (ExecException e) {
            throw new PlanException(e.getMessage(),e.getErrorCode(),e.getErrorSource(),e);
        }
        lr.setResultType(DataType.TUPLE);
        lr.setKeyType(keyTypes.get(i).size() > 1 ? DataType.TUPLE : keyTypes.get(i).get(0));
        lr.setPlans(inpPlans.get(inpPhyOp));
        LRs[i]= lr;
    }
}
 
開發者ID:sigmoidanalytics,項目名稱:spork,代碼行數:22,代碼來源:POMergeJoin.java

示例6: createJoinPlans

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
private void createJoinPlans(MultiMap<PhysicalOperator, PhysicalPlan> inpPlans) throws PlanException {

        int i = -1;
        for (PhysicalOperator inpPhyOp : inpPlans.keySet()) {
            ++i;
            POLocalRearrange lr = new POLocalRearrange(genKey());
            try {
                lr.setIndex(i);
            } catch (ExecException e) {
                throw new PlanException(e.getMessage(), e.getErrorCode(), e.getErrorSource(), e);
            }
            lr.setResultType(DataType.TUPLE);
            lr.setKeyType(DataType.TUPLE);//keyTypes.get(i).size() > 1 ? DataType.TUPLE : keyTypes.get(i).get(0));
            lr.setPlans(inpPlans.get(inpPhyOp));
            LRs[i] = lr;
        }
    }
 
開發者ID:sigmoidanalytics,項目名稱:spork,代碼行數:18,代碼來源:SkewedJoinConverter.java

示例7: exec

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
@Override
public DataBag exec(Tuple input) throws IOException {
    try {
        DataBag output = BagFactory.getInstance().newDefaultBag();
        String str = input.get(0).toString();

        String title = str;

        if (title != null) {
            List<String> nGrams = makeNGrams(title);

            for (Iterator<String> it = nGrams.iterator(); it.hasNext(); ) {
                Tuple t = TupleFactory.getInstance().newTuple(1);
                t.set(0, it.next());
                output.add(t);
            }
        }

        return output;
    } catch (ExecException ee) {
        IOException ioe = new IOException(ee.getMessage());
        ioe.initCause(ee);
        throw ioe;
    }
}
 
開發者ID:sigmoidanalytics,項目名稱:spork,代碼行數:26,代碼來源:TestEvalPipeline.java

示例8: getValue

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
@Override
public Tuple getValue() {
  if (accumSketch_ == null) {
    accumSketch_ = new ItemsSketch<T>(sketchSize_);
  }
  final Tuple outputTuple;
  try {
    outputTuple = Util.serializeSketchToTuple(accumSketch_, serDe_);
  } catch (final ExecException ex) {
    throw new RuntimeException("Pig Error: " + ex.getMessage(), ex);
  }
  return outputTuple;
}
 
開發者ID:DataSketches,項目名稱:sketches-pig,代碼行數:14,代碼來源:DataToFrequentItemsSketch.java

示例9: createResultTuple

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
static Tuple createResultTuple(final long n, final int k, final DataBag samples) {
  final Tuple output = TupleFactory.getInstance().newTuple(3);

  try {
    output.set(0, n);
    output.set(1, k);
    output.set(2, samples);
  } catch (final ExecException e) {
    throw new RuntimeException("Pig error: " + e.getMessage(), e);
  }

  return output;
}
 
開發者ID:DataSketches,項目名稱:sketches-pig,代碼行數:14,代碼來源:ReservoirSampling.java

示例10: exec

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
@Override
public Tuple exec(Tuple input) throws IOException{
    try {
        Tuple output = TupleFactory.getInstance().newTuple(1);
        output.set(0, new String("g"));
        return output;
    } catch (ExecException ee) {
        IOException ioe = new IOException(ee.getMessage());
        ioe.initCause(ee);
        throw ioe;
    }
}
 
開發者ID:sigmoidanalytics,項目名稱:spork-streaming,代碼行數:13,代碼來源:TestLocal.java

示例11: illustratorMarkup

import org.apache.pig.backend.executionengine.ExecException; //導入方法依賴的package包/類
@Override
public Tuple illustratorMarkup(Object in, Object out, int eqClassIndex) {
    if(illustrator != null) {
        ExampleTuple tOut = new ExampleTuple((Tuple) out);
        LineageTracer lineageTracer = illustrator.getLineage();
        lineageTracer.insert(tOut);
        Tuple tmp;
        boolean synthetic = false;
        if (illustrator.getEquivalenceClasses() == null) {
            LinkedList<IdentityHashSet<Tuple>> equivalenceClasses = new LinkedList<IdentityHashSet<Tuple>>();
            for (int i = 0; i < numInputs; ++i) {
                IdentityHashSet<Tuple> equivalenceClass = new IdentityHashSet<Tuple>();
                equivalenceClasses.add(equivalenceClass);
            }
            illustrator.setEquivalenceClasses(equivalenceClasses, this);
        }

        if (distinct) {
            int count;
            for (count = 0; tupIter.hasNext(); ++count) {
                NullableTuple ntp = tupIter.next();
                tmp = (Tuple) ntp.getValueAsPigType();
                if (!tmp.equals(tOut))
                    lineageTracer.union(tOut, tmp);
            }
            if (count > 1) // only non-distinct tuples are inserted into the equivalence class
                illustrator.getEquivalenceClasses().get(eqClassIndex).add(tOut);
            illustrator.addData((Tuple) tOut);
            return (Tuple) tOut;
        }
        boolean outInEqClass = true;
        try {
            for (int i = 1; i < numInputs+1; i++)
            {
                DataBag dbs = (DataBag) ((Tuple) out).get(i);
                Iterator<Tuple> iter = dbs.iterator();
                if (dbs.size() <= 1 && outInEqClass) // all inputs have >= 2 records
                    outInEqClass = false;
                while (iter.hasNext()) {
                    tmp = iter.next();
                    // any of synthetic data in bags causes the output tuple to be synthetic
                    if (!synthetic && ((ExampleTuple)tmp).synthetic)
                        synthetic = true;
                    lineageTracer.union(tOut, tmp);
                }
            }
        } catch (ExecException e) {
          // TODO better exception handling
          throw new RuntimeException("Illustrator exception :"+e.getMessage());
        }
        if (outInEqClass)
            illustrator.getEquivalenceClasses().get(eqClassIndex).add(tOut);
        tOut.synthetic = synthetic;
        illustrator.addData((Tuple) tOut);
        return tOut;
    } else
        return (Tuple) out;
}
 
開發者ID:sigmoidanalytics,項目名稱:spork-streaming,代碼行數:59,代碼來源:POPackage.java


注:本文中的org.apache.pig.backend.executionengine.ExecException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。