當前位置: 首頁>>代碼示例>>Java>>正文


Java RemoveDuplicates類代碼示例

本文整理匯總了Java中nl.vu.cs.ajira.actions.RemoveDuplicates的典型用法代碼示例。如果您正苦於以下問題:Java RemoveDuplicates類的具體用法?Java RemoveDuplicates怎麽用?Java RemoveDuplicates使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RemoveDuplicates類屬於nl.vu.cs.ajira.actions包,在下文中一共展示了RemoveDuplicates類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getResultsQuery

import nl.vu.cs.ajira.actions.RemoveDuplicates; //導入依賴的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;
}
 
開發者ID:jrbn,項目名稱:querypie,代碼行數:24,代碼來源:ReasoningUtils.java

示例2: applyTo

import nl.vu.cs.ajira.actions.RemoveDuplicates; //導入依賴的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);
}
 
開發者ID:jrbn,項目名稱:querypie,代碼行數:36,代碼來源:OptimalBCAlgo.java

示例3: main

import nl.vu.cs.ajira.actions.RemoveDuplicates; //導入依賴的package包/類
public static void main(String[] args) throws Exception {

		if (args.length < 2) {
			System.out
					.println("Usage: BenchmarkSorting <input dir> <output dir> --output [btree,files,none] --ibis-server --procs <num>");
			System.exit(0);
		}

		parseArgs(args);

		// Launch a simple job

		Ajira arch = new Ajira();
		Configuration conf = arch.getConfiguration();

		// Init some configuration params of the cluster
		conf.setBoolean(Consts.START_IBIS, ibis);
		conf.setInt(Consts.N_PROC_THREADS, nProcThreads);
		// conf.setInt(ReadFromFiles.MINIMUM_SPLIT_SIZE, 30000);

		// Start the cluster
		arch.startup();

		if (arch.amItheServer()) {
			// Now we can launch our program
			Job job = new Job();

			// Set up the program
			ActionSequence actions = new ActionSequence();

			// Split the input in more chunks, so that the reading
			// is done in parallel
			ActionConf c = ActionFactory.getActionConf(ReadFromFiles.class);
			c.setParamString(ReadFromFiles.S_PATH, args[0]);
			actions.add(c);

			// Distribute all the lines
			c = ActionFactory.getActionConf(PartitionToNodes.class);
			c.setParamStringArray(PartitionToNodes.SA_TUPLE_FIELDS,
					TString.class.getName());
			c.setParamBoolean(PartitionToNodes.B_SORT, true);
			int nNodes = arch.getNumberNodes();
			int nPartitionsPerNode = nNodes > 32 ? 1 : 32 / nNodes; // Assumes
																	// nNodes is
																	// a power
																	// of 2.
			c.setParamInt(PartitionToNodes.I_NPARTITIONS_PER_NODE,
					nPartitionsPerNode);
			actions.add(c);

			// Remove the duplicates
			actions.add(ActionFactory.getActionConf(RemoveDuplicates.class));

			if (output.equals("files")) {
				c = ActionFactory.getActionConf(WriteToFiles.class);
				c.setParamString(WriteToFiles.S_PATH, args[1]);
				actions.add(c);
			} else if (output.equals("btree")) {
				// TODO: Implement
			} else if (output.equals("none")) {
				c = ActionFactory.getActionConf(CollectToNode.class);
				c.setParamStringArray(CollectToNode.SA_TUPLE_FIELDS,
						TString.class.getName());
				actions.add(c);
			}

			// Launch it!
			job.setActions(actions);
			Submission s = arch.waitForCompletion(job);
			s.printStatistics();

			// Exit
			arch.shutdown();
			System.exit(0);

		}

	}
 
開發者ID:jrbn,項目名稱:ajira,代碼行數:79,代碼來源:BenchmarkSorting.java


注:本文中的nl.vu.cs.ajira.actions.RemoveDuplicates類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。