本文整理汇总了Java中com.carrotsearch.hppc.IntObjectHashMap类的典型用法代码示例。如果您正苦于以下问题:Java IntObjectHashMap类的具体用法?Java IntObjectHashMap怎么用?Java IntObjectHashMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IntObjectHashMap类属于com.carrotsearch.hppc包,在下文中一共展示了IntObjectHashMap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: readFrom
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
jobId = new UUID(in.readLong(), in.readLong());
fetchPhaseId = in.readVInt();
int numReaders = in.readVInt();
if (numReaders > 0) {
toFetch = new IntObjectHashMap<>(numReaders);
for (int i = 0; i < numReaders; i++) {
int readerId = in.readVInt();
int numDocs = in.readVInt();
IntArrayList docs = new IntArrayList(numDocs);
toFetch.put(readerId, docs);
for (int j = 0; j < numDocs; j++) {
docs.add(in.readInt());
}
}
}
}
开发者ID:baidu,项目名称:Elasticsearch,代码行数:20,代码来源:NodeFetchRequest.java
示例2: State
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
protected State (String name, int index, double initialWeight, double finalWeight,
int[] inputs, int[] outputs, double[] weights,
String[] destinationNames, FeatureTransducer transducer)
{
assert (inputs.length == outputs.length
&& inputs.length == weights.length
&& inputs.length == destinationNames.length);
this.transducer = transducer;
this.name = name;
this.index = index;
this.initialWeight = initialWeight;
this.finalWeight = finalWeight;
this.transitions = new Transition[inputs.length];
this.input2transitions = new IntObjectHashMap ();
transitionCounts = null;
for (int i = 0; i < inputs.length; i++) {
// This constructor places the transtion into this.input2transitions
transitions[i] = new Transition (inputs[i], outputs[i],
weights[i], this, destinationNames[i]);
transitions[i].index = i;
}
}
开发者ID:mimno,项目名称:Mallet,代码行数:23,代码来源:FeatureTransducer.java
示例3: NodeFetchRequest
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
public NodeFetchRequest(UUID jobId, int fetchPhaseId, IntObjectHashMap<IntContainer> toFetch) {
this.jobId = jobId;
this.fetchPhaseId = fetchPhaseId;
if (!toFetch.isEmpty()) {
this.toFetch = toFetch;
}
}
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:NodeFetchRequest.java
示例4: PercolatorService
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
@Inject
public PercolatorService(Settings settings, IndexNameExpressionResolver indexNameExpressionResolver, IndicesService indicesService,
PageCacheRecycler pageCacheRecycler, BigArrays bigArrays,
HighlightPhase highlightPhase, ClusterService clusterService,
AggregationPhase aggregationPhase, ScriptService scriptService,
MappingUpdatedAction mappingUpdatedAction) {
super(settings);
this.indexNameExpressionResolver = indexNameExpressionResolver;
this.parseFieldMatcher = new ParseFieldMatcher(settings);
this.indicesService = indicesService;
this.pageCacheRecycler = pageCacheRecycler;
this.bigArrays = bigArrays;
this.clusterService = clusterService;
this.highlightPhase = highlightPhase;
this.aggregationPhase = aggregationPhase;
this.scriptService = scriptService;
this.mappingUpdatedAction = mappingUpdatedAction;
this.sortParseElement = new SortParseElement();
final long maxReuseBytes = settings.getAsBytesSize("indices.memory.memory_index.size_per_thread", new ByteSizeValue(1, ByteSizeUnit.MB)).bytes();
cache = new CloseableThreadLocal<MemoryIndex>() {
@Override
protected MemoryIndex initialValue() {
// TODO: should we expose payloads as an option? should offsets be turned on always?
return new ExtendedMemoryIndex(true, false, maxReuseBytes);
}
};
single = new SingleDocumentPercolatorIndex(cache);
multi = new MultiDocumentPercolatorIndex(cache);
percolatorTypes = new IntObjectHashMap<>(6);
percolatorTypes.put(countPercolator.id(), countPercolator);
percolatorTypes.put(queryCountPercolator.id(), queryCountPercolator);
percolatorTypes.put(matchPercolator.id(), matchPercolator);
percolatorTypes.put(queryPercolator.id(), queryPercolator);
percolatorTypes.put(scoringPercolator.id(), scoringPercolator);
percolatorTypes.put(topMatchingPercolator.id(), topMatchingPercolator);
}
开发者ID:baidu,项目名称:Elasticsearch,代码行数:39,代码来源:PercolatorService.java
示例5: buildNamedAnalyzer
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
public static synchronized NamedAnalyzer buildNamedAnalyzer(FormatDateTimeFormatter formatter, int precisionStep) {
IntObjectHashMap<NamedAnalyzer> precisionMap = globalAnalyzers.get(formatter.format());
if (precisionMap == null) {
precisionMap = new IntObjectHashMap<>();
globalAnalyzers.put(formatter.format(), precisionMap);
}
NamedAnalyzer namedAnalyzer = precisionMap.get(precisionStep);
if (namedAnalyzer == null) {
String name = "_date/" + ((precisionStep == Integer.MAX_VALUE) ? "max" : precisionStep);
namedAnalyzer = new NamedAnalyzer(name, AnalyzerScope.GLOBAL, new NumericDateAnalyzer(precisionStep, formatter.parser()));
precisionMap.put(precisionStep, namedAnalyzer);
}
return namedAnalyzer;
}
开发者ID:baidu,项目名称:Elasticsearch,代码行数:15,代码来源:NumericDateAnalyzer.java
示例6: channelClosed
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
void channelClosed(Throwable ex) {
isOpen.set(false);
if (ex != null) {
final IntObjectHashMap<RpcOutcome<?>> clonedMap;
synchronized (map) {
clonedMap = map.clone();
map.clear();
}
final RpcException e = RpcException.mapException(ex);
clonedMap.forEach(new SetExceptionProcedure(e));
}
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:13,代码来源:RequestIdMap.java
示例7: addFragment
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
private void addFragment(final FragmentData fragmentData) {
final FragmentHandle fragmentHandle = fragmentData.getHandle();
final int majorFragmentId = fragmentHandle.getMajorFragmentId();
final int minorFragmentId = fragmentHandle.getMinorFragmentId();
IntObjectHashMap<FragmentData> minorMap = fragmentDataMap.get(majorFragmentId);
if (minorMap == null) {
minorMap = new IntObjectHashMap<>();
fragmentDataMap.put(majorFragmentId, minorMap);
}
minorMap.put(minorFragmentId, fragmentData);
fragmentDataSet.add(fragmentData);
}
开发者ID:axbaretto,项目名称:drill,代码行数:14,代码来源:QueryManager.java
示例8: apply
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
@Override
public boolean apply(final int majorFragmentId, final IntObjectHashMap<FragmentData> minorMap) {
final MajorFragmentProfile.Builder builder = MajorFragmentProfile.newBuilder().setMajorFragmentId(majorFragmentId);
minorMap.forEach(new InnerIter(builder));
profileBuilder.addFragmentProfile(builder);
return true;
}
开发者ID:axbaretto,项目名称:drill,代码行数:8,代码来源:QueryManager.java
示例9: channelClosed
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
void channelClosed(Throwable ex) {
isOpen.set(false);
if (ex != null) {
final RpcException e = RpcException.mapException(ex);
IntObjectHashMap<RpcOutcome<?>> clonedMap;
synchronized (map) {
clonedMap = map.clone();
map.clear();
}
clonedMap.forEach(new SetExceptionProcedure(e));
}
}
开发者ID:axbaretto,项目名称:drill,代码行数:13,代码来源:RequestIdMap.java
示例10: generate
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
@Override
public ConcatVectorNamespace generate(SourceOfRandomness sourceOfRandomness, GenerationStatus generationStatus) {
ConcatVectorNamespace namespace = new ConcatVectorNamespace();
namespace.featureToIndex.putAll(generateFeatureMap(sourceOfRandomness));
for (ObjectCursor<String> key : namespace.featureToIndex.keys()) {
if (sourceOfRandomness.nextBoolean()) {
ObjectIntMap<String> sparseMap = generateFeatureMap(sourceOfRandomness);
IntObjectMap< String> reverseSparseMap = new IntObjectHashMap<>();
for (ObjectCursor<String> sparseKey : sparseMap.keys()) reverseSparseMap.put(sparseMap.get(sparseKey.value), sparseKey.value);
namespace.sparseFeatureIndex.put(key.value, sparseMap);
namespace.reverseSparseFeatureIndex.put(key.value, reverseSparseMap);
}
}
return namespace;
}
开发者ID:keenon,项目名称:loglinear,代码行数:16,代码来源:ConcatVectorNamespaceTest.java
示例11: test
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
@Override
public int test() {
final IntObjectHashMap<Integer> m_map = new IntObjectHashMap<>( m_keys.length, 0.5f );
for ( int i = 0; i < m_keys.length; ++i )
m_map.put( m_keys[ i ], null );
for ( int i = 0; i < m_keys.length; ++i )
m_map.put( m_keys[ i ], null );
return m_map.size();
}
开发者ID:mikvor,项目名称:hashmapTest,代码行数:10,代码来源:HppcIntObjectMapTest.java
示例12: toIntMap
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
public static <T, K, U> Collector<T, IntObjectHashMap<U>, IntObjectHashMap<U>> toIntMap(
ToIntFunction<? super T> keyMapper, Function<? super T, ? extends U> valueMapper) {
BiConsumer<IntObjectHashMap<U>, T> accumulator = (map, element) -> map
.put(keyMapper.applyAsInt(element), valueMapper.apply(element));
return new CollectorImpl<>(IntObjectHashMap::new, accumulator, (m1, m2) -> {
m1.putAll(m2);
return m1;
}, CH_ID);
}
开发者ID:PhantomThief,项目名称:more-lambdas-java,代码行数:10,代码来源:MoreCollectors.java
示例13: OneLabelL2PRConstraints
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
protected OneLabelL2PRConstraints(IntObjectHashMap<OneLabelPRConstraint> constraints,
IntIntHashMap constraintIndices, StateLabelMap map, boolean normalized) {
this.constraints = new IntObjectHashMap<OneLabelPRConstraint>();
for (IntObjectCursor<OneLabelPRConstraint> keyVal : constraints) {
this.constraints.put(keyVal.key, keyVal.value.copy());
}
//this.constraints = constraints;
this.constraintIndices = constraintIndices;
this.map = map;
this.cache = new IntArrayList();
this.normalized = normalized;
}
开发者ID:mimno,项目名称:Mallet,代码行数:14,代码来源:OneLabelL2PRConstraints.java
示例14: OneLabelL2IndPRConstraints
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
public OneLabelL2IndPRConstraints(boolean normalized) {
this.normalized = normalized;
this.numDimensions = 0;
this.constraints = new IntObjectHashMap<OneLabelL2IndPRConstraint>();
// this will be set by the PRTrainer
this.map = null;
this.cache = new IntArrayList();
}
开发者ID:mimno,项目名称:Mallet,代码行数:9,代码来源:OneLabelL2IndPRConstraints.java
示例15: MaxEntRangeL2FLGEConstraints
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
public MaxEntRangeL2FLGEConstraints(int numFeatures, int numLabels, boolean useValues, boolean normalize) {
this.numFeatures = numFeatures;
this.numLabels = numLabels;
this.useValues = useValues;
this.normalize = normalize;
this.constraints = new IntObjectHashMap<MaxEntL2IndGEConstraint>();
this.indexCache = new IntArrayList();
this.valueCache = new DoubleArrayList();
}
开发者ID:mimno,项目名称:Mallet,代码行数:10,代码来源:MaxEntRangeL2FLGEConstraints.java
示例16: MaxEntFLGEConstraints
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
public MaxEntFLGEConstraints(int numFeatures, int numLabels, boolean useValues) {
this.numFeatures = numFeatures;
this.numLabels = numLabels;
this.useValues = useValues;
this.constraints = new IntObjectHashMap<MaxEntFLGEConstraint>();
this.indexCache = new IntArrayList();
this.valueCache = new DoubleArrayList();
}
开发者ID:mimno,项目名称:Mallet,代码行数:9,代码来源:MaxEntFLGEConstraints.java
示例17: MaxEntFLPRConstraints
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
public MaxEntFLPRConstraints(int numFeatures, int numLabels, boolean useValues) {
this.useValues = useValues;
this.numFeatures = numFeatures;
this.numLabels = numLabels;
this.constraints = new IntObjectHashMap<MaxEntFLPRConstraint>();
this.indexCache = new IntArrayList();
this.valueCache = new DoubleArrayList();
}
开发者ID:mimno,项目名称:Mallet,代码行数:9,代码来源:MaxEntFLPRConstraints.java
示例18: ImmutableOpenIntMap
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
private ImmutableOpenIntMap(IntObjectHashMap<VType> map) {
this.map = map;
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:ImmutableOpenIntMap.java
示例19: Builder
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
public Builder(int size) {
this.map = new IntObjectHashMap<>(size);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:ImmutableOpenIntMap.java
示例20: build
import com.carrotsearch.hppc.IntObjectHashMap; //导入依赖的package包/类
/**
* Builds a new instance of the
*/
public ImmutableOpenIntMap<VType> build() {
IntObjectHashMap<VType> map = this.map;
this.map = null; // nullify the map, so any operation post build will fail! (hackish, but safest)
return new ImmutableOpenIntMap<>(map);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:ImmutableOpenIntMap.java
注:本文中的com.carrotsearch.hppc.IntObjectHashMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论