Exemple #1
0
  private static void finishSetup() {
    setupLatch.countDown();
    if (setupLatch.getCount() == 0) {
      try {
        BdbTerminologyStore ts = new BdbTerminologyStore();
        if (P.s == null) {
          Ts.set(ts);
          FxTs.set(ts);
          P.s = ts;
        }
        Looker.add(ts, UUID.randomUUID(), "Embedded BdbTerminologyStore");
        Looker.add(
            new TtkConceptChronicleConverter(),
            UUID.randomUUID(),
            "TtkConceptChronicle to ConceptChronicleDTO converter");
        ConceptChronicle.reset();

        ReferenceConcepts.reset();
        String versionString = getProperty(G_VERSION);
        if (versionString != null) {
          gVersion.set(Long.parseLong(versionString));
        }
        if (viewCoordinateMapFile.exists()) {
          FileInputStream fis = new FileInputStream(viewCoordinateMapFile);
          try (ObjectInputStream ois = new ObjectInputStream(fis)) {
            try {
              viewCoordinates = (ConcurrentHashMap<UUID, ViewCoordinate>) ois.readObject();
            } catch (IOException | ClassNotFoundException ex) {
              Logger.getLogger(Bdb.class.getName()).log(Level.SEVERE, null, ex);
            }
          }
        }
        pathManager = BdbPathManager.get();
        Looker.lookup(TermstoreLatch.class).openLatch();

        AceLog.getAppLog()
            .info(
                "mutable maxMem: " + Bdb.mutable.bdbEnv.getConfig().getConfigParam("je.maxMemory"));
        AceLog.getAppLog()
            .info("mutable shared cache: " + Bdb.mutable.bdbEnv.getConfig().getSharedCache());
        AceLog.getAppLog()
            .info(
                "readOnly maxMem: "
                    + Bdb.readOnly.bdbEnv.getConfig().getConfigParam("je.maxMemory"));
        AceLog.getAppLog()
            .info("readOnly shared cache: " + Bdb.readOnly.bdbEnv.getConfig().getSharedCache());

      } catch (IOException ex) {
        Logger.getLogger(Bdb.class.getName()).log(Level.SEVERE, null, ex);
      }
    }
  }
Exemple #2
0
    @Override
    public void run() {
      try {
        activity.setIndeterminate(false);
        activity.setValue(0);
        activity.setMaximum(9);
        setProperty(G_VERSION, Long.toString(gVersion.incrementAndGet()));
        activity.setProgressInfoLower("Writing uuidDb... ");
        activity.setValue(1);
        activity.setProgressInfoLower("Writing uuidsToNidMapDb... ");
        uuidsToNidMapDb.sync();
        activity.setValue(2);
        nidCidMapDb.sync();
        activity.setValue(3);
        activity.setProgressInfoLower("Writing statusAtPositionDb... ");
        stampDb.sync();
        activity.setValue(4);
        activity.setProgressInfoLower("Writing conceptDb... ");
        conceptDb.sync();
        activity.setValue(5);
        activity.setValue(6);
        activity.setProgressInfoLower("Writing propDb... ");
        propDb.sync();
        activity.setProgressInfoLower("Writing mutable environment... ");
        activity.setValue(7);
        mutable.bdbEnv.sync();
        activity.setProgressInfoLower("Writing readonly environment... ");
        activity.setValue(8);
        if (readOnly.bdbEnv.getConfig().getReadOnly() == false) {
          readOnly.bdbEnv.sync();
        }
        activity.setValue(9);
        long endTime = System.currentTimeMillis();

        long elapsed = endTime - startTime;
        String elapsedStr = TimeHelper.getElapsedTimeString(elapsed);

        activity.setProgressInfoUpper("Database sync complete.");
        activity.setProgressInfoLower("Elapsed: " + elapsedStr);
        activity.complete();
      } catch (DatabaseException | IOException e) {
        AceLog.getAppLog().alertAndLogException(e);
      } catch (ComputationCanceled e) {
        // Nothing to do
      }
    }