Java 类com.intellij.util.io.PersistentStringEnumerator 实例源码

项目:intellij-ce-playground    文件:SerializationManagerImpl.java   
public SerializationManagerImpl() {
  myFile.getParentFile().mkdirs();
  try {
    // we need to cache last id -> String mappings due to StringRefs and stubs indexing that initially creates stubs (doing enumerate on String)
    // and then index them (valueOf), also similar string items are expected to be enumerated during stubs processing
    myNameStorage = new PersistentStringEnumerator(myFile, true);
    myStubSerializationHelper = new StubSerializationHelper(myNameStorage);
  }
  catch (IOException e) {
    nameStorageCrashed();
    LOG.info(e);
    repairNameStorage(); // need this in order for myNameStorage not to be null
    nameStorageCrashed();
  }
  finally {
    registerSerializer(PsiFileStubImpl.TYPE);
    ShutDownTracker.getInstance().registerShutdownTask(new Runnable() {
      @Override
      public void run() {
        performShutdown();
      }
    });
  }
}
项目:tools-idea    文件:SerializationManagerImpl.java   
public SerializationManagerImpl() {
  myFile.getParentFile().mkdirs();
  try {
    // we need to cache last id -> String mappings due to StringRefs and stubs indexing that initially creates stubs (doing enumerate on String)
    // and then index them (valueOf), also similar string items are expected to be enumerated during stubs processing
    myNameStorage = new PersistentStringEnumerator(myFile, true);
    myStubSerializationHelper = new StubSerializationHelper(myNameStorage);
  }
  catch (IOException e) {
    nameStorageCrashed();
    LOG.info(e);
    repairNameStorage(); // need this in order for myNameStorage not to be null
    nameStorageCrashed();
  }
  finally {
    registerSerializer(PsiFileStubImpl.TYPE);
    ShutDownTracker.getInstance().registerShutdownTask(new Runnable() {
      @Override
      public void run() {
        performShutdown();
      }
    });
  }
}
项目:consulo    文件:SerializationManagerImpl.java   
public SerializationManagerImpl() {
  myFile.getParentFile().mkdirs();
  try {
    // we need to cache last id -> String mappings due to StringRefs and stubs indexing that initially creates stubs (doing enumerate on String)
    // and then index them (valueOf), also similar string items are expected to be enumerated during stubs processing
    myNameStorage = new PersistentStringEnumerator(myFile, true);
    myStubSerializationHelper = new StubSerializationHelper(myNameStorage);
  }
  catch (IOException e) {
    nameStorageCrashed();
    LOG.info(e);
    repairNameStorage(); // need this in order for myNameStorage not to be null
    nameStorageCrashed();
  }
  finally {
    registerSerializer(PsiFileStubImpl.TYPE);
    ShutDownTracker.getInstance().registerShutdownTask(new Runnable() {
      @Override
      public void run() {
        performShutdown();
      }
    });
  }
}
项目:intellij-ce-playground    文件:DependencyContext.java   
DependencyContext(final File rootDir) throws IOException {
  final File file = getTableFile(rootDir, STRING_TABLE_NAME);
  myEnumerator = new PersistentStringEnumerator(file, true);
  myEmptyName = myEnumerator.enumerate("");
}
项目:tools-idea    文件:DependencyContext.java   
DependencyContext(final File rootDir) throws IOException {
  final File file = getTableFile(rootDir, STRING_TABLE_NAME);
  myEnumerator = new PersistentStringEnumerator(file, true);
  myEmptyName = myEnumerator.enumerate("");
}