当前位置: 首页>>代码示例>>Java>>正文


Java JobCreationException类代码示例

本文整理汇总了Java中org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException的典型用法代码示例。如果您正苦于以下问题:Java JobCreationException类的具体用法?Java JobCreationException怎么用?Java JobCreationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JobCreationException类属于org.apache.pig.backend.hadoop.executionengine.mapReduceLayer包,在下文中一共展示了JobCreationException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGlob6

import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException; //导入依赖的package包/类
@Test
public void testGlob6() throws IOException {
    // Verify that an IOException is thrown if no files are matched by the glob pattern.
    String output = outbasedir + "testGlob6";
    deleteDirectory(new File(output));
    String [] queries = {
       " in = LOAD '" + Util.encodeEscape(testNoMatchedFiles) + "' USING org.apache.pig.piggybank.storage.avro.AvroStorage ();",
       " STORE in INTO '" + output + "' USING org.apache.pig.piggybank.storage.avro.AvroStorage (" +
           "   'schema', '{\"type\":\"array\",\"items\":\"float\"}'  );"
        };
    try {
        testAvroStorage(queries);
        Assert.fail("Negative test to test an exception. Should not be succeeding!");
    } catch (JobCreationException e) {
        // The IOException thrown by AvroStorage for input file not found is catched
        // by the Pig backend, and JobCreationException (a subclass of IOException)
        // is re-thrown while creating a job configuration.
        assertEquals(e.getMessage(), "Internal error creating job configuration.");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:21,代码来源:TestAvroStorage.java

示例2: testJobControlCompilerErr

import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException; //导入依赖的package包/类
@Test
public void testJobControlCompilerErr() throws Exception {
    String query = "a = load 'input';" + "b = order a by $0;" + "store b into 'output';";
    PigServer pigServer = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
    PhysicalPlan pp = Util.buildPp(pigServer, query);
    POStore store = GenPhyOp.dummyPigStorageOp();
    pp.addAsLeaf(store);
    MROperPlan mrPlan = Util.buildMRPlan(pp, pc);
    
    for(MapReduceOper mro: mrPlan.getLeaves()) {
        if(mro.reducePlan != null) {
            PhysicalOperator po = mro.reducePlan.getRoots().get(0);
            if(po instanceof POPackage) {
                ((POPackage)po).setKeyType(DataType.BAG);
                mro.setGlobalSort(true);
            }
        }
    }
    
    ConfigurationValidator.validatePigProperties(pc.getProperties());
    Configuration conf = ConfigurationUtil.toConfiguration(pc.getProperties());
    JobControlCompiler jcc = new JobControlCompiler(pc, conf);
    try {
        jcc.compile(mrPlan, "Test");
    } catch (JobCreationException jce) {
        assertTrue(jce.getErrorCode() == 1068);
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:29,代码来源:TestJobSubmission.java

示例3: testJobControlCompilerErr

import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException; //导入依赖的package包/类
@Test
public void testJobControlCompilerErr() throws Exception {
	String query = "a = load 'input';" + "b = order a by $0;" + "store b into 'output';";
	PigServer pigServer = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
	PhysicalPlan pp = Util.buildPp(pigServer, query);
	POStore store = GenPhyOp.dummyPigStorageOp();
	pp.addAsLeaf(store);
	MROperPlan mrPlan = Util.buildMRPlan(pp, pc);
	
	for(MapReduceOper mro: mrPlan.getLeaves()) {
		if(mro.reducePlan != null) {
			PhysicalOperator po = mro.reducePlan.getRoots().get(0);
			if(po instanceof POPackage) {
				((POPackage)po).setKeyType(DataType.BAG);
				mro.setGlobalSort(true);
			}
		}
	}
	
    ConfigurationValidator.validatePigProperties(pc.getProperties());
    Configuration conf = ConfigurationUtil.toConfiguration(pc.getProperties());
    JobControlCompiler jcc = new JobControlCompiler(pc, conf);
    try {
    	jcc.compile(mrPlan, "Test");
    } catch (JobCreationException jce) {
        assertTrue(jce.getErrorCode() == 1068);
    }
}
 
开发者ID:PonIC,项目名称:PonIC,代码行数:29,代码来源:TestJobSubmission.java


注:本文中的org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。