Author: djencks
Date: Thu Jan 1 13:37:17 2009
New Revision: 730614
URL: http://svn.apache.org/viewvc?rev=730614&view=rev
Log:
AMQ-2052 more better fixes of where to make the name file system safe
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/ContainerId.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/ContainerId.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/ContainerId.java?rev=730614&r1=730613&r2=730614&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/ContainerId.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/ContainerId.java
Thu Jan 1 13:37:17 2009
@@ -80,8 +80,4 @@
public String toString() {
return "CID{" + dataContainerName + ":" + key + "}";
}
-
- public String getFileSystemSafeContainerName() {
- return IOHelper.toFileSystemSafeName(dataContainerName);
- }
}
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java?rev=730614&r1=730613&r2=730614&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
Thu Jan 1 13:37:17 2009
@@ -70,11 +70,10 @@
private final String mode;
private IndexRootContainer mapsContainer;
private IndexRootContainer listsContainer;
- private Map<ContainerId, ListContainerImpl> lists = new
ConcurrentHashMap<ContainerId, ListContainerImpl>();
- private Map<ContainerId, MapContainerImpl> maps = new
ConcurrentHashMap<ContainerId, MapContainerImpl>();
- private Map<String, DataManager> dataManagers = new
ConcurrentHashMap<String, DataManager>();
- private Map<String, IndexManager> indexManagers = new
ConcurrentHashMap<String, IndexManager>();
- private IndexManager rootIndexManager; // contains all the root indexes
+ private final Map<ContainerId, ListContainerImpl> lists = new
ConcurrentHashMap<ContainerId, ListContainerImpl>();
+ private final Map<ContainerId, MapContainerImpl> maps = new
ConcurrentHashMap<ContainerId, MapContainerImpl>();
+ private final Map<String, DataManager> dataManagers = new
ConcurrentHashMap<String, DataManager>();
+ private final Map<String, IndexManager> indexManagers = new
ConcurrentHashMap<String, IndexManager>();
private boolean closed;
private boolean initialized;
private boolean logIndexChanges;
@@ -216,9 +215,8 @@
ContainerId containerId = new ContainerId(id, containerName);
MapContainerImpl result = maps.get(containerId);
if (result == null) {
- String fileSystemSafeContainerName =
containerId.getFileSystemSafeContainerName();
- DataManager dm = getDataManager(fileSystemSafeContainerName);
- IndexManager im = getIndexManager(dm, fileSystemSafeContainerName);
+ DataManager dm = getDataManager(containerName);
+ IndexManager im = getIndexManager(dm, containerName);
IndexItem root = mapsContainer.getRoot(im, containerId);
if (root == null) {
@@ -283,9 +281,8 @@
ContainerId containerId = new ContainerId(id, containerName);
ListContainerImpl result = lists.get(containerId);
if (result == null) {
- String fileSystemSafeContainerName =
containerId.getFileSystemSafeContainerName();
- DataManager dm = getDataManager(fileSystemSafeContainerName);
- IndexManager im = getIndexManager(dm, fileSystemSafeContainerName);
+ DataManager dm = getDataManager(containerName);
+ IndexManager im = getIndexManager(dm, containerName);
IndexItem root = listsContainer.getRoot(im, containerId);
if (root == null) {
@@ -406,7 +403,6 @@
}
/**
- * @see org.apache.activemq.kaha.IndexTypes
* @return the default index type
*/
public synchronized String getIndexTypeAsString() {
@@ -416,8 +412,7 @@
/**
* Set the default index type
*
- * @param type
- * @see org.apache.activemq.kaha.IndexTypes
+ * @param type "PERSISTENT" or "VM"
*/
public synchronized void setIndexTypeAsString(String type) {
if (type.equalsIgnoreCase("VM")) {
@@ -445,7 +440,7 @@
}
/**
- * @return
+ * @return size of store
* @see org.apache.activemq.kaha.Store#size()
*/
public long size(){
@@ -469,7 +464,7 @@
lockFile = new RandomAccessFile(new File(directory, "lock"), "rw");
lock();
DataManager defaultDM = getDataManager(defaultContainerName);
- rootIndexManager = getIndexManager(defaultDM,
defaultContainerName);
+ IndexManager rootIndexManager = getIndexManager(defaultDM,
defaultContainerName);
IndexItem mapRoot = new IndexItem();
IndexItem listRoot = new IndexItem();
if (rootIndexManager.isEmpty()) {
@@ -537,7 +532,7 @@
/**
* scans the directory and builds up the IndexManager and DataManager
*
- * @throws IOException
+ * @throws IOException if there is a problem accessing an index or data
file
*/
private void generateInterestInListDataFiles() throws IOException {
for (Iterator i = listsContainer.getKeys().iterator(); i.hasNext();) {
@@ -559,7 +554,7 @@
/**
* scans the directory and builds up the IndexManager and DataManager
*
- * @throws IOException
+ * @throws IOException if there is a problem accessing an index or data
file
*/
private void generateInterestInMapDataFiles() throws IOException {
for (Iterator i = mapsContainer.getKeys().iterator(); i.hasNext();) {
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java?rev=730614&r1=730613&r2=730614&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
Thu Jan 1 13:37:17 2009
@@ -679,7 +679,7 @@
}
public void setFilePrefix(String filePrefix) {
- this.filePrefix = filePrefix;
+ this.filePrefix = IOHelper.toFileSystemSafeName(filePrefix);
}
public Map<WriteKey, WriteCommand> getInflightWrites() {
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java?rev=730614&r1=730613&r2=730614&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java
Thu Jan 1 13:37:17 2009
@@ -72,7 +72,6 @@
if (index == null) {
if (persistentIndex) {
String name = containerId.getDataContainerName() + "_" +
containerId.getKey();
- name=IOHelper.toFileSystemSafeName(name);
try {
HashIndex hashIndex = new HashIndex(directory, name,
indexManager);
hashIndex.setNumberOfBins(getIndexBinSize());