com.intellij.util.io.EnumeratorIntegerDescriptor Java Examples

The following examples show how to use com.intellij.util.io.EnumeratorIntegerDescriptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VcsLogFullDetailsIndex.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
private MyMapReduceIndex createMapReduceIndex(@Nonnull DataExternalizer<T> dataExternalizer, int version) throws IOException {
  MyIndexExtension extension = new MyIndexExtension(myIndexer, dataExternalizer, getVersion());
  Pair<ForwardIndex, ForwardIndexAccessor<Integer, T>> pair = createdForwardIndex();
  ForwardIndex forwardIndex = pair != null ? pair.getFirst() : null;
  ForwardIndexAccessor<Integer, T> forwardIndexAccessor = pair != null ? pair.getSecond() : null;

  MyMapIndexStorage myMapIndexStorage = new MyMapIndexStorage(getStorageFile(myName, myLogId), EnumeratorIntegerDescriptor.INSTANCE, dataExternalizer, 5000, false);

  return new MyMapReduceIndex(extension, myMapIndexStorage, forwardIndex, forwardIndexAccessor);
}
 
Example #2
Source File: PersistentMapBasedForwardIndex.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
protected PersistentHashMap<Integer, ByteArraySequence> createMap(File file) throws IOException {
  Boolean oldHasNoChunksValue = PersistentHashMapValueStorage.CreationTimeOptions.HAS_NO_CHUNKS.get();
  PersistentHashMapValueStorage.CreationTimeOptions.HAS_NO_CHUNKS.set(!myUseChunks);
  try {
    return new PersistentHashMap<>(file, EnumeratorIntegerDescriptor.INSTANCE, ByteSequenceDataExternalizer.INSTANCE);
  }
  finally {
    PersistentHashMapValueStorage.CreationTimeOptions.HAS_NO_CHUNKS.set(oldHasNoChunksValue);
  }
}
 
Example #3
Source File: ContainerIdUsagesStubIndex.java    From idea-php-symfony2-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public DataExternalizer<Integer> getValueExternalizer() {
    return EnumeratorIntegerDescriptor.INSTANCE;
}
 
Example #4
Source File: SingleEntryFileBasedIndexExtension.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public final KeyDescriptor<Integer> getKeyDescriptor() {
  return EnumeratorIntegerDescriptor.INSTANCE;
}
 
Example #5
Source File: VcsLogFullDetailsIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public KeyDescriptor<Integer> getKeyDescriptor() {
  return EnumeratorIntegerDescriptor.INSTANCE;
}
 
Example #6
Source File: IntStubIndexExtension.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
public KeyDescriptor<Integer> getKeyDescriptor() {
  return EnumeratorIntegerDescriptor.INSTANCE;
}
 
Example #7
Source File: IntForwardIndexAccessor.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
default InputDataDiffBuilder<Key, Value> getDiffBuilder(int inputId, @Nullable ByteArraySequence sequence) throws IOException {
  return getDiffBuilderFromInt(inputId, sequence == null ? 0 : AbstractForwardIndexAccessor.deserializeFromByteSeq(sequence, EnumeratorIntegerDescriptor.INSTANCE));
}
 
Example #8
Source File: IntForwardIndexAccessor.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
default ByteArraySequence serializeIndexedData(@Nonnull InputData<Key, Value> data) throws IOException {
  return AbstractForwardIndexAccessor.serializeToByteSeq(serializeIndexedDataToInt(data), EnumeratorIntegerDescriptor.INSTANCE, 8);
}
 
Example #9
Source File: IntForwardIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
default ByteArraySequence get(@Nonnull Integer key) throws IOException {
  int intValue = getInt(key);
  return AbstractForwardIndexAccessor.serializeToByteSeq(intValue, EnumeratorIntegerDescriptor.INSTANCE, 4);
}
 
Example #10
Source File: IntForwardIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
default void put(@Nonnull Integer key, @Nullable ByteArraySequence value) throws IOException {
  int valueAsInt = value == null ? 0 : AbstractForwardIndexAccessor.deserializeFromByteSeq(value, EnumeratorIntegerDescriptor.INSTANCE);
  putInt(key, valueAsInt);
}
 
Example #11
Source File: StubProvidedIndexExtension.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public KeyDescriptor<Integer> createKeyDescriptor() {
  return EnumeratorIntegerDescriptor.INSTANCE;
}
 
Example #12
Source File: TrigramIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public KeyDescriptor<Integer> getKeyDescriptor() {
  return EnumeratorIntegerDescriptor.INSTANCE;
}
 
Example #13
Source File: HashIdForwardIndexAccessor.java    From consulo with Apache License 2.0 4 votes vote down vote up
HashIdForwardIndexAccessor(@Nonnull UpdatableSnapshotInputMappingIndex<Key, Value, Input> snapshotInputMappingIndex) {
  super(EnumeratorIntegerDescriptor.INSTANCE);
  mySnapshotInputMappingIndex = snapshotInputMappingIndex;
}
 
Example #14
Source File: TracingData.java    From consulo with Apache License 2.0 4 votes vote down vote up
private static PersistentHashMap<Integer, Integer> createOrOpenMap() throws IOException {
  return new PersistentHashMap<>(new File(tracingDataLocation), EnumeratorIntegerDescriptor.INSTANCE,
                                 EnumeratorIntegerDescriptor.INSTANCE);
}
 
Example #15
Source File: DuplicatesIndex.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public KeyDescriptor<Integer> getKeyDescriptor() {
  return EnumeratorIntegerDescriptor.INSTANCE;
}