Package org.apache.activemq.kaha

Examples of org.apache.activemq.kaha.StoreEntry


     * @return the last element from this list.
     */
    public Object removeLast(){
        if(size==0)
            return null;
        StoreEntry result=last;
        remove(last);
        return result;
    }
View Full Code Here


        }
        return result;
    }
   
   public  StoreEntry getEntry(StoreEntry current){
        StoreEntry result=null;
        if(current != null && current.getOffset() >= 0){
            try{
                result=indexManager.getIndex(current.getOffset());
            }catch(IOException e){
                throw new RuntimeException("Failed to index",e);
View Full Code Here

   /**
    * Update the indexes of a StoreEntry
    * @param current
    */
   public StoreEntry refreshEntry(StoreEntry current){
       StoreEntry result=null;
       if(current != null && current.getOffset() >= 0){
           try{
               result=indexManager.refreshIndex((IndexItem)current);
           }catch(IOException e){
               throw new RuntimeException("Failed to index",e);
View Full Code Here

        this.root=root;
        this.indexManager=im;
        this.dataManager=dfm;
        long nextItem=root.getNextItem();
        while(nextItem!=Item.POSITION_NOT_SET){
            StoreEntry item=indexManager.getIndex(nextItem);
            StoreLocation data=item.getKeyDataItem();
            Object key = dataManager.readItem(rootMarshaller,data);
            map.put(key,item);
            list.add(item);
            nextItem=item.getNextItem();
            dataManager.addInterestInFile(item.getKeyFile());
        }
    }
View Full Code Here

        list.add(newRoot);
        return containerRoot;
    }
   
    void removeRoot(IndexManager containerIndexManager,ContainerId key) throws IOException{
        StoreEntry oldRoot=(StoreEntry)map.remove(key);
        if(oldRoot!=null){
            dataManager.removeInterestInFile(oldRoot.getKeyFile());
            // get the container root
            IndexItem containerRoot=containerIndexManager.getIndex(oldRoot.getValueOffset());
            if(containerRoot!=null){
                containerIndexManager.freeIndex(containerRoot);
            }
            int index=list.indexOf(oldRoot);
            IndexItem prev=index>0?(IndexItem)list.get(index-1):root;
View Full Code Here

            indexManager.freeIndex((IndexItem)oldRoot);
        }
    }
   
    IndexItem getRoot(IndexManager containerIndexManager,ContainerId key) throws IOException{
        StoreEntry index =  (StoreEntry) map.get(key);
        if (index != null){
            return containerIndexManager.getIndex(index.getValueOffset());
        }
        return null;
    }
View Full Code Here

     */
    public StoreEntry removeFirst(){
        if(size==0){
            return null;
        }
        StoreEntry result=root.next;
        remove(root.next);
        return result;
    }
View Full Code Here

     * @see org.apache.activemq.kaha.impl.IndexLinkedList#removeLast()
     */
    public Object removeLast(){
        if(size==0)
            return null;
        StoreEntry result=root.prev;
        remove(root.prev);
        return result;
    }
View Full Code Here

        return result != null ? indexManager.getIndex(result.getIndexOffset()) : null;
    }

    public synchronized StoreEntry remove(Object key) throws IOException {
        load();
        StoreEntry result = null;
        HashEntry entry = new HashEntry();
        entry.setKey((Comparable)key);
        HashEntry he = getBin(key).remove(entry);
        if (he != null) {
            this.size--;
View Full Code Here

     * @param key
     * @return store entry
     * @see org.apache.activemq.kaha.impl.index.Index#removeKey(java.lang.Object)
     */
    public StoreEntry remove(Object key) {
        StoreEntry result = map.remove(key);
        if (result != null) {
            try {
                result = indexManager.refreshIndex((IndexItem)result);
            } catch (IOException e) {
                LOG.error("Failed to refresh entry", e);
View Full Code Here

TOP

Related Classes of org.apache.activemq.kaha.StoreEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.