本文整理汇总了Java中org.galagosearch.tupleflow.execution.ErrorHandler类的典型用法代码示例。如果您正苦于以下问题:Java ErrorHandler类的具体用法?Java ErrorHandler怎么用?Java ErrorHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ErrorHandler类属于org.galagosearch.tupleflow.execution包,在下文中一共展示了ErrorHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("ManifestWriter requires a 'filename' parameter.");
return;
}
File f = new File(parameters.getXML().get("filename"));
if (f.isFile() && f.canWrite()) {
return; // good news
}
if (f.isDirectory()) {
handler.addError("Pathname " + f.toString() + " exists, and it is a directory, but " +
"ManifestWriter would like to write a file there.");
return;
}
// this will search upwards and verify that we can make
// the necessary directory structure to store this file.
Verification.requireWriteableFile(f.toString(), handler);
}
示例2: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) throws ClassNotFoundException {
if (!Verification.requireParameters(new String[]{"class", "order"}, parameters.getXML(),
handler)) {
return;
}
String className = parameters.getXML().get("class");
String[] order = parameters.getXML().get("order").split(" ");
boolean result;
result = Verification.requireClass(className, handler);
result = result && Verification.requireOrder(className, order, handler);
if (!result) {
return;
}
Class klass = Class.forName(className);
Verification.verifyTypeReader("keys", klass, order, parameters, handler);
Verification.verifyTypeReader("values", klass, order, parameters, handler);
}
示例3: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters fullParameters, ErrorHandler handler) {
Parameters parameters = fullParameters.getXML();
String[] requiredParameters = {"order", "class"};
if (!Verification.requireParameters(requiredParameters, parameters, handler)) {
return;
}
String className = parameters.get("class");
String[] orderSpec = parameters.get("order").split(" ");
Verification.requireClass(className, handler);
Verification.requireOrder(className, orderSpec, handler);
if (parameters.containsKey("reducer")) {
String reducerType = parameters.get("reducer");
Verification.requireClass(reducerType, handler);
}
}
示例4: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("DocumentLengthsWriter requires an 'filename' parameter.");
return;
}
String filename = parameters.getXML().get("filename");
Verification.requireWriteableFile(filename, handler);
}
示例5: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("PositionsListWriter requires an 'filename' parameter.");
return;
}
String index = parameters.getXML().get("filename");
Verification.requireWriteableFile(index, handler);
}
示例6: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (parameters.getXML().containsKey("filename")) {
return;
}
if (parameters.getXML().stringList("word").size() == 0) {
handler.addWarning("Couldn't find any words in the stopword list.");
}
}
示例7: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!Verification.requireParameters(new String[] { "textSource" }, parameters.getXML(), handler))
return;
String readerName = parameters.getXML().get("textSource");
Verification.verifyTypeReader(readerName, AdditionalDocumentText.class, parameters, handler);
}
示例8: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("DocumentIndexWriter requires an 'filename' parameter.");
return;
}
String index = parameters.getXML().get("filename");
Verification.requireWriteableFile(index, handler);
}
示例9: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!Verification.requireParameters(new String[]{"filename"}, parameters.getXML(), handler)) {
return;
}
String filename = parameters.getXML().get("filename");
if (!new File(filename).isFile()) {
handler.addError("File " + filename + " does not exist.");
}
}
示例10: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!Verification.requireParameters(new String[] { "extractedLinks", "documentDatas" },
parameters.getXML(), handler)) {
return;
}
String extractedLinksName = parameters.getXML().get("extractedLinks");
String documentDatasName = parameters.getXML().get("documentDatas");
Verification.verifyTypeReader(extractedLinksName, ExtractedLink.class, parameters, handler);
Verification.verifyTypeReader(documentDatasName, DocumentData.class, parameters, handler);
}
示例11: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) throws ClassNotFoundException {
Verification.requireParameters(new String[]{"input", "class"}, parameters.getXML(), handler);
List<String> inputs = parameters.getXML().stringList("input");
String cls = parameters.getXML().get("class");
for (String input : inputs) {
Verification.verifyTypeReader(input, Class.forName(cls), parameters, handler);
}
}
示例12: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static boolean verify(TupleFlowParameters parameters, ErrorHandler handler) {
Parameters p = parameters.getXML();
if (!Verification.requireParameters(new String[] { "filename", "class" }, p, handler))
return false;
if (!Verification.requireClass(p.get("class"), handler))
return false;
if (!Verification.requireWriteableFile(p.get("filename"), handler))
return false;
return true;
}
示例13: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!(parameters.getXML().containsKey("directory") || parameters.getXML().containsKey("filename"))) {
handler.addError("FileSource requires either at least one directory or filename parameter.");
return;
}
if (parameters.getXML().containsKey("directory")) {
List<Value> directories = parameters.getXML().list("directory");
for (Value directory : directories) {
File directoryFile = new File(directory.toString());
if (directoryFile.exists() == false) {
handler.addError("Directory " + directoryFile.toString() + " doesn't exist.");
} else if (directoryFile.isDirectory() == false) {
handler.addError(directoryFile.toString() + " exists, but it isn't a directory.");
}
}
} else if (parameters.getXML().containsKey("filename")) {
List<Value> files = parameters.getXML().list("filename");
for (Value file : files) {
File f = new File(file.toString());
if (f.exists() == false) {
handler.addError("File " + file.toString() + " doesn't exist.");
} else if (f.isFile() == false) {
handler.addError(file.toString() + " exists, but isn't a file.");
}
}
}
}
示例14: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("DocumentNameWriter requires an 'filename' parameter.");
return;
}
}
示例15: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
Verification.verifyTypeReader("numberedDocumentData", NumberedDocumentData.class,
parameters, handler);
}