当前位置: 首页>>代码示例>>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;未经允许,请勿转载。