Example #1
0
 private void dumpLSNInfo(OutputStream os) {
   try {
     StringBuilder sb = new StringBuilder();
     sb.append("\n>>dump_begin\t>>----- [LSNInfo] -----");
     sb.append("\nappendLsn: " + appendLSN);
     sb.append("\nflushLsn: " + flushLSN.get());
     sb.append("\n>>dump_end\t>>----- [LSNInfo] -----\n");
     os.write(sb.toString().getBytes());
   } catch (Exception e) {
     // ignore exception and continue dumping as much as possible.
     if (IS_DEBUG_MODE) {
       e.printStackTrace();
     }
   }
 }
Example #2
0
 private void initializeLogManager(long nextLogFileId) {
   emptyQ = new LinkedBlockingQueue<LogBuffer>(numLogPages);
   flushQ = new LinkedBlockingQueue<LogBuffer>(numLogPages);
   for (int i = 0; i < numLogPages; i++) {
     emptyQ.offer(new LogBuffer(txnSubsystem, logPageSize, flushLSN));
   }
   appendLSN.set(initializeLogAnchor(nextLogFileId));
   flushLSN.set(appendLSN.get());
   if (LOGGER.isLoggable(Level.INFO)) {
     LOGGER.info("LogManager starts logging in LSN: " + appendLSN);
   }
   appendChannel = getFileChannel(appendLSN.get(), false);
   getAndInitNewPage();
   logFlusher = new LogFlusher(this, emptyQ, flushQ);
   futureLogFlusher =
       txnSubsystem.getAsterixAppRuntimeContextProvider().getThreadExecutor().submit(logFlusher);
 }