本文整理汇总了Java中org.apache.hadoop.contrib.index.mapred.Shard类的典型用法代码示例。如果您正苦于以下问题:Java Shard类的具体用法?Java Shard怎么用?Java Shard使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Shard类属于org.apache.hadoop.contrib.index.mapred包,在下文中一共展示了Shard类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ShardWriter
import org.apache.hadoop.contrib.index.mapred.Shard; //导入依赖的package包/类
/**
* Constructor
* @param fs
* @param shard
* @param tempDir
* @param iconf
* @throws IOException
*/
public ShardWriter(FileSystem fs, Shard shard, String tempDir,
IndexUpdateConfiguration iconf) throws IOException {
LOG.info("Construct a shard writer");
this.fs = fs;
localFs = FileSystem.getLocal(iconf.getConfiguration());
perm = new Path(shard.getDirectory());
temp = new Path(tempDir);
long initGeneration = shard.getGeneration();
if (!fs.exists(perm)) {
assert (initGeneration < 0);
fs.mkdirs(perm);
} else {
restoreGeneration(fs, perm, initGeneration);
}
dir =
new MixedDirectory(fs, perm, localFs, fs.startLocalOutput(perm, temp),
iconf.getConfiguration());
// analyzer is null because we only use addIndexes, not addDocument
writer =
new IndexWriter(dir, false, null,
initGeneration < 0 ? new KeepOnlyLastCommitDeletionPolicy()
: new MixedDeletionPolicy());
setParameters(iconf);
}
示例2: init
import org.apache.hadoop.contrib.index.mapred.Shard; //导入依赖的package包/类
public void init(Shard[] shards) {
numShards = shards.length;
}
示例3: init
import org.apache.hadoop.contrib.index.mapred.Shard; //导入依赖的package包/类
public void init(Shard[] shards) {
numShards = shards.length;
rr = 0;
}