activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Edstrom <seij...@gmail.com>
Subject Re: Checkpoint on High performance journal
Date Sat, 23 Oct 2010 00:24:25 GMT
From activemq/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java

    private int journalLogFileSize = 1024 * 1024 * 20;
    private int journalLogFiles = 2;

In activemq/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java

private final long checkpointInterval = 1000 * 60 * 5;
    private long lastCheckpointRequest = System.currentTimeMillis();
    private long lastCleanup = System.currentTimeMillis();
    private int maxCheckpointWorkers = 10;
    private int maxCheckpointMessageAddSize = 1024 * 1024;


public synchronized void start() throws Exception {
        if (!started.compareAndSet(false, true)) {
            return;
        }

        checkpointTask = taskRunnerFactory.createTaskRunner(new Task() {
            public boolean iterate() {
                return doCheckpoint();
            }
        }, "ActiveMQ Journal Checkpoint Worker");

        checkpointExecutor = new ThreadPoolExecutor(maxCheckpointWorkers, maxCheckpointWorkers,
30, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new ThreadFactory() {
            public Thread newThread(Runnable runable) {
                Thread t = new Thread(runable, "Journal checkpoint worker");
                t.setPriority(7);
                return t;
            }
        });
        // checkpointExecutor.allowCoreThreadTimeOut(true);

        this.usageManager.getMemoryUsage().addUsageListener(this);

        if (longTermPersistence instanceof JDBCPersistenceAdapter) {
            // Disabled periodic clean up as it deadlocks with the checkpoint
            // operations.
            ((JDBCPersistenceAdapter)longTermPersistence).setCleanupPeriod(0);
        }

        longTermPersistence.start();
        createTransactionStore();
        recover();

        // Do a checkpoint periodically.
        this.scheduler = new Scheduler("Journal Scheduler");
        this.scheduler.start();
        this.scheduler.executePeriodically(periodicCheckpointTask, checkpointInterval / 10);

    }


On Oct 22, 2010, at 5:29 PM, kseelam wrote:

> 
> Hi,
> 
> We are looking at using High performance journal with JDBC as described  at
> http://activemq.apache.org/persistence.html
> 
> It mentioned that only outstanding messages will be persisted in the DB (by
> batch) when the checkpoint tot he DB happens.
> 
> Could anyone explain how exactly the 'checkpoint' works? I did not find any
> checkpointInterval attribute.
> Also how the journalLogFiles and journalLogFileSize work?
> 
> We are looking at some design/architectural point of view and any reference
> to any of the document would be highly appreciated. 
> 
> Thank you all.
> Krishna
> 
> 
> 
> -- 
> View this message in context: http://activemq.2283324.n4.nabble.com/Checkpoint-on-High-performance-journal-tp3008012p3008012.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Johan Edstrom

joed@opennms.org

They that can give up essential liberty to purchase a little temporary safety, deserve neither
liberty nor safety.

Benjamin Franklin, Historical Review of Pennsylvania, 1759






Mime
View raw message