本文整理汇总了Java中org.apache.pig.backend.BackendException类的典型用法代码示例。如果您正苦于以下问题:Java BackendException类的具体用法?Java BackendException怎么用?Java BackendException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BackendException类属于org.apache.pig.backend包,在下文中一共展示了BackendException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: killJob
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
@Override
public void killJob(String jobID, Configuration conf) throws BackendException {
try {
if (conf != null) {
JobConf jobConf = new JobConf(conf);
JobClient jc = new JobClient(jobConf);
JobID id = JobID.forName(jobID);
RunningJob job = jc.getJob(id);
if (job == null)
System.out.println("Job with id " + jobID + " is not active");
else
{
job.killJob();
log.info("Kill " + id + " submitted.");
}
}
} catch (IOException e) {
throw new BackendException(e);
}
}
示例2: inferWritable
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
protected Object inferWritable(Object o) throws BackendException {
System.out.println("Got object '" + o + "' type " + o.getClass());
switch (DataType.findType(o)) {
case BYTEARRAY: {
return new BytesWritable(((DataByteArray) o).get());
}
case CHARARRAY: {
return new Text(o.toString());
}
case INTEGER: {
return new IntWritable((Integer) o);
}
case LONG: {
return new LongWritable((Long) o);
}
case FLOAT: {
return new FloatWritable((Float) o);
}
case DOUBLE: {
return new DoubleWritable((Double) o);
}
case BOOLEAN: {
return new BooleanWritable((Boolean) o);
}
case BYTE: {
return new ByteWritable((Byte) o);
}
}
throw new BackendException("Unable to translate " + o.getClass() +
" to a Writable datatype");
}
示例3: cancel
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
@Override
public void cancel(InterpreterContext context) {
LOGGER.info("Cancel paragraph:" + context.getParagraphId());
PigScriptListener listener = listenerMap.get(context.getParagraphId());
if (listener != null) {
Set<String> jobIds = listener.getJobIds();
if (jobIds.isEmpty()) {
LOGGER.info("No job is started, so can not cancel paragraph:" + context.getParagraphId());
}
for (String jobId : jobIds) {
LOGGER.info("Kill jobId:" + jobId);
HExecutionEngine engine =
(HExecutionEngine) getPigServer().getPigContext().getExecutionEngine();
try {
Field launcherField = HExecutionEngine.class.getDeclaredField("launcher");
launcherField.setAccessible(true);
Launcher launcher = (Launcher) launcherField.get(engine);
// It doesn't work for Tez Engine due to PIG-5035
launcher.killJob(jobId, new Configuration());
} catch (NoSuchFieldException | BackendException | IllegalAccessException e) {
LOGGER.error("Fail to cancel paragraph:" + context.getParagraphId(), e);
}
}
} else {
LOGGER.warn("No PigScriptListener found, can not cancel paragraph:"
+ context.getParagraphId());
}
}
示例4: setKeyType
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
protected void setKeyType(Class<?> keyClass) throws BackendException {
this.keyType |= inferPigDataType(keyClass);
if (keyType == DataType.ERROR) {
LOG.warn("Unable to translate key "+key.getClass()+" to a Pig datatype");
throw new BackendException("Unable to translate "+key.getClass()+" to a Pig datatype");
}
}
示例5: setValueType
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
protected void setValueType(Class<?> valueClass) throws BackendException {
this.valType |= inferPigDataType(valueClass);
if (keyType == DataType.ERROR) {
LOG.warn("Unable to translate key "+key.getClass()+" to a Pig datatype");
throw new BackendException("Unable to translate "+key.getClass()+" to a Pig datatype");
}
}
示例6: kill
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
@Override
public void kill() throws BackendException {
if (runningJob != null) {
try {
runningJob.killJob();
} catch (Exception e) {
throw new BackendException(e);
}
}
destroy();
}
示例7: killJob
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
@Override
public void killJob(String jobID, Configuration conf) throws BackendException {
if (runningJob != null && runningJob.getApplicationId().toString() == jobID) {
try {
runningJob.killJob();
} catch (Exception e) {
throw new BackendException(e);
}
} else {
log.info("Cannot find job: " + jobID);
}
}
示例8: setKeyType
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
protected void setKeyType(Class<?> keyClass) throws BackendException {
this.keyType |= inferPigDataType(keyClass);
if (keyType == DataType.ERROR) {
LOG.warn("Unable to translate key "+key.getClass()+" to a Pig datatype");
throw new BackendException("Unable to translate "+key.getClass()+" to a Pig datatype");
}
}
示例9: setValueType
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
protected void setValueType(Class<?> valueClass) throws BackendException {
this.valType |= inferPigDataType(valueClass);
if (keyType == DataType.ERROR) {
LOG.warn("Unable to translate key "+key.getClass()+" to a Pig datatype");
throw new BackendException("Unable to translate "+key.getClass()+" to a Pig datatype");
}
}
示例10: kill
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
@Override
public void kill() throws BackendException {
// Not really necessary for a streaming job...
}
示例11: killJob
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
@Override
public void killJob(String jobID, Configuration conf)
throws BackendException {
// Not really necessary for a streaming job...
}
示例12: killJob
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
public abstract void killJob(String jobID, Configuration conf)
throws BackendException;
示例13: kill
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
@Override
public void kill() throws BackendException {
// TODO Auto-generated method stub
}
示例14: killJob
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
@Override
public void killJob(String jobID, Configuration conf)
throws BackendException {
// TODO Auto-generated method stub
}
示例15: killJob
import org.apache.pig.backend.BackendException; //导入依赖的package包/类
@Override
public void killJob(String jobID) throws BackendException {
if (launcher != null) {
launcher.killJob(jobID, getJobConf());
}
}