当前位置: 首页>>代码示例>>Java>>正文


Java ActionConf.setParamByteArray方法代码示例

本文整理汇总了Java中nl.vu.cs.ajira.actions.ActionConf.setParamByteArray方法的典型用法代码示例。如果您正苦于以下问题:Java ActionConf.setParamByteArray方法的具体用法?Java ActionConf.setParamByteArray怎么用?Java ActionConf.setParamByteArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nl.vu.cs.ajira.actions.ActionConf的用法示例。


在下文中一共展示了ActionConf.setParamByteArray方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: kmeans

import nl.vu.cs.ajira.actions.ActionConf; //导入方法依赖的package包/类
private static final void kmeans(ActionSequence actions, String outputDir)
		throws ActionNotConfiguredException {
	// Find the closest center
	actions.add(ActionFactory.getActionConf(FindClosestCenter.class));

	// Groups the pairs
	ActionConf action = ActionFactory.getActionConf(GroupBy.class);
	action.setParamStringArray(GroupBy.SA_TUPLE_FIELDS,
			TInt.class.getName(), TDoubleArray.class.getName());
	action.setParamByteArray(GroupBy.BA_FIELDS_TO_GROUP, (byte) 0);
	action.setParamInt(GroupBy.I_NPARTITIONS_PER_NODE, PARTITIONS_PER_NODE);
	actions.add(action);

	// Update the clusters
	actions.add(ActionFactory.getActionConf(UpdateClusters.class));

	// Write the results in a bucket
	action = ActionFactory.getActionConf(WriteToBucket.class);
	action.setParamStringArray(WriteToBucket.SA_TUPLE_FIELDS,
			TInt.class.getName(), TDoubleArray.class.getName());
	actions.add(action);

	// Collect to one node
	action = ActionFactory.getActionConf(CollectToNode.class);
	action.setParamStringArray(CollectToNode.SA_TUPLE_FIELDS,
			TInt.class.getName(), TInt.class.getName());
	actions.add(action);

	// Update the centroids
	action = ActionFactory.getActionConf(UpdateCentroids.class);
	action.setParamString(UpdateCentroids.S_OUTPUT_DIR, outputDir);
	actions.add(action);
}
 
开发者ID:jrbn,项目名称:ajira,代码行数:34,代码来源:KMeans.java

示例2: 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;
}
 
开发者ID:jrbn,项目名称:ajira,代码行数:32,代码来源:WordCount.java

示例3: createJob

import nl.vu.cs.ajira.actions.ActionConf; //导入方法依赖的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;
}
 
开发者ID:jrbn,项目名称:ajira,代码行数:41,代码来源:StreamingWordCount.java

示例4: groupAndSumCountsTriples

import nl.vu.cs.ajira.actions.ActionConf; //导入方法依赖的package包/类
private void groupAndSumCountsTriples(ActionSequence actions)
		throws ActionNotConfiguredException {
	ActionConf c = ActionFactory.getActionConf(GroupBy.class);
	c.setParamInt(GroupBy.I_NPARTITIONS_PER_NODE, 6);
	c.setParamByteArray(GroupBy.BA_FIELDS_TO_GROUP, (byte) 0, (byte) 1,
			(byte) 2);
	c.setParamStringArray(GroupBy.SA_TUPLE_FIELDS, TLong.class.getName(),
			TLong.class.getName(), TLong.class.getName(),
			TInt.class.getName(), TInt.class.getName());
	actions.add(c);

	actions.add(ActionFactory
			.getActionConf(nl.vu.cs.dynamite.index.SumCounts.class));
}
 
开发者ID:jrbn,项目名称:dynamite,代码行数:15,代码来源:CreateIndex.java

示例5: groupBy

import nl.vu.cs.ajira.actions.ActionConf; //导入方法依赖的package包/类
private static void groupBy(ActionSequence actions)
		throws ActionNotConfiguredException {
	ActionConf c = ActionFactory.getActionConf(GroupBy.class);
	c.setParamByteArray(GroupBy.BA_FIELDS_TO_GROUP, (byte) 0);
	c.setParamStringArray(GroupBy.SA_TUPLE_FIELDS,
			TByteArray.class.getName(), TBoolean.class.getName(),
			TByte.class.getName(), TLong.class.getName());
	c.setParamInt(GroupBy.I_NPARTITIONS_PER_NODE,
			nl.vu.cs.dynamite.reasoner.support.Consts.GROUP_BY_NUM_THREADS);
	actions.add(c);
}
 
开发者ID:jrbn,项目名称:dynamite,代码行数:12,代码来源:ActionsHelper.java

示例6: sort

import nl.vu.cs.ajira.actions.ActionConf; //导入方法依赖的package包/类
public static void sort(ActionSequence actions)
		throws ActionNotConfiguredException {
	ActionConf c = ActionFactory.getActionConf(PartitionToNodes.class);
	c.setParamInt(PartitionToNodes.I_NPARTITIONS_PER_NODE,
			nl.vu.cs.dynamite.reasoner.support.Consts.SORT_NUM_THREADS);
	c.setParamStringArray(PartitionToNodes.SA_TUPLE_FIELDS,
			TLong.class.getName(), TLong.class.getName(),
			TLong.class.getName(), TInt.class.getName());
	c.setParamBoolean(PartitionToNodes.B_SORT, true);
	c.setParamByteArray(PartitionToNodes.BA_PARTITION_FIELDS, (byte) 0,
			(byte) 1, (byte) 2);
	actions.add(c);
}
 
开发者ID:jrbn,项目名称:dynamite,代码行数:14,代码来源:ActionsHelper.java

示例7: createJob

import nl.vu.cs.ajira.actions.ActionConf; //导入方法依赖的package包/类
public static Job createJob(String filename)
		throws ActionNotConfiguredException {
	Job job = new Job();
	ActionSequence actions = new ActionSequence();

	// Input
	RandomTupleGeneratorAction.addToChain(numTuples, numDistinctWords,
			seed, actions);

	// Partition by words
	ActionConf action = ActionFactory.getActionConf(PartitionToNodes.class);
	action.setParamInt(PartitionToNodes.I_NPARTITIONS_PER_NODE,
			numInputPartitionsPerNode);
	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);

	// Rolling count
	RollingCountAction.addToChain(winSizeInSeconds, updateFreqInSeconds,
			evalMode, actions);

	// Partition by words
	action = ActionFactory.getActionConf(PartitionToNodes.class);
	action.setParamInt(PartitionToNodes.I_NPARTITIONS_PER_NODE,
			numIntermediatePartitionsPerNode);
	action.setParamBoolean(PartitionToNodes.B_SORT, false);
	action.setParamBoolean(PartitionToNodes.B_STREAMING, true);
	action.setParamByteArray(PartitionToNodes.BA_PARTITION_FIELDS, bytes);
	action.setParamStringArray(PartitionToNodes.SA_TUPLE_FIELDS,
			TString.class.getName(), TLong.class.getName());
	actions.add(action);

	// Intermediate ranking
	AbstractRankerAction.addIntermediateRankingToChain(topN,
			updateFreqInSeconds, evalMode, actions);

	// 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,
			TStringArray.class.getName(), TLongArray.class.getName());
	actions.add(action);

	// Total ranking
	AbstractRankerAction.addTotalRankingToChain(topN, updateFreqInSeconds,
			evalMode, actions);

	// Print the results
	TuplePrinter.addToChain(filename, actions);

	job.setActions(actions);
	return job;
}
 
开发者ID:jrbn,项目名称:ajira,代码行数:59,代码来源:TrendingTopicsLaunch.java


注:本文中的nl.vu.cs.ajira.actions.ActionConf.setParamByteArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。