Java 类com.intellij.psi.stubs.SerializationManagerEx 实例源码

项目:tools-idea    文件:FileBasedIndexImpl.java   
private void flushAllIndices(final long modCount) {
  if (HeavyProcessLatch.INSTANCE.isRunning()) {
    return;
  }
  IndexingStamp.flushCaches();
  for (ID<?, ?> indexId : new ArrayList<ID<?, ?>>(myIndices.keySet())) {
    if (HeavyProcessLatch.INSTANCE.isRunning() || modCount != myLocalModCount) {
      return; // do not interfere with 'main' jobs
    }
    try {
      final UpdatableIndex<?, ?, FileContent> index = getIndex(indexId);
      if (index != null) {
        index.flush();
      }
    }
    catch (StorageException e) {
      LOG.info(e);
      requestRebuild(indexId);
    }
  }

  if (!HeavyProcessLatch.INSTANCE.isRunning() && modCount == myLocalModCount) { // do not interfere with 'main' jobs
    SerializationManagerEx.getInstanceEx().flushNameStorage();
  }
}
项目:consulo-lua    文件:LuaTableStubType.java   
@Override
@Nullable
public LuaTableStub deserialize(StubInputStream dataStream, StubElement parentStub) throws IOException {
    boolean hasType = dataStream.readBoolean();
    byte[] typedata = null;
    if (hasType)
    {
        int len = dataStream.readVarInt();
        if (len < 0) ((SerializationManagerEx) SerializationManagerEx.getInstance()).repairNameStorage();

        if (len <= 0) {
            return new LuaTableStubImpl(parentStub);
        }

        typedata = new byte[len];
        dataStream.read(typedata, 0, len);
    }

    return new LuaTableStubImpl(parentStub, typedata);
}
项目:consulo    文件:FileBasedIndexImpl.java   
@Override
protected void prepare() {
  mySerializationManagerEx = SerializationManagerEx.getInstanceEx();
  File indexRoot = PathManager.getIndexRoot();
  final File corruptionMarker = new File(indexRoot, CORRUPTION_MARKER_NAME);
  currentVersionCorrupted = corruptionMarker.exists();
  if (currentVersionCorrupted) {
    FileUtil.deleteWithRenaming(indexRoot);
    indexRoot.mkdirs();
    // serialization manager is initialized before and use removed index root so we need to reinitialize it
    mySerializationManagerEx.reinitializeNameStorage();
    ID.reinitializeDiskStorage();
  }
  FileUtil.delete(corruptionMarker);
}