Esempio n. 1
0
  void configureNewFile() {

    blockSize(configImpl().blockSize());
    _fileHeader = FileHeader.newCurrentFileHeader();
    setRegularEndAddress(_fileHeader.length());

    newSystemData(configImpl().freespaceSystem(), configImpl().idSystemType());
    systemData().converterVersion(Converter.VERSION);
    createStringIO(_systemData.stringEncoding());
    createIdSystem();

    initializeClassMetadataRepository();
    initalizeWeakReferenceSupport();

    generateNewIdentity();

    AbstractFreespaceManager blockedFreespaceManager = AbstractFreespaceManager.createNew(this);
    installFreespaceManager(blockedFreespaceManager);

    initNewClassCollection();
    initializeEssentialClasses();

    _fileHeader.initNew(this);

    blockedFreespaceManager.start(0);
  }
Esempio n. 2
0
  public void writeHeader(boolean startFileLockingThread, boolean shuttingDown) {
    if (shuttingDown) {
      _freespaceManager.write(this);
      _freespaceManager = null;
    }

    StatefulBuffer writer = createStatefulBuffer(systemTransaction(), 0, _fileHeader.length());

    _fileHeader.writeFixedPart(this, startFileLockingThread, shuttingDown, writer, blockSize());

    if (shuttingDown) {
      ensureLastSlotWritten();
    }
    syncFiles();
  }