本文整理汇总了Java中nl.vu.cs.ajira.submissions.Job类的典型用法代码示例。如果您正苦于以下问题:Java Job类的具体用法?Java Job怎么用?Java Job使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Job类属于nl.vu.cs.ajira.submissions包,在下文中一共展示了Job类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateInput
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private final void generateInput(Ajira ajira, int seed, int numThreads) {
ExecutionPath path = ExecutionPath.getExecutionPath();
path = path.addRandomTestGenerator(seed, numThreads, EvalHelper.generateAttributeList("A", "B", "C", "D"), numEvents, seed);
Job job = JobGenerator.generateJobFrom(path);
ajira.waitForCompletion(job);
if (runJoin) {
path = ExecutionPath.getExecutionPath();
path = path.addRandomTestGenerator(100 + seed, numThreads, EvalHelper.generateAttributeList("A", "B", "C"), numEvents, 100 + seed);
job = JobGenerator.generateJobFrom(path);
ajira.waitForCompletion(job);
path = ExecutionPath.getExecutionPath();
path = path.addRandomTestGenerator(200 + seed, numThreads, EvalHelper.generateAttributeList("A", "D", "E"), numEvents, 200 + seed);
job = JobGenerator.generateJobFrom(path);
ajira.waitForCompletion(job);
}
}
示例2: main
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
public static void main(String args[]) {
Ajira ajira = new Ajira();
ajira.getConfiguration().set(InputLayer.INPUT_LAYER_CLASS, RandomInputLayer.class.getName());
try {
ajira.startup();
} catch (Exception e1) {
e1.printStackTrace();
}
Job job = new Job();
try {
job.setActions(generateSequence());
} catch (Exception e) {
e.printStackTrace();
}
double startTime = System.nanoTime();
ajira.waitForCompletion(job);
double endTime = System.nanoTime();
System.out.println("Total time: " + (endTime - startTime) / 1000000.0 + " ms");
ajira.shutdown();
}
示例3: launchReasoning
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private static void launchReasoning(Ajira arch) throws ActionNotConfiguredException {
Job job = new Job();
ActionSequence actions = new ActionSequence();
if (deltaDir == null) {
ActionsHelper.readFakeTuple(actions);
CompleteRulesController.addToChain(actions);
} else {
loadLastStepFromFile();
ActionsHelper.readFakeTuple(actions);
IncrRulesController.addToChain(actions, deltaDir, add);
}
job.setActions(actions);
if (arch.amItheServer()) {
try {
Submission s = arch.waitForCompletion(job);
s.printStatistics();
} catch (Exception e) {
log.error("The job is failed!", e);
}
}
writeLastStepToFile();
}
示例4: launchLister
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private static void launchLister(Ajira arch, String dest) throws ActionNotConfiguredException {
Job job = new Job();
ActionSequence actions = new ActionSequence();
ActionsHelper.readEverythingFromBTree(actions);
ActionConf c = ActionFactory.getActionConf(WriteToFiles.class);
c.setParamString(WriteToFiles.S_PATH, dest);
actions.add(c);
job.setActions(actions);
if (arch.amItheServer()) {
try {
Submission s = arch.waitForCompletion(job);
s.printStatistics();
} catch (Exception e) {
log.error("The job is failed!", e);
}
}
}
示例5: launchProcessing
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private static void launchProcessing(Ajira ajira)
throws ActionNotConfiguredException {
ActionSequence actions = new ActionSequence();
ActionConf c = ActionFactory.getActionConf(ReadFromFiles.class);
c.setParamString(ReadFromFiles.S_PATH, dictionaryDir);
c.setParamString(ReadFromFiles.S_FILE_FILTER,
FilterOnlyDictionaryFiles.class.getName());
c.setParamString(ReadFromFiles.S_CUSTOM_READER,
Dictionary.Reader.class.getName());
actions.add(c);
DictionaryLookup.addToChain(input, output, actions);
Job job = new Job();
job.setActions(actions);
Submission s = ajira.waitForCompletion(job);
s.printStatistics();
ajira.shutdown();
}
示例6: createJob
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
public static Job createJob(String inDir, String outDir)
throws ActionNotConfiguredException {
Job job = new Job();
ActionSequence actions = new ActionSequence();
// Read the input files
ActionConf action = ActionFactory.getActionConf(ReadFromFiles.class);
action.setParamString(ReadFromFiles.S_PATH, inDir);
actions.add(action);
// Count the words
actions.add(ActionFactory.getActionConf(CountWords.class));
// Groups the pairs
action = ActionFactory.getActionConf(GroupBy.class);
action.setParamStringArray(GroupBy.SA_TUPLE_FIELDS,
TString.class.getName(), TInt.class.getName());
action.setParamByteArray(GroupBy.BA_FIELDS_TO_GROUP, (byte) 0);
actions.add(action);
// Sum the counts
actions.add(ActionFactory.getActionConf(SumCounts.class));
// Write the results on files
action = ActionFactory.getActionConf(WriteToFiles.class);
action.setParamString(WriteToFiles.S_PATH, outDir);
actions.add(action);
job.setActions(actions);
return job;
}
示例7: createJob
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
public static Job createJob(String filename)
throws ActionNotConfiguredException {
Job job = new Job();
ActionSequence actions = new ActionSequence();
// Input
RandomTupleGeneratorAction.addToChain(numTuples, numDistinctPhrases,
numWordsPerPhrase, numDistinctWords, seed, actions);
// Count the words
actions.add(ActionFactory.getActionConf(CountWords.class));
ActionConf action = ActionFactory.getActionConf(PartitionToNodes.class);
action.setParamInt(PartitionToNodes.I_NPARTITIONS_PER_NODE,
numPartitions);
action.setParamBoolean(PartitionToNodes.B_SORT, false);
action.setParamBoolean(PartitionToNodes.B_STREAMING, true);
byte[] bytes = { 0 };
action.setParamByteArray(PartitionToNodes.BA_PARTITION_FIELDS, bytes);
action.setParamStringArray(PartitionToNodes.SA_TUPLE_FIELDS,
TString.class.getName());
actions.add(action);
// Sum the counts
actions.add(ActionFactory.getActionConf(SumCounts.class));
// Collect to node
action = ActionFactory.getActionConf(CollectToNode.class);
action.setParamBoolean(CollectToNode.B_SORT, false);
action.setParamBoolean(CollectToNode.B_STREAMING_MODE, true);
action.setParamStringArray(CollectToNode.SA_TUPLE_FIELDS,
TString.class.getName(), TLong.class.getName());
actions.add(action);
// Print the results
TuplePrinter.addToChain(filename, actions);
job.setActions(actions);
return job;
}
示例8: runMultiThreadExamples
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private final void runMultiThreadExamples(Ajira ajira) {
int maxNumThreads = 8;
int maxLength = 100;
for (int numThreads = 1; numThreads <= maxNumThreads; numThreads++) {
for (int seed = 0; seed <= numSeeds; seed++) {
generateInput(ajira, seed, numThreads);
}
for (int seed = 0; seed <= numSeeds; seed++) {
for (int length = 5; length <= maxLength; length += 5) {
Job job = generateFilterMultiThreadExample(numThreads, length);
runExample("MultiThread_" + numThreads, ajira, job, seed, length == maxLength);
}
}
}
}
示例9: runExample
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private final void runExample(String name, Ajira ajira, Job job, int seed, boolean newLine) {
long startTime = System.nanoTime();
ajira.waitForCompletion(job);
double totalLatency = ((System.nanoTime() - startTime)) / 1000000.0;
// double perEventLatency = totalLatency / numEvents;
if (seed > 0) writeToFile(name, totalLatency, newLine);
}
示例10: generateFilterExample
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private final Job generateFilterExample(int seed) {
ExecutionPath path = ExecutionPath.getExecutionPath();
path = path.addRandomTestReader(seed);
path = path.addFilterOperator(EvalHelper.generateFilter("A", Op.GT, 50));
if (printTuples) path = path.addTuplePrinter();
return JobGenerator.generateJobFrom(path);
}
示例11: generateMapExample
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private final Job generateMapExample(int seed) {
ExecutionPath path = ExecutionPath.getExecutionPath();
path = path.addRandomTestReader(seed);
path = path.addMapOperator("A", "B", "C");
if (printTuples) path = path.addTuplePrinter();
return JobGenerator.generateJobFrom(path);
}
示例12: generateAggregateExample
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private final Job generateAggregateExample(int seed) {
ExecutionPath path = ExecutionPath.getExecutionPath();
path = path.addRandomTestReader(seed);
path = path.addAggregateOperator("A", 100, 1, AggregationFunction.AVG, EvalHelper.generateAttributeSet("A", "B", "C", "D"));
if (printTuples) path = path.addTuplePrinter();
return JobGenerator.generateJobFrom(path);
}
示例13: generateOrderExample
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private final Job generateOrderExample(int seed) {
ExecutionPath path = ExecutionPath.getExecutionPath();
path = path.addRandomTestReader(seed);
path = path.addSortOperator("A", 100, Ordering.ASCENDING);
if (printTuples) path = path.addTuplePrinter();
return JobGenerator.generateJobFrom(path);
}
示例14: generateJoinExample
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private final Job generateJoinExample(int seed, int win) {
ExecutionPath path = ExecutionPath.getExecutionPath();
path = path.addRandomTestReader(100 + seed);
ExecutionPath otherPath = ExecutionPath.getExecutionPath();
otherPath = otherPath.addRandomTestReader(200 + seed);
path = path.join("A", win, otherPath, true);
if (printTuples) path = path.addTuplePrinter();
return JobGenerator.generateJobFrom(path);
}
示例15: generateMapMultiFiltersExample
import nl.vu.cs.ajira.submissions.Job; //导入依赖的package包/类
private final Job generateMapMultiFiltersExample() {
ExecutionPath path = ExecutionPath.getExecutionPath();
path = path.addRandomTestReader(0);
path = path.addFilterOperator(EvalHelper.generateFilter("A", Op.GT, 50));
path = path.addFilterOperator(EvalHelper.generateFilter("B", Op.GT, 0));
path = path.addFilterOperator(EvalHelper.generateFilter("C", Op.LT, 100));
path = path.addMapOperator("A", "B", "C");
if (printTuples) path = path.addTuplePrinter();
return JobGenerator.generateJobFrom(path);
}