本文整理匯總了Java中nl.vu.cs.ajira.actions.ActionConf.setParamString方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionConf.setParamString方法的具體用法?Java ActionConf.setParamString怎麽用?Java ActionConf.setParamString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nl.vu.cs.ajira.actions.ActionConf
的用法示例。
在下文中一共展示了ActionConf.setParamString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getResultsQuery
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static ActionSequence getResultsQuery(ActionSequence chain,
Tuple tuple, boolean converge) throws ActionNotConfiguredException {
// Get the pattern
Query q = new Query(tuple);
ActionConf c = ActionFactory.getActionConf(QueryInputLayer.class);
c.setParamWritable(QueryInputLayer.W_QUERY, q);
c.setParamString(QueryInputLayer.S_INPUTLAYER,
QueryInputLayer.DEFAULT_LAYER);
chain.add(c);
if (converge) {
c = ActionFactory.getActionConf(CollectToNode.class);
c.setParamStringArray(CollectToNode.SA_TUPLE_FIELDS,
RDFTerm.class.getName(), RDFTerm.class.getName(),
RDFTerm.class.getName());
c.setParamBoolean(CollectToNode.B_SORT, true);
chain.add(c);
chain.add(ActionFactory.getActionConf(RemoveDuplicates.class));
}
return chain;
}
示例2: process
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
@Override
public void process(Tuple tuple, ActionContext context, ActionOutput actionOutput) throws Exception {
if (first) {
first = false;
for (int i = 1; i < tasks; ++i) {
ActionConf c = ActionFactory.getActionConf(QueryInputLayer.class);
c.setParamString(QueryInputLayer.S_INPUTLAYER, "DEFAULT");
Tuple t = query.getTuple();
SimpleData[] newTuple = new SimpleData[5];
newTuple[0] = t.get(0);
newTuple[1] = t.get(1);
newTuple[2] = t.get(2);
newTuple[3] = new TInt(i);
newTuple[4] = new TInt(tasks);
t.set(newTuple);
c.setParamWritable(QueryInputLayer.W_QUERY, query);
c.setParamStringArray(QueryInputLayer.SA_SIGNATURE_QUERY, t.getSignature());
actionOutput.branch(new ActionSequence(c));
}
}
actionOutput.output(tuple);
}
示例3: launchLister
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的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);
}
}
}
示例4: readEverythingFromFiles
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static void readEverythingFromFiles(String copyDir,
ActionSequence actions, Class<? extends FilenameFilter> filter)
throws ActionNotConfiguredException {
ActionConf c = ActionFactory.getActionConf(ReadFromFiles.class);
c.setParamString(ReadFromFiles.S_PATH, copyDir);
c.setParamString(ReadFromFiles.S_CUSTOM_READER,
TripleFileStorage.Reader.class.getName());
if (filter != null) {
c.setParamString(ReadFromFiles.S_FILE_FILTER, filter.getName());
}
actions.add(c);
}
示例5: applyTo
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static void applyTo(RDFTerm v1, RDFTerm v2, RDFTerm v3,
boolean explicit, int typeRules, long iteration,
ActionSequence actions) throws ActionNotConfiguredException {
ActionConf c = ActionFactory.getActionConf(QueryInputLayer.class);
c.setParamString(QueryInputLayer.S_INPUTLAYER,
DummyLayer.class.getName());
c.setParamWritable(
QueryInputLayer.W_QUERY,
new nl.vu.cs.ajira.actions.support.Query(TupleFactory.newTuple(
v1, v2, v3, new TInt(0))));
actions.add(c);
c = ActionFactory.getActionConf(ExpandQuery.class);
c.setParamBoolean(ExpandQuery.B_EXPLICIT, explicit);
c.setParamInt(ExpandQuery.I_TYPE_RULES, typeRules);
actions.add(c);
c = ActionFactory.getActionConf(CollectToNode.class);
c.setParamStringArray(CollectToNode.SA_TUPLE_FIELDS,
RDFTerm.class.getName(), RDFTerm.class.getName(),
RDFTerm.class.getName(), TBoolean.class.getName());
c.setParamBoolean(CollectToNode.B_SORT, true);
actions.add(c);
actions.add(ActionFactory.getActionConf(RemoveDuplicates.class));
c = ActionFactory.getActionConf(OptimalBCAlgo.class);
c.setParamLong(OptimalBCAlgo.L_FIELD1, v1.getValue());
c.setParamLong(OptimalBCAlgo.L_FIELD2, v2.getValue());
c.setParamLong(OptimalBCAlgo.L_FIELD3, v3.getValue());
c.setParamBoolean(OptimalBCAlgo.B_EXPLICIT, explicit);
c.setParamLong(OptimalBCAlgo.L_ITERATION, iteration);
actions.add(c);
}
示例6: reloadRulesOnOtherNodes
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
private void reloadRulesOnOtherNodes(ActionOutput output, String newList)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("reloadRulesOnOtherNodes");
}
ActionSequence sequence = new ActionSequence();
ActionConf c = ActionFactory.getActionConf(QueryInputLayer.class);
c.setParamString(QueryInputLayer.S_INPUTLAYER,
RDFStorage.class.getName());
c.setParamWritable(
QueryInputLayer.W_QUERY,
new nl.vu.cs.ajira.actions.support.Query(TupleFactory.newTuple(
new RDFTerm(Schema.CLOSURE_BROADCASTFLAG), new RDFTerm(
0), new RDFTerm(0), new TInt(0))));
sequence.add(c);
// Action which reloads the rules and sends nothing
c = ActionFactory.getActionConf(ReloadRules.class);
c.setParamString(ReloadRules.S_FILE, newList);
sequence.add(c);
// CollectToNode
c = ActionFactory.getActionConf(CollectToNode.class);
c.setParamStringArray(CollectToNode.SA_TUPLE_FIELDS,
TLong.class.getName());
sequence.add(c);
// Action that increase the lock in the stopProcess
sequence.add(ActionFactory.getActionConf(IncreaseLock.class));
output.branch(sequence);
}
示例7: addToChain
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static void addToChain(String inputFile, String outputFile,
ActionSequence actions) throws ActionNotConfiguredException {
ActionConf c = ActionFactory.getActionConf(DictionaryLookup.class);
c.setParamString(S_INPUT_FILE, inputFile);
c.setParamString(S_OUTPUT_FILE, outputFile);
actions.add(c);
}
示例8: addToChain
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static void addToChain(ActionSequence actions, String deltaDir,
boolean add) throws ActionNotConfiguredException {
ActionConf a = ActionFactory.getActionConf(IncrRulesController.class);
a.setParamString(IncrRulesController.S_DELTA_DIR, deltaDir);
a.setParamBoolean(IncrRulesController.B_ADD, add);
actions.add(a);
}
示例9: stopProcess
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
@Override
public void stopProcess(ActionContext context, ActionOutput actionOutput)
throws Exception {
context.putObjectInCache(CENTERS, centers);
context.broadcastCacheObjects(CENTERS);
if (context.isPrincipalBranch()) {
ActionSequence actions = new ActionSequence();
// Read the input files
ActionConf action = ActionFactory
.getActionConf(ReadFromFiles.class);
action.setParamString(ReadFromFiles.S_PATH, inputDir);
actions.add(action);
// Parse the textual lines into vectors
actions.add(ActionFactory.getActionConf(ParseVectors.class));
// Start the k-means procedure with a branch
kmeans(actions, outputDir);
actionOutput.branch(actions);
}
inputDir = null;
outputDir = null;
centers = null;
}
示例10: writeCopyToFiles
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static void writeCopyToFiles(String dir, ActionSequence actions,
boolean counts) throws ActionNotConfiguredException {
ActionConf c = ActionFactory.getActionConf(WriteToFiles.class);
c.setParamString(WriteToFiles.S_PATH, dir);
if (!counts) {
c.setParamString(WriteToFiles.S_CUSTOM_WRITER,
TripleFileStorage.Writer.class.getName());
} else {
c.setParamString(WriteToFiles.S_CUSTOM_WRITER,
TripleFileStorage.WriterCount.class.getName());
c.setParamString(WriteToFiles.S_PREFIX_FILE, "_count");
}
actions.add(c);
}
示例11: createJob
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的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;
}
示例12: addToChain
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static void addToChain(String attribute, int size, int channelId1, int channelId2, boolean winJoin, ActionSequence actions) throws ActionNotConfiguredException {
ActionConf c = ActionFactory.getActionConf(JoinOperator.class);
c.setParamString(S_ATTRIBUTE, attribute);
c.setParamInt(I_SIZE, size);
c.setParamInt(I_CHANNEL_ID_1, channelId1);
c.setParamInt(I_CHANNEL_ID_2, channelId2);
c.setParamBoolean(B_WINDOW_JOIN, winJoin);
actions.add(c);
}
示例13: addToChain
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static void addToChain(String attribute, int slack, Ordering ordering, ActionSequence actions) throws ActionNotConfiguredException {
ActionConf c = ActionFactory.getActionConf(SortOperator.class);
c.setParamString(S_ATTRIBUTE, attribute);
c.setParamInt(I_SLACK, slack);
c.setParamBoolean(B_ASCENDING, ordering == Ordering.ASCENDING);
actions.add(c);
}
示例14: main
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
if (args.length < 1) {
System.err.println("USAGE: PrintDictionary <dir>");
return;
}
ActionSequence list = new ActionSequence();
File dictDir = new File(args[0]);
if (dictDir.exists() && dictDir.listFiles().length > 0) {
ActionConf c = ActionFactory.getActionConf(ReadFromFiles.class);
c.setParamString(ReadFromFiles.S_PATH, dictDir.getAbsolutePath());
c.setParamString(ReadFromFiles.S_FILE_FILTER,
FilterOnlyDictionaryFiles.class.getName());
c.setParamString(ReadFromFiles.S_CUSTOM_READER,
Dictionary.Reader.class.getName());
list.add(c);
list.add(ActionFactory.getActionConf(PrintDictionary.class));
Ajira ajira = new Ajira();
ajira.startup();
if (ajira.amItheServer()) {
// Init the program and launch the execution.
Job job = new Job();
job.setActions(list);
ajira.waitForCompletion(job);
ajira.shutdown();
}
} else {
System.err.println("Dictionary directory does not contain dictionary.");
return;
}
}
示例15: readFakeTuple
import nl.vu.cs.ajira.actions.ActionConf; //導入方法依賴的package包/類
public static void readFakeTuple(ActionSequence actions)
throws ActionNotConfiguredException {
ActionConf a = ActionFactory.getActionConf(QueryInputLayer.class);
a.setParamString(QueryInputLayer.S_INPUTLAYER,
DummyLayer.class.getName());
a.setParamWritable(QueryInputLayer.W_QUERY, new Query());
actions.add(a);
}