activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r453124 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq: kaha/ kaha/impl/ store/kahadaptor/
Date Thu, 05 Oct 2006 07:20:34 GMT
Author: rajdavies
Date: Thu Oct  5 00:20:31 2006
New Revision: 453124

URL: http://svn.apache.org/viewvc?view=rev&rev=453124
Log:
 work for https://issues.apache.org/activemq/browse/AMQ-876

Added:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/IndexTypes.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreEntry.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreLocation.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/StoreLockedExcpetion.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/StoreEntryMarshaller.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAck.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAckMarshaller.java

Added: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/IndexTypes.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/IndexTypes.java?view=auto&rev=453124
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/IndexTypes.java
(added)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/IndexTypes.java
Thu Oct  5 00:20:31 2006
@@ -0,0 +1,35 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.kaha;
+
+/**
+ * Types of Indexes used by the Store
+ * 
+ * @version $Revision: 1.2 $
+ */
+public interface IndexTypes{
+    
+    /**
+     * use in memory indexes
+     */
+    public final static String IN_MEMORY_INDEX= "InMemoryIndex";
+    /**
+     * use disk-based indexes
+     */
+    public final static String DISK_INDEX = "DiskIndex";
+}
\ No newline at end of file

Added: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreEntry.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreEntry.java?view=auto&rev=453124
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreEntry.java
(added)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreEntry.java
Thu Oct  5 00:20:31 2006
@@ -0,0 +1,59 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.kaha;
+
+/**
+*  Entry for Store data
+* 
+* @version $Revision: 1.2 $
+*/
+public interface StoreEntry{
+
+    public abstract StoreLocation getKeyDataItem();
+
+    public abstract StoreLocation getValueDataItem();
+
+    /**
+     * @return next item
+     */
+    public abstract long getNextItem();
+
+    /**
+     * @return Returns the keyFile.
+     */
+    public abstract int getKeyFile();
+
+    /**
+     * @return Returns the valueFile.
+     */
+    public abstract int getValueFile();
+
+    /**
+     * @return Returns the valueOffset.
+     */
+    public abstract long getValueOffset();
+
+    /**
+     * @return Returns the offset.
+     */
+    public abstract long getOffset();
+
+    public abstract int getKeySize();
+
+    public abstract int getValueSize();
+}
\ No newline at end of file

Added: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreLocation.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreLocation.java?view=auto&rev=453124
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreLocation.java
(added)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreLocation.java
Thu Oct  5 00:20:31 2006
@@ -0,0 +1,42 @@
+/**
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.activemq.kaha;
+
+/**
+ * Location of a data in the Store
+ * 
+ * @version $Revision: 1.2 $
+ */
+public interface StoreLocation{
+
+    /**
+     * @return Returns the size.
+     */
+    public int getSize();
+
+    /**
+     * @return Returns the offset.
+     */
+    public long getOffset();
+
+    /**
+     * @return Returns the file.
+     */
+    public int getFile();
+}
\ No newline at end of file

Added: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/StoreLockedExcpetion.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/StoreLockedExcpetion.java?view=auto&rev=453124
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/StoreLockedExcpetion.java
(added)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/StoreLockedExcpetion.java
Thu Oct  5 00:20:31 2006
@@ -0,0 +1,45 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.kaha.impl;
+
+import java.io.IOException;
+
+
+
+/**
+* Exception thrown if the store is in use by another application
+* 
+* @version $Revision: 1.1.1.1 $
+*/
+public class StoreLockedExcpetion extends IOException{
+
+    private static final long serialVersionUID=3857646689671366926L;
+
+    /**
+     * Default Constructor
+     */
+    public StoreLockedExcpetion(){
+    }
+
+    /**
+     * @param s
+     */
+    public StoreLockedExcpetion(String s){
+        super(s);
+    }
+}

Added: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/StoreEntryMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/StoreEntryMarshaller.java?view=auto&rev=453124
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/StoreEntryMarshaller.java
(added)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/StoreEntryMarshaller.java
Thu Oct  5 00:20:31 2006
@@ -0,0 +1,47 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.store.kahadaptor;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import org.apache.activemq.kaha.Marshaller;
+import org.apache.activemq.kaha.impl.index.IndexItem;
+
+
+/**
+ * Marshall a TopicSubAck
+ * @version $Revision: 1.10 $
+ */
+public class StoreEntryMarshaller implements Marshaller{
+   
+
+    public void writePayload(Object object,DataOutput dataOut) throws IOException{
+       IndexItem item = (IndexItem)object;
+       dataOut.writeLong(item.getOffset());
+       item.write(dataOut);
+       
+    }
+
+    public Object readPayload(DataInput dataIn) throws IOException{
+        IndexItem item = new IndexItem();
+        item.setOffset(dataIn.readLong());
+        item.read(dataIn);
+        return item;
+    }
+}

Added: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAck.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAck.java?view=auto&rev=453124
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAck.java
(added)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAck.java
Thu Oct  5 00:20:31 2006
@@ -0,0 +1,74 @@
+/**
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements. See the NOTICE
+ * file distributed with this work for additional information regarding copyright ownership.
The ASF licenses this file
+ * to You under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the
+ * License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+package org.apache.activemq.store.kahadaptor;
+
+import org.apache.activemq.kaha.StoreEntry;
+
+/**
+ * Holds information for location of message
+ * 
+ * @version $Revision: 1.10 $
+ */
+public class TopicSubAck{
+
+    private int count =0;
+    private StoreEntry storeEntry;
+
+    /**
+     * @return the count
+     */
+    public int getCount(){
+        return this.count;
+    }
+
+    /**
+     * @param count the count to set
+     */
+    public void setCount(int count){
+        this.count=count;
+    }
+    
+    /**
+     * @return the value of the count after it's decremented
+     */
+    public int decrementCount() {
+        return --count;
+    }
+    
+    /**
+     * @return the value of the count after it's incremented
+     */
+    public int incrementCount() {
+        return ++count;
+    }
+
+    
+    /**
+     * @return the storeEntry
+     */
+    public StoreEntry getStoreEntry(){
+        return this.storeEntry;
+    }
+
+    
+    /**
+     * @param storeEntry the storeEntry to set
+     */
+    public void setStoreEntry(StoreEntry storeEntry){
+        this.storeEntry=storeEntry;
+    }
+
+   
+}

Added: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAckMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAckMarshaller.java?view=auto&rev=453124
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAckMarshaller.java
(added)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubAckMarshaller.java
Thu Oct  5 00:20:31 2006
@@ -0,0 +1,53 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.store.kahadaptor;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import org.apache.activemq.kaha.Marshaller;
+import org.apache.activemq.kaha.impl.index.IndexItem;
+
+
+/**
+ * Marshall a TopicSubAck
+ * @version $Revision: 1.10 $
+ */
+public class TopicSubAckMarshaller implements Marshaller{
+   
+
+    public void writePayload(Object object,DataOutput dataOut) throws IOException{
+       TopicSubAck tsa = (TopicSubAck) object;
+       dataOut.writeInt(tsa.getCount());
+       IndexItem item = (IndexItem)tsa.getStoreEntry();
+       dataOut.writeLong(item.getOffset());
+       item.write(dataOut);
+       
+    }
+
+    public Object readPayload(DataInput dataIn) throws IOException{
+        TopicSubAck tsa = new TopicSubAck();
+        int count = dataIn.readInt();
+        tsa.setCount(count);
+        IndexItem item = new IndexItem();
+        item.setOffset(dataIn.readLong());
+        item.read(dataIn);
+        tsa.setStoreEntry(item);
+        return tsa;
+    }
+}



Mime
View raw message