Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2010, Red Hat, Inc. and/or its affiliates,
   * and individual contributors as indicated by the @author tags.
   * See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   * This copyrighted material is made available to anyone wishing to use,
   * modify, copy, or redistribute it subject to the terms and conditions
   * of the GNU Lesser General Public License, v. 2.1.
  * This program is distributed in the hope that it will be useful, but WITHOUT A
  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public License,
  * v.2.1 along with this distribution; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
  *
  * (C) 2010,
  * @author JBoss, by Red Hat.
  */
 package com.arjuna.ats.internal.arjuna.objectstore.hornetq;
 
 import java.io.File;
 
A JavaBean containing assorted configuration properties for the HornetQ Journal based transaction logging system. Parameters on this file serve a similar role to their counterparts in HornetQ. The HornetQ docs therefore provide relevant information on usage: http://hornetq.sourceforge.net/docs/hornetq-2.1.2.Final/user-manual/en/html/persistence.html#configuring.message.journal.journal-type

Author(s):
Jonathan Halliday (jonathan.halliday@redhat.com), 2010-03
 
 @PropertyPrefix(prefix = "com.arjuna.ats.arjuna.hornetqjournal.")
 {
     private volatile int fileSize = 1024*1024*2;
 
     private volatile int minFiles = 4;
 
     private volatile int compactMinFiles = 10;
 
     private volatile int compactPercentage = 30;
 
     private volatile String filePrefix = "jbossts";
 
     private volatile String fileExtension = "txlog";
 
     private volatile int maxIO = 1;
 
     private volatile String storeDir = System.getProperty("user.dir") + . + "HornetqJournalStore";
 
     private volatile boolean syncWrites = true;
 
     private volatile boolean syncDeletes = true;
 
     private volatile int bufferFlushesPerSecond = 500;
 
     private volatile int bufferSize = 490 * 1024;
 
     private volatile boolean logRates = false;
 
     private volatile boolean asyncIO = true;


    
Returns the desired size in bytes of each log file. Minimum 1024. Default: 2MB (2097152 bytes)

Returns:
The individual log file size, in bytes.
 
     public int getFileSize()
     {
         return ;
     }

    
Sets the desired size in bytes for each log file.

Parameters:
fileSize the individual log file size, in bytes.
 
     public void setFileSize(int fileSize)
     {
         this. = fileSize;
     }

    
Returns the minimum number of log files to use. Minimum 2. Default: 4

Returns:
the minimum number of individual log files.
 
     public int getMinFiles()
    {
        return ;
    }

    
Sets the minimum number of log files to use.

Parameters:
minFiles the minimum number of individual log files.
    public void setMinFiles(int minFiles)
    {
        this. = minFiles;
    }

    
Gets the minimal number of files before we can consider compacting. Default: 10

Returns:
the threshold file count.
    public int getCompactMinFiles()
    {
        return ;
    }

    
Sets the minimal number of files before we can consider compacting.

Parameters:
compactMinFiles the threshold file count.
    public void setCompactMinFiles(int compactMinFiles)
    {
        this. = compactMinFiles;
    }

    
Gets the percentage minimum capacity usage at which to start compacting. Default: 30

Returns:
the threshold percentage.
    public int getCompactPercentage()
    {
        return ;
    }

    
Sets the percentage minimum capacity usage at which to start compacting.

Parameters:
compactPercentage the threshold percentage.
    public void setCompactPercentage(int compactPercentage)
    {
        this. = compactPercentage;
    }

    
Returns the prefix to be used when naming each log file. Default: "jbossts"

Returns:
the prefix used to construct individual log file names.
    public String getFilePrefix()
    {
        return ;
    }

    
Sets the prefix to be used when naming each log file.

Parameters:
filePrefix the prefix used to construct individual log file names.
    public void setFilePrefix(String filePrefix)
    {
        this. = filePrefix;
    }

    
Returns the suffix to be used then naming each log file. Default: "txlog"

Returns:
the suffix used to construct individual log file names.
    public String getFileExtension()
    {
        return ;
    }

    
Sets the suffix to be used when naming each log file.

Parameters:
fileExtension the suffix used to construct individual log file names.
    public void setFileExtension(String fileExtension)
    {
        this. = fileExtension;
    }

    
Gets the maximum write requests queue depth. Minimum 1. Use 1 for NIO. For AIO, recommended 500. Default: 1

Returns:
the max number of outstanding requests.
    public int getMaxIO()
    {
        return ;
    }

    
Sets the maximum write requests queue depth.

Parameters:
maxIO the max number of outstanding requests.
    public void setMaxIO(int maxIO)
    {
        this. = maxIO;
    }

    
Returns the log directory path Default: {user.dir}/HornetqJournalStore

Returns:
the log directory name
    public String getStoreDir()
    {
        return ;
    }

    
Sets the log directory path.

Parameters:
storeDir the path to the log directory.
    public void setStoreDir(String storeDir)
    {
        this. = storeDir;
    }

    
Returns the sync setting for transaction log write operations. To preserve ACID properties this value must be set to true, in which case log write operations block until data is forced to the physical storage device. Turn sync off only if you don't care about data integrity. Default: true.

Returns:
true if log writes should be synchronous, false otherwise.
    public boolean isSyncWrites()
    {
        return ;
    }

    
Sets if log write operations should be synchronous or not.

Parameters:
syncWrites true for synchronous operation, false otherwise.
    public void setSyncWrites(boolean syncWrites)
    {
        this. = syncWrites;
    }

    
Returns the sync setting for transaction log delete operations. For optimal crash recovery this value should be set to true. Asynchronous deletes may give rise to unnecessary crash recovery complications. Default: true.

Returns:
true if log deletes should be synchronous, false otherwise.
    public boolean isSyncDeletes()
    {
        return ;
    }

    
Sets if log delete operations should be synchronous or not.

Parameters:
syncDeletes true for synchronous operation, false otherwise.
    public void setSyncDeletes(boolean syncDeletes)
    {
        this. = syncDeletes;
    }

    
Returns the target number of timer based buffer flushes per second. Caution: this property is functionally equivalent to HornetQ's journal-buffer-timeout but uses different units. Default 500.

Returns:
the number of buffer flushes per second.
    public int getBufferFlushesPerSecond()
    {
        return ;
    }

    
Sets the target number of timer based buffer flushes per second.

Parameters:
bufferFlushesPerSecond the target number.
    public void setBufferFlushesPerSecond(int bufferFlushesPerSecond)
    {
        this. = bufferFlushesPerSecond;
    }

    
Returns the buffer size in bytes. Default: 490 KB.

Returns:
the size of the buffer.
    public int getBufferSize()
    {
        return ;
    }

    
Sets the buffer size in bytes.

Parameters:
bufferSize the size of the buffer.
    public void setBufferSize(int bufferSize)
    {
        this. = bufferSize;
    }

    
Returns the debug log mode for Journal throughput statistics. Default: false.

Returns:
true is rate logging is enabled, false otherwise.
    public boolean isLogRates()
    {
        return ;
    }

    
Sets the debug log mode for Journal throughput statistics.

Parameters:
logRates true to enable logging of statistics, false to disable.
    public void setLogRates(boolean logRates)
    {
        this. = logRates;
    }

    
Returns the IO type of Journal. Default: true

Returns:
true if AsyncIO is enabled, false otherwise which means NIO
    public boolean isAsyncIO() {
        return ;
    }

    
Sets the type of Journal. Note that Journal silently falls back to NIO if AIO native libraries are not available.

Parameters:
asyncIO true to enable AsyncIO, false to disable
    public void setAsyncIO(boolean asyncIO) {
        this. = asyncIO;
    }
New to GrepCode? Check out our FAQ X